move bt709 fix to -v4l2 and -rpi* options, instead of Caps for all.

This commit is contained in:
fduncanh
2022-06-20 21:34:48 -04:00
parent 0ce2edb29a
commit bdbe73108c
2 changed files with 8 additions and 2 deletions

View File

@@ -97,7 +97,7 @@ static logger_t *logger = NULL;
static unsigned short width, height, width_source, height_source; /* not currently used */
static bool first_packet = false;
/* apple uses colorimetry=1:3:5:1 (not recognized by gstreamer) *
/* apple uses colorimetry=1:3:5:1 (not recognized by gstreamer v4l2) *
* 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 *
@@ -106,7 +106,7 @@ static bool first_packet = false;
* 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";
static const char h264_caps[]="video/x-h264,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;

View File

@@ -586,11 +586,15 @@ int main (int argc, char *argv[]) {
video_converter.erase();
video_converter = "videoconvert";
} else if (arg == "-v4l2" || arg == "-rpi") {
video_parser.erase();
video_parser = "h264parse ! capssetter caps=\"video/x-h264, colorimetry=bt709\"";
video_decoder.erase();
video_decoder = "v4l2h264dec";
video_converter.erase();
video_converter = "v4l2convert";
} else if (arg == "-rpifb") {
video_parser.erase();
video_parser = "h264parse ! capssetter caps=\"video/x-h264, colorimetry=bt709\"";
video_decoder.erase();
video_decoder = "v4l2h264dec";
video_converter.erase();
@@ -598,6 +602,8 @@ int main (int argc, char *argv[]) {
videosink.erase();
videosink = "kmssink";
} 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();