problem with filesink

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

problem with filesink

Edward-47
Pals,
A small problem blockes me these days.
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.
Thanks a lot for your helps.
 
BRS
Edward

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: problem with filesink

Florent THIERY-2
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

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: problem with filesink

Edward-47


On 2/29/08, Florent <[hidden email]> 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


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel