QtGStreamer: Segmentation fault when calling query function

bfederau benjamin.federau at basyskom.com
Tue Jun 18 01:10:47 PDT 2013


bfederau wrote
>> Hi,
>>
>> I have implemented the following Qt function
>>
>> QTime Player::getPosition()
>> {
>>     if (m_pipeline) {
>>         QGst::PositionQueryPtr query =
>> QGst::PositionQuery::create(QGst::FormatTime);
>>         m_pipeline->query(query);
>>         return QGst::ClockTime(query->position()).toTime();
>>     } else {
>>         return QTime();
>>     }
>> }
>>
>> When it comes to the m_pipeline->query(query) line the app crashes with a
>> Segmentation fault.
>>
>> The backtrace is:
>> #0  0x00000011 in ?? ()
>> #1  0xb335b41d in QGlib::RefPointer
> <QGst::PositionQuery>
> ::clear() () from
>> /home/meego/mediaplayer/libMediaPlayer.so
>> #2  0xb335a7c6 in QGlib::RefPointer
> <QGst::PositionQuery>
> ::~RefPointer() ()
>> from /home/meego/mediaplayer/libMediaPlayer.so
>> #3  0xb3359489 in Player::getPosition() () from
>> /home/meego/mediaplayer/libMediaPlayer.so
>> .....
>>
> 
> After the execution of  m_pipeline->query(query)  it seg faults inside the
> clear() function of RefPointer when the unref() function of m_class (type
> of QGst::PositionQuery) is called.
> 
> snip from  QGlib/refpointer.h:
> template 
> <class T>
> void RefPointer
> <T>
> ::clear()
> {
>     if (!isNull()) {
>         static_cast<RefCountedObject*>(m_class)->unref(); //this may
> delete m_class at this point
>         m_class = NULL;
>     }
> }
> 
> 
> Unfortunately I'm not that familiar with the QGlib implementation. On
> QtGStreamer for Qt4 the query functionality is working but on the
> QtGStreamer Qt5 implementation it is not working.
> 
> Does anyone have a glue what's going wrong here?
> 
> 
>>> And on console I get a:
>>> GLib-GObject-CRITICAL **: g_value_get_int64: assertion
>>> `G_VALUE_HOLDS_INT64
>>> (value)' failed
>>>
>>>
>>> Can somebody give me a hint whats going wrong here?
>>>
> 
>> Can you share a sample program that illustrates this issue. I can try it
>> locally here.
> 
> 
> Mandeep, could you test my sample app with Qt5?

This fix below from the qt-gstreamer master has solved the issue.

qt5: objectstore: Fix refcount problem on Qt5 port:
http://cgit.freedesktop.org/gstreamer/qt-gstreamer/commit/?id=1ac15da8b248f7f0ca5d88c0004590b30e0ef4b2

-
Benjamin Federau




--
View this message in context: http://gstreamer-devel.966125.n4.nabble.com/QtGStreamer-Segmentation-fault-when-calling-query-function-tp4659657p4660599.html
Sent from the GStreamer-devel mailing list archive at Nabble.com.


More information about the gstreamer-devel mailing list