<html><body><div style="color:#000; background-color:#fff; font-family:tahoma, new york, times, serif;font-size:12pt"><div><div><font class="Apple-style-span" face="tahoma, 'new york', times, serif">The code below is to stream <span id="misspell-0" class=""><span id="misspell-0" class="">mpeg</span></span>4 video (using v4l2<span id="misspell-1" class=""><span id="misspell-1" class="">src</span></span> element of the following capabilities: width=640, height=480, frame rate=30/1) over a network using a <span id="misspell-2" class=""><span id="misspell-2" class="">updsink</span></span> element and the capabilities values should change to (</font><span class="Apple-style-span" style="font-family: tahoma, 'new york', times, serif; ">width=352, height=288, frame rate=15/1</span><span class="Apple-style-span" style="font-family: tahoma, 'new york', times, serif; ">) after pressing "1" </span><span class="Apple-style-span yui_3_2_0_15_13164514018681244"
style="font-family: tahoma, 'new york', times, serif; ">on the keyboard. I tried to do this by pausing the pipeline after the "1" is pressed and then re-setting the caps to the new values and then get the pipeline into playing state again but this did not work for me.</span></div><div><span class="Apple-style-span" style="font-family: tahoma, 'new york', times, serif; ">I get the caps values printed before pausing the pipeline and after the changes made and I can see that the changes were done but not applied when the pipeline is brought to playing state again. </span></div><div><span class="Apple-style-span yui_3_2_0_15_13164514018681244" style="font-family: tahoma, 'new york', times, serif; "><br></span></div><div><font class="Apple-style-span" face="tahoma, 'new york', times, serif">please help.......</font></div><div><span class="Apple-style-span" style="font-family: tahoma, 'new york', times, serif; "><br></span></div><div><span
class="Apple-style-span" style="font-family: tahoma, 'new york', times, serif; ">you can playback this stream by typing into a new terminal the following command just before running the code below:</span></div><div><span class="Apple-style-span" style="font-family: tahoma, 'new york', times, serif; "><span id="misspell-3" class=""><span id="misspell-3" class="">gst</span></span>-launch <span id="misspell-4" class=""><span id="misspell-4" class="">udpsrc</span></span> multicast-group=127.0.0.1 port=8999 ! <span id="misspell-5" class=""><span id="misspell-5" class="">mpeg</span></span>4<span id="misspell-6" class=""><span id="misspell-6" class="">videoparse</span></span> ! <span id="misspell-7" class=""><span id="misspell-7" class="">ffdec</span></span>_<span id="misspell-8" class=""><span id="misspell-8" class="">mpeg</span></span>4 ! <span id="misspell-9" class=""><span id="misspell-9" class="">ffmpegcolorspace</span></span> ! <span id="misspell-10"
class=""><span id="misspell-10" class="">autovideosink</span></span></span></div><div><span class="Apple-style-span" style="font-family: tahoma, 'new york', times, serif; "><br></span></div><div><span class="Apple-style-span" style="font-family: tahoma, 'new york', times, serif; ">======================</span></div><div><font class="Apple-style-span" face="tahoma, 'new york', times, serif">#include <<span id="misspell-11" class=""><span id="misspell-11" class="">gst</span></span>/<span id="misspell-12" class=""><span id="misspell-12" class="">gst</span></span>.h></font></div><div><font class="Apple-style-span" face="tahoma, 'new york', times, serif">#include <glib.h></font></div><div><font class="Apple-style-span" face="tahoma, 'new york', times, serif">#include <stdio.h></font></div><div><font class="Apple-style-span" face="tahoma, 'new york', times, serif">#include <glib-object.h></font></div><div><font class="Apple-style-span"
face="tahoma, 'new york', times, serif"><br></font></div><div><font class="Apple-style-span" face="tahoma, 'new york', times, serif">static <span id="misspell-13" class=""><span id="misspell-13" class="">gboolean</span></span> bus_call (<span id="misspell-14" class=""><span id="misspell-14" class="">GstBus</span></span> *bus, <span id="misspell-15" class=""><span id="misspell-15" class="">GstMessage</span></span> *<span id="misspell-16" class=""><span id="misspell-16" class="">msg</span></span>, <span id="misspell-17" class=""><span id="misspell-17" class="">gpointer</span></span> data)</font></div><div><font class="Apple-style-span" face="tahoma, 'new york', times, serif">{</font></div><div><font class="Apple-style-span" face="tahoma, 'new york', times, serif"> <span id="misspell-18" class=""><span id="misspell-18" class="">GMainLoop</span></span> *loop = (<span id="misspell-19" class=""><span id="misspell-19"
class="">GMainLoop</span></span> *) data;</font></div><div><font class="Apple-style-span" face="tahoma, 'new york', times, serif"> switch (<span id="misspell-20" class=""><span id="misspell-20" class="">GST</span></span>_MESSAGE_TYPE (<span id="misspell-21" class=""><span id="misspell-21" class="">msg</span></span>)) {</font></div><div><font class="Apple-style-span" face="tahoma, 'new york', times, serif"><span class="Apple-tab-span" style="white-space:pre">                </span>case <span id="misspell-22" class=""><span id="misspell-22" class="">GST</span></span>_MESSAGE_<span id="misspell-23" class=""><span id="misspell-23" class="">EOS</span></span>:</font></div><div><font class="Apple-style-span" face="tahoma, 'new york', times, serif"><span class="Apple-tab-span" style="white-space:pre">                        </span>g_print ("End of stream\n");</font></div><div><font class="Apple-style-span" face="tahoma, 'new york', times, serif"><span class="Apple-tab-span"
style="white-space:pre">                        </span>g_main_loop_quit (loop);</font></div><div><font class="Apple-style-span" face="tahoma, 'new york', times, serif"><span class="Apple-tab-span" style="white-space:pre">                        </span>break;</font></div><div><font class="Apple-style-span" face="tahoma, 'new york', times, serif"><br></font></div><div><font class="Apple-style-span" face="tahoma, 'new york', times, serif"><span class="Apple-tab-span" style="white-space:pre">                </span>case <span id="misspell-24" class=""><span id="misspell-24" class="">GST</span></span>_MESSAGE_ERROR: {</font></div><div><font class="Apple-style-span" face="tahoma, 'new york', times, serif"><span class="Apple-tab-span" style="white-space:pre">                        </span><span id="misspell-25" class=""><span id="misspell-25" class="">gchar</span></span> *debug;</font></div><div><font class="Apple-style-span" face="tahoma, 'new york', times, serif"><span class="Apple-tab-span" style="white-space:pre">                        </span><span
id="misspell-26" class=""><span id="misspell-26" class="">GError</span></span> *error;</font></div><div><font class="Apple-style-span" face="tahoma, 'new york', times, serif"><span class="Apple-tab-span" style="white-space:pre">                        </span><span id="misspell-27" class=""><span id="misspell-27" class="">gst</span></span>_message_parse_error (<span id="misspell-28" class=""><span id="misspell-28" class="">msg</span></span>, &error, &debug);</font></div><div><font class="Apple-style-span" face="tahoma, 'new york', times, serif"><span class="Apple-tab-span" style="white-space:pre">                        </span>g_free (debug);</font></div><div><font class="Apple-style-span" face="tahoma, 'new york', times, serif"><span class="Apple-tab-span" style="white-space:pre">                        </span>g_<span id="misspell-29" class=""><span id="misspell-29" class="">printerr</span></span> ("Error: %s\n", error->message);</font></div><div><font class="Apple-style-span" face="tahoma, 'new york',
times, serif"><span class="Apple-tab-span" style="white-space:pre">                        </span>g_error_free (error);</font></div><div><font class="Apple-style-span" face="tahoma, 'new york', times, serif"><span class="Apple-tab-span" style="white-space:pre">                        </span>g_main_loop_quit (loop);</font></div><div><font class="Apple-style-span" face="tahoma, 'new york', times, serif"><span class="Apple-tab-span" style="white-space:pre">                        </span>break;</font></div><div><font class="Apple-style-span" face="tahoma, 'new york', times, serif"><span class="Apple-tab-span" style="white-space:pre">                        </span>}</font></div><div><font class="Apple-style-span" face="tahoma, 'new york', times, serif"><br></font></div><div><font class="Apple-style-span" face="tahoma, 'new york', times, serif"><span class="Apple-tab-span" style="white-space:pre">                </span>default: break;</font></div><div><font class="Apple-style-span" face="tahoma, 'new york', times, serif"><span class="Apple-tab-span"
style="white-space:pre">                </span>}</font></div><div><font class="Apple-style-span" face="tahoma, 'new york', times, serif"> return TRUE;</font></div><div><font class="Apple-style-span" face="tahoma, 'new york', times, serif"> }</font></div><div><font class="Apple-style-span" face="tahoma, 'new york', times, serif"><br></font></div><div><font class="Apple-style-span" face="tahoma, 'new york', times, serif">int main (int <span id="misspell-30" class=""><span id="misspell-30" class="">argc</span></span>, char *<span id="misspell-31" class=""><span id="misspell-31" class="">argv</span></span>[])</font></div><div><font class="Apple-style-span" face="tahoma, 'new york', times, serif">{</font></div><div><font class="Apple-style-span" face="tahoma, 'new york', times, serif"> <span id="misspell-32" class=""><span id="misspell-32" class="">GMainLoop</span></span> *loop;</font></div><div><font class="Apple-style-span"
face="tahoma, 'new york', times, serif"> <span id="misspell-33" class=""><span id="misspell-33" class="">GstElement</span></span> *pipeline, *source, *filter, *<span id="misspell-34" class=""><span id="misspell-34" class="">vrate</span></span>, *encoder, *<span id="misspell-35" class=""><span id="misspell-35" class="">conv</span></span>, *sink;</font></div><div><font class="Apple-style-span" face="tahoma, 'new york', times, serif"> <span id="misspell-36" class=""><span id="misspell-36" class="">GstBus</span></span> *bus;</font></div><div><font class="Apple-style-span" face="tahoma, 'new york', times, serif"> <span id="misspell-37" class=""><span id="misspell-37" class="">GstCaps</span></span> *<span id="misspell-38" class=""><span id="misspell-38" class="">filtercaps</span></span>; </font></div><div><font class="Apple-style-span" face="tahoma, 'new york', times, serif"> <span id="misspell-39"
class=""><span id="misspell-39" class="">gint</span></span> width, height, <span id="misspell-40" class=""><span id="misspell-40" class="">num</span></span>, <span id="misspell-41" class=""><span id="misspell-41" class="">denom</span></span>;</font></div><div><font class="Apple-style-span" face="tahoma, 'new york', times, serif"> <span id="misspell-42" class=""><span id="misspell-42" class="">const</span></span> <span id="misspell-43" class=""><span id="misspell-43" class="">GstStructure</span></span> *<span id="misspell-44" class=""><span id="misspell-44" class="">str</span></span>;</font></div><div><font class="Apple-style-span" face="tahoma, 'new york', times, serif"><br></font></div><div><font class="Apple-style-span" face="tahoma, 'new york', times, serif"> /* Initialisation */</font></div><div><font class="Apple-style-span" face="tahoma, 'new york', times, serif"> <span id="misspell-45" class=""><span
id="misspell-45" class="">gst</span></span>_<span id="misspell-46" class=""><span id="misspell-46" class="">init</span></span> (&<span id="misspell-47" class=""><span id="misspell-47" class="">argc</span></span>, &<span id="misspell-48" class=""><span id="misspell-48" class="">argv</span></span>);</font></div><div><font class="Apple-style-span" face="tahoma, 'new york', times, serif"> loop = g_main_loop_new (NULL, FALSE);</font></div><div><font class="Apple-style-span" face="tahoma, 'new york', times, serif"><br></font></div><div><font class="Apple-style-span" face="tahoma, 'new york', times, serif"> /* Check input arguments */</font></div><div><font class="Apple-style-span" face="tahoma, 'new york', times, serif"> if (<span id="misspell-49" class=""><span id="misspell-49" class="">argc</span></span> != 2) {</font></div><div><font class="Apple-style-span" face="tahoma, 'new york', times, serif"><span
class="Apple-tab-span" style="white-space:pre">        </span>g_<span id="misspell-50" class=""><span id="misspell-50" class="">printerr</span></span> ("Usage: %s <<span id="misspell-51" class=""><span id="misspell-51" class="">Ogg</span></span>/<span id="misspell-52" class=""><span id="misspell-52" class="">Vorbis</span></span> <span id="misspell-53" class=""><span id="misspell-53" class="">filename</span></span>>\n", <span id="misspell-54" class=""><span id="misspell-54" class="">argv</span></span>[0]);</font></div><div><font class="Apple-style-span" face="tahoma, 'new york', times, serif"><span class="Apple-tab-span" style="white-space:pre">        </span>return -1;</font></div><div><font class="Apple-style-span" face="tahoma, 'new york', times, serif"> }</font></div><div><font class="Apple-style-span" face="tahoma, 'new york', times, serif"><br></font></div><div><font class="Apple-style-span" face="tahoma, 'new york', times, serif">
/* Create gstreamer elements */</font></div><div><font class="Apple-style-span" face="tahoma, 'new york', times, serif"> pipeline = <span id="misspell-56" class=""><span id="misspell-56" class="">gst</span></span>_pipeline_new ("video-player");</font></div><div><font class="Apple-style-span" face="tahoma, 'new york', times, serif"> source = <span id="misspell-57" class=""><span id="misspell-57" class="">gst</span></span>_element_factory_make ("v4l2<span id="misspell-58" class=""><span id="misspell-58" class="">src</span></span>", "file-source");</font></div><div><font class="Apple-style-span" face="tahoma, 'new york', times, serif"> <span id="misspell-59" class=""><span id="misspell-59" class="">vrate</span></span> = <span id="misspell-60" class=""><span id="misspell-60" class="">gst</span></span>_element_factory_make ("<span id="misspell-61" class=""><span id="misspell-61" class="">videorate</span></span>",
"video-rate");</font></div><div><font class="Apple-style-span" face="tahoma, 'new york', times, serif"> filter = <span id="misspell-62" class=""><span id="misspell-62" class="">gst</span></span>_element_factory_make ("<span id="misspell-63" class=""><span id="misspell-63" class="">capsfilter</span></span>", "filter");</font></div><div><font class="Apple-style-span" face="tahoma, 'new york', times, serif"> <span id="misspell-64" class=""><span id="misspell-64" class="">conv</span></span> = <span id="misspell-65" class=""><span id="misspell-65" class="">gst</span></span>_element_factory_make ("<span id="misspell-66" class=""><span id="misspell-66" class="">ffmpegcolorspace</span></span>","converter");</font></div><div><font class="Apple-style-span" face="tahoma, 'new york', times, serif"> encoder = <span id="misspell-67" class=""><span id="misspell-67" class="">gst</span></span>_element_factory_make ("<span
id="misspell-68" class=""><span id="misspell-68" class="">ffenc</span></span>_<span id="misspell-69" class=""><span id="misspell-69" class="">mpeg</span></span>4","<span id="misspell-70" class=""><span id="misspell-70" class="">mpeg</span></span>-decoder");</font></div><div><font class="Apple-style-span" face="tahoma, 'new york', times, serif"> sink = <span id="misspell-71" class=""><span id="misspell-71" class="">gst</span></span>_element_factory_make ("<span id="misspell-72" class=""><span id="misspell-72" class="">udpsink</span></span>","audio-output");</font></div><div><font class="Apple-style-span" face="tahoma, 'new york', times, serif"><br></font></div><div><font class="Apple-style-span" face="tahoma, 'new york', times, serif"><br></font></div><div><font class="Apple-style-span" face="tahoma, 'new york', times, serif"> if (!pipeline || !source || !filter || !<span id="misspell-73" class=""><span id="misspell-73"
class="">vrate</span></span> || !<span id="misspell-74" class=""><span id="misspell-74" class="">conv</span></span> || !encoder || !sink) {</font></div><div><font class="Apple-style-span" face="tahoma, 'new york', times, serif"><span class="Apple-tab-span" style="white-space:pre">        </span>g_<span id="misspell-75" class=""><span id="misspell-75" class="">printerr</span></span> ("One element could not be created. Exiting.\n");</font></div><div><font class="Apple-style-span" face="tahoma, 'new york', times, serif"><span class="Apple-tab-span" style="white-space:pre">        </span>return -1;</font></div><div><font class="Apple-style-span" face="tahoma, 'new york', times, serif"> }</font></div><div><font class="Apple-style-span" face="tahoma, 'new york', times, serif"><br></font></div><div><font class="Apple-style-span" face="tahoma, 'new york', times, serif"> /* Set up the pipeline */</font></div><div><font class="Apple-style-span"
face="tahoma, 'new york', times, serif"> /* we set the input <span id="misspell-76" class=""><span id="misspell-76" class="">filename</span></span> to the source element */</font></div><div><font class="Apple-style-span" face="tahoma, 'new york', times, serif"> <span id="misspell-77" class=""><span id="misspell-77" class="">filtercaps</span></span> = <span id="misspell-78" class=""><span id="misspell-78" class="">gst</span></span>_caps_new_simple ("video/x-raw-<span id="misspell-79" class=""><span id="misspell-79" class="">yuv</span></span>",</font></div><div><font class="Apple-style-span" face="tahoma, 'new york', times, serif"><span class="Apple-tab-span" style="white-space:pre">                </span>"width", G_TYPE_INT, 640,</font></div><div><font class="Apple-style-span" face="tahoma, 'new york', times, serif"><span class="Apple-tab-span" style="white-space:pre">                </span>"height", G_TYPE_INT, 480,</font></div><div><font
class="Apple-style-span" face="tahoma, 'new york', times, serif"><span class="Apple-tab-span" style="white-space:pre">                </span>"<span id="misspell-80" class=""><span id="misspell-80" class="">framerate</span></span>", <span id="misspell-81" class=""><span id="misspell-81" class="">GST</span></span>_TYPE_FRACTION, 30, 1,</font></div><div><font class="Apple-style-span" face="tahoma, 'new york', times, serif"><span class="Apple-tab-span" style="white-space:pre">                </span>NULL);</font></div><div><font class="Apple-style-span" face="tahoma, 'new york', times, serif"><br></font></div><div><font class="Apple-style-span" face="tahoma, 'new york', times, serif"> g_object_set (G_OBJECT (filter), "caps", <span id="misspell-82" class=""><span id="misspell-82" class="">filtercaps</span></span>, NULL);</font></div><div><font class="Apple-style-span" face="tahoma, 'new york', times, serif"> <span id="misspell-83" class=""><span id="misspell-83"
class="">gst</span></span>_caps_<span id="misspell-84" class=""><span id="misspell-84" class="">unref</span></span> (<span id="misspell-85" class=""><span id="misspell-85" class="">filtercaps</span></span>);</font></div><div><font class="Apple-style-span" face="tahoma, 'new york', times, serif"> g_object_set (G_OBJECT (encoder), "<span id="misspell-86" class=""><span id="misspell-86" class="">bitrate</span></span>" , 384 , NULL);</font></div><div><font class="Apple-style-span" face="tahoma, 'new york', times, serif"> g_object_set (G_OBJECT (sink), "host" , <span id="misspell-87" class=""><span id="misspell-87" class="">argv</span></span>[1] , NULL);</font></div><div><font class="Apple-style-span" face="tahoma, 'new york', times, serif"> g_object_set (G_OBJECT (sink), "port" , 8999 , NULL);</font></div><div><font class="Apple-style-span" face="tahoma, 'new york', times, serif">
g_object_set (G_OBJECT (sink), "<span id="misspell-88" class=""><span id="misspell-88" class="">async</span></span>" , FALSE , NULL);</font></div><div><font class="Apple-style-span" face="tahoma, 'new york', times, serif"><br></font></div><div><font class="Apple-style-span" face="tahoma, 'new york', times, serif"> </font></div><div><font class="Apple-style-span" face="tahoma, 'new york', times, serif"> /* we add a message handler */</font></div><div><font class="Apple-style-span" face="tahoma, 'new york', times, serif"> bus = <span id="misspell-89" class=""><span id="misspell-89" class="">gst</span></span>_pipeline_get_bus (<span id="misspell-90" class=""><span id="misspell-90" class="">GST</span></span>_PIPELINE (pipeline));</font></div><div><font class="Apple-style-span" face="tahoma, 'new york', times, serif"> <span id="misspell-91" class=""><span id="misspell-91"
class="">gst</span></span>_bus_add_watch (bus, bus_call, loop);</font></div><div><font class="Apple-style-span" face="tahoma, 'new york', times, serif"> <span id="misspell-92" class=""><span id="misspell-92" class="">gst</span></span>_object_<span id="misspell-93" class=""><span id="misspell-93" class="">unref</span></span> (bus);</font></div><div><font class="Apple-style-span" face="tahoma, 'new york', times, serif"><br></font></div><div><font class="Apple-style-span" face="tahoma, 'new york', times, serif"> /* we add all elements into the pipeline */</font></div><div><font class="Apple-style-span" face="tahoma, 'new york', times, serif"> /* file-source | <span id="misspell-94" class=""><span id="misspell-94" class="">ogg</span></span>-<span id="misspell-95" class=""><span id="misspell-95" class="">demuxer</span></span> | <span id="misspell-96" class=""><span id="misspell-96" class="">vorbis</span></span>-decoder |
converter | <span id="misspell-97" class=""><span id="misspell-97" class="">alsa</span></span>-output */</font></div><div><font class="Apple-style-span" face="tahoma, 'new york', times, serif"> <span id="misspell-98" class=""><span id="misspell-98" class="">gst</span></span>_bin_add_many (<span id="misspell-99" class=""><span id="misspell-99" class="">GST</span></span>_BIN (pipeline), source, <span id="misspell-100" class=""><span id="misspell-100" class="">vrate</span></span>, filter, <span id="misspell-101" class=""><span id="misspell-101" class="">conv</span></span>, encoder, sink, NULL);</font></div><div><font class="Apple-style-span" face="tahoma, 'new york', times, serif"><br></font></div><div><font class="Apple-style-span" face="tahoma, 'new york', times, serif"> /* we link the elements together */</font></div><div><font class="Apple-style-span" face="tahoma, 'new york', times, serif"> /* file-source ->
<span id="misspell-102" class=""><span id="misspell-102" class="">ogg</span></span>-<span id="misspell-103" class=""><span id="misspell-103" class="">demuxer</span></span> ~> <span id="misspell-104" class=""><span id="misspell-104" class="">vorbis</span></span>-decoder -> converter -> <span id="misspell-105" class=""><span id="misspell-105" class="">alsa</span></span>-output */</font></div><div><font class="Apple-style-span" face="tahoma, 'new york', times, serif"> <span id="misspell-106" class=""><span id="misspell-106" class="">gst</span></span>_element_link_many (source, <span id="misspell-107" class=""><span id="misspell-107" class="">vrate</span></span>, filter, <span id="misspell-108" class=""><span id="misspell-108" class="">conv</span></span>, encoder, sink, NULL);</font></div><div><font class="Apple-style-span" face="tahoma, 'new york', times, serif"><br></font></div><div><font class="Apple-style-span" face="tahoma,
'new york', times, serif"><br></font></div><div><font class="Apple-style-span" face="tahoma, 'new york', times, serif"> </font></div><div><font class="Apple-style-span" face="tahoma, 'new york', times, serif"> /* Set the pipeline to "playing" state*/</font></div><div><font class="Apple-style-span" face="tahoma, 'new york', times, serif"> g_print ("Now playing: \n");</font></div><div><font class="Apple-style-span" face="tahoma, 'new york', times, serif"> <span id="misspell-109" class=""><span id="misspell-109" class="">gst</span></span>_element_set_state (pipeline, <span id="misspell-110" class=""><span id="misspell-110" class="">GST</span></span>_STATE_PLAYING);</font></div><div><font class="Apple-style-span" face="tahoma, 'new york', times, serif"> </font></div><div><font class="Apple-style-span" face="tahoma, 'new york', times, serif">
</font></div><div><font class="Apple-style-span" face="tahoma, 'new york', times, serif"> /* Print out the frame size and rate */</font></div><div><font class="Apple-style-span" face="tahoma, 'new york', times, serif"> <span id="misspell-111" class=""><span id="misspell-111" class="">str</span></span> = <span id="misspell-112" class=""><span id="misspell-112" class="">gst</span></span>_caps_get_structure (<span id="misspell-113" class=""><span id="misspell-113" class="">filtercaps</span></span>, 0);</font></div><div><font class="Apple-style-span" face="tahoma, 'new york', times, serif"> if (!<span id="misspell-114" class=""><span id="misspell-114" class="">gst</span></span>_structure_get_int (<span id="misspell-115" class=""><span id="misspell-115" class="">str</span></span>, "width", &width) || !<span id="misspell-116" class=""><span id="misspell-116" class="">gst</span></span>_structure_get_int
(<span id="misspell-117" class=""><span id="misspell-117" class="">str</span></span>, "height", &height) || </font></div><div><font class="Apple-style-span" face="tahoma, 'new york', times, serif"> !<span id="misspell-118" class=""><span id="misspell-118" class="">gst</span></span>_structure_get_fraction (<span id="misspell-119" class=""><span id="misspell-119" class="">str</span></span>, "<span id="misspell-120" class=""><span id="misspell-120" class="">framerate</span></span>", &<span id="misspell-121" class=""><span id="misspell-121" class="">num</span></span>, &<span id="misspell-122" class=""><span id="misspell-122" class="">denom</span></span>)) </font></div><div><font class="Apple-style-span" face="tahoma, 'new york', times, serif"> <span class="Apple-tab-span" style="white-space:pre">                </span>g_print ("No width/height available\n");</font></div><div><font class="Apple-style-span"
face="tahoma, 'new york', times, serif"> g_print ("The video size of this set of capabilities is %<span id="misspell-123" class=""><span id="misspell-123" class="">dx</span></span>%d and the frame rate is %d/%d\n", width, height, <span id="misspell-124" class=""><span id="misspell-124" class="">num</span></span>, <span id="misspell-125" class=""><span id="misspell-125" class="">denom</span></span>);</font></div><div><font class="Apple-style-span" face="tahoma, 'new york', times, serif"> </font></div><div><font class="Apple-style-span" face="tahoma, 'new york', times, serif"><br></font></div><div><font class="Apple-style-span" face="tahoma, 'new york', times, serif"><br></font></div><div><font class="Apple-style-span" face="tahoma, 'new york', times, serif"> /* Pausing the <span id="misspell-126" class=""><span id="misspell-126" class="">streame</span></span> */ </font></div><div><font class="Apple-style-span"
face="tahoma, 'new york', times, serif"> int in;</font></div><div><font class="Apple-style-span" face="tahoma, 'new york', times, serif"> if (<span id="misspell-127" class=""><span id="misspell-127" class="">scanf</span></span> ("%d", &in) == 1){</font></div><div><font class="Apple-style-span" face="tahoma, 'new york', times, serif"><span class="Apple-tab-span" style="white-space:pre">        </span>g_print ("Now pausing: \n");</font></div><div><font class="Apple-style-span" face="tahoma, 'new york', times, serif"> <span class="Apple-tab-span" style="white-space:pre">        </span><span id="misspell-128" class=""><span id="misspell-128" class="">gst</span></span>_element_set_state (pipeline, <span id="misspell-129" class=""><span id="misspell-129" class="">GST</span></span>_STATE_PAUSED );</font></div><div><span class="Apple-tab-span" style="white-space:pre"><font class="Apple-style-span" face="tahoma, 'new york', times,
serif">        </font></span></div><div><font class="Apple-style-span" face="tahoma, 'new york', times, serif"><span class="Apple-tab-span" style="white-space:pre">        </span>g_assert (<span id="misspell-130" class=""><span id="misspell-130" class="">GST</span></span>_STATE (pipeline) == <span id="misspell-131" class=""><span id="misspell-131" class="">GST</span></span>_STATE_PAUSED);</font></div><div><font class="Apple-style-span" face="tahoma, 'new york', times, serif"><span class="Apple-tab-span" style="white-space:pre">        </span>g_assert (<span id="misspell-132" class=""><span id="misspell-132" class="">GST</span></span>_STATE (source) == <span id="misspell-133" class=""><span id="misspell-133" class="">GST</span></span>_STATE_PAUSED);</font></div><div><font class="Apple-style-span" face="tahoma, 'new york', times, serif"><span class="Apple-tab-span" style="white-space:pre">        </span>g_assert (<span id="misspell-134" class=""><span id="misspell-134"
class="">GST</span></span>_STATE (filter) == <span id="misspell-135" class=""><span id="misspell-135" class="">GST</span></span>_STATE_PAUSED);</font></div><div><font class="Apple-style-span" face="tahoma, 'new york', times, serif"><span class="Apple-tab-span" style="white-space:pre">        </span>g_assert (<span id="misspell-136" class=""><span id="misspell-136" class="">GST</span></span>_STATE (<span id="misspell-137" class=""><span id="misspell-137" class="">vrate</span></span>) == <span id="misspell-138" class=""><span id="misspell-138" class="">GST</span></span>_STATE_PAUSED);</font></div><div><font class="Apple-style-span" face="tahoma, 'new york', times, serif"><span class="Apple-tab-span" style="white-space:pre">        </span>g_assert (<span id="misspell-139" class=""><span id="misspell-139" class="">GST</span></span>_STATE (encoder) == <span id="misspell-140" class=""><span id="misspell-140" class="">GST</span></span>_STATE_PAUSED);</font></div><div><font
class="Apple-style-span" face="tahoma, 'new york', times, serif"><span class="Apple-tab-span" style="white-space:pre">        </span>g_assert (<span id="misspell-141" class=""><span id="misspell-141" class="">GST</span></span>_STATE (<span id="misspell-142" class=""><span id="misspell-142" class="">conv</span></span>) == <span id="misspell-143" class=""><span id="misspell-143" class="">GST</span></span>_STATE_PAUSED);</font></div><div><font class="Apple-style-span" face="tahoma, 'new york', times, serif"><span class="Apple-tab-span" style="white-space:pre">        </span>g_assert (<span id="misspell-144" class=""><span id="misspell-144" class="">GST</span></span>_STATE (sink) == <span id="misspell-145" class=""><span id="misspell-145" class="">GST</span></span>_STATE_PAUSED);</font></div><div><font class="Apple-style-span" face="tahoma, 'new york', times, serif"><br></font></div><div><span class="Apple-tab-span" style="white-space:pre"><font class="Apple-style-span"
face="tahoma, 'new york', times, serif">        </font></span></div><div><font class="Apple-style-span" face="tahoma, 'new york', times, serif"><span class="Apple-tab-span" style="white-space:pre">        </span>/* apply the alterations to the caps now */</font></div><div><font class="Apple-style-span" face="tahoma, 'new york', times, serif"><span class="Apple-tab-span" style="white-space:pre">        </span><span id="misspell-146" class=""><span id="misspell-146" class="">gst</span></span>_caps_set_simple (<span id="misspell-147" class=""><span id="misspell-147" class="">filtercaps</span></span>, "width", G_TYPE_INT, 352, "height", G_TYPE_INT, 288, "<span id="misspell-148" class=""><span id="misspell-148" class="">framerate</span></span>", <span id="misspell-149" class=""><span id="misspell-149" class="">GST</span></span>_TYPE_FRACTION, 15, 1, NULL); </font></div><div><font class="Apple-style-span" face="tahoma, 'new york', times, serif">
</font></div><div><span class="Apple-tab-span" style="white-space:pre"><font class="Apple-style-span" face="tahoma, 'new york', times, serif">        </font></span></div><div><font class="Apple-style-span" face="tahoma, 'new york', times, serif"> /* Print out the frame size and rate after alteration*/</font></div><div><font class="Apple-style-span" face="tahoma, 'new york', times, serif"><span class="Apple-tab-span" style="white-space:pre">        </span><span id="misspell-150" class=""><span id="misspell-150" class="">str</span></span> = <span id="misspell-151" class=""><span id="misspell-151" class="">gst</span></span>_caps_get_structure (<span id="misspell-152" class=""><span id="misspell-152" class="">filtercaps</span></span>, 0);</font></div><div><font class="Apple-style-span" face="tahoma, 'new york', times, serif"> if (!<span id="misspell-153" class=""><span id="misspell-153"
class="">gst</span></span>_structure_get_int (<span id="misspell-154" class=""><span id="misspell-154" class="">str</span></span>, "width", &width) || !<span id="misspell-155" class=""><span id="misspell-155" class="">gst</span></span>_structure_get_int (<span id="misspell-156" class=""><span id="misspell-156" class="">str</span></span>, "height", &height) || </font></div><div><font class="Apple-style-span" face="tahoma, 'new york', times, serif"><span class="Apple-tab-span" style="white-space:pre">        </span> !<span id="misspell-157" class=""><span id="misspell-157" class="">gst</span></span>_structure_get_fraction (<span id="misspell-158" class=""><span id="misspell-158" class="">str</span></span>, "<span id="misspell-159" class=""><span id="misspell-159" class="">framerate</span></span>", &<span id="misspell-160" class=""><span id="misspell-160" class="">num</span></span>, &<span id="misspell-161" class=""><span
id="misspell-161" class="">denom</span></span>)) </font></div><div><font class="Apple-style-span" face="tahoma, 'new york', times, serif"> <span class="Apple-tab-span" style="white-space:pre">                </span>g_print ("No width/height available\n");</font></div><div><font class="Apple-style-span" face="tahoma, 'new york', times, serif"><span class="Apple-tab-span" style="white-space:pre">        </span>g_print ("The video size of this set of capabilities is %<span id="misspell-162" class=""><span id="misspell-162" class="">dx</span></span>%d and the frame rate is %d/%d\n", width, height, <span id="misspell-163" class=""><span id="misspell-163" class="">num</span></span>, <span id="misspell-164" class=""><span id="misspell-164" class="">denom</span></span>);<span class="Apple-tab-span" style="white-space:pre">        </span></font></div><div><span class="Apple-tab-span" style="white-space:pre"><font class="Apple-style-span" face="tahoma, 'new york', times,
serif">        </font></span></div><div><font class="Apple-style-span" face="tahoma, 'new york', times, serif"><span class="Apple-tab-span" style="white-space:pre">        </span>/* set back to playing */</font></div><div><font class="Apple-style-span" face="tahoma, 'new york', times, serif"><span class="Apple-tab-span" style="white-space:pre">        </span><span id="misspell-165" class=""><span id="misspell-165" class="">gst</span></span>_element_set_state (pipeline, <span id="misspell-166" class=""><span id="misspell-166" class="">GST</span></span>_STATE_PLAYING);</font></div><div><font class="Apple-style-span" face="tahoma, 'new york', times, serif"><br></font></div><div><font class="Apple-style-span" face="tahoma, 'new york', times, serif"><span class="Apple-tab-span" style="white-space:pre">        </span>g_assert (<span id="misspell-167" class=""><span id="misspell-167" class="">GST</span></span>_STATE (pipeline) == <span id="misspell-168" class=""><span id="misspell-168"
class="">GST</span></span>_STATE_PLAYING);</font></div><div><font class="Apple-style-span" face="tahoma, 'new york', times, serif"><span class="Apple-tab-span" style="white-space:pre">        </span>g_assert (<span id="misspell-169" class=""><span id="misspell-169" class="">GST</span></span>_STATE (source) == <span id="misspell-170" class=""><span id="misspell-170" class="">GST</span></span>_STATE_PLAYING);</font></div><div><font class="Apple-style-span" face="tahoma, 'new york', times, serif"><span class="Apple-tab-span" style="white-space:pre">        </span>g_assert (<span id="misspell-171" class=""><span id="misspell-171" class="">GST</span></span>_STATE (filter) == <span id="misspell-172" class=""><span id="misspell-172" class="">GST</span></span>_STATE_PLAYING);</font></div><div><font class="Apple-style-span" face="tahoma, 'new york', times, serif"><span class="Apple-tab-span" style="white-space:pre">        </span>g_assert (<span id="misspell-173" class=""><span
id="misspell-173" class="">GST</span></span>_STATE (<span id="misspell-174" class=""><span id="misspell-174" class="">vrate</span></span>) == <span id="misspell-175" class=""><span id="misspell-175" class="">GST</span></span>_STATE_PLAYING);</font></div><div><font class="Apple-style-span" face="tahoma, 'new york', times, serif"><span class="Apple-tab-span" style="white-space:pre">        </span>g_assert (<span id="misspell-176" class=""><span id="misspell-176" class="">GST</span></span>_STATE (encoder) == <span id="misspell-177" class=""><span id="misspell-177" class="">GST</span></span>_STATE_PLAYING);</font></div><div><font class="Apple-style-span" face="tahoma, 'new york', times, serif"><span class="Apple-tab-span" style="white-space:pre">        </span>g_assert (<span id="misspell-178" class=""><span id="misspell-178" class="">GST</span></span>_STATE (<span id="misspell-179" class=""><span id="misspell-179" class="">conv</span></span>) == <span id="misspell-180"
class=""><span id="misspell-180" class="">GST</span></span>_STATE_PLAYING);</font></div><div><font class="Apple-style-span" face="tahoma, 'new york', times, serif"><span class="Apple-tab-span" style="white-space:pre">        </span>g_assert (<span id="misspell-181" class=""><span id="misspell-181" class="">GST</span></span>_STATE (sink) == <span id="misspell-182" class=""><span id="misspell-182" class="">GST</span></span>_STATE_PLAYING);<span class="Apple-tab-span" style="white-space:pre">        </span></font></div><div><span class="Apple-tab-span" style="white-space:pre"><font class="Apple-style-span" face="tahoma, 'new york', times, serif">        </font></span></div><div><font class="Apple-style-span" face="tahoma, 'new york', times, serif"> }</font></div><div><font class="Apple-style-span" face="tahoma, 'new york', times, serif"> </font></div><div><font class="Apple-style-span" face="tahoma, 'new york', times,
serif"><br></font></div><div><font class="Apple-style-span" face="tahoma, 'new york', times, serif"> /* Iterate */</font></div><div><font class="Apple-style-span" face="tahoma, 'new york', times, serif"> g_print ("Running...\n");</font></div><div><font class="Apple-style-span" face="tahoma, 'new york', times, serif"> g_main_loop_run (loop);</font></div><div><font class="Apple-style-span" face="tahoma, 'new york', times, serif"> </font></div><div><font class="Apple-style-span" face="tahoma, 'new york', times, serif"> </font></div><div><font class="Apple-style-span" face="tahoma, 'new york', times, serif"> /* Out of the main loop, clean up nicely */</font></div><div><font class="Apple-style-span" face="tahoma, 'new york', times, serif"> g_print ("Returned, stopping playback\n");</font></div><div><font class="Apple-style-span" face="tahoma, 'new york', times,
serif"> <span id="misspell-183" class=""><span id="misspell-183" class="">gst</span></span>_element_set_state (pipeline, <span id="misspell-184" class=""><span id="misspell-184" class="">GST</span></span>_STATE_NULL);</font></div><div><font class="Apple-style-span" face="tahoma, 'new york', times, serif"> g_print ("Deleting pipeline\n");</font></div><div><font class="Apple-style-span" face="tahoma, 'new york', times, serif"> <span id="misspell-185" class=""><span id="misspell-185" class="">gst</span></span>_object_<span id="misspell-186" class=""><span id="misspell-186" class="">unref</span></span> (<span id="misspell-187" class=""><span id="misspell-187" class="">GST</span></span>_OBJECT (pipeline));</font></div><div><font class="Apple-style-span" face="tahoma, 'new york', times, serif"><br></font></div><div><font class="Apple-style-span" face="tahoma, 'new york', times, serif"> return
0;</font></div><div><font class="Apple-style-span" face="tahoma, 'new york', times, serif">}</font></div><div style="font-size: 12pt; font-family: tahoma, 'new york', times, serif; "><br></div><div style="font-size: 12pt; font-family: tahoma, 'new york', times, serif; " class="yui_3_2_0_15_13164514018681236"><br></div><div style="font-size: 12pt; font-family: tahoma, 'new york', times, serif; " class="yui_3_2_0_15_13164514018681236">Cheers.</div><div style="font-family: tahoma, 'new york', times, serif; font-size: 12pt; " class="yui_3_2_0_15_13164514018681236 yui_3_2_0_15_13164514018683207"><br></div><div style="font-family: tahoma, 'new york', times, serif; font-size: 12pt; " class="yui_3_2_0_15_13164514018681236 yui_3_2_0_15_13164514018683207">Ibra</div></div></div></body></html>