/* GStreamer
*
- * unit test for ffmpegcolorspace
+ * unit test for videoconvert
*
* Copyright (C) <2006> Tim-Philipp Müller <tim centricular net>
*
#include <gst/check/gstcheck.h>
-typedef struct _RGBFormat
-{
- const gchar *nick;
- guint bpp, depth;
- guint32 red_mask, green_mask, blue_mask, alpha_mask;
- guint endianness;
-} RGBFormat;
-
typedef struct _RGBConversion
{
- RGBFormat from_fmt;
- RGBFormat to_fmt;
+ const gchar *from_fmt;
+ const gchar *to_fmt;
GstCaps *from_caps;
GstCaps *to_caps;
} RGBConversion;
static GstCaps *
-rgb_format_to_caps (RGBFormat * fmt)
+rgb_format_to_caps (const gchar * fmt)
{
GstCaps *caps;
g_assert (fmt != NULL);
- g_assert (fmt->endianness != 0);
-
- caps = gst_caps_new_simple ("video/x-raw-rgb",
- "bpp", G_TYPE_INT, fmt->bpp,
- "depth", G_TYPE_INT, fmt->depth,
- "red_mask", G_TYPE_INT, fmt->red_mask,
- "green_mask", G_TYPE_INT, fmt->green_mask,
- "blue_mask", G_TYPE_INT, fmt->blue_mask,
+
+ caps = gst_caps_new_simple ("video/x-raw",
+ "format", G_TYPE_STRING, fmt,
"width", G_TYPE_INT, 16, "height", G_TYPE_INT, 16,
- "endianness", G_TYPE_INT, fmt->endianness,
"framerate", GST_TYPE_FRACTION, 1, 1, NULL);
- fail_unless (fmt->alpha_mask == 0 || fmt->bpp == 32);
-
- if (fmt->alpha_mask != 0) {
- gst_structure_set (gst_caps_get_structure (caps, 0),
- "alpha_mask", G_TYPE_INT, fmt->alpha_mask, NULL);
- }
-
return caps;
}
static GList *
create_rgb_conversions (void)
{
- const RGBFormat rgb_formats[] = {
- {
- "RGBA", 32, 32, 0xff000000, 0x00ff0000, 0x0000ff00, 0x000000ff, 0}, {
- "ARGB", 32, 32, 0x00ff0000, 0x0000ff00, 0x000000ff, 0xff000000, 0}, {
- "BGRA", 32, 32, 0x0000ff00, 0x00ff0000, 0xff000000, 0x000000ff, 0}, {
- "ABGR", 32, 32, 0x000000ff, 0x0000ff00, 0x00ff0000, 0xff000000, 0}, {
- "RGBx", 32, 24, 0xff000000, 0x00ff0000, 0x0000ff00, 0x00000000, 0}, {
- "xRGB", 32, 24, 0x00ff0000, 0x0000ff00, 0x000000ff, 0x00000000, 0}, {
- "BGRx", 32, 24, 0x0000ff00, 0x00ff0000, 0xff000000, 0x00000000, 0}, {
- "xBGR", 32, 24, 0x000000ff, 0x0000ff00, 0x00ff0000, 0x00000000, 0}, {
- "RGB ", 24, 24, 0x00ff0000, 0x0000ff00, 0x000000ff, 0x00000000, 0}, {
- "BGR ", 24, 24, 0x000000ff, 0x0000ff00, 0x00ff0000, 0x00000000, 0}, {
- "RGB565", 16, 16, 0x0000f800, 0x000007e0, 0x0000001f, 0x00000000, 0}, {
- "xRGB1555", 16, 15, 0x00007c00, 0x000003e0, 0x0000001f, 0x0000000, 0}
- };
- const struct
- {
- guint from_endianness, to_endianness;
- } end_arr[4] = {
- {
- G_LITTLE_ENDIAN, G_LITTLE_ENDIAN}, {
- G_BIG_ENDIAN, G_LITTLE_ENDIAN}, {
- G_LITTLE_ENDIAN, G_BIG_ENDIAN}, {
- G_BIG_ENDIAN, G_BIG_ENDIAN}
+ const gchar *rgb_formats[] = {
+ "RGBA",
+ "ARGB",
+ "BGRA",
+ "ABGR",
+ "RGBx",
+ "xRGB",
+ "BGRx",
+ "xBGR",
+ "RGB",
+ "BGR",
+ "RGB15",
+ "BGR15",
+ "RGB16",
+ "BGR16"
};
GList *conversions = NULL;
guint from_fmt, to_fmt;
conversion = g_new0 (RGBConversion, 1);
conversion->from_fmt = rgb_formats[from_fmt];
conversion->to_fmt = rgb_formats[to_fmt];
- conversion->from_fmt.endianness = end_arr[i].from_endianness;
- conversion->to_fmt.endianness = end_arr[i].to_endianness;
- conversion->from_caps = rgb_format_to_caps (&conversion->from_fmt);
- conversion->to_caps = rgb_format_to_caps (&conversion->to_fmt);
+ conversion->from_caps = rgb_format_to_caps (conversion->from_fmt);
+ conversion->to_caps = rgb_format_to_caps (conversion->to_fmt);
conversions = g_list_prepend (conversions, conversion);
}
}
return pixel;
}
+#if 0
static guint8
fix_expected_colour (guint32 col_mask, guint8 col_expected)
{
// FIXME: fix alpha check
// fail_unless (a_mask == 0 || alpha != 0); /* better than nothing */
}
+#endif
static void
got_buf_cb (GstElement * sink, GstBuffer * new_buf, GstPad * pad,
GstElement *pipeline, *src, *filter1, *csp, *filter2, *sink;
GstCaps *template_caps;
GstBuffer *buf = NULL;
- GstPad *srcpad;
+ GstPad *srcpad, *csppad;
GList *conversions, *l;
gint p;
pipeline = gst_pipeline_new ("pipeline");
src = gst_check_setup_element ("videotestsrc");
filter1 = gst_check_setup_element ("capsfilter");
- csp = gst_check_setup_element ("ffmpegcolorspace");
+ csp = gst_check_setup_element ("videoconvert");
filter2 = gst_element_factory_make ("capsfilter", "to_filter");
sink = gst_check_setup_element ("fakesink");
template_caps = gst_pad_get_pad_template_caps (srcpad);
gst_object_unref (srcpad);
+ csppad = gst_element_get_static_pad (csp, "src");
+
g_object_set (sink, "signal-handoffs", TRUE, NULL);
g_signal_connect (sink, "preroll-handoff", G_CALLBACK (got_buf_cb), &buf);
/* caps are supported, let's run some tests then ... */
for (p = 0; p < G_N_ELEMENTS (test_patterns); ++p) {
GstStateChangeReturn state_ret;
- RGBFormat *from = &conv->from_fmt;
- RGBFormat *to = &conv->to_fmt;
+ const gchar *from = conv->from_fmt;
+ const gchar *to = conv->to_fmt;
+#if 0
guint8 *data;
gsize size;
+#endif
/* trick compiler into thinking from is used, might throw warning
* otherwise if the debugging system is disabled */
g_object_set (src, "pattern", test_patterns[p].pattern_enum, NULL);
- GST_INFO ("%5s %u/%u %08x %08x %08x %08x %u => "
- "%5s %u/%u %08x %08x %08x %08x %u, pattern=%s",
- from->nick, from->bpp, from->depth, from->red_mask,
- from->green_mask, from->blue_mask, from->alpha_mask,
- from->endianness, to->nick, to->bpp, to->depth, to->red_mask,
- to->green_mask, to->blue_mask, to->alpha_mask, to->endianness,
- test_patterns[p].pattern_name);
+ GST_INFO ("%5s => %5s, pattern=%s",
+ from, to, test_patterns[p].pattern_name);
/* now get videotestsrc to produce a buffer with the given caps */
g_object_set (filter1, "caps", conv->from_caps, NULL);
- /* ... and force ffmpegcolorspace to convert to our target caps */
+ /* ... and force videoconvert to convert to our target caps */
g_object_set (filter2, "caps", conv->to_caps, NULL);
state_ret = gst_element_set_state (pipeline, GST_STATE_PAUSED);
fail_unless (err != NULL);
if (msg->src == GST_OBJECT_CAST (src) &&
err->code == GST_STREAM_ERROR_FORMAT) {
- GST_DEBUG ("ffmpegcolorspace does not support this conversion");
+ GST_DEBUG ("videoconvert does not support this conversion");
gst_message_unref (msg);
g_error_free (err);
continue;
/* check buffer caps */
{
+ GstCaps *caps;
GstStructure *s;
- gint v;
-
- fail_unless (GST_BUFFER_CAPS (buf) != NULL);
- s = gst_caps_get_structure (GST_BUFFER_CAPS (buf), 0);
- fail_unless (gst_structure_get_int (s, "bpp", &v));
- fail_unless_equals_int (v, to->bpp);
- fail_unless (gst_structure_get_int (s, "depth", &v));
- fail_unless_equals_int (v, to->depth);
- fail_unless (gst_structure_get_int (s, "red_mask", &v));
- fail_unless_equals_int (v, to->red_mask);
- fail_unless (gst_structure_get_int (s, "green_mask", &v));
- fail_unless_equals_int (v, to->green_mask);
- fail_unless (gst_structure_get_int (s, "blue_mask", &v));
- fail_unless_equals_int (v, to->blue_mask);
- /* there mustn't be an alpha_mask if there's no alpha component */
- if (to->depth == 32) {
- fail_unless (gst_structure_get_int (s, "alpha_mask", &v));
- fail_unless_equals_int (v, to->alpha_mask);
- } else {
- fail_unless (gst_structure_get_value (s, "alpha_mask") == NULL);
- }
+ const gchar *fmt;
+
+ g_object_get (csppad, "caps", &caps, NULL);
+
+ fail_unless (caps != NULL);
+ s = gst_caps_get_structure (caps, 0);
+ fmt = gst_structure_get_string (s, "format");
+ fail_unless (fmt != NULL);
+ fail_unless (!strcmp (fmt, to));
}
+#if 0
/* now check the top-left pixel */
data = gst_buffer_map (buf, &size, NULL, GST_MAP_READ);
check_rgb_buf (data, to->red_mask,
test_patterns[p].r_expected, test_patterns[p].g_expected,
test_patterns[p].b_expected, to->endianness, to->bpp, to->depth);
gst_buffer_unmap (buf, data, size);
+#endif
gst_buffer_unref (buf);
buf = NULL;
GST_END_TEST;
static Suite *
-ffmpegcolorspace_suite (void)
+videoconvert_suite (void)
{
- Suite *s = suite_create ("ffmpegcolorspace");
+ Suite *s = suite_create ("videoconvert");
TCase *tc_chain = tcase_create ("general");
suite_add_tcase (s, tc_chain);
return s;
}
-GST_CHECK_MAIN (ffmpegcolorspace);
+GST_CHECK_MAIN (videoconvert);
vis = gst_check_setup_element (factory_name);
cf = gst_check_setup_element ("capsfilter");
- caps = gst_caps_new_simple ("video/x-raw-rgb", "width", G_TYPE_INT, 320,
+ caps = gst_caps_new_simple ("video/x-raw", "width", G_TYPE_INT, 320,
"height", G_TYPE_INT, 240, "framerate", GST_TYPE_FRACTION, 15, 1, NULL);
g_object_set (cf, "caps", caps, NULL);
gst_caps_unref (caps);
{
static GstStaticPadTemplate sink_templ = GST_STATIC_PAD_TEMPLATE ("sink",
GST_PAD_SINK, GST_PAD_ALWAYS,
- GST_STATIC_CAPS ("video/x-raw-yuv; video/x-compressed")
+ GST_STATIC_CAPS ("video/x-raw; video/x-compressed")
);
GstElementClass *element_class = GST_ELEMENT_CLASS (klass);
s = gst_caps_get_structure (caps, 0);
- if (gst_structure_has_name (s, "video/x-raw-yuv")) {
+ if (gst_structure_has_name (s, "video/x-raw")) {
sink->raw = TRUE;
} else if (gst_structure_has_name (s, "video/x-compressed")) {
sink->raw = FALSE;
} else {
- fail_unless (gst_structure_has_name (s, "video/x-raw-yuv")
+ fail_unless (gst_structure_has_name (s, "video/x-raw")
|| gst_structure_has_name (s, "video/x-compressed"));
return FALSE;
}
static GstStaticPadTemplate src_templ = GST_STATIC_PAD_TEMPLATE ("src_%d",
GST_PAD_SRC, GST_PAD_SOMETIMES,
GST_STATIC_CAPS ("audio/x-raw-int; audio/x-compressed; "
- "video/x-raw-yuv; video/x-compressed")
+ "video/x-raw; video/x-compressed")
);
GstElementClass *element_class = GST_ELEMENT_CLASS (klass);
}
if (g_str_equal (streaminfo, "raw-video")) {
- caps = gst_caps_new_simple ("video/x-raw-yuv",
+ caps = gst_caps_new_simple ("video/x-raw",
"format", GST_TYPE_FOURCC, GST_MAKE_FOURCC ('I', '4', '2', '0'),
"width", G_TYPE_INT, 320,
"height", G_TYPE_INT, 240,
playbin =
create_playbin
- ("caps:video/x-raw-yuv, "
- "format=(fourcc)I420, "
+ ("caps:video/x-raw, "
+ "format=(string)I420, "
"width=(int)320, "
"height=(int)240, "
"framerate=(fraction)0/1, " "pixel-aspect-ratio=(fraction)1/1", TRUE);
gst_red_video_src_get_caps (GstBaseSrc * src, GstCaps * filter)
{
guint w = 64, h = 64;
- return gst_caps_new_simple ("video/x-raw-yuv", "format", GST_TYPE_FOURCC,
+ return gst_caps_new_simple ("video/x-raw", "format", GST_TYPE_FOURCC,
GST_MAKE_FOURCC ('I', '4', '2', '0'), "width", G_TYPE_INT, w, "height",
G_TYPE_INT, h, "framerate", GST_TYPE_FRACTION, 1, 1, NULL);
}
GstBaseSrcClass *basesrc_class = GST_BASE_SRC_CLASS (klass);
static GstStaticPadTemplate src_templ = GST_STATIC_PAD_TEMPLATE ("src",
GST_PAD_SRC, GST_PAD_ALWAYS,
- GST_STATIC_CAPS ("video/x-raw-yuv, format=(fourcc)I420")
+ GST_STATIC_CAPS ("video/x-raw, format=(string)I420")
);
GstElementClass *element_class = GST_ELEMENT_CLASS (klass);
static GstPad *myvideosrcpad, *mytextsrcpad, *mysinkpad;
#define VIDEO_CAPS_STRING \
- "video/x-raw-yuv, " \
- "format = (fourcc) I420, " \
+ "video/x-raw, " \
+ "format = (string) I420, " \
"framerate = (fraction) 1/1, " \
"width = (int) 240, " \
"height = (int) 120"
#define VIDEO_CAPS_TEMPLATE_STRING \
- "video/x-raw-yuv, " \
- "format = (fourcc) I420"
+ "video/x-raw, " \
+ "format = (string) I420"
static GstStaticPadTemplate sinktemplate = GST_STATIC_PAD_TEMPLATE ("sink",
GST_PAD_SINK,
#define VIDEO_CAPS_TEMPLATE_STRING \
- "video/x-raw-yuv"
+ "video/x-raw"
#define VIDEO_CAPS_STRING \
- "video/x-raw-yuv, " \
+ "video/x-raw, " \
"width = (int) 320, " \
"height = (int) 240, " \
"framerate = (fraction) 25/1 , " \
- "format = (fourcc) I420"
+ "format = (string) I420"
#define VIDEO_CAPS_NO_FRAMERATE_STRING \
- "video/x-raw-yuv, " \
+ "video/x-raw, " \
"width = (int) 320, " \
"height = (int) 240, " \
- "format = (fourcc) I420"
+ "format = (string) I420"
#define VIDEO_CAPS_NEWSIZE_STRING \
- "video/x-raw-yuv, " \
+ "video/x-raw, " \
"width = (int) 240, " \
"height = (int) 120, " \
"framerate = (fraction) 25/1 , " \
- "format = (fourcc) I420"
+ "format = (string) I420"
#define VIDEO_CAPS_UNUSUAL_FRAMERATE \
- "video/x-raw-yuv, " \
+ "video/x-raw, " \
"width = (int) 240, " \
"height = (int) 120, " \
"framerate = (fraction) 999/7 , " \
- "format = (fourcc) I420, " \
+ "format = (string) I420, " \
"color-matrix=(string)sdtv"
static GstStaticPadTemplate sinktemplate = GST_STATIC_PAD_TEMPLATE ("sink",
GST_START_TEST (test_negotiation)
{
_test_negotiation
- ("video/x-raw-yuv,format=(fourcc)AYUV,width=720,height=576,pixel-aspect-ratio=16/15",
- "video/x-raw-yuv,format=(fourcc)AYUV,width=768,height=576",
- 768, 576, 1, 1);
+ ("video/x-raw,format=(string)AYUV,width=720,height=576,pixel-aspect-ratio=16/15",
+ "video/x-raw,format=(string)AYUV,width=768,height=576", 768, 576, 1, 1);
_test_negotiation
- ("video/x-raw-yuv,format=(fourcc)AYUV,width=320,height=240",
- "video/x-raw-yuv,format=(fourcc)AYUV,width=640,height=320",
- 640, 320, 2, 3);
+ ("video/x-raw,format=(string)AYUV,width=320,height=240",
+ "video/x-raw,format=(string)AYUV,width=640,height=320", 640, 320, 2, 3);
_test_negotiation
- ("video/x-raw-yuv,format=(fourcc)AYUV,width=320,height=240",
- "video/x-raw-yuv,format=(fourcc)AYUV,width=640,height=320,pixel-aspect-ratio=[0/1, 1/1]",
+ ("video/x-raw,format=(string)AYUV,width=320,height=240",
+ "video/x-raw,format=(string)AYUV,width=640,height=320,pixel-aspect-ratio=[0/1, 1/1]",
640, 320, 2, 3);
_test_negotiation
- ("video/x-raw-yuv,format=(fourcc)AYUV,width=1920,height=2560,pixel-aspect-ratio=1/1",
- "video/x-raw-yuv,format=(fourcc)AYUV,width=[1, 2048],height=[1, 2048],pixel-aspect-ratio=1/1",
+ ("video/x-raw,format=(string)AYUV,width=1920,height=2560,pixel-aspect-ratio=1/1",
+ "video/x-raw,format=(string)AYUV,width=[1, 2048],height=[1, 2048],pixel-aspect-ratio=1/1",
1536, 2048, 1, 1);
_test_negotiation
- ("video/x-raw-yuv,format=(fourcc)AYUV,width=1920,height=2560,pixel-aspect-ratio=1/1",
- "video/x-raw-yuv,format=(fourcc)AYUV,width=[1, 2048],height=[1, 2048]",
+ ("video/x-raw,format=(string)AYUV,width=1920,height=2560,pixel-aspect-ratio=1/1",
+ "video/x-raw,format=(string)AYUV,width=[1, 2048],height=[1, 2048]",
1920, 2048, 4, 5);
_test_negotiation
- ("video/x-raw-yuv,format=(fourcc)AYUV,width=1920,height=2560",
- "video/x-raw-yuv,format=(fourcc)AYUV,width=[1, 2048],height=[1, 2048]",
+ ("video/x-raw,format=(string)AYUV,width=1920,height=2560",
+ "video/x-raw,format=(string)AYUV,width=[1, 2048],height=[1, 2048]",
1920, 2048, 4, 5);
_test_negotiation
- ("video/x-raw-yuv,format=(fourcc)AYUV,width=1920,height=2560",
- "video/x-raw-yuv,format=(fourcc)AYUV,width=1200,height=[1, 2048],pixel-aspect-ratio=1/1",
+ ("video/x-raw,format=(string)AYUV,width=1920,height=2560",
+ "video/x-raw,format=(string)AYUV,width=1200,height=[1, 2048],pixel-aspect-ratio=1/1",
1200, 1600, 1, 1);
/* Doesn't keep DAR but must be possible! */
_test_negotiation
- ("video/x-raw-yuv,format=(fourcc)AYUV,width=320,height=240,pixel-aspect-ratio=1/1",
- "video/x-raw-yuv,format=(fourcc)AYUV,width=200,height=200,pixel-aspect-ratio=1/2",
+ ("video/x-raw,format=(string)AYUV,width=320,height=240,pixel-aspect-ratio=1/1",
+ "video/x-raw,format=(string)AYUV,width=200,height=200,pixel-aspect-ratio=1/2",
200, 200, 1, 2);
}
g_object_set (src, "num-buffers", 3, NULL);
- caps = gst_caps_new_simple ("video/x-raw-yuv", "format", GST_TYPE_FOURCC,
+ caps = gst_caps_new_simple ("video/x-raw", "format", GST_TYPE_FOURCC,
GST_MAKE_FOURCC ('U', 'Y', 'V', 'Y'), "width", G_TYPE_INT, 352,
"height", G_TYPE_INT, 288, "framerate", GST_TYPE_FRACTION, 30, 1,
"pixel-aspect-ratio", GST_TYPE_FRACTION, 1, 1, NULL);
gst_caps_unref (caps);
/* same caps, just different pixel-aspect-ratio */
- caps = gst_caps_new_simple ("video/x-raw-yuv", "format", GST_TYPE_FOURCC,
+ caps = gst_caps_new_simple ("video/x-raw", "format", GST_TYPE_FOURCC,
GST_MAKE_FOURCC ('U', 'Y', 'V', 'Y'), "width", G_TYPE_INT, 352,
"height", G_TYPE_INT, 288, "framerate", GST_TYPE_FRACTION, 30, 1,
"pixel-aspect-ratio", GST_TYPE_FRACTION, 12, 11, NULL);
#define CAPS_TEMPLATE_STRING \
"video/x-raw-yuv, " \
- "format = (fourcc) UYVY, " \
+ "format = (string) UYVY, " \
"width = (int) [ 1, MAX ], " \
"height = (int) [ 1, MAX ], " \
"framerate = (fraction) [ 0/1, MAX ]"
"video/x-h261", "video/x-huffyuv", "video/x-intel-h263", "video/x-jpeg",
"video/x-mjpeg", "video/x-mjpeg-b", "video/mpegts", "video/x-mng",
"video/x-mszh", "video/x-msvideocodec", "video/x-mve", "video/x-nut",
- "video/x-nuv", "video/x-qdrw", "video/x-raw-gray", "video/x-smc",
+ "video/x-nuv", "video/x-qdrw", "video/x-raw", "video/x-smc",
"video/x-smoke", "video/x-tarkin", "video/x-theora", "video/x-rle",
"video/x-ultimotion", "video/x-vcd", "video/x-vmnc", "video/x-vp3",
"video/x-vp5", "video/x-vp6", "video/x-vp6-flash", "video/x-vp7",
"audio/x-raw-int, endianness=(int)1234, signed=(boolean)true, width=(int)16, depth=(int)16, rate=(int)44100, channels=(int)2",
"audio/x-raw-float, rate=(int)22050, channels=(int)2, endianness=(int)1234, width=(int)32",
/* raw video */
- "video/x-raw-rgb, bpp=(int)16, endianness=(int)1234, depth=(int)16, red_mask=(int)63488, green_mask=(int)2016, blue_mask=(int)31, width=(int)320, height=(int)240, framerate=(fraction)30/1, pixel-aspect-ratio=(fraction)1/1",
- "video/x-raw-yuv, format=(fourcc)YUY2, width=(int)320, height=(int)240, framerate=(fraction)30/1",
+ "video/x-raw, format=(string)RGB16, width=(int)320, height=(int)240, framerate=(fraction)30/1, pixel-aspect-ratio=(fraction)1/1",
+ "video/x-raw, format=(string)YUY2, width=(int)320, height=(int)240, framerate=(fraction)30/1",
/* and a made-up format */
"video/x-tpm"
};
caps = gst_caps_from_string ("video/x-glitter,sparkling=True");
caps2 =
- gst_caps_from_string
- ("video/x-raw-yuv,width=640,height=480,framerate=15/1");
+ gst_caps_from_string ("video/x-raw,width=640,height=480,framerate=15/1");
sprof = (GstEncodingProfile *)
gst_encoding_video_profile_new (caps, "seriously glittery", caps2, 0);
gst_encoding_video_profile_set_variableframerate ((GstEncodingVideoProfile *)
GST_DEBUG ("Checking the container profile has the video//x-glitter stream");
tmpcaps = gst_caps_from_string ("video/x-glitter,sparkling=True");
tmpcaps2 =
- gst_caps_from_string
- ("video/x-raw-yuv,width=640,height=480,framerate=15/1");
+ gst_caps_from_string ("video/x-raw,width=640,height=480,framerate=15/1");
sprof2 = (GstEncodingProfile *)
gst_encoding_video_profile_new (tmpcaps, "seriously glittery", tmpcaps2,
0);
type=video\n\
preset=seriously glittery\n\
format=video/x-glitter,sparkling=True\n\
-restriction=video/x-raw-yuv,width=640,height=480,framerate=15/1\n\
+restriction=video/x-raw,width=640,height=480,framerate=15/1\n\
presence=0\n\
variableframerate=true\n\
";
GST_START_TEST (test_video_size_from_caps)
{
gint size;
- guint32 fourcc = GST_MAKE_FOURCC ('Y', 'V', '1', '2');
- GstCaps *caps = gst_caps_new_simple ("video/x-raw-yuv",
- "format", GST_TYPE_FOURCC, fourcc,
+
+ GstCaps *caps = gst_caps_new_simple ("video/x-raw",
+ "format", G_TYPE_STRING, "YV12",
"width", G_TYPE_INT, 640,
"height", G_TYPE_INT, 480,
"framerate", GST_TYPE_FRACTION, 25, 1,
#include <gst/check/gstcheck.h>
-#define FIRST_CAPS "video/x-raw-yuv,width=(int)480,height=(int)320"
-#define SECOND_CAPS "video/x-raw-yuv,width=(int)120,height=(int)100"
-#define THIRD_CAPS "video/x-raw-yuv,width=(int)[10,50],height=(int)[100,200]"
-#define FOURTH_CAPS "video/x-raw-rgb,width=(int)300,height=(int)[25,75];" \
- "video/x-raw-yuv,width=(int)[30,40]," \
- "height=(int)[100,200],format=(fourcc)YUY2"
+#define FIRST_CAPS "video/x-raw,width=(int)480,height=(int)320"
+#define SECOND_CAPS "video/x-raw,width=(int)120,height=(int)100"
+#define THIRD_CAPS "video/x-raw,width=(int)[10,50],height=(int)[100,200]"
+#define FOURTH_CAPS "video/x-raw,width=(int)300,height=(int)[25,75];" \
+ "video/x-raw,width=(int)[30,40]," \
+ "height=(int)[100,200],format=(string)YUY2"
int buffer_count = 0;
GstCaps *current_caps = NULL;
run_capsfilter_renegotiation ("videotestsrc num-buffers=200 peer-alloc=false"
" ! capsfilter caps=\"" FIRST_CAPS "\" name=cf ! fakesink name=sink");
run_capsfilter_renegotiation ("videotestsrc num-buffers=200 peer-alloc=false"
- " ! capsfilter caps=\"video/x-raw-yuv, format=(fourcc)I420, width=(int)100, height=(int)100\" "
- " ! ffmpegcolorspace ! videoscale ! capsfilter caps=\"" FIRST_CAPS
+ " ! capsfilter caps=\"video/x-raw, format=(string)I420, width=(int)100, height=(int)100\" "
+ " ! videoconvert ! videoscale ! capsfilter caps=\"" FIRST_CAPS
"\" name=cf " " ! fakesink name=sink");
}
#ifdef HAVE_LIBVISUAL
s = "audiotestsrc num-buffers=30 ! tee name=t ! alsasink t. ! audioconvert ! "
- "libvisual_lv_scope ! ffmpegcolorspace ! xvimagesink";
+ "libvisual_lv_scope ! videoconvert ! xvimagesink";
run_pipeline (setup_pipeline (s), s,
GST_MESSAGE_ANY & ~(GST_MESSAGE_ERROR | GST_MESSAGE_WARNING),
GST_MESSAGE_UNKNOWN);
/* Check that videoscale can pick a height given only a width */
s = "videotestsrc num-buffers=2 ! "
- "video/x-raw-yuv,format=(fourcc)I420,width=320,height=240 ! "
- "videoscale ! video/x-raw-yuv,width=640 ! fakesink";
+ "video/x-raw,format=(string)I420,width=320,height=240 ! "
+ "videoscale ! video/x-raw,width=640 ! fakesink";
run_pipeline (setup_pipeline (s), s,
GST_MESSAGE_ANY & ~(GST_MESSAGE_ERROR | GST_MESSAGE_WARNING),
GST_MESSAGE_UNKNOWN);
- /* Test that ffmpegcolorspace can pick an output format that isn't
+ /* Test that videoconvert can pick an output format that isn't
* passthrough without completely specified output caps */
s = "videotestsrc num-buffers=2 ! "
- "video/x-raw-yuv,format=(fourcc)I420,width=320,height=240 ! "
- "ffmpegcolorspace ! video/x-raw-rgb ! fakesink";
+ "video/x-raw,format=(string)I420,width=320,height=240 ! "
+ "videoconvert ! video/x-raw,format=(string)RGB ! fakesink";
run_pipeline (setup_pipeline (s), s,
GST_MESSAGE_ANY & ~(GST_MESSAGE_ERROR | GST_MESSAGE_WARNING),
GST_MESSAGE_UNKNOWN);
GST_MESSAGE_UNKNOWN);
/* Check that videoscale doesn't claim to be able to transform input in
- * formats it can't handle for a given scaling method; ffmpegcolorspace
+ * formats it can't handle for a given scaling method; videoconvert
* should then make sure a format that can be handled is chosen (4-tap
* scaling is not implemented for RGB and packed yuv currently) */
- s = "videotestsrc num-buffers=2 ! video/x-raw-rgb,width=64,height=64 ! "
- "ffmpegcolorspace ! videoscale method=4-tap ! ffmpegcolorspace ! "
- "video/x-raw-rgb,width=32,height=32,framerate=(fraction)30/1,"
- "pixel-aspect-ratio=(fraction)1/1,bpp=(int)24,depth=(int)24,"
- "red_mask=(int)16711680,green_mask=(int)65280,blue_mask=(int)255,"
- "endianness=(int)4321 ! fakesink";
+ s = "videotestsrc num-buffers=2 ! video/x-raw,format=(string)ARGB64 ! "
+ "videoconvert ! videoscale method=4-tap ! videoconvert ! "
+ "video/x-raw,format=(string)RGB, width=32,height=32,framerate=(fraction)30/1,"
+ "pixel-aspect-ratio=(fraction)1/1 ! fakesink";
run_pipeline (setup_pipeline (s), s,
GST_MESSAGE_ANY & ~(GST_MESSAGE_ERROR | GST_MESSAGE_WARNING),
GST_MESSAGE_UNKNOWN);
- s = "videotestsrc num-buffers=2 ! video/x-raw-yuv,format=(fourcc)AYUV,"
- "width=64,height=64 ! ffmpegcolorspace ! videoscale method=4-tap ! "
- "ffmpegcolorspace ! video/x-raw-yuv,format=(fourcc)AYUV,width=32,"
+ s = "videotestsrc num-buffers=2 ! video/x-raw,format=(string)AYUV,"
+ "width=64,height=64 ! videoconvert ! videoscale method=4-tap ! "
+ "videoconvert ! video/x-raw,format=(string)AYUV,width=32,"
"height=32 ! fakesink";
run_pipeline (setup_pipeline (s), s,
GST_MESSAGE_ANY & ~(GST_MESSAGE_ERROR | GST_MESSAGE_WARNING),
GST_MESSAGE_UNKNOWN);
/* make sure nothing funny happens in passthrough mode (we don't check that
* passthrough mode is chosen though) */
- s = "videotestsrc num-buffers=2 ! video/x-raw-yuv,format=(fourcc)I420,"
- "width=64,height=64 ! ffmpegcolorspace ! videoscale method=4-tap ! "
- "ffmpegcolorspace ! video/x-raw-yuv,format=(fourcc)I420,width=32,"
+ s = "videotestsrc num-buffers=2 ! video/x-raw,format=(string)I420,"
+ "width=64,height=64 ! videoconvert ! videoscale method=4-tap ! "
+ "videoconvert ! video/x-raw,format=(string)I420,width=32,"
"height=32 ! fakesink";
run_pipeline (setup_pipeline (s), s,
GST_MESSAGE_ANY & ~(GST_MESSAGE_ERROR | GST_MESSAGE_WARNING),
GError *error = NULL;
pipe_str = g_strdup_printf ("videotestsrc timestamp-offset=%" G_GUINT64_FORMAT
- " num-buffers=10 ! video/x-raw-yuv,format=(fourcc)I420,framerate=10/1"
+ " num-buffers=10 ! video/x-raw,format=(string)I420,framerate=10/1"
" ! theoraenc ! fakesink name=fs0", TIMESTAMP_OFFSET);
bin = gst_parse_launch (pipe_str, &error);
GError *error = NULL;
pipe_str = g_strdup_printf ("videotestsrc num-buffers=10"
- " ! video/x-raw-yuv,format=(fourcc)I420,framerate=10/1"
+ " ! video/x-raw,format=(string)I420,framerate=10/1"
" ! theoraenc ! fakesink name=fs0");
bin = gst_parse_launch (pipe_str, &error);
guint drop_id;
pipe_str = g_strdup_printf ("videotestsrc num-buffers=10"
- " ! video/x-raw-yuv,format=(fourcc)I420,framerate=10/1"
+ " ! video/x-raw,format=(string)I420,framerate=10/1"
" ! theoraenc ! fakesink name=fs0");
bin = gst_parse_launch (pipe_str, &error);