<div style="line-height:1.7;color:#000000;font-size:14px;font-family:Arial"><div id="isForwardContent"><br><div style="line-height:1.7;color:#000000;font-size:14px;font-family:Arial"><div>Hi,All</div><div><br></div><div>I am writing a program to push audio and video to rtmp server.But now it only support pushing video to server.Can not mux with audio.Can you give me some guide?  Thanks!</div><div>The relevant code is as follows:  </div><br><div id="isForwardContent"><div style="line-height: 1.7;"><br><div style="color: rgb(0, 0, 0); font-family: Arial; font-size: 14px;"><br></div><div style=""><div style="color: rgb(0, 0, 0); font-family: Arial; font-size: 14px;"><br></div><pre style="background-color: rgb(255, 255, 255);"><span style="color: rgb(128, 128, 0); font-family: "Courier 10 Pitch"; font-size: 12pt;">#include </span><span style="color: rgb(0, 128, 0); font-family: "Courier 10 Pitch"; font-size: 12pt; font-weight: bold;"><gst/gst.h><br></span><font face="Courier 10 Pitch"><span style="color: rgb(0, 128, 0); font-weight: bold; font-size: 12pt;"></span></font><span style="color: rgb(128, 128, 128); font-family: "Courier 10 Pitch"; font-size: 12pt; font-style: italic;"><br></span><span style="color: rgb(0, 0, 128); font-family: "Courier 10 Pitch"; font-size: 12pt; font-weight: bold;">typedef struct </span><span style="color: rgb(0, 128, 128); font-family: "Courier 10 Pitch"; font-size: 12pt;">_CustomData </span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">{<br>    </span></font><span style="color: rgb(55, 31, 128); font-family: "Courier 10 Pitch"; font-size: 12pt;">GstElement </span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">*</span></font><span style="color: rgb(102, 14, 122); font-family: "Courier 10 Pitch"; font-size: 12pt;">pipeline</span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">;<br>    </span></font><span style="color: rgb(55, 31, 128); font-family: "Courier 10 Pitch"; font-size: 12pt;">GstElement </span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">*</span></font><span style="color: rgb(102, 14, 122); font-family: "Courier 10 Pitch"; font-size: 12pt;">vsource</span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">;<br>    </span></font><span style="color: rgb(55, 31, 128); font-family: "Courier 10 Pitch"; font-size: 12pt;">GstElement </span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">*</span></font><span style="color: rgb(102, 14, 122); font-family: "Courier 10 Pitch"; font-size: 12pt;">vconvert</span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">;<br>    </span></font><span style="color: rgb(55, 31, 128); font-family: "Courier 10 Pitch"; font-size: 12pt;">GstElement </span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">*</span></font><span style="color: rgb(102, 14, 122); font-family: "Courier 10 Pitch"; font-size: 12pt;">x264enc</span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">;<br>    </span></font><span style="color: rgb(55, 31, 128); font-family: "Courier 10 Pitch"; font-size: 12pt;">GstElement </span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">*</span></font><span style="color: rgb(102, 14, 122); font-family: "Courier 10 Pitch"; font-size: 12pt;">h264parse</span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">;<br>    </span></font><span style="color: rgb(55, 31, 128); font-family: "Courier 10 Pitch"; font-size: 12pt;">GstElement </span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">*</span></font><span style="color: rgb(102, 14, 122); font-family: "Courier 10 Pitch"; font-size: 12pt;">vcapsfilter</span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">;<br>    </span></font><span style="color: rgb(55, 31, 128); font-family: "Courier 10 Pitch"; font-size: 12pt;">GstElement </span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">*</span></font><span style="color: rgb(102, 14, 122); font-family: "Courier 10 Pitch"; font-size: 12pt;">vsink</span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">;<br><br>    </span></font><span style="color: rgb(55, 31, 128); font-family: "Courier 10 Pitch"; font-size: 12pt;">GstElement </span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">*</span></font><span style="color: rgb(102, 14, 122); font-family: "Courier 10 Pitch"; font-size: 12pt;">asource</span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">;<br>    </span></font><span style="color: rgb(55, 31, 128); font-family: "Courier 10 Pitch"; font-size: 12pt;">GstElement </span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">*</span></font><span style="color: rgb(102, 14, 122); font-family: "Courier 10 Pitch"; font-size: 12pt;">aconvert</span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">;<br>    </span></font><span style="color: rgb(55, 31, 128); font-family: "Courier 10 Pitch"; font-size: 12pt;">GstElement </span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">*</span></font><span style="color: rgb(102, 14, 122); font-family: "Courier 10 Pitch"; font-size: 12pt;">amp3enc</span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">;<br>    </span></font><span style="color: rgb(55, 31, 128); font-family: "Courier 10 Pitch"; font-size: 12pt;">GstElement </span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">*</span></font><span style="color: rgb(102, 14, 122); font-family: "Courier 10 Pitch"; font-size: 12pt;">acapfilter</span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">;<br>    </span></font><span style="color: rgb(55, 31, 128); font-family: "Courier 10 Pitch"; font-size: 12pt;">GstElement </span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">*</span></font><span style="color: rgb(102, 14, 122); font-family: "Courier 10 Pitch"; font-size: 12pt;">ampegaudiopaser</span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">;<br>    </span></font><span style="color: rgb(55, 31, 128); font-family: "Courier 10 Pitch"; font-size: 12pt;">GstElement </span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">*</span></font><span style="color: rgb(102, 14, 122); font-family: "Courier 10 Pitch"; font-size: 12pt;">asink</span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">;<br><br>    </span></font><span style="color: rgb(55, 31, 128); font-family: "Courier 10 Pitch"; font-size: 12pt;">GstElement </span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">*</span></font><span style="color: rgb(102, 14, 122); font-family: "Courier 10 Pitch"; font-size: 12pt;">vqueue</span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">;<br>    </span></font><span style="color: rgb(55, 31, 128); font-family: "Courier 10 Pitch"; font-size: 12pt;">GstElement </span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">*</span></font><span style="color: rgb(102, 14, 122); font-family: "Courier 10 Pitch"; font-size: 12pt;">aqueue</span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">;<br><br><br>    </span></font><span style="color: rgb(55, 31, 128); font-family: "Courier 10 Pitch"; font-size: 12pt;">GstElement </span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">*</span></font><span style="color: rgb(102, 14, 122); font-family: "Courier 10 Pitch"; font-size: 12pt;">video_enc_queue</span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">;<br>    </span></font><span style="color: rgb(55, 31, 128); font-family: "Courier 10 Pitch"; font-size: 12pt;">GstElement </span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">*</span></font><span style="color: rgb(102, 14, 122); font-family: "Courier 10 Pitch"; font-size: 12pt;">audio_enc_queue</span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">;<br><br>    </span></font><span style="color: rgb(55, 31, 128); font-family: "Courier 10 Pitch"; font-size: 12pt;">GstElement </span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">*</span></font><span style="color: rgb(102, 14, 122); font-family: "Courier 10 Pitch"; font-size: 12pt;">flvmuxer</span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">;<br>    </span></font><span style="color: rgb(55, 31, 128); font-family: "Courier 10 Pitch"; font-size: 12pt;">GstElement </span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">*</span></font><span style="color: rgb(102, 14, 122); font-family: "Courier 10 Pitch"; font-size: 12pt;">rtmpsink</span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">;<br><br>} </span></font><span style="color: rgb(55, 31, 128); font-family: "Courier 10 Pitch"; font-size: 12pt;">CustomData</span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">;<br><br></span></font><span style="color: rgb(0, 0, 128); font-family: "Courier 10 Pitch"; font-size: 12pt; font-weight: bold;">int </span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">main(</span></font><span style="color: rgb(0, 0, 128); font-family: "Courier 10 Pitch"; font-size: 12pt; font-weight: bold;">int </span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">argc, </span></font><span style="color: rgb(0, 0, 128); font-family: "Courier 10 Pitch"; font-size: 12pt; font-weight: bold;">char </span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">*argv[]) {<br>    </span></font><span style="color: rgb(55, 31, 128); font-family: "Courier 10 Pitch"; font-size: 12pt;">CustomData </span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">data;<br>    </span></font><span style="color: rgb(55, 31, 128); font-family: "Courier 10 Pitch"; font-size: 12pt;">GstBus </span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">*bus;<br>    </span></font><span style="color: rgb(55, 31, 128); font-family: "Courier 10 Pitch"; font-size: 12pt;">GstMessage </span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">*msg;<br>    </span></font><span style="color: rgb(55, 31, 128); font-family: "Courier 10 Pitch"; font-size: 12pt;">GstStateChangeReturn </span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">ret;<br>    </span></font><span style="color: rgb(55, 31, 128); font-family: "Courier 10 Pitch"; font-size: 12pt;">gboolean </span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">terminate = </span></font><span style="color: rgb(31, 84, 46); font-family: "Courier 10 Pitch"; font-size: 12pt; font-weight: bold;">FALSE</span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">;<br><br>    </span></font><span style="color: rgb(128, 128, 128); font-family: "Courier 10 Pitch"; font-size: 12pt; font-style: italic;">/* Initialize GStreamer */<br></span><span style="color: rgb(128, 128, 128); font-family: "Courier 10 Pitch"; font-size: 12pt; font-style: italic;">    //gst_init (&argc, &argv);<br></span><span style="color: rgb(128, 128, 128); font-family: "Courier 10 Pitch"; font-size: 12pt; font-style: italic;">    </span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">gst_init(</span></font><span style="color: rgb(31, 84, 46); font-family: "Courier 10 Pitch"; font-size: 12pt; font-weight: bold;">NULL</span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">, </span></font><span style="color: rgb(31, 84, 46); font-family: "Courier 10 Pitch"; font-size: 12pt; font-weight: bold;">NULL</span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">);<br>    </span></font><span style="color: rgb(128, 128, 128); font-family: "Courier 10 Pitch"; font-size: 12pt; font-style: italic;">/* Create the elements */<br></span><span style="color: rgb(128, 128, 128); font-family: "Courier 10 Pitch"; font-size: 12pt; font-style: italic;">    //"video/x-raw, width=(int)160, height=(int)120, framerate=(fraction)30/1, format=I420, pixel-aspect-ratio=(fraction)1/1, interlace-mode=(string)progressive"<br></span><span style="color: rgb(128, 128, 128); font-family: "Courier 10 Pitch"; font-size: 12pt; font-style: italic;">    </span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">data.</span></font><span style="color: rgb(102, 14, 122); font-family: "Courier 10 Pitch"; font-size: 12pt;">vsource </span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">= gst_element_factory_make(</span></font><span style="color: rgb(0, 128, 0); font-family: "Courier 10 Pitch"; font-size: 12pt; font-weight: bold;">"v4l2src"</span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">, </span></font><span style="color: rgb(0, 128, 0); font-family: "Courier 10 Pitch"; font-size: 12pt; font-weight: bold;">"camera-source"</span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">);</span></font><span style="color: rgb(128, 128, 128); font-family: "Courier 10 Pitch"; font-size: 12pt; font-style: italic;">//autovideosrc v4l2src<br></span><span style="color: rgb(128, 128, 128); font-family: "Courier 10 Pitch"; font-size: 12pt; font-style: italic;">    </span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">data.</span></font><span style="color: rgb(102, 14, 122); font-family: "Courier 10 Pitch"; font-size: 12pt;">vconvert </span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">= gst_element_factory_make(</span></font><span style="color: rgb(0, 128, 0); font-family: "Courier 10 Pitch"; font-size: 12pt; font-weight: bold;">"videoconvert"</span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">, </span></font><span style="color: rgb(0, 128, 0); font-family: "Courier 10 Pitch"; font-size: 12pt; font-weight: bold;">"convert"</span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">);<br>    data.</span></font><span style="color: rgb(102, 14, 122); font-family: "Courier 10 Pitch"; font-size: 12pt;">vsink </span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">= gst_element_factory_make(</span></font><span style="color: rgb(0, 128, 0); font-family: "Courier 10 Pitch"; font-size: 12pt; font-weight: bold;">"ximagesink"</span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">, </span></font><span style="color: rgb(0, 128, 0); font-family: "Courier 10 Pitch"; font-size: 12pt; font-weight: bold;">"camera-sink"</span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">);<br>    data.</span></font><span style="color: rgb(102, 14, 122); font-family: "Courier 10 Pitch"; font-size: 12pt;">vqueue </span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">= gst_element_factory_make(</span></font><span style="color: rgb(0, 128, 0); font-family: "Courier 10 Pitch"; font-size: 12pt; font-weight: bold;">"queue"</span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">, </span></font><span style="color: rgb(0, 128, 0); font-family: "Courier 10 Pitch"; font-size: 12pt; font-weight: bold;">"camera-queue"</span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">);<br>    data.</span></font><span style="color: rgb(102, 14, 122); font-family: "Courier 10 Pitch"; font-size: 12pt;">x264enc </span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">= gst_element_factory_make(</span></font><span style="color: rgb(0, 128, 0); font-family: "Courier 10 Pitch"; font-size: 12pt; font-weight: bold;">"x264enc"</span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">, </span></font><span style="color: rgb(0, 128, 0); font-family: "Courier 10 Pitch"; font-size: 12pt; font-weight: bold;">"x264-encoder"</span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">);<br>    data.</span></font><span style="color: rgb(102, 14, 122); font-family: "Courier 10 Pitch"; font-size: 12pt;">vcapsfilter </span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">= gst_element_factory_make(</span></font><span style="color: rgb(0, 128, 0); font-family: "Courier 10 Pitch"; font-size: 12pt; font-weight: bold;">"capsfilter"</span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">, </span></font><span style="color: rgb(0, 128, 0); font-family: "Courier 10 Pitch"; font-size: 12pt; font-weight: bold;">"video-filter"</span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">);<br>    data.</span></font><span style="color: rgb(102, 14, 122); font-family: "Courier 10 Pitch"; font-size: 12pt;">h264parse </span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">= gst_element_factory_make(</span></font><span style="color: rgb(0, 128, 0); font-family: "Courier 10 Pitch"; font-size: 12pt; font-weight: bold;">"h264parse"</span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">, </span></font><span style="color: rgb(0, 128, 0); font-family: "Courier 10 Pitch"; font-size: 12pt; font-weight: bold;">"mux-video-parser"</span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">);;<br></span><span style="font-size: 12pt;"><br><br>    data.</span></font><span style="color: rgb(102, 14, 122); font-family: "Courier 10 Pitch"; font-size: 12pt;">asource </span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">= gst_element_factory_make(</span></font><span style="color: rgb(0, 128, 0); font-family: "Courier 10 Pitch"; font-size: 12pt; font-weight: bold;">"alsasrc"</span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">, </span></font><span style="color: rgb(0, 128, 0); font-family: "Courier 10 Pitch"; font-size: 12pt; font-weight: bold;">"audio-alsa-source"</span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">);<br>    data.</span></font><span style="color: rgb(102, 14, 122); font-family: "Courier 10 Pitch"; font-size: 12pt;">aconvert </span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">= gst_element_factory_make(</span></font><span style="color: rgb(0, 128, 0); font-family: "Courier 10 Pitch"; font-size: 12pt; font-weight: bold;">"audioconvert"</span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">, </span></font><span style="color: rgb(0, 128, 0); font-family: "Courier 10 Pitch"; font-size: 12pt; font-weight: bold;">"audio-converter"</span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">);<br>    data.</span></font><span style="color: rgb(102, 14, 122); font-family: "Courier 10 Pitch"; font-size: 12pt;">amp3enc </span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">= gst_element_factory_make(</span></font><span style="color: rgb(0, 128, 0); font-family: "Courier 10 Pitch"; font-size: 12pt; font-weight: bold;">"lamemp3enc"</span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">, </span></font><span style="color: rgb(0, 128, 0); font-family: "Courier 10 Pitch"; font-size: 12pt; font-weight: bold;">"mp3-encode"</span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">);<br>    data.</span></font><span style="color: rgb(102, 14, 122); font-family: "Courier 10 Pitch"; font-size: 12pt;">acapfilter </span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">= gst_element_factory_make(</span></font><span style="color: rgb(0, 128, 0); font-family: "Courier 10 Pitch"; font-size: 12pt; font-weight: bold;">"capsfilter"</span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">, </span></font><span style="color: rgb(0, 128, 0); font-family: "Courier 10 Pitch"; font-size: 12pt; font-weight: bold;">"audio-capsfilter"</span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">);<br>    data.</span></font><span style="color: rgb(102, 14, 122); font-family: "Courier 10 Pitch"; font-size: 12pt;">asink </span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">= gst_element_factory_make(</span></font><span style="color: rgb(0, 128, 0); font-family: "Courier 10 Pitch"; font-size: 12pt; font-weight: bold;">"filesink"</span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">, </span></font><span style="color: rgb(0, 128, 0); font-family: "Courier 10 Pitch"; font-size: 12pt; font-weight: bold;">"file-sink"</span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">);<br>    data.</span></font><span style="color: rgb(102, 14, 122); font-family: "Courier 10 Pitch"; font-size: 12pt;">aqueue </span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">= gst_element_factory_make(</span></font><span style="color: rgb(0, 128, 0); font-family: "Courier 10 Pitch"; font-size: 12pt; font-weight: bold;">"queue"</span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">, </span></font><span style="color: rgb(0, 128, 0); font-family: "Courier 10 Pitch"; font-size: 12pt; font-weight: bold;">"audio-queue"</span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">);<br>    data.</span></font><span style="color: rgb(102, 14, 122); font-family: "Courier 10 Pitch"; font-size: 12pt;">ampegaudiopaser </span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">= gst_element_factory_make(</span></font><span style="color: rgb(0, 128, 0); font-family: "Courier 10 Pitch"; font-size: 12pt; font-weight: bold;">"mpegaudioparse"</span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">, </span></font><span style="color: rgb(0, 128, 0); font-family: "Courier 10 Pitch"; font-size: 12pt; font-weight: bold;">"audio-paser"</span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">);<br><br>    data.</span></font><span style="color: rgb(102, 14, 122); font-family: "Courier 10 Pitch"; font-size: 12pt;">flvmuxer </span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">= gst_element_factory_make(</span></font><span style="color: rgb(0, 128, 0); font-family: "Courier 10 Pitch"; font-size: 12pt; font-weight: bold;">"flvmux"</span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">, </span></font><span style="color: rgb(0, 128, 0); font-family: "Courier 10 Pitch"; font-size: 12pt; font-weight: bold;">"mux-flvmux"</span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">);<br>    data.</span></font><span style="color: rgb(102, 14, 122); font-family: "Courier 10 Pitch"; font-size: 12pt;">rtmpsink </span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">= gst_element_factory_make(</span></font><span style="color: rgb(0, 128, 0); font-family: "Courier 10 Pitch"; font-size: 12pt; font-weight: bold;">"rtmpsink"</span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">, </span></font><span style="color: rgb(0, 128, 0); font-family: "Courier 10 Pitch"; font-size: 12pt; font-weight: bold;">"rtmp-sink"</span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">);<br><br>    data.</span></font><span style="color: rgb(102, 14, 122); font-family: "Courier 10 Pitch"; font-size: 12pt;">video_enc_queue </span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">= gst_element_factory_make(</span></font><span style="color: rgb(0, 128, 0); font-family: "Courier 10 Pitch"; font-size: 12pt; font-weight: bold;">"queue"</span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">, </span></font><span style="color: rgb(0, 128, 0); font-family: "Courier 10 Pitch"; font-size: 12pt; font-weight: bold;">"video_enc_queue"</span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">);<br>    data.</span></font><span style="color: rgb(102, 14, 122); font-family: "Courier 10 Pitch"; font-size: 12pt;">audio_enc_queue </span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">= gst_element_factory_make(</span></font><span style="color: rgb(0, 128, 0); font-family: "Courier 10 Pitch"; font-size: 12pt; font-weight: bold;">"queue"</span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">, </span></font><span style="color: rgb(0, 128, 0); font-family: "Courier 10 Pitch"; font-size: 12pt; font-weight: bold;">"audio_enc_queue"</span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">);<br><br>    g_object_set(</span></font><span style="color: rgb(31, 84, 46); font-family: "Courier 10 Pitch"; font-size: 12pt; font-weight: bold;">G_OBJECT</span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">(data.</span></font><span style="color: rgb(102, 14, 122); font-family: "Courier 10 Pitch"; font-size: 12pt;">rtmpsink</span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">), </span></font><span style="color: rgb(0, 128, 0); font-family: "Courier 10 Pitch"; font-size: 12pt; font-weight: bold;">"location"</span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">, </span></font><span style="color: rgb(0, 128, 0); font-family: "Courier 10 Pitch"; font-size: 12pt; font-weight: bold;">"rtmp://localhost:1935/live/movie"</span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">, </span></font><span style="color: rgb(31, 84, 46); font-family: "Courier 10 Pitch"; font-size: 12pt; font-weight: bold;">NULL</span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">);<br>    g_object_set(</span></font><span style="color: rgb(31, 84, 46); font-family: "Courier 10 Pitch"; font-size: 12pt; font-weight: bold;">G_OBJECT</span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">(data.</span></font><span style="color: rgb(102, 14, 122); font-family: "Courier 10 Pitch"; font-size: 12pt;">flvmuxer</span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">), </span></font><span style="color: rgb(0, 128, 0); font-family: "Courier 10 Pitch"; font-size: 12pt; font-weight: bold;">"streamable"</span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">, </span></font><span style="color: rgb(0, 0, 128); font-family: "Courier 10 Pitch"; font-size: 12pt; font-weight: bold;">true</span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">, </span></font><span style="color: rgb(31, 84, 46); font-family: "Courier 10 Pitch"; font-size: 12pt; font-weight: bold;">NULL</span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">);<br><br>    </span></font><span style="color: rgb(128, 128, 128); font-family: "Courier 10 Pitch"; font-size: 12pt; font-style: italic;">/* Create the empty pipeline */<br></span><span style="color: rgb(128, 128, 128); font-family: "Courier 10 Pitch"; font-size: 12pt; font-style: italic;">    </span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">data.</span></font><span style="color: rgb(102, 14, 122); font-family: "Courier 10 Pitch"; font-size: 12pt;">pipeline </span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">= gst_pipeline_new(</span></font><span style="color: rgb(0, 128, 0); font-family: "Courier 10 Pitch"; font-size: 12pt; font-weight: bold;">"push-pipeline"</span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">);<br><br>    </span></font><span style="color: rgb(0, 0, 128); font-family: "Courier 10 Pitch"; font-size: 12pt; font-weight: bold;">if </span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">(!data.</span></font><span style="color: rgb(102, 14, 122); font-family: "Courier 10 Pitch"; font-size: 12pt;">pipeline<br></span><span style="color: rgb(102, 14, 122); font-family: "Courier 10 Pitch"; font-size: 12pt;">        </span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">|| !data.</span></font><span style="color: rgb(102, 14, 122); font-family: "Courier 10 Pitch"; font-size: 12pt;">vsource </span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">|| !data.</span></font><span style="color: rgb(102, 14, 122); font-family: "Courier 10 Pitch"; font-size: 12pt;">vconvert </span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">|| !data.</span></font><span style="color: rgb(102, 14, 122); font-family: "Courier 10 Pitch"; font-size: 12pt;">vqueue </span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">|| !data.</span></font><span style="color: rgb(102, 14, 122); font-family: "Courier 10 Pitch"; font-size: 12pt;">x264enc </span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">|| !data.</span></font><span style="color: rgb(102, 14, 122); font-family: "Courier 10 Pitch"; font-size: 12pt;">vcapsfilter </span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">|| !data.</span></font><span style="color: rgb(102, 14, 122); font-family: "Courier 10 Pitch"; font-size: 12pt;">vsink<br></span><span style="color: rgb(102, 14, 122); font-family: "Courier 10 Pitch"; font-size: 12pt;">        </span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">|| !data.</span></font><span style="color: rgb(102, 14, 122); font-family: "Courier 10 Pitch"; font-size: 12pt;">asource </span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">|| !data.</span></font><span style="color: rgb(102, 14, 122); font-family: "Courier 10 Pitch"; font-size: 12pt;">aconvert </span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">|| !data.</span></font><span style="color: rgb(102, 14, 122); font-family: "Courier 10 Pitch"; font-size: 12pt;">amp3enc </span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">|| !data.</span></font><span style="color: rgb(102, 14, 122); font-family: "Courier 10 Pitch"; font-size: 12pt;">acapfilter </span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">|| !data.</span></font><span style="color: rgb(102, 14, 122); font-family: "Courier 10 Pitch"; font-size: 12pt;">asink </span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">|| !data.</span></font><span style="color: rgb(102, 14, 122); font-family: "Courier 10 Pitch"; font-size: 12pt;">aqueue</span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">) {<br>        g_printerr(</span></font><span style="color: rgb(0, 128, 0); font-family: "Courier 10 Pitch"; font-size: 12pt; font-weight: bold;">"Not all elements could be created.</span><span style="color: rgb(0, 0, 128); font-family: "Courier 10 Pitch"; font-size: 12pt; font-weight: bold;">\n</span><span style="color: rgb(0, 128, 0); font-family: "Courier 10 Pitch"; font-size: 12pt; font-weight: bold;">"</span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">);<br>        </span></font><span style="color: rgb(0, 0, 128); font-family: "Courier 10 Pitch"; font-size: 12pt; font-weight: bold;">return </span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">-</span></font><span style="color: rgb(0, 0, 255); font-family: "Courier 10 Pitch"; font-size: 12pt;">1</span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">;<br>    }<br><br><br>    gst_bin_add_many(</span></font><span style="color: rgb(31, 84, 46); font-family: "Courier 10 Pitch"; font-size: 12pt; font-weight: bold;">GST_BIN</span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">(data.</span></font><span style="color: rgb(102, 14, 122); font-family: "Courier 10 Pitch"; font-size: 12pt;">pipeline</span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">), data.</span></font><span style="color: rgb(102, 14, 122); font-family: "Courier 10 Pitch"; font-size: 12pt;">asource</span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">, data.</span></font><span style="color: rgb(102, 14, 122); font-family: "Courier 10 Pitch"; font-size: 12pt;">aqueue</span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">, data.</span></font><span style="color: rgb(102, 14, 122); font-family: "Courier 10 Pitch"; font-size: 12pt;">aconvert</span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">, data.</span></font><span style="color: rgb(102, 14, 122); font-family: "Courier 10 Pitch"; font-size: 12pt;">amp3enc</span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">, data.</span></font><span style="color: rgb(102, 14, 122); font-family: "Courier 10 Pitch"; font-size: 12pt;">acapfilter</span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">,<br>                     data.</span></font><span style="color: rgb(102, 14, 122); font-family: "Courier 10 Pitch"; font-size: 12pt;">ampegaudiopaser</span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">, data.</span></font><span style="color: rgb(102, 14, 122); font-family: "Courier 10 Pitch"; font-size: 12pt;">audio_enc_queue</span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">, </span></font><span style="color: rgb(31, 84, 46); font-family: "Courier 10 Pitch"; font-size: 12pt; font-weight: bold;">NULL</span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">);<br>    gst_bin_add_many(</span></font><span style="color: rgb(31, 84, 46); font-family: "Courier 10 Pitch"; font-size: 12pt; font-weight: bold;">GST_BIN</span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">(data.</span></font><span style="color: rgb(102, 14, 122); font-family: "Courier 10 Pitch"; font-size: 12pt;">pipeline</span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">), data.</span></font><span style="color: rgb(102, 14, 122); font-family: "Courier 10 Pitch"; font-size: 12pt;">vsource</span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">, data.</span></font><span style="color: rgb(102, 14, 122); font-family: "Courier 10 Pitch"; font-size: 12pt;">vqueue</span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">, data.</span></font><span style="color: rgb(102, 14, 122); font-family: "Courier 10 Pitch"; font-size: 12pt;">vconvert</span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">, data.</span></font><span style="color: rgb(102, 14, 122); font-family: "Courier 10 Pitch"; font-size: 12pt;">x264enc</span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">, data.</span></font><span style="color: rgb(102, 14, 122); font-family: "Courier 10 Pitch"; font-size: 12pt;">vcapsfilter</span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">,<br>                     data.</span></font><span style="color: rgb(102, 14, 122); font-family: "Courier 10 Pitch"; font-size: 12pt;">h264parse</span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">, data.</span></font><span style="color: rgb(102, 14, 122); font-family: "Courier 10 Pitch"; font-size: 12pt;">video_enc_queue</span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">, </span></font><span style="color: rgb(31, 84, 46); font-family: "Courier 10 Pitch"; font-size: 12pt; font-weight: bold;">NULL</span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">);<br>    gst_bin_add_many(</span></font><span style="color: rgb(31, 84, 46); font-family: "Courier 10 Pitch"; font-size: 12pt; font-weight: bold;">GST_BIN</span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">(data.</span></font><span style="color: rgb(102, 14, 122); font-family: "Courier 10 Pitch"; font-size: 12pt;">pipeline</span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">), data.</span></font><span style="color: rgb(102, 14, 122); font-family: "Courier 10 Pitch"; font-size: 12pt;">rtmpsink</span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">, data.</span></font><span style="color: rgb(102, 14, 122); font-family: "Courier 10 Pitch"; font-size: 12pt;">flvmuxer</span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">, </span></font><span style="color: rgb(31, 84, 46); font-family: "Courier 10 Pitch"; font-size: 12pt; font-weight: bold;">NULL</span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">);<br><br><br>    </span></font><span style="color: rgb(128, 128, 128); font-family: "Courier 10 Pitch"; font-size: 12pt; font-style: italic;">//"video/x-h264, width=(int)640, height=(int)480, framerate=(fraction)30/1, stream-format=avc, alignment=au, profile=main"<br></span><span style="color: rgb(128, 128, 128); font-family: "Courier 10 Pitch"; font-size: 12pt; font-style: italic;">    </span><span style="color: rgb(55, 31, 128); font-family: "Courier 10 Pitch"; font-size: 12pt;">GstCaps </span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">*filtercaps = gst_caps_new_simple(</span></font><span style="color: rgb(0, 128, 0); font-family: "Courier 10 Pitch"; font-size: 12pt; font-weight: bold;">"video/x-h264"</span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">,<br>                                              </span></font><span style="color: rgb(0, 128, 0); font-family: "Courier 10 Pitch"; font-size: 12pt; font-weight: bold;">"stream-format"</span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">, </span></font><span style="color: rgb(31, 84, 46); font-family: "Courier 10 Pitch"; font-size: 12pt; font-weight: bold;">G_TYPE_STRING</span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">, </span></font><span style="color: rgb(0, 128, 0); font-family: "Courier 10 Pitch"; font-size: 12pt; font-weight: bold;">"byte-stream"</span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">,</span></font><span style="color: rgb(128, 128, 128); font-family: "Courier 10 Pitch"; font-size: 12pt; font-style: italic;">//avc,byte-stream<br></span><span style="color: rgb(128, 128, 128); font-family: "Courier 10 Pitch"; font-size: 12pt; font-style: italic;">                                              </span><span style="color: rgb(0, 128, 0); font-family: "Courier 10 Pitch"; font-size: 12pt; font-weight: bold;">"width"</span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">, </span></font><span style="color: rgb(31, 84, 46); font-family: "Courier 10 Pitch"; font-size: 12pt; font-weight: bold;">G_TYPE_INT</span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">, </span></font><span style="color: rgb(0, 0, 255); font-family: "Courier 10 Pitch"; font-size: 12pt;">320</span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">,<br>                                              </span></font><span style="color: rgb(0, 128, 0); font-family: "Courier 10 Pitch"; font-size: 12pt; font-weight: bold;">"height"</span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">, </span></font><span style="color: rgb(31, 84, 46); font-family: "Courier 10 Pitch"; font-size: 12pt; font-weight: bold;">G_TYPE_INT</span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">, </span></font><span style="color: rgb(0, 0, 255); font-family: "Courier 10 Pitch"; font-size: 12pt;">240</span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">,<br>                                              </span></font><span style="color: rgb(0, 128, 0); font-family: "Courier 10 Pitch"; font-size: 12pt; font-weight: bold;">"framerate"</span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">, </span></font><span style="color: rgb(31, 84, 46); font-family: "Courier 10 Pitch"; font-size: 12pt; font-weight: bold;">GST_TYPE_FRACTION</span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">, </span></font><span style="color: rgb(0, 0, 255); font-family: "Courier 10 Pitch"; font-size: 12pt;">30</span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">, </span></font><span style="color: rgb(0, 0, 255); font-family: "Courier 10 Pitch"; font-size: 12pt;">1</span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">,<br>                                              </span></font><span style="color: rgb(0, 128, 0); font-family: "Courier 10 Pitch"; font-size: 12pt; font-weight: bold;">"alignment"</span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">, </span></font><span style="color: rgb(31, 84, 46); font-family: "Courier 10 Pitch"; font-size: 12pt; font-weight: bold;">G_TYPE_STRING</span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">, </span></font><span style="color: rgb(0, 128, 0); font-family: "Courier 10 Pitch"; font-size: 12pt; font-weight: bold;">"au"</span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">,<br>                                              </span></font><span style="color: rgb(0, 128, 0); font-family: "Courier 10 Pitch"; font-size: 12pt; font-weight: bold;">"profile"</span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">, </span></font><span style="color: rgb(31, 84, 46); font-family: "Courier 10 Pitch"; font-size: 12pt; font-weight: bold;">G_TYPE_STRING</span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">, </span></font><span style="color: rgb(0, 128, 0); font-family: "Courier 10 Pitch"; font-size: 12pt; font-weight: bold;">"main"</span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">,<br>                                              </span></font><span style="color: rgb(31, 84, 46); font-family: "Courier 10 Pitch"; font-size: 12pt; font-weight: bold;">NULL</span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">);<br><br>    g_object_set(</span></font><span style="color: rgb(31, 84, 46); font-family: "Courier 10 Pitch"; font-size: 12pt; font-weight: bold;">G_OBJECT </span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">(data.</span></font><span style="color: rgb(102, 14, 122); font-family: "Courier 10 Pitch"; font-size: 12pt;">vcapsfilter</span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">), </span></font><span style="color: rgb(0, 128, 0); font-family: "Courier 10 Pitch"; font-size: 12pt; font-weight: bold;">"caps"</span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">, filtercaps, </span></font><span style="color: rgb(31, 84, 46); font-family: "Courier 10 Pitch"; font-size: 12pt; font-weight: bold;">NULL</span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">);<br><br><br>    </span></font><span style="color: rgb(0, 0, 128); font-family: "Courier 10 Pitch"; font-size: 12pt; font-weight: bold;">bool </span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">v1 = gst_element_link(data.</span></font><span style="color: rgb(102, 14, 122); font-family: "Courier 10 Pitch"; font-size: 12pt;">vsource</span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">, data.</span></font><span style="color: rgb(102, 14, 122); font-family: "Courier 10 Pitch"; font-size: 12pt;">vconvert</span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">);<br><br>    </span></font><span style="color: rgb(0, 0, 128); font-family: "Courier 10 Pitch"; font-size: 12pt; font-weight: bold;">if </span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">(!gst_element_link(data.</span></font><span style="color: rgb(102, 14, 122); font-family: "Courier 10 Pitch"; font-size: 12pt;">vconvert</span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">, data.</span></font><span style="color: rgb(102, 14, 122); font-family: "Courier 10 Pitch"; font-size: 12pt;">vqueue</span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">)) {<br>        g_printerr(</span></font><span style="color: rgb(0, 128, 0); font-family: "Courier 10 Pitch"; font-size: 12pt; font-weight: bold;">"Elements could not be linked.</span><span style="color: rgb(0, 0, 128); font-family: "Courier 10 Pitch"; font-size: 12pt; font-weight: bold;">\n</span><span style="color: rgb(0, 128, 0); font-family: "Courier 10 Pitch"; font-size: 12pt; font-weight: bold;">"</span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">);<br>        gst_object_unref(data.</span></font><span style="color: rgb(102, 14, 122); font-family: "Courier 10 Pitch"; font-size: 12pt;">pipeline</span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">);<br>        </span></font><span style="color: rgb(0, 0, 128); font-family: "Courier 10 Pitch"; font-size: 12pt; font-weight: bold;">return </span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">-</span></font><span style="color: rgb(0, 0, 255); font-family: "Courier 10 Pitch"; font-size: 12pt;">1</span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">;<br>    }<br><br>    </span></font><span style="color: rgb(0, 0, 128); font-family: "Courier 10 Pitch"; font-size: 12pt; font-weight: bold;">if </span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">(!gst_element_link(data.</span></font><span style="color: rgb(102, 14, 122); font-family: "Courier 10 Pitch"; font-size: 12pt;">vqueue</span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">, data.</span></font><span style="color: rgb(102, 14, 122); font-family: "Courier 10 Pitch"; font-size: 12pt;">x264enc</span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">)) {<br>        g_printerr(</span></font><span style="color: rgb(0, 128, 0); font-family: "Courier 10 Pitch"; font-size: 12pt; font-weight: bold;">"Elements could not be linked.</span><span style="color: rgb(0, 0, 128); font-family: "Courier 10 Pitch"; font-size: 12pt; font-weight: bold;">\n</span><span style="color: rgb(0, 128, 0); font-family: "Courier 10 Pitch"; font-size: 12pt; font-weight: bold;">"</span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">);<br>        gst_object_unref(data.</span></font><span style="color: rgb(102, 14, 122); font-family: "Courier 10 Pitch"; font-size: 12pt;">pipeline</span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">);<br>        </span></font><span style="color: rgb(0, 0, 128); font-family: "Courier 10 Pitch"; font-size: 12pt; font-weight: bold;">return </span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">-</span></font><span style="color: rgb(0, 0, 255); font-family: "Courier 10 Pitch"; font-size: 12pt;">1</span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">;<br>    }<br><br><br>    </span></font><span style="color: rgb(0, 0, 128); font-family: "Courier 10 Pitch"; font-size: 12pt; font-weight: bold;">if </span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">(!gst_element_link(data.</span></font><span style="color: rgb(102, 14, 122); font-family: "Courier 10 Pitch"; font-size: 12pt;">x264enc</span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">, data.</span></font><span style="color: rgb(102, 14, 122); font-family: "Courier 10 Pitch"; font-size: 12pt;">vcapsfilter</span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">)) {<br>        g_printerr(</span></font><span style="color: rgb(0, 128, 0); font-family: "Courier 10 Pitch"; font-size: 12pt; font-weight: bold;">"Elements could not be linked.</span><span style="color: rgb(0, 0, 128); font-family: "Courier 10 Pitch"; font-size: 12pt; font-weight: bold;">\n</span><span style="color: rgb(0, 128, 0); font-family: "Courier 10 Pitch"; font-size: 12pt; font-weight: bold;">"</span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">);<br>        gst_object_unref(data.</span></font><span style="color: rgb(102, 14, 122); font-family: "Courier 10 Pitch"; font-size: 12pt;">pipeline</span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">);<br>        </span></font><span style="color: rgb(0, 0, 128); font-family: "Courier 10 Pitch"; font-size: 12pt; font-weight: bold;">return </span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">-</span></font><span style="color: rgb(0, 0, 255); font-family: "Courier 10 Pitch"; font-size: 12pt;">1</span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">;<br>    }<br><br>    </span></font><span style="color: rgb(0, 0, 128); font-family: "Courier 10 Pitch"; font-size: 12pt; font-weight: bold;">if </span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">(!gst_element_link(data.</span></font><span style="color: rgb(102, 14, 122); font-family: "Courier 10 Pitch"; font-size: 12pt;">vcapsfilter</span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">, data.</span></font><span style="color: rgb(102, 14, 122); font-family: "Courier 10 Pitch"; font-size: 12pt;">h264parse</span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">)) {<br>        g_printerr(</span></font><span style="color: rgb(0, 128, 0); font-family: "Courier 10 Pitch"; font-size: 12pt; font-weight: bold;">"Elements could not be linked.</span><span style="color: rgb(0, 0, 128); font-family: "Courier 10 Pitch"; font-size: 12pt; font-weight: bold;">\n</span><span style="color: rgb(0, 128, 0); font-family: "Courier 10 Pitch"; font-size: 12pt; font-weight: bold;">"</span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">);<br>        gst_object_unref(data.</span></font><span style="color: rgb(102, 14, 122); font-family: "Courier 10 Pitch"; font-size: 12pt;">pipeline</span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">);<br>        </span></font><span style="color: rgb(0, 0, 128); font-family: "Courier 10 Pitch"; font-size: 12pt; font-weight: bold;">return </span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">-</span></font><span style="color: rgb(0, 0, 255); font-family: "Courier 10 Pitch"; font-size: 12pt;">1</span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">;<br>    }<br><br>    </span></font><span style="color: rgb(0, 0, 128); font-family: "Courier 10 Pitch"; font-size: 12pt; font-weight: bold;">if </span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">(!gst_element_link(data.</span></font><span style="color: rgb(102, 14, 122); font-family: "Courier 10 Pitch"; font-size: 12pt;">h264parse</span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">, data.</span></font><span style="color: rgb(102, 14, 122); font-family: "Courier 10 Pitch"; font-size: 12pt;">video_enc_queue</span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">)) {<br>        g_printerr(</span></font><span style="color: rgb(0, 128, 0); font-family: "Courier 10 Pitch"; font-size: 12pt; font-weight: bold;">"Elements could not be linked.</span><span style="color: rgb(0, 0, 128); font-family: "Courier 10 Pitch"; font-size: 12pt; font-weight: bold;">\n</span><span style="color: rgb(0, 128, 0); font-family: "Courier 10 Pitch"; font-size: 12pt; font-weight: bold;">"</span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">);<br>        gst_object_unref(data.</span></font><span style="color: rgb(102, 14, 122); font-family: "Courier 10 Pitch"; font-size: 12pt;">pipeline</span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">);<br>        </span></font><span style="color: rgb(0, 0, 128); font-family: "Courier 10 Pitch"; font-size: 12pt; font-weight: bold;">return </span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">-</span></font><span style="color: rgb(0, 0, 255); font-family: "Courier 10 Pitch"; font-size: 12pt;">1</span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">;<br>    }<br><br><br></span></font><span style="color: rgb(128, 128, 128); font-family: "Courier 10 Pitch"; font-size: 12pt; font-style: italic;">//"audio/mpeg, mpegversion=1, layer=3, rate=(int)11025, channels=(int)2"<br></span><span style="color: rgb(128, 128, 128); font-family: "Courier 10 Pitch"; font-size: 12pt; font-style: italic;">    </span><span style="color: rgb(55, 31, 128); font-family: "Courier 10 Pitch"; font-size: 12pt;">GstCaps </span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">*fcaps = gst_caps_new_simple(</span></font><span style="color: rgb(0, 128, 0); font-family: "Courier 10 Pitch"; font-size: 12pt; font-weight: bold;">"audio/mpeg"</span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">,<br>                                         </span></font><span style="color: rgb(0, 128, 0); font-family: "Courier 10 Pitch"; font-size: 12pt; font-weight: bold;">"stream-format"</span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">, </span></font><span style="color: rgb(31, 84, 46); font-family: "Courier 10 Pitch"; font-size: 12pt; font-weight: bold;">G_TYPE_STRING</span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">, </span></font><span style="color: rgb(0, 128, 0); font-family: "Courier 10 Pitch"; font-size: 12pt; font-weight: bold;">"byte-stream"</span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">,<br>                                         </span></font><span style="color: rgb(0, 128, 0); font-family: "Courier 10 Pitch"; font-size: 12pt; font-weight: bold;">"mpegversion"</span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">, </span></font><span style="color: rgb(31, 84, 46); font-family: "Courier 10 Pitch"; font-size: 12pt; font-weight: bold;">G_TYPE_INT</span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">, </span></font><span style="color: rgb(0, 0, 255); font-family: "Courier 10 Pitch"; font-size: 12pt;">1</span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">,<br>                                         </span></font><span style="color: rgb(0, 128, 0); font-family: "Courier 10 Pitch"; font-size: 12pt; font-weight: bold;">"layer"</span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">, </span></font><span style="color: rgb(31, 84, 46); font-family: "Courier 10 Pitch"; font-size: 12pt; font-weight: bold;">G_TYPE_INT</span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">, </span></font><span style="color: rgb(0, 0, 255); font-family: "Courier 10 Pitch"; font-size: 12pt;">3</span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">,<br>                                         </span></font><span style="color: rgb(0, 128, 0); font-family: "Courier 10 Pitch"; font-size: 12pt; font-weight: bold;">"rate"</span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">, </span></font><span style="color: rgb(31, 84, 46); font-family: "Courier 10 Pitch"; font-size: 12pt; font-weight: bold;">G_TYPE_INT</span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">, </span></font><span style="color: rgb(0, 0, 255); font-family: "Courier 10 Pitch"; font-size: 12pt;">11025</span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">,</span></font><span style="color: rgb(128, 128, 128); font-family: "Courier 10 Pitch"; font-size: 12pt; font-style: italic;">//44100<br></span><span style="color: rgb(128, 128, 128); font-family: "Courier 10 Pitch"; font-size: 12pt; font-style: italic;">                                         </span><span style="color: rgb(0, 128, 0); font-family: "Courier 10 Pitch"; font-size: 12pt; font-weight: bold;">"channels"</span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">, </span></font><span style="color: rgb(31, 84, 46); font-family: "Courier 10 Pitch"; font-size: 12pt; font-weight: bold;">G_TYPE_INT</span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">, </span></font><span style="color: rgb(0, 0, 255); font-family: "Courier 10 Pitch"; font-size: 12pt;">2</span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">,<br>                                         </span></font><span style="color: rgb(31, 84, 46); font-family: "Courier 10 Pitch"; font-size: 12pt; font-weight: bold;">NULL</span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">);<br><br>    g_object_set(</span></font><span style="color: rgb(31, 84, 46); font-family: "Courier 10 Pitch"; font-size: 12pt; font-weight: bold;">G_OBJECT</span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">(data.</span></font><span style="color: rgb(102, 14, 122); font-family: "Courier 10 Pitch"; font-size: 12pt;">acapfilter</span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">), </span></font><span style="color: rgb(0, 128, 0); font-family: "Courier 10 Pitch"; font-size: 12pt; font-weight: bold;">"caps"</span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">, fcaps, </span></font><span style="color: rgb(31, 84, 46); font-family: "Courier 10 Pitch"; font-size: 12pt; font-weight: bold;">NULL</span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">);<br>    </span></font><span style="color: rgb(128, 128, 128); font-family: "Courier 10 Pitch"; font-size: 12pt; font-style: italic;">//g_object_set(G_OBJECT(data.asink), "location", "/home/greg/pre-push1.mp3", NULL);<br></span><span style="color: rgb(128, 128, 128); font-family: "Courier 10 Pitch"; font-size: 12pt; font-style: italic;"><br></span><span style="color: rgb(128, 128, 128); font-family: "Courier 10 Pitch"; font-size: 12pt; font-style: italic;">    </span><span style="color: rgb(0, 0, 128); font-family: "Courier 10 Pitch"; font-size: 12pt; font-weight: bold;">bool </span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">a0 = gst_element_link(data.</span></font><span style="color: rgb(102, 14, 122); font-family: "Courier 10 Pitch"; font-size: 12pt;">asource</span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">, data.</span></font><span style="color: rgb(102, 14, 122); font-family: "Courier 10 Pitch"; font-size: 12pt;">aqueue</span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">);<br>    </span></font><span style="color: rgb(0, 0, 128); font-family: "Courier 10 Pitch"; font-size: 12pt; font-weight: bold;">bool </span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">a1 = gst_element_link(data.</span></font><span style="color: rgb(102, 14, 122); font-family: "Courier 10 Pitch"; font-size: 12pt;">aqueue</span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">, data.</span></font><span style="color: rgb(102, 14, 122); font-family: "Courier 10 Pitch"; font-size: 12pt;">aconvert</span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">);<br>    </span></font><span style="color: rgb(0, 0, 128); font-family: "Courier 10 Pitch"; font-size: 12pt; font-weight: bold;">bool </span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">a2 = gst_element_link(data.</span></font><span style="color: rgb(102, 14, 122); font-family: "Courier 10 Pitch"; font-size: 12pt;">aconvert</span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">, data.</span></font><span style="color: rgb(102, 14, 122); font-family: "Courier 10 Pitch"; font-size: 12pt;">amp3enc</span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">);<br>    </span></font><span style="color: rgb(0, 0, 128); font-family: "Courier 10 Pitch"; font-size: 12pt; font-weight: bold;">bool </span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">a3 = gst_element_link(data.</span></font><span style="color: rgb(102, 14, 122); font-family: "Courier 10 Pitch"; font-size: 12pt;">amp3enc</span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">, data.</span></font><span style="color: rgb(102, 14, 122); font-family: "Courier 10 Pitch"; font-size: 12pt;">acapfilter</span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">);<br>    </span></font><span style="color: rgb(0, 0, 128); font-family: "Courier 10 Pitch"; font-size: 12pt; font-weight: bold;">bool </span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">aa = gst_element_link(data.</span></font><span style="color: rgb(102, 14, 122); font-family: "Courier 10 Pitch"; font-size: 12pt;">acapfilter</span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">, data.</span></font><span style="color: rgb(102, 14, 122); font-family: "Courier 10 Pitch"; font-size: 12pt;">ampegaudiopaser</span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">);<br>    </span></font><span style="color: rgb(0, 0, 128); font-family: "Courier 10 Pitch"; font-size: 12pt; font-weight: bold;">bool </span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">xz = gst_element_link(data.</span></font><span style="color: rgb(102, 14, 122); font-family: "Courier 10 Pitch"; font-size: 12pt;">ampegaudiopaser</span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">, data.</span></font><span style="color: rgb(102, 14, 122); font-family: "Courier 10 Pitch"; font-size: 12pt;">audio_enc_queue</span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">);<br><br>    </span></font><span style="color: rgb(0, 0, 128); font-family: "Courier 10 Pitch"; font-size: 12pt; font-weight: bold;">bool </span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">c1 = gst_element_link(data.</span></font><span style="color: rgb(102, 14, 122); font-family: "Courier 10 Pitch"; font-size: 12pt;">audio_enc_queue</span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">, data.</span></font><span style="color: rgb(102, 14, 122); font-family: "Courier 10 Pitch"; font-size: 12pt;">flvmuxer</span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">);<br>    </span></font><span style="color: rgb(0, 0, 128); font-family: "Courier 10 Pitch"; font-size: 12pt; font-weight: bold;">bool </span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">c2 = gst_element_link(data.</span></font><span style="color: rgb(102, 14, 122); font-family: "Courier 10 Pitch"; font-size: 12pt;">video_enc_queue</span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">, data.</span></font><span style="color: rgb(102, 14, 122); font-family: "Courier 10 Pitch"; font-size: 12pt;">flvmuxer</span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">);<br>    </span></font><span style="color: rgb(0, 0, 128); font-family: "Courier 10 Pitch"; font-size: 12pt; font-weight: bold;">bool </span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">c3 = gst_element_link(data.</span></font><span style="color: rgb(102, 14, 122); font-family: "Courier 10 Pitch"; font-size: 12pt;">flvmuxer</span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">, data.</span></font><span style="color: rgb(102, 14, 122); font-family: "Courier 10 Pitch"; font-size: 12pt;">rtmpsink</span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">);<br><br>    </span></font><span style="color: rgb(128, 128, 128); font-family: "Courier 10 Pitch"; font-size: 12pt; font-style: italic;">/* Set  device=/dev/video0 */<br></span><span style="color: rgb(128, 128, 128); font-family: "Courier 10 Pitch"; font-size: 12pt; font-style: italic;">    </span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">g_object_set(data.</span></font><span style="color: rgb(102, 14, 122); font-family: "Courier 10 Pitch"; font-size: 12pt;">vsource</span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">, </span></font><span style="color: rgb(0, 128, 0); font-family: "Courier 10 Pitch"; font-size: 12pt; font-weight: bold;">"device"</span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">, </span></font><span style="color: rgb(0, 128, 0); font-family: "Courier 10 Pitch"; font-size: 12pt; font-weight: bold;">"/dev/video0"</span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">, </span></font><span style="color: rgb(31, 84, 46); font-family: "Courier 10 Pitch"; font-size: 12pt; font-weight: bold;">NULL</span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">);<br><br></span></font><span style="color: rgb(128, 128, 128); font-family: "Courier 10 Pitch"; font-size: 12pt; font-style: italic;">//    g_object_set(G_OBJECT(data.amp3enc) , "target"  , 1       , NULL) ;<br></span><span style="color: rgb(128, 128, 128); font-family: "Courier 10 Pitch"; font-size: 12pt; font-style: italic;">//    g_object_set(G_OBJECT(data.amp3enc) , "cbr"     , true    , NULL) ; // CBR<br></span><span style="color: rgb(128, 128, 128); font-family: "Courier 10 Pitch"; font-size: 12pt; font-style: italic;">//    g_object_set(G_OBJECT(data.amp3enc) , "bitrate" , 64 , NULL) ; // CBR<br></span><span style="color: rgb(128, 128, 128); font-family: "Courier 10 Pitch"; font-size: 12pt; font-style: italic;"><br></span><span style="color: rgb(128, 128, 128); font-family: "Courier 10 Pitch"; font-size: 12pt; font-style: italic;"><br></span><span style="color: rgb(128, 128, 128); font-family: "Courier 10 Pitch"; font-size: 12pt; font-style: italic;">    </span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">ret = gst_element_set_state(data.</span></font><span style="color: rgb(102, 14, 122); font-family: "Courier 10 Pitch"; font-size: 12pt;">pipeline</span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">, </span></font><span style="color: rgb(102, 14, 122); font-family: "Courier 10 Pitch"; font-size: 12pt; font-weight: bold; font-style: italic;">GST_STATE_PLAYING</span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">);<br>    </span></font><span style="color: rgb(0, 0, 128); font-family: "Courier 10 Pitch"; font-size: 12pt; font-weight: bold;">if </span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">(ret == </span></font><span style="color: rgb(102, 14, 122); font-family: "Courier 10 Pitch"; font-size: 12pt; font-weight: bold; font-style: italic;">GST_STATE_CHANGE_FAILURE</span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">) {<br>        g_printerr(</span></font><span style="color: rgb(0, 128, 0); font-family: "Courier 10 Pitch"; font-size: 12pt; font-weight: bold;">"Unable to set the pipeline to the playing state.</span><span style="color: rgb(0, 0, 128); font-family: "Courier 10 Pitch"; font-size: 12pt; font-weight: bold;">\n</span><span style="color: rgb(0, 128, 0); font-family: "Courier 10 Pitch"; font-size: 12pt; font-weight: bold;">"</span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">);<br>        gst_object_unref(data.</span></font><span style="color: rgb(102, 14, 122); font-family: "Courier 10 Pitch"; font-size: 12pt;">pipeline</span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">);<br>        </span></font><span style="color: rgb(0, 0, 128); font-family: "Courier 10 Pitch"; font-size: 12pt; font-weight: bold;">return </span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">-</span></font><span style="color: rgb(0, 0, 255); font-family: "Courier 10 Pitch"; font-size: 12pt;">1</span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">;<br>    }<br><br>    </span></font><span style="color: rgb(128, 128, 128); font-family: "Courier 10 Pitch"; font-size: 12pt; font-style: italic;">/* Listen to the bus */<br></span><span style="color: rgb(128, 128, 128); font-family: "Courier 10 Pitch"; font-size: 12pt; font-style: italic;">    </span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">bus = gst_element_get_bus(data.</span></font><span style="color: rgb(102, 14, 122); font-family: "Courier 10 Pitch"; font-size: 12pt;">pipeline</span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">);<br>    </span></font><span style="color: rgb(0, 0, 128); font-family: "Courier 10 Pitch"; font-size: 12pt; font-weight: bold;">do </span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">{<br>        msg = gst_bus_timed_pop_filtered(bus, </span></font><span style="color: rgb(31, 84, 46); font-family: "Courier 10 Pitch"; font-size: 12pt; font-weight: bold;">GST_CLOCK_TIME_NONE</span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">,<br>                                         (</span></font><span style="color: rgb(55, 31, 128); font-family: "Courier 10 Pitch"; font-size: 12pt;">GstMessageType</span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">) (</span></font><span style="color: rgb(102, 14, 122); font-family: "Courier 10 Pitch"; font-size: 12pt; font-weight: bold; font-style: italic;">GST_MESSAGE_STATE_CHANGED </span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">| </span></font><span style="color: rgb(102, 14, 122); font-family: "Courier 10 Pitch"; font-size: 12pt; font-weight: bold; font-style: italic;">GST_MESSAGE_ERROR </span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">|<br>                                                           </span></font><span style="color: rgb(102, 14, 122); font-family: "Courier 10 Pitch"; font-size: 12pt; font-weight: bold; font-style: italic;">GST_MESSAGE_EOS</span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">));<br><br>        </span></font><span style="color: rgb(128, 128, 128); font-family: "Courier 10 Pitch"; font-size: 12pt; font-style: italic;">/* Parse message */<br></span><span style="color: rgb(128, 128, 128); font-family: "Courier 10 Pitch"; font-size: 12pt; font-style: italic;">        </span><span style="color: rgb(0, 0, 128); font-family: "Courier 10 Pitch"; font-size: 12pt; font-weight: bold;">if </span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">(msg != </span></font><span style="color: rgb(31, 84, 46); font-family: "Courier 10 Pitch"; font-size: 12pt; font-weight: bold;">NULL</span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">) {<br>            </span></font><span style="color: rgb(55, 31, 128); font-family: "Courier 10 Pitch"; font-size: 12pt;">GError </span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">*err;<br>            </span></font><span style="color: rgb(55, 31, 128); font-family: "Courier 10 Pitch"; font-size: 12pt;">gchar </span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">*debug_info;<br><br>            </span></font><span style="color: rgb(0, 0, 128); font-family: "Courier 10 Pitch"; font-size: 12pt; font-weight: bold;">switch </span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">(</span></font><span style="color: rgb(31, 84, 46); font-family: "Courier 10 Pitch"; font-size: 12pt; font-weight: bold;">GST_MESSAGE_TYPE </span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">(msg)) {<br>                </span></font><span style="color: rgb(0, 0, 128); font-family: "Courier 10 Pitch"; font-size: 12pt; font-weight: bold;">case </span><span style="color: rgb(102, 14, 122); font-family: "Courier 10 Pitch"; font-size: 12pt; font-weight: bold; font-style: italic;">GST_MESSAGE_ERROR</span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">:<br>                    gst_message_parse_error(msg, &err, &debug_info);<br>                    g_printerr(</span></font><span style="color: rgb(0, 128, 0); font-family: "Courier 10 Pitch"; font-size: 12pt; font-weight: bold;">"Error received from element </span><span style="color: rgb(0, 0, 128); font-family: "Courier 10 Pitch"; font-size: 12pt; font-weight: bold;">%s</span><span style="color: rgb(0, 128, 0); font-family: "Courier 10 Pitch"; font-size: 12pt; font-weight: bold;">: </span><span style="color: rgb(0, 0, 128); font-family: "Courier 10 Pitch"; font-size: 12pt; font-weight: bold;">%s\n</span><span style="color: rgb(0, 128, 0); font-family: "Courier 10 Pitch"; font-size: 12pt; font-weight: bold;">"</span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">, </span></font><span style="color: rgb(31, 84, 46); font-family: "Courier 10 Pitch"; font-size: 12pt; font-weight: bold;">GST_OBJECT_NAME </span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">(msg-></span></font><span style="color: rgb(102, 14, 122); font-family: "Courier 10 Pitch"; font-size: 12pt;">src</span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">), err-></span></font><span style="color: rgb(102, 14, 122); font-family: "Courier 10 Pitch"; font-size: 12pt;">message</span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">);<br>                    g_printerr(</span></font><span style="color: rgb(0, 128, 0); font-family: "Courier 10 Pitch"; font-size: 12pt; font-weight: bold;">"Debugging information: </span><span style="color: rgb(0, 0, 128); font-family: "Courier 10 Pitch"; font-size: 12pt; font-weight: bold;">%s\n</span><span style="color: rgb(0, 128, 0); font-family: "Courier 10 Pitch"; font-size: 12pt; font-weight: bold;">"</span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">, debug_info ? debug_info : </span></font><span style="color: rgb(0, 128, 0); font-family: "Courier 10 Pitch"; font-size: 12pt; font-weight: bold;">"none"</span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">);<br>                    g_clear_error(&err);<br>                    g_free(debug_info);<br>                    terminate = </span></font><span style="color: rgb(31, 84, 46); font-family: "Courier 10 Pitch"; font-size: 12pt; font-weight: bold;">TRUE</span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">;<br>                    </span></font><span style="color: rgb(0, 0, 128); font-family: "Courier 10 Pitch"; font-size: 12pt; font-weight: bold;">break</span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">;<br>                </span></font><span style="color: rgb(0, 0, 128); font-family: "Courier 10 Pitch"; font-size: 12pt; font-weight: bold;">case </span><span style="color: rgb(102, 14, 122); font-family: "Courier 10 Pitch"; font-size: 12pt; font-weight: bold; font-style: italic;">GST_MESSAGE_EOS</span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">:<br>                    g_print(</span></font><span style="color: rgb(0, 128, 0); font-family: "Courier 10 Pitch"; font-size: 12pt; font-weight: bold;">"End-Of-Stream reached.</span><span style="color: rgb(0, 0, 128); font-family: "Courier 10 Pitch"; font-size: 12pt; font-weight: bold;">\n</span><span style="color: rgb(0, 128, 0); font-family: "Courier 10 Pitch"; font-size: 12pt; font-weight: bold;">"</span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">);<br>                    terminate = </span></font><span style="color: rgb(31, 84, 46); font-family: "Courier 10 Pitch"; font-size: 12pt; font-weight: bold;">TRUE</span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">;<br>                    </span></font><span style="color: rgb(0, 0, 128); font-family: "Courier 10 Pitch"; font-size: 12pt; font-weight: bold;">break</span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">;<br>                </span></font><span style="color: rgb(0, 0, 128); font-family: "Courier 10 Pitch"; font-size: 12pt; font-weight: bold;">case </span><span style="color: rgb(102, 14, 122); font-family: "Courier 10 Pitch"; font-size: 12pt; font-weight: bold; font-style: italic;">GST_MESSAGE_STATE_CHANGED</span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">:<br>                    </span></font><span style="color: rgb(128, 128, 128); font-family: "Courier 10 Pitch"; font-size: 12pt; font-style: italic;">/* We are only interested in state-changed messages from the pipeline */<br></span><span style="color: rgb(128, 128, 128); font-family: "Courier 10 Pitch"; font-size: 12pt; font-style: italic;">                    </span><span style="color: rgb(0, 0, 128); font-family: "Courier 10 Pitch"; font-size: 12pt; font-weight: bold;">if </span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">(</span></font><span style="color: rgb(31, 84, 46); font-family: "Courier 10 Pitch"; font-size: 12pt; font-weight: bold;">GST_MESSAGE_SRC </span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">(msg) == </span></font><span style="color: rgb(31, 84, 46); font-family: "Courier 10 Pitch"; font-size: 12pt; font-weight: bold;">GST_OBJECT </span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">(data.</span></font><span style="color: rgb(102, 14, 122); font-family: "Courier 10 Pitch"; font-size: 12pt;">pipeline</span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">)) {<br>                        </span></font><span style="color: rgb(55, 31, 128); font-family: "Courier 10 Pitch"; font-size: 12pt;">GstState </span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">old_state, new_state, pending_state;<br>                        gst_message_parse_state_changed(msg, &old_state, &new_state, &pending_state);<br>                        g_print(</span></font><span style="color: rgb(0, 128, 0); font-family: "Courier 10 Pitch"; font-size: 12pt; font-weight: bold;">"Pipeline state changed from </span><span style="color: rgb(0, 0, 128); font-family: "Courier 10 Pitch"; font-size: 12pt; font-weight: bold;">%s</span><span style="color: rgb(0, 128, 0); font-family: "Courier 10 Pitch"; font-size: 12pt; font-weight: bold;"> to </span><span style="color: rgb(0, 0, 128); font-family: "Courier 10 Pitch"; font-size: 12pt; font-weight: bold;">%s</span><span style="color: rgb(0, 128, 0); font-family: "Courier 10 Pitch"; font-size: 12pt; font-weight: bold;">:</span><span style="color: rgb(0, 0, 128); font-family: "Courier 10 Pitch"; font-size: 12pt; font-weight: bold;">\n</span><span style="color: rgb(0, 128, 0); font-family: "Courier 10 Pitch"; font-size: 12pt; font-weight: bold;">"</span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">,<br>                                gst_element_state_get_name(old_state), gst_element_state_get_name(new_state));<br>                    }<br>                    </span></font><span style="color: rgb(0, 0, 128); font-family: "Courier 10 Pitch"; font-size: 12pt; font-weight: bold;">break</span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">;<br>                </span></font><span style="color: rgb(0, 0, 128); font-family: "Courier 10 Pitch"; font-size: 12pt; font-weight: bold;">default</span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">:<br>                    </span></font><span style="color: rgb(128, 128, 128); font-family: "Courier 10 Pitch"; font-size: 12pt; font-style: italic;">/* We should not reach here */<br></span><span style="color: rgb(128, 128, 128); font-family: "Courier 10 Pitch"; font-size: 12pt; font-style: italic;">                    </span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">g_printerr(</span></font><span style="color: rgb(0, 128, 0); font-family: "Courier 10 Pitch"; font-size: 12pt; font-weight: bold;">"Unexpected message received.</span><span style="color: rgb(0, 0, 128); font-family: "Courier 10 Pitch"; font-size: 12pt; font-weight: bold;">\n</span><span style="color: rgb(0, 128, 0); font-family: "Courier 10 Pitch"; font-size: 12pt; font-weight: bold;">"</span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">);<br>                    </span></font><span style="color: rgb(0, 0, 128); font-family: "Courier 10 Pitch"; font-size: 12pt; font-weight: bold;">break</span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">;<br>            }<br>            gst_message_unref(msg);<br>        }<br>    } </span></font><span style="color: rgb(0, 0, 128); font-family: "Courier 10 Pitch"; font-size: 12pt; font-weight: bold;">while </span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">(!terminate);<br><br>    </span></font><span style="color: rgb(128, 128, 128); font-family: "Courier 10 Pitch"; font-size: 12pt; font-style: italic;">/* Free resources */<br></span><span style="color: rgb(128, 128, 128); font-family: "Courier 10 Pitch"; font-size: 12pt; font-style: italic;">    </span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">gst_object_unref(bus);<br>    gst_element_set_state(data.</span></font><span style="color: rgb(102, 14, 122); font-family: "Courier 10 Pitch"; font-size: 12pt;">pipeline</span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">, </span></font><span style="color: rgb(102, 14, 122); font-family: "Courier 10 Pitch"; font-size: 12pt; font-weight: bold; font-style: italic;">GST_STATE_NULL</span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">);<br>    gst_object_unref(data.</span></font><span style="color: rgb(102, 14, 122); font-family: "Courier 10 Pitch"; font-size: 12pt;">pipeline</span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">);<br>    </span></font><span style="color: rgb(0, 0, 128); font-family: "Courier 10 Pitch"; font-size: 12pt; font-weight: bold;">return </span><span style="color: rgb(0, 0, 255); font-family: "Courier 10 Pitch"; font-size: 12pt;">0</span><font face="Courier 10 Pitch"><span style="font-size: 12pt;">;<br>}</span></font></pre></div></div><br><br><span title="neteasefooter"><div id="netease_mail_footer"><div style="border-top:#CCC 1px solid;padding:10px 5px;font-size:16px;color:#777;line-height:22px"><a href="http://you.163.com/item/detail?id=1092001&from=web_gg_mail_jiaobiao_7" target="_blank" style="color:#3366FF;text-decoration:none">【网易自营|30天无忧退货】爱上书写:施华洛世奇制造商星空原色水晶笔,限时仅29元>> </a>
    </div></div></span></div></div><br><br><span title="neteasefooter"><p> </p></span></div></div><br><br><span title="neteasefooter"><p> </p></span>