[gst-devel] problem with filesink

Edward littleblueb at gmail.com
Fri Feb 29 11:08:24 CET 2008


On 2/29/08, Florent <fthiery at gmail.com> wrote:
>
> Hi
>
> > I want to find out an element which works like filesink but need to
> change
> > file location (file name) frequently. I tried filesink firstly, but it
> can only setlocation before the specified
> > file opened and can not setlocation to it after it got EOS.
>
> AFAIK, this is a known limitation. The only workaround i could found
> sofar is blocking the pads of the filesink, switching it to a
> fakesink, creating a new filesink with new location and linking it
> back. However, this worked only on simple pipelines (videotestsrc,
> single video pipeline), not complex ones (muxed ones).
>
> I'd be glad to know more as well. What's the proper way to emit an
> arbitrary EOS signal ?
>
> FLo
>

What my solution is:

gst_element_set_state (gstFileSink, GST_STATE_NULL);
if(gst_element_get_state(gstFileSink, NULL, NULL, -1) == GST_STATE_NULL)
{
                       g_object_set( G_OBJECT(gstFileSink), "location",
pcURI, NULL);

                        pFileSinkPad =  gst_element_get_pad (gstFileSink,
"sink");
                        gstBaseSink = GST_BASE_SINK_CAST(gstFileSink);
                        baseSinkPriv = (_MMCamcorderBaseSinkPrivCast*
)gstBaseSink->priv;
                        baseSinkPriv->m_ReceivedEOS = FALSE;
                        gst_pad_set_active(pFileSinkPad, TRUE);
                        gst_element_set_state (gstFileSink,
GST_STATE_PLAYING);

}

Here I cast the filesink to basesink to access its member. Really, it is
very bad solution I think.

-- 
Best Regards
Edward
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20080229/4a4d6a23/attachment.htm>


More information about the gstreamer-devel mailing list