Separate H.265 video format for SDR and HDR formats

This commit is contained in:
Cameron Gutman 2017-11-25 12:12:38 -08:00
commit 26fe1cb22c
5 changed files with 29 additions and 16 deletions

View file

@ -536,12 +536,17 @@ int performRtspHandshake(void) {
// format to H264, so we can't just look for the HEVC MIME type. What we'll do instead is
// 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;
if (StreamConfig.enableHdr) {
NegotiatedVideoFormat = VIDEO_FORMAT_H265_MAIN10;
}
else {
NegotiatedVideoFormat = VIDEO_FORMAT_H265;
// Apply bitrate adjustment for SDR HEVC if the client requested one
if (StreamConfig.hevcBitratePercentageMultiplier != 0 && !StreamConfig.enableHdr) {
StreamConfig.bitrate *= StreamConfig.hevcBitratePercentageMultiplier;
StreamConfig.bitrate /= 100;
// Apply bitrate adjustment for SDR HEVC if the client requested one
if (StreamConfig.hevcBitratePercentageMultiplier != 0) {
StreamConfig.bitrate *= StreamConfig.hevcBitratePercentageMultiplier;
StreamConfig.bitrate /= 100;
}
}
}
else {