Skip to content

Commit

Permalink
automatically selects better color space if possible
Browse files Browse the repository at this point in the history
  • Loading branch information
mariotaku committed Apr 22, 2024
1 parent ff1cd13 commit 629e095
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/app/stream/session.c
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,14 @@ void session_config_init(app_t *app, session_config_t *config, const SERVER_DATA
if (config->stream.supportedVideoFormats == 0) {
config->stream.supportedVideoFormats = VIDEO_FORMAT_H264;
}
config->stream.colorSpace = COLORSPACE_REC_709/* TODO: get from video capabilities */;
if (video_cap.colorSpace & SS4S_VIDEO_CAP_COLORSPACE_BT2020 &&
(config->stream.supportedVideoFormats & ~VIDEO_FORMAT_MASK_H264)) {
config->stream.colorSpace = COLORSPACE_REC_2020;
} else if (video_cap.colorSpace & SS4S_VIDEO_CAP_COLORSPACE_BT709) {
config->stream.colorSpace = COLORSPACE_REC_709;
} else {
config->stream.colorSpace = COLORSPACE_REC_601;
}
config->stream.colorRange = video_cap.fullColorRange ? COLOR_RANGE_FULL : COLOR_RANGE_LIMITED;
#if FEATURE_SURROUND_SOUND
if (audio_cap.maxChannels < CHANNEL_COUNT_FROM_AUDIO_CONFIGURATION(config->stream.audioConfiguration)) {
Expand Down

0 comments on commit 629e095

Please sign in to comment.