Trouble removing a sink from a playing pipeline

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

Trouble removing a sink from a playing pipeline

Tal Liron
(Resending this because the mailing list seems to hate HTML)


I'm still very stuck with this problem!


I have an audio pipeline with a tee (and each branch has its own queue).
I am trying to remove one branch (a bin) while keeping the pipeline playing.


In order to entirely remove the branch, I have to set its state to NULL.
But, when the sink specifically changes to NULL, the pipeline stops
playing! It is still in PLAYING state, but it just stops at the timeline.


I'm in a weird chicken-and-egg problem. On the one hand, I want to
remove the sink, but on the other hand, until I remove it, it's still
part of the pipeline.


Things that I've tried and haven't helped:


1) Using a valve before the sink.

2) Blocking the pad before the sink.

3) Calling unparent() on the sink. (Causes all kinds of failures.)


I have two questions that might help direct an answer:


1) Is it possible to remove an element without setting its state to NULL?

2) Is it possible to change the default behavior of Bin so that it
doesn't respond to state changes of its children?

_______________________________________________
gstreamer-devel mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Trouble removing a sink from a playing pipeline

Stefan Sauer
On 10/02/2011 02:15 AM, Tal Liron wrote:

> (Resending this because the mailing list seems to hate HTML)
>
>
> I'm still very stuck with this problem!
>
>
> I have an audio pipeline with a tee (and each branch has its own
> queue). I am trying to remove one branch (a bin) while keeping the
> pipeline playing.
>
>
> In order to entirely remove the branch, I have to set its state to
> NULL. But, when the sink specifically changes to NULL, the pipeline
> stops playing! It is still in PLAYING state, but it just stops at the
> timeline.

When you do dynamic pipieline changes all you need to keep in mind is
that gstreamer does not like dataflow on unconnected pads. Thus if your
pipeline pushes data towards the sink, you want to do a pad_block on the
src-pad of the tee (for the branch you want to remove). When the block
callback got triggered remove the elements and release the pad.

Stefan

>
>
> I'm in a weird chicken-and-egg problem. On the one hand, I want to
> remove the sink, but on the other hand, until I remove it, it's still
> part of the pipeline.
>
>
> Things that I've tried and haven't helped:
>
>
> 1) Using a valve before the sink.
>
> 2) Blocking the pad before the sink.
>
> 3) Calling unparent() on the sink. (Causes all kinds of failures.)
>
>
> I have two questions that might help direct an answer:
>
>
> 1) Is it possible to remove an element without setting its state to NULL?
>
> 2) Is it possible to change the default behavior of Bin so that it
> doesn't respond to state changes of its children?
>
> _______________________________________________
> gstreamer-devel mailing list
> [hidden email]
> http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

_______________________________________________
gstreamer-devel mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Re: Trouble removing a sink from a playing pipeline

Tal Liron-2

On 01/-10/-28163 01:59 PM, Stefan Sauer wrote:

> On 10/02/2011 02:15 AM, Tal Liron wrote:
>> In order to entirely remove the branch, I have to set its state to
>> NULL. But, when the sink specifically changes to NULL, the pipeline
>> stops playing! It is still in PLAYING state, but it just stops at the
>> timeline.
> When you do dynamic pipieline changes all you need to keep in mind is
> that gstreamer does not like dataflow on unconnected pads. Thus if your
> pipeline pushes data towards the sink, you want to do a pad_block on the
> src-pad of the tee (for the branch you want to remove). When the block
> callback got triggered remove the elements and release the pad.
Thanks for the help -- the problem is not data flow, however, but state.
In order to remove the elements, I need to set state to NULL, but if I
do that the rest of the pipeline is affected.

Is there a way to either force removal of elements, or perhaps to change
their state to NULL without affecting the pipeline?
_______________________________________________
gstreamer-devel mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Re: Trouble removing a sink from a playing pipeline

Tal Liron
In reply to this post by Stefan Sauer

On 01/-10/-28163 01:59 PM, Stefan Sauer wrote:

> On 10/02/2011 02:15 AM, Tal Liron wrote:
>> In order to entirely remove the branch, I have to set its state to
>> NULL. But, when the sink specifically changes to NULL, the pipeline
>> stops playing! It is still in PLAYING state, but it just stops at the
>> timeline.
> When you do dynamic pipieline changes all you need to keep in mind is
> that gstreamer does not like dataflow on unconnected pads. Thus if your
> pipeline pushes data towards the sink, you want to do a pad_block on the
> src-pad of the tee (for the branch you want to remove). When the block
> callback got triggered remove the elements and release the pad.

Thanks for the help -- the problem is not data flow, however, but state.
In order to remove the elements, I need to set state to NULL, but if I
do that the rest of the pipeline is affected.

Is there a way to either force removal of elements, or perhaps to change
their state to NULL without affecting the pipeline?
_______________________________________________
gstreamer-devel mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Re: Trouble removing a sink from a playing pipeline

Victor Manuel Jáquez Leal
On Wed, Oct 5, 2011 at 11:21 PM, Tal Liron <[hidden email]> wrote:

>
> On 01/-10/-28163 01:59 PM, Stefan Sauer wrote:
>>
>> On 10/02/2011 02:15 AM, Tal Liron wrote:
>>>
>>> In order to entirely remove the branch, I have to set its state to
>>> NULL. But, when the sink specifically changes to NULL, the pipeline
>>> stops playing! It is still in PLAYING state, but it just stops at the
>>> timeline.
>>
>> When you do dynamic pipieline changes all you need to keep in mind is
>> that gstreamer does not like dataflow on unconnected pads. Thus if your
>> pipeline pushes data towards the sink, you want to do a pad_block on the
>> src-pad of the tee (for the branch you want to remove). When the block
>> callback got triggered remove the elements and release the pad.
>
> Thanks for the help -- the problem is not data flow, however, but state. In
> order to remove the elements, I need to set state to NULL, but if I do that
> the rest of the pipeline is affected.
>
> Is there a way to either force removal of elements, or perhaps to change
> their state to NULL without affecting the pipeline?

If you have to set to NULL state your element before it is unlinked
from the pipeline, I guess you have a buggy element.

Check out this document:

http://cgit.freedesktop.org/gstreamer/gstreamer/tree/docs/design/part-block.txt

vmjl
_______________________________________________
gstreamer-devel mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Re: Re: Trouble removing a sink from a playing pipeline

Tal Liron-2
On 01/-10/-28163 01:59 PM, Victor Manuel Jáquez Leal wrote:
> If you have to set to NULL state your element before it is unlinked
> from the pipeline, I guess you have a buggy element.
>
> Check out this document:
>
> http://cgit.freedesktop.org/gstreamer/gstreamer/tree/docs/design/part-block.txt
Thanks, I am aware of that document, but it's not the issue -- my
problem is removing the element, not unlinking it. Here is the error
message:

    GStreamer-CRITICAL **:
    Trying to dispose element branch1, but it is in PLAYING (locked)
    instead of the NULL state.
    You need to explicitly set elements to the NULL state before
    dropping the final reference, to allow them to clean up.
    This problem may also be caused by a refcounting bug in the
    application or some element.


The elements I use are all standard GStreamer, nothing custom.
_______________________________________________
gstreamer-devel mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Re: Re: Trouble removing a sink from a playing pipeline

Tal Liron
In reply to this post by Victor Manuel Jáquez Leal
On 01/-10/-28163 01:59 PM, Victor Manuel Jáquez Leal wrote:
> If you have to set to NULL state your element before it is unlinked
> from the pipeline, I guess you have a buggy element.
>
> Check out this document:
>
> http://cgit.freedesktop.org/gstreamer/gstreamer/tree/docs/design/part-block.txt
Thanks, I am aware of that document, but it's not the issue -- my
problem is removing the element, not unlinking it. Here is the error
message:

    GStreamer-CRITICAL **:
    Trying to dispose element branch1, but it is in PLAYING (locked)
    instead of the NULL state.
    You need to explicitly set elements to the NULL state before
    dropping the final reference, to allow them to clean up.
    This problem may also be caused by a refcounting bug in the
    application or some element.


The elements I use are all standard GStreamer, nothing custom.
_______________________________________________
gstreamer-devel mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Trouble removing a sink from a playing pipeline

Nathanael D. Noblet
In reply to this post by Tal Liron-2
On 10/05/2011 02:15 PM, Tal Liron wrote:

>
> On 01/-10/-28163 01:59 PM, Stefan Sauer wrote:
>> On 10/02/2011 02:15 AM, Tal Liron wrote:
>>> In order to entirely remove the branch, I have to set its state to
>>> NULL. But, when the sink specifically changes to NULL, the pipeline
>>> stops playing! It is still in PLAYING state, but it just stops at the
>>> timeline.
>> When you do dynamic pipieline changes all you need to keep in mind is
>> that gstreamer does not like dataflow on unconnected pads. Thus if your
>> pipeline pushes data towards the sink, you want to do a pad_block on the
>> src-pad of the tee (for the branch you want to remove). When the block
>> callback got triggered remove the elements and release the pad.
> Thanks for the help -- the problem is not data flow, however, but state.
> In order to remove the elements, I need to set state to NULL, but if I
> do that the rest of the pipeline is affected.
>
> Is there a way to either force removal of elements, or perhaps to change
> their state to NULL without affecting the pipeline?
> _______________________________________________
> gstreamer-devel mailing list
> [hidden email]
> http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
>

Maybe start here...

http://sourceforge.net/mailarchive/forum.php?thread_name=4CED51BC.6050800%40gnat.ca&forum_name=gstreamer-devel

--
Nathanael d. Noblet
t 403.875.4613
_______________________________________________
gstreamer-devel mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Trouble removing a sink from a playing pipeline

Stefan Sauer
In reply to this post by Tal Liron-2
On 10/06/2011 11:53 PM, Tal Liron wrote:

> On 01/-10/-28163 01:59 PM, Victor Manuel Jáquez Leal wrote:
>> If you have to set to NULL state your element before it is unlinked
>> from the pipeline, I guess you have a buggy element.
>>
>> Check out this document:
>>
>> http://cgit.freedesktop.org/gstreamer/gstreamer/tree/docs/design/part-block.txt
>>
> Thanks, I am aware of that document, but it's not the issue -- my
> problem is removing the element, not unlinking it. Here is the error
> message:
>
>    GStreamer-CRITICAL **:
>    Trying to dispose element branch1, but it is in PLAYING (locked)
>    instead of the NULL state.
>    You need to explicitly set elements to the NULL state before
>    dropping the final reference, to allow them to clean up.
>    This problem may also be caused by a refcounting bug in the
>    application or some element.

you need to block the src pad of the previous element, unlink, set the
sink to NULL and dispose the sink. But you have to set the sink to NULL
before disposing. This won't have any effect on the rest of the
pipeline, are you indeed only doing the state-change on the sink?

Stefan
>
>
>
> The elements I use are all standard GStreamer, nothing custom.
> _______________________________________________
> gstreamer-devel mailing list
> [hidden email]
> http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

_______________________________________________
gstreamer-devel mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Trouble removing a sink from a playing pipeline

bboyavatar
In reply to this post by Tal Liron