QtGtstreamer: query position returns a wrong value

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

QtGtstreamer: query position returns a wrong value

gianks
Hi all, i'm still quite new with GStreamer and i'm working on my first project with it. I'm using QtGStreamer bindings so i have implemented a simple function to query the current pipeline about position:
            QTime MyPipeline::queryPosition() {
                QGst::PositionQueryPtr query = QGst::PositionQuery::create(QGst::FormatTime);
                pipeline->query(query);
                return QGst::ClockTime(query->position()).toTime();
            }
Now after entering the playing state i set up a QTimer to run each second the following:
                void debugPosition() {
                        qDebug() << this << " ### Position: " << queryPosition()
                }
Up to here it works as expected since i can retrieve for each Pipeline the current playback position and print it. The same function is also sometimes called inside the callback 'formatLocation' of the sink element 'muxsplitsink' in one of the pipelines since the position is needed to be acquired in that moment, but for some reasons from there the value 99% is reported as QTime("23:34:33.709"). I remember something about querying the position from certain contexts can fail but i cannot find this in the manual, can someone help? Thanks
Reply | Threaded
Open this post in threaded view
|

Re: QtGtstreamer: query position returns a wrong value

gianks
I'm sorry not having noticed it before but query() is actually returning false when giving that value.
Anyway i have no idea why, i have tried emitting signals with explicit queued connections and also to invoke the method via QMetaObject but in any case the only point where the query returns true is from QTimers setup in the application.

Can someone explain me why if the query failing and how to investigate it?

Thanks