significance of STREAM_LOCK

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

significance of STREAM_LOCK

chandu
Hi,

Iam a bit confused with STREAM_LOCK functionality. my doubts are

->what is the significance of STREAM_LOCK. how any one can use it.
->why FLUSH_START does not require STREAM_LOCK and why FLUSH_STOP require STREAM_LOCK
->what are streaming threads
->how the chain function block them

Can any one please help me on this.

Thanks in advance.
Reply | Threaded
Open this post in threaded view
|

Re: significance of STREAM_LOCK

ved kpl
Stream lock on a  pad is taken (by the core), before entering it's
processing function such as chain, loop.
It is a recursive lock and can be locked by the same thread n times,
which means no other thread can acquire
the lock during this. This assures that the processing of buffers
won't happen from two different threads.

FLUSH_START is a non serialized event, which means it does not require
STREAM LOCK to be taken.
So it is possible that you could receive the FLUSH_START event in your
event handler of the element, while
your element is busy processing in it's chain function. The
significance of this event is that you tell your element
to come out of its chain function immediately (unblock, flush everything).

FLUSH_STOP event is serialized which means it will ensure that your
element is done with flushing
and is not in its chain function, hence ready to accept new buffers.

Streaming threads are part of your pipeline buffer flow. The data
processing happens in separate thread contexts.
chain, loop are all part of it.


On Thu, Dec 8, 2011 at 9:31 AM, chandu
<[hidden email]> wrote:

> Hi,
>
> Iam a bit confused with STREAM_LOCK functionality. my doubts are
>
> ->what is the significance of STREAM_LOCK. how any one can use it.
> ->why FLUSH_START does not require STREAM_LOCK and why FLUSH_STOP require
> STREAM_LOCK
> ->what are streaming threads
> ->how the chain function block them
>
> Can any one please help me on this.
>
> Thanks in advance.
>
> --
> View this message in context: http://gstreamer-devel.966125.n4.nabble.com/significance-of-STREAM-LOCK-tp4171489p4171489.html
> Sent from the GStreamer-devel mailing list archive at Nabble.com.
> _______________________________________________
> 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: significance of STREAM_LOCK

chandu
Hi,

Thanks for the explanation. That was very useful information.

i have doubt regarding streaming thread.
streaming thread and chain function execute in different threads?
If YES, chain function blocks streaming thread because, chain function processes data provided by streaming thread. Is that correct
Reply | Threaded
Open this post in threaded view
|

Re: significance of STREAM_LOCK

ved kpl
Streaming thread is a generic term in which your pipeline is running,
which means
when you set the pipeline to playing (from the application thread,
main()), the pipeline
will start running in separate thread(s), which we call as streaming thread(s).

chain function is just a function which is called on the sinkpad when
an upstream element
pushes the buffers down. (chain function is called under streaming
thread context).

On Thu, Dec 8, 2011 at 1:31 PM, chandu
<[hidden email]> wrote:

> Hi,
>
> Thanks for the explanation. That was very useful information.
>
> i have doubt regarding streaming thread.
> streaming thread and chain function execute in different threads?
> If YES, chain function blocks streaming thread because, chain function
> processes data provided by streaming thread. Is that correct
>
> --
> View this message in context: http://gstreamer-devel.966125.n4.nabble.com/significance-of-STREAM-LOCK-tp4171489p4171895.html
> Sent from the GStreamer-devel mailing list archive at Nabble.com.
> _______________________________________________
> 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