mpeg2dec test: Fix expected output caps

In the absence of explicit info, video decoders
now output mono multiview caps by default, so make
the expected caps match that
This commit is contained in:
Jan Schmidt 2017-05-19 18:59:17 +02:00
parent d02e7d8029
commit 32335ab3e4
2 changed files with 31 additions and 14 deletions

View file

@ -94,4 +94,8 @@ elements_mpg123audiodec_LDADD = \
$(GST_PLUGINS_BASE_LIBS) $(GST_BASE_LIBS) $(GST_LIBS) $(LDADD) \ $(GST_PLUGINS_BASE_LIBS) $(GST_BASE_LIBS) $(GST_LIBS) $(LDADD) \
-lgstaudio-@GST_API_VERSION@ -lgstfft-@GST_API_VERSION@ -lgstapp-@GST_API_VERSION@ -lgstaudio-@GST_API_VERSION@ -lgstfft-@GST_API_VERSION@ -lgstapp-@GST_API_VERSION@
elements_mpeg2dec_CFLAGS = $(GST_PLUGINS_BASE_CFLAGS) $(GST_BASE_CFLAGS) $(AM_CFLAGS)
elements_mpeg2dec_LDADD = $(GST_PLUGINS_BASE_LIBS) $(GST_BASE_LIBS) $(GST_LIBS) $(LDADD) \
-lgstvideo-@GST_API_VERSION@
EXTRA_DIST = gst-plugins-ugly.supp EXTRA_DIST = gst-plugins-ugly.supp

View file

@ -23,6 +23,7 @@
#include <unistd.h> #include <unistd.h>
#include <gst/check/gstcheck.h> #include <gst/check/gstcheck.h>
#include <gst/video/video-info.h>
/* For ease of programming we use globals to keep refs for our floating /* For ease of programming we use globals to keep refs for our floating
* src and sink pads we create; otherwise we always have to do get_pad, * src and sink pads we create; otherwise we always have to do get_pad,
@ -1749,6 +1750,7 @@ GST_START_TEST (test_decode_stream1)
int i, num_buffers; int i, num_buffers;
GstCaps *out_caps, *caps; GstCaps *out_caps, *caps;
guint offset = 0; guint offset = 0;
GstVideoInfo info;
mpeg2dec = setup_mpeg2dec (); mpeg2dec = setup_mpeg2dec ();
@ -1779,13 +1781,18 @@ GST_START_TEST (test_decode_stream1)
fail_unless_equals_int (num_buffers, 30); fail_unless_equals_int (num_buffers, 30);
/* each buffer should have these caps */ /* each buffer should have these caps */
out_caps = gst_video_info_init (&info);
gst_caps_new_simple ("video/x-raw", "format", G_TYPE_STRING, gst_video_info_set_format (&info, GST_VIDEO_FORMAT_I420, 176, 144);
"I420", "width", G_TYPE_INT, 176, "height", G_TYPE_INT, 144, GST_VIDEO_INFO_PAR_N (&info) = GST_VIDEO_INFO_PAR_D (&info) = 1;
"pixel-aspect-ratio", GST_TYPE_FRACTION, 1, 1, "framerate", GST_VIDEO_INFO_FPS_N (&info) = 25;
GST_TYPE_FRACTION, 25, 1, "interlace-mode", G_TYPE_STRING, "progressive", GST_VIDEO_INFO_FPS_D (&info) = 1;
"chroma-site", G_TYPE_STRING, "mpeg2", GST_VIDEO_INFO_FPS_D (&info) = 1;
"colorimetry", G_TYPE_STRING, "bt601", NULL); GST_VIDEO_INFO_CHROMA_SITE (&info) = GST_VIDEO_CHROMA_SITE_MPEG2;
gst_video_colorimetry_from_string (&GST_VIDEO_INFO_COLORIMETRY (&info),
GST_VIDEO_COLORIMETRY_BT601);
GST_VIDEO_INFO_MULTIVIEW_MODE (&info) = GST_VIDEO_MULTIVIEW_MODE_MONO;
out_caps = gst_video_info_to_caps (&info);
caps = gst_pad_get_current_caps (mysinkpad); caps = gst_pad_get_current_caps (mysinkpad);
GST_LOG ("output caps %" GST_PTR_FORMAT, caps); GST_LOG ("output caps %" GST_PTR_FORMAT, caps);
@ -1825,6 +1832,7 @@ GST_START_TEST (test_decode_stream2)
GstCaps *out_caps; GstCaps *out_caps;
GstCaps *caps; GstCaps *caps;
guint offset = 0; guint offset = 0;
GstVideoInfo info;
mpeg2dec = setup_mpeg2dec (); mpeg2dec = setup_mpeg2dec ();
@ -1856,13 +1864,18 @@ GST_START_TEST (test_decode_stream2)
fail_unless_equals_int (num_buffers, 30); fail_unless_equals_int (num_buffers, 30);
/* each buffer should have these caps */ /* each buffer should have these caps */
out_caps = gst_video_info_init (&info);
gst_caps_new_simple ("video/x-raw", "format", G_TYPE_STRING, "I420", gst_video_info_set_format (&info, GST_VIDEO_FORMAT_I420, 183, 217);
"width", G_TYPE_INT, 183, "height", G_TYPE_INT, 217, GST_VIDEO_INFO_PAR_N (&info) = GST_VIDEO_INFO_PAR_D (&info) = 1;
"pixel-aspect-ratio", GST_TYPE_FRACTION, 1, 1, "framerate", GST_VIDEO_INFO_FPS_N (&info) = 25;
GST_TYPE_FRACTION, 25, 1, "interlace-mode", G_TYPE_STRING, "progressive", GST_VIDEO_INFO_FPS_D (&info) = 1;
"chroma-site", G_TYPE_STRING, "mpeg2", "colorimetry", G_TYPE_STRING, GST_VIDEO_INFO_FPS_D (&info) = 1;
"bt601", NULL); GST_VIDEO_INFO_CHROMA_SITE (&info) = GST_VIDEO_CHROMA_SITE_MPEG2;
gst_video_colorimetry_from_string (&GST_VIDEO_INFO_COLORIMETRY (&info),
GST_VIDEO_COLORIMETRY_BT601);
GST_VIDEO_INFO_MULTIVIEW_MODE (&info) = GST_VIDEO_MULTIVIEW_MODE_MONO;
out_caps = gst_video_info_to_caps (&info);
caps = gst_pad_get_current_caps (mysinkpad); caps = gst_pad_get_current_caps (mysinkpad);
GST_LOG ("output caps %" GST_PTR_FORMAT, caps); GST_LOG ("output caps %" GST_PTR_FORMAT, caps);