mirror of
https://github.com/moonlight-stream/moonlight-common-c.git
synced 2025-08-18 09:25:49 +00:00
Add the ability for clients to reduce bitrate when HEVC is used
This commit is contained in:
parent
957b1de1ad
commit
c0596ad1df
@ -37,6 +37,12 @@ typedef struct _STREAM_CONFIGURATION {
|
||||
// if the server is able to provide one.
|
||||
int supportsHevc;
|
||||
|
||||
// Specifies the percentage that the specified bitrate will be adjusted
|
||||
// when an HEVC stream will be delivered. This allows clients to opt to
|
||||
// reduce bandwidth when HEVC is chosen as the video codec rather than
|
||||
// (or in addition to) improving image quality.
|
||||
int hevcBitratePercentageMultiplier;
|
||||
|
||||
// AES encryption data for the remote input stream. This must be
|
||||
// the same as what was passed as rikey and rikeyid
|
||||
// in /launch and /resume requests.
|
||||
|
@ -537,6 +537,12 @@ int performRtspHandshake(void) {
|
||||
// look for the base 64 encoded VPS NALU prefix that is unique to the HEVC bitstream.
|
||||
if (StreamConfig.supportsHevc && strstr(response.payload, "sprop-parameter-sets=AAAAAU")) {
|
||||
NegotiatedVideoFormat = VIDEO_FORMAT_H265;
|
||||
|
||||
// Apply bitrate adjustment for HEVC if the client requested one
|
||||
if (StreamConfig.hevcBitratePercentageMultiplier != 0) {
|
||||
StreamConfig.bitrate *= StreamConfig.hevcBitratePercentageMultiplier;
|
||||
StreamConfig.bitrate /= 100;
|
||||
}
|
||||
}
|
||||
else {
|
||||
NegotiatedVideoFormat = VIDEO_FORMAT_H264;
|
||||
|
Loading…
x
Reference in New Issue
Block a user