move colorimetry=bt709 to video caps set in video_renderer_gstreamer.c

This commit is contained in:
fduncanh
2022-04-20 19:02:58 -04:00
parent b39717b5f1
commit c1115017bc
2 changed files with 11 additions and 7 deletions

View File

@@ -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;

View File

@@ -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();