mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-06-07 07:58:51 +00:00
tests: enable more formats in videofilter unit test, check more resolutions
This commit is contained in:
parent
a1a0186a62
commit
2a8103553d
1 changed files with 25 additions and 19 deletions
|
@ -36,6 +36,9 @@ GstPad *mysrcpad, *mysinkpad;
|
||||||
#define VIDEO_CAPS_TEMPLATE_STRING \
|
#define VIDEO_CAPS_TEMPLATE_STRING \
|
||||||
GST_VIDEO_CAPS_YUV ("I420") ";" \
|
GST_VIDEO_CAPS_YUV ("I420") ";" \
|
||||||
GST_VIDEO_CAPS_YUV ("AYUV") ";" \
|
GST_VIDEO_CAPS_YUV ("AYUV") ";" \
|
||||||
|
GST_VIDEO_CAPS_YUV ("YUY2") ";" \
|
||||||
|
GST_VIDEO_CAPS_YUV ("UYVY") ";" \
|
||||||
|
GST_VIDEO_CAPS_YUV ("YVYU") ";" \
|
||||||
GST_VIDEO_CAPS_xRGB
|
GST_VIDEO_CAPS_xRGB
|
||||||
|
|
||||||
static GstStaticPadTemplate sinktemplate = GST_STATIC_PAD_TEMPLATE ("sink",
|
static GstStaticPadTemplate sinktemplate = GST_STATIC_PAD_TEMPLATE ("sink",
|
||||||
|
@ -129,7 +132,14 @@ check_filter_caps (const gchar * name, GstCaps * caps, gint size,
|
||||||
static void
|
static void
|
||||||
check_filter (const gchar * name, gint num_buffers, const gchar * prop, ...)
|
check_filter (const gchar * name, gint num_buffers, const gchar * prop, ...)
|
||||||
{
|
{
|
||||||
gint i, n;
|
static const struct
|
||||||
|
{
|
||||||
|
const int width, height;
|
||||||
|
} resolutions[] = { {
|
||||||
|
384, 288}, {
|
||||||
|
385, 289}, {
|
||||||
|
385, 385}};
|
||||||
|
gint i, n, r;
|
||||||
GstVideoFormat format;
|
GstVideoFormat format;
|
||||||
gint size;
|
gint size;
|
||||||
GstCaps *templ = gst_caps_from_string (VIDEO_CAPS_TEMPLATE_STRING);
|
GstCaps *templ = gst_caps_from_string (VIDEO_CAPS_TEMPLATE_STRING);
|
||||||
|
@ -142,27 +152,23 @@ check_filter (const gchar * name, gint num_buffers, const gchar * prop, ...)
|
||||||
GstCaps *caps = gst_caps_new_empty ();
|
GstCaps *caps = gst_caps_new_empty ();
|
||||||
|
|
||||||
gst_caps_append_structure (caps, gst_structure_copy (s));
|
gst_caps_append_structure (caps, gst_structure_copy (s));
|
||||||
gst_caps_set_simple (caps, "width", G_TYPE_INT, 384, "height", G_TYPE_INT,
|
|
||||||
288, "framerate", GST_TYPE_FRACTION, 25, 1, NULL);
|
|
||||||
|
|
||||||
GST_DEBUG ("Testing with caps: %" GST_PTR_FORMAT, caps);
|
/* try various resolutions */
|
||||||
gst_video_format_parse_caps (caps, &format, NULL, NULL);
|
for (r = 0; r < G_N_ELEMENTS (resolutions); ++r) {
|
||||||
size = gst_video_format_get_size (format, 384, 288);
|
caps = gst_caps_make_writable (caps);
|
||||||
va_start (varargs, prop);
|
gst_caps_set_simple (caps, "width", G_TYPE_INT, resolutions[r].width,
|
||||||
check_filter_caps (name, caps, size, num_buffers, prop, varargs);
|
"height", G_TYPE_INT, resolutions[r].height,
|
||||||
va_end (varargs);
|
"framerate", GST_TYPE_FRACTION, 25, 1, NULL);
|
||||||
|
|
||||||
/* and again with 'odd' width/height */
|
GST_DEBUG ("Testing with caps: %" GST_PTR_FORMAT, caps);
|
||||||
caps = gst_caps_make_writable (caps);
|
gst_video_format_parse_caps (caps, &format, NULL, NULL);
|
||||||
gst_caps_set_simple (caps, "width", G_TYPE_INT, 385, "height", G_TYPE_INT,
|
size = gst_video_format_get_size (format, resolutions[r].width,
|
||||||
289, "framerate", GST_TYPE_FRACTION, 25, 1, NULL);
|
resolutions[r].height);
|
||||||
|
|
||||||
GST_DEBUG ("Testing with caps: %" GST_PTR_FORMAT, caps);
|
va_start (varargs, prop);
|
||||||
gst_video_format_parse_caps (caps, &format, NULL, NULL);
|
check_filter_caps (name, caps, size, num_buffers, prop, varargs);
|
||||||
size = gst_video_format_get_size (format, 385, 289);
|
va_end (varargs);
|
||||||
va_start (varargs, prop);
|
}
|
||||||
check_filter_caps (name, caps, size, num_buffers, prop, varargs);
|
|
||||||
va_end (varargs);
|
|
||||||
|
|
||||||
gst_caps_unref (caps);
|
gst_caps_unref (caps);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue