<br><br>
<div><span class="gmail_quote">On 2/29/08, <b class="gmail_sendername">Florent</b> <<a href="mailto:fthiery@gmail.com">fthiery@gmail.com</a>> wrote:</span>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">Hi<br><br>> I want to find out an element which works like filesink but need to change<br>> file location (file name) frequently. I tried filesink firstly, but it can only setlocation before the specified<br>
> file opened and can not setlocation to it after it got EOS.<br><br>AFAIK, this is a known limitation. The only workaround i could found<br>sofar is blocking the pads of the filesink, switching it to a<br>fakesink, creating a new filesink with new location and linking it<br>
back. However, this worked only on simple pipelines (videotestsrc,<br>single video pipeline), not complex ones (muxed ones).<br><br>I'd be glad to know more as well. What's the proper way to emit an<br>arbitrary EOS signal ?<br>
<br>FLo<br></blockquote></div>
<div> </div>
<div>What my solution is:</div>
<div>
<p>gst_element_set_state (gstFileSink, GST_STATE_NULL);<br>if(gst_element_get_state(gstFileSink, NULL, NULL, -1) == GST_STATE_NULL)<br>{<br> g_object_set( G_OBJECT(gstFileSink), "location", pcURI, NULL);</p>
<p> pFileSinkPad = gst_element_get_pad (gstFileSink, "sink");<br> gstBaseSink = GST_BASE_SINK_CAST(gstFileSink);<br> baseSinkPriv = (_MMCamcorderBaseSinkPrivCast* )gstBaseSink->priv;<br>
baseSinkPriv->m_ReceivedEOS = FALSE;<br> gst_pad_set_active(pFileSinkPad, TRUE);<br> gst_element_set_state (gstFileSink, GST_STATE_PLAYING);</p>
<p>}</p>
<p>Here I cast the filesink to basesink to access its member. Really, it is very bad solution I think.<br clear="all"><br>-- <br>Best Regards<br>Edward </p></div>