<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Hi </div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
I have some queries as with regards to how to stop the GstSplitMuxSink</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<ol>
<li><span>Stopping it. I have split the files to be saved (each of 5 mins). The result is ok for the video files fulfilling the 5 mins interval but the last video (which is less than 5 mins) has size of 0 bytes. Nothing is being saved to it.</span></li></ol>
<div><span>           I read up the forum to find that I would need to send eos event to the splitmuxsink when I want to stop it.                        Somehow or rather I could not get it right. Would like some pointers on how to stop (any additional stuff
 needs to            be done</span></div>
<div><br>
</div>
<div>          My source code(or pseudo code) below</div>
<div><br>
</div>
<div>         GstPadProbeReturn
<div>         eos_cb(GstPad *pad, GstPadProbeInfo * info, gpointer user_data)</div>
<div>        {</div>
<div>               // blocking codes</div>
<div>               while(GST_EVENT_TYPE (GST_PAD_PROBE_INFO_DATA (info)) != GST_EVENT_EOS)<br>
</div>
<div>                         sleep(1);</div>
<div>               g_print("thread live: pad received eos \n");</div>
<div><br>
</div>
<div>               return GST_PAD_PROBE_REMOVE;</div>
<span>         }</span><br>
</div>
<div><br>
</div>
<div>        int main()</div>
<div>        {</div>
<div><br>
</div>
<div>         /*******************   do something   ************************/</div>
<div><br>
</div>
<div>         case RECORD_STOP:<br>
                   GstPad* splitMuxPad = gst_element_get_static_pad(records->fsink, "video");
<div>                  if (!splitMuxPad && !(records->fsink))</div>
<div>                  {</div>
<div>                            g_critical(" Could not obtain the splitmux and records->fsink sinkpad!!\n"); // <---- fails here!</div>
<div>                           exit(-1);</div>
<div>                   }</div>
<div><br>
</div>
<div>                  gst_pad_add_probe(splitMuxPad,</div>
<div>                                                      (GstPadProbeType)(GST_PAD_PROBE_TYPE_EVENT_DOWNSTREAM),</div>
<div>                                                      eos_cb,</div>
<div>                                                       NULL,</div>
<div>                                                      NULL);</div>
<div><br>
</div>
<div>                   <b> // should i send eos event to splitmuxsink or the pad?</b></div>
<div>                     gst_pad_send_event(splitMuxPad, gst_event_new_eos());</div>
<div><br>
</div>
                     gst_object_unref(splitMuxPad);<br>
</div>
<div><br>
</div>
<div>                   /****</div>
<div>                          Proceed on detaching other parts of the record bin</div>
<div>                   *****/</div>
<div><br>
</div>
<div>             }</div>
<div><br>
</div>
<div>       2. To start another cycle of recording and stop recording. The "working" method seem to be to destroy or unreference the Splitmuxsink and recreate splitmuxsink upon starting the recording. Is this true? Find it rather strange.</div>
<div><br>
</div>
<div>Thanks </div>
<div><br>
</div>
</div>
</body>
</html>