Changing the pad activate mode to push gives WARNING

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

Changing the pad activate mode to push gives WARNING

DeepakRohan
Hi,
      I am trying ot write a gstreamer-1.0 plugin for a parser where I require to check for tags initially. So I have to change the pad from push to pull to access the whole file then based on the tags and meta data obtained I will do the things accordingly. But changing the pad activate mode from push to pull works after that changing it back to push is giving some problem.

The code snippet is some what like the below mentioned code
if (gst_pad_activate_mode ( GST_PAD_PEER(sinkpad), GST_PAD_MODE_PULL, TRUE))
{
//tag and metadat parsing
 result = gst_pad_activate_mode ( GST_PAD_PEER(sinkpad), GST_PAD_MODE_PUSH, TRUE);
//The above statement gives the below mentioned error. The result returned is FALSE
}

The result of running my parser gives the below error:
(gst-launch-1.0:14101): GStreamer-WARNING **:
Trying to join task 0x9fe6068 from its thread would deadlock.
You cannot change the state of an element from its streaming
thread. Use g_idle_add() or post a GstMessage on the bus to
schedule the state change from the main thread.

After the above warning the task hangs.
It is a push model so I could not understand the meaning of above error.
So can anyone please help me in figuring out the issue and any possible solution.
Reply | Threaded
Open this post in threaded view
|

Re: Changing the pad activate mode to push gives WARNING

vikasr_gstreamer
Hi,

I am also facing the above problem in gstreamer 1.0.
Initially I read the whole file in pull mode. Then I convert back to push mode.
This problem is faced when I run my plugin changes from pull to push mode with playbin in gstreamer 1.0.
It is working fine in gstreamer-0.10.

Can anyone please help me in figuring out this issue?
Reply | Threaded
Open this post in threaded view
|

Re: Changing the pad activate mode to push gives WARNING

DeepakRohan
In reply to this post by DeepakRohan
Hi,

In gstreamer 1.0 you do the activation of sinkpad either in pull mode or in push mode only once at the beginning.
So once activated in push mode then you can do random access (which you could do only if you were in pull mode).
This topic is closed.
Reply | Threaded
Open this post in threaded view
|

Re: Changing the pad activate mode to push gives WARNING

Sebastian Dröge-3
On So, 2016-03-13 at 22:33 -0700, DeepakRohan wrote:

> In gstreamer 1.0 you do the activation of sinkpad either in pull mode or in
> push mode only once at the beginning.
> So once activated in push mode then you can do random access (which you
> could do only if you were in pull mode).

Actually you can change the scheduling mode later too, which is what
happens often in decodebin at typefind. It first runs in pull mode
itself, once a demuxer is plugged in after the type is found, typefind
deactivates and the demuxer runs in pull mode.
But that's a very special case that usually does not happen in other
pipelines.

Decision whether to run in pull or push mode is btw done with the
SCHEDULING query in 1.x, which is done before the activation.

--
Sebastian Dröge, Centricular Ltd · http://www.centricular.com


_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

signature.asc (968 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Changing the pad activate mode to push gives WARNING

DeepakRohan
Thank You  Sebastian.