From c1115017bce92d18acd4cd35c049e688c499c631 Mon Sep 17 00:00:00 2001 From: fduncanh Date: Wed, 20 Apr 2022 19:02:58 -0400 Subject: [PATCH] move colorimetry=bt709 to video caps set in video_renderer_gstreamer.c --- renderers/video_renderer_gstreamer.c | 12 +++++++++++- uxplay.cpp | 6 ------ 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/renderers/video_renderer_gstreamer.c b/renderers/video_renderer_gstreamer.c index 0637aad..a0b0577 100644 --- a/renderers/video_renderer_gstreamer.c +++ b/renderers/video_renderer_gstreamer.c @@ -96,7 +96,17 @@ static video_renderer_t *renderer = NULL; static logger_t *logger = NULL; static unsigned short width, height, width_source, height_source; /* not currently used */ static bool first_packet = false; -static const char h264_caps[]="video/x-h264,stream-format=(string)byte-stream,alignment=(string)au"; + +/* apple uses colorimetry=1:3:5:1 (not recognized by gstreamer) * + * See .../gst-libs/gst/video/video-color.h in gst-plugins-base * + * range = 1 -> GST_VIDEO_COLOR_RANGE_0_255 ("full RGB") * + * matrix = 3 -> GST_VIDEO_COLOR_MATRIX_BT709 * + * transfer = 5 -> GST_VIDEO_TRANSFER_BT709 * + * primaries = 1 -> GST_VIDEO_COLOR_PRIMARIES_BT709 * + * closest is BT709, 2:3:5:1 with * + * range = 2 -> GST_VIDEO_COLOR_RANGE_16_235 ("limited RGB") */ + +static const char h264_caps[]="video/x-h264,colorimetry=bt709,stream-format=(string)byte-stream,alignment=(string)au"; void video_renderer_size(float *f_width_source, float *f_height_source, float *f_width, float *f_height) { width_source = (unsigned short) *f_width_source; diff --git a/uxplay.cpp b/uxplay.cpp index d930eaf..39e44c8 100644 --- a/uxplay.cpp +++ b/uxplay.cpp @@ -585,8 +585,6 @@ int main (int argc, char *argv[]) { video_converter.erase(); video_converter = "videoconvert"; } else if (arg == "-rpigl") { - video_parser.erase(); - video_parser = "h264parse ! capssetter caps=\"video/x-h264, colorimetry=bt709\""; video_decoder.erase(); video_decoder = "v4l2h264dec"; video_converter.erase(); @@ -594,8 +592,6 @@ int main (int argc, char *argv[]) { videosink.erase(); videosink = "glimagesink"; } else if (arg == "-rpiwl" ) { - video_parser.erase(); - video_parser = "h264parse ! capssetter caps=\"video/x-h264, colorimetry=bt709\""; video_decoder.erase(); video_decoder = "v4l2h264dec"; video_converter.erase(); @@ -603,8 +599,6 @@ int main (int argc, char *argv[]) { videosink.erase(); videosink = "waylandsink"; } else if (arg == "-rpi" ) { - video_parser.erase(); - video_parser = "h264parse ! capssetter caps=\"video/x-h264, colorimetry=bt709\""; video_decoder.erase(); video_decoder = "v4l2h264dec"; video_converter.erase();