2 ways, depending on what you want. I think that what you are asking is setting caps. Here is what you do.<br><br>GstCaps *pCaps = gst_caps_new_simple("audio/x-raw-int", "channels", g_int (?), 2, NULL);<br>
gst_link_filtered(element*1, element*2, pCaps);<br>gst_caps_unref(pCaps);<br><br>You can also set parameters on elements using:<br><br>g_object_set(G_OBJECT(someelement), "option1", value, "option2", value, NULL);<br>
<br>Refer to the GstCaps and GstElement sections in the Core Reference Manual.<br><br><div class="gmail_quote">On Thu, Feb 28, 2013 at 11:46 AM, Jim <span dir="ltr"><<a href="mailto:restlessmindsstudio@gmail.com" target="_blank">restlessmindsstudio@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div link="blue" vlink="purple" lang="EN-US"><div><p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial","sans-serif"">In the following gst-launch command line, right before the alsasink element, the audio format is being specified:<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial","sans-serif""><u></u> <u></u></span></p><p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial","sans-serif"">gst-launch filesrc location=video.ts typefind=true ! flutsdemux name=demux demux. ! queue max-size-buffers=0 max-size-time=0 ! vpudec ! mfw_v4lsink demux. ! queue max-size-buffers=0 max-size-time=0 ! beepdec ! audioconvert ! 'audio/x-raw-int, channels=2' ! alsasink<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial","sans-serif""><u></u> <u></u></span></p><p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial","sans-serif"">How would I specify the audio format in my C code? Since this is separated with an exclamation point (!) in the command line, it seems like a separate element so I tried:<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial","sans-serif"">gst_element_factory_make("audio/x-raw-int, channels=2", "myAudioFormat"); <u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial","sans-serif"">but that didn’t work.<u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial","sans-serif""><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial","sans-serif"">Thanks,<u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial","sans-serif"">Jim<u></u><u></u></span></p>
</div></div><br>_______________________________________________<br>
gstreamer-devel mailing list<br>
<a href="mailto:gstreamer-devel@lists.freedesktop.org">gstreamer-devel@lists.freedesktop.org</a><br>
<a href="http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel" target="_blank">http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel</a><br>
<br></blockquote></div><br>