2
/*** block from ../../../docs/manual/advanced-dataaccess.xml ***/
10
main (int argc, char **argv)
12
GstElement *pipe, *filter;
19
gst_init (&argc, &argv);
21
pipe = gst_parse_launch_full ("videotestsrc ! capsfilter name=filter ! "
22
"ximagesink", NULL, GST_PARSE_FLAG_NONE, NULL);
23
g_assert (pipe != NULL);
25
filter = gst_bin_get_by_name (GST_BIN (pipe), "filter");
32
for (round = 0; round < MAX_ROUND; round++) {
34
g_print ("resize to %dx%d (%d/%d) \r", width, height, round, MAX_ROUND);
36
/* we prefer our fixed width and height but allow other dimensions to pass
38
capsstr = g_strdup_printf ("video/x-raw, width=(int)%d, height=(int)%d",
41
caps = gst_caps_from_string (capsstr);
43
g_object_set (filter, "caps", caps, NULL);
44
gst_caps_unref (caps);
47
gst_element_set_state (pipe, GST_STATE_PLAYING);
58
else if (height < 150)
62
gst_bus_poll (GST_ELEMENT_BUS (pipe), GST_MESSAGE_ERROR,
65
g_print ("got error \n");
67
gst_message_unref (message);
72
gst_object_unref (filter);
73
gst_element_set_state (pipe, GST_STATE_NULL);
74
gst_object_unref (pipe);