Gstreamer critical on pipeline.set_state(Gst.State.NULL)

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

Gstreamer critical on pipeline.set_state(Gst.State.NULL)

Krutskikh Ivan
Hi all,

I get a really annoying bug while using gstreamer on python. :


GStreamer-CRITICAL **:
июл 26 16:09:44 archive1 distributor.py[5954]: Trying to dispose element queue9, but it is in PLAYING instead of the NULL state.

And such for every element of the pipeline.

I use Gst.parse_launch for creating pipelines and

    def message_handler(self,bus,message):
        streamer = None
        for s in self.job.streamers:
            if s.get_bus() == bus:
                streamer = s
           
        msgType = message.type
       
        if msgType == Gst.MessageType.ERROR or msgType == Gst.MessageType.EOS:
            streamer.pipeline.set_state(Gst.State.NULL)
            if streamer == self.job.streamers[0]:
                if self.queue and not self.export_running:
                    self.finish()

                if self.ping_test(self.host) == 0:
                    self.job.state = -2
                else:
                    self.job.state = -1
                self.recorder = None
           
            streamer = None

For message handling.

This is kind of urgent for me, what can I do to solve this?

Thanks in advance!



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

Re: Gstreamer critical on pipeline.set_state(Gst.State.NULL)

Krutskikh Ivan
Maybe I should go with sync state changes on all my pipelines?

2016-07-29 13:53 GMT+03:00 Krutskikh Ivan <[hidden email]>:
Hi all,

I get a really annoying bug while using gstreamer on python. :


GStreamer-CRITICAL **:
июл 26 16:09:44 archive1 distributor.py[5954]: Trying to dispose element queue9, but it is in PLAYING instead of the NULL state.

And such for every element of the pipeline.

I use Gst.parse_launch for creating pipelines and

    def message_handler(self,bus,message):
        streamer = None
        for s in self.job.streamers:
            if s.get_bus() == bus:
                streamer = s
           
        msgType = message.type
       
        if msgType == Gst.MessageType.ERROR or msgType == Gst.MessageType.EOS:
            streamer.pipeline.set_state(Gst.State.NULL)
            if streamer == self.job.streamers[0]:
                if self.queue and not self.export_running:
                    self.finish()

                if self.ping_test(self.host) == 0:
                    self.job.state = -2
                else:
                    self.job.state = -1
                self.recorder = None
           
            streamer = None

For message handling.

This is kind of urgent for me, what can I do to solve this?

Thanks in advance!




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

Re: Gstreamer critical on pipeline.set_state(Gst.State.NULL)

Krutskikh Ivan
I would like to bump my question

2016-07-29 13:59 GMT+03:00 Krutskikh Ivan <[hidden email]>:
Maybe I should go with sync state changes on all my pipelines?

2016-07-29 13:53 GMT+03:00 Krutskikh Ivan <[hidden email]>:
Hi all,

I get a really annoying bug while using gstreamer on python. :


GStreamer-CRITICAL **:
июл 26 16:09:44 archive1 distributor.py[5954]: Trying to dispose element queue9, but it is in PLAYING instead of the NULL state.

And such for every element of the pipeline.

I use Gst.parse_launch for creating pipelines and

    def message_handler(self,bus,message):
        streamer = None
        for s in self.job.streamers:
            if s.get_bus() == bus:
                streamer = s
           
        msgType = message.type
       
        if msgType == Gst.MessageType.ERROR or msgType == Gst.MessageType.EOS:
            streamer.pipeline.set_state(Gst.State.NULL)
            if streamer == self.job.streamers[0]:
                if self.queue and not self.export_running:
                    self.finish()

                if self.ping_test(self.host) == 0:
                    self.job.state = -2
                else:
                    self.job.state = -1
                self.recorder = None
           
            streamer = None

For message handling.

This is kind of urgent for me, what can I do to solve this?

Thanks in advance!





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

Re: Gstreamer critical on pipeline.set_state(Gst.State.NULL)

Dirk-Jan C. Binnema

> I would like to bump my question

There is no "bump" here.

>>> I get a really annoying bug while using gstreamer on python. :
>>>
>>>
>>> GStreamer-CRITICAL **:
>>> июл 26 16:09:44 archive1 distributor.py[5954]: Trying to dispose element
>>> queue9, but it is in PLAYING instead of the NULL state.

Typically, you get such errors when disposing (freeing) your pipeline
when it's not in NULL state yet, just as the error says - ie., you need
to give GStreamer a chance to go through the state-changes to reach NULL
before disposing your pipeline and its elements.

One way to do that is to use (the Python equivalent of) a blocking
gst_element_get_state after you set the state.

Cheers,
Dirk.

--
Dirk-Jan C. Binnema                  Helsinki, Finland
e:[hidden email]           w:www.djcbsoftware.nl
pgp: D09C E664 897D 7D39 5047 A178 E96A C7A1 017D DA3C
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Gstreamer critical on pipeline.set_state(Gst.State.NULL)

Krutskikh Ivan
Hi again!

I've tried a lot of variants with this setup. Right now I have:

 if msgType == Gst.MessageType.ERROR or msgType == Gst.MessageType.EOS:
            streamer.sink.emit('clear')
            streamer.pipeline.set_state(Gst.State.NULL)
            streamer.pipeline.get_state(timeout=10*Gst.SECOND)

It sometimes fails with :

авг 18 12:26:24 archive4 videoserver.py[9608]: (python:9608): GStreamer-CRITICAL **:
авг 18 12:26:24 archive4 videoserver.py[9608]: Trying to dispose element manager, but it is in PLAYING (locked) instead of the NULL state.


streamer.sink is a tcpserversink element which I strip from all clients at pipeline shutdown/

2016-07-31 12:04 GMT+03:00 Dirk-Jan C. Binnema <[hidden email]>:

> I would like to bump my question

There is no "bump" here.

>>> I get a really annoying bug while using gstreamer on python. :
>>>
>>>
>>> GStreamer-CRITICAL **:
>>> июл 26 16:09:44 archive1 distributor.py[5954]: Trying to dispose element
>>> queue9, but it is in PLAYING instead of the NULL state.

Typically, you get such errors when disposing (freeing) your pipeline
when it's not in NULL state yet, just as the error says - ie., you need
to give GStreamer a chance to go through the state-changes to reach NULL
before disposing your pipeline and its elements.

One way to do that is to use (the Python equivalent of) a blocking
gst_element_get_state after you set the state.

Cheers,
Dirk.

--
Dirk-Jan C. Binnema                  Helsinki, Finland
[hidden email]           w:www.djcbsoftware.nl
pgp: D09C E664 897D 7D39 5047 A178 E96A C7A1 017D DA3C
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel


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