After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 680236 - QtGStreamer doesn't wrap GstDiscoverer
QtGStreamer doesn't wrap GstDiscoverer
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: qt-gstreamer
git master
Other Linux
: Normal normal
: 0.10.3
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on: 680233 680235 680237
Blocks:
 
 
Reported: 2012-07-19 09:26 UTC by Mathias Hasselmann (IRC: tbf)
Modified: 2012-12-12 21:15 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
cmake: Tell CMake about GStreamer's PBUtils (1.49 KB, patch)
2012-07-19 09:26 UTC, Mathias Hasselmann (IRC: tbf)
needs-work Details | Review
Add initial wrapping of GstDiscoverer (22.55 KB, patch)
2012-07-19 09:34 UTC, Mathias Hasselmann (IRC: tbf)
none Details | Review
Discoverer: Update gen.cpp for GstDiscoverer wrapping (46.08 KB, patch)
2012-07-19 09:35 UTC, Mathias Hasselmann (IRC: tbf)
none Details | Review
tests: Teach QCOMPARE() printing certain GStreamer (973 bytes, patch)
2012-07-19 09:35 UTC, Mathias Hasselmann (IRC: tbf)
none Details | Review
tests: Add equality operators to QGst::Fraction (909 bytes, patch)
2012-07-19 09:36 UTC, Mathias Hasselmann (IRC: tbf)
none Details | Review
tests: Add tests for QGst::Discoverer (178.44 KB, patch)
2012-07-19 09:36 UTC, Mathias Hasselmann (IRC: tbf)
none Details | Review

Description Mathias Hasselmann (IRC: tbf) 2012-07-19 09:26:45 UTC
Created attachment 219207 [details] [review]
cmake: Tell CMake about GStreamer's PBUtils

QtGStreamer doesn't wrap GstDiscoverer.
Comment 1 Mathias Hasselmann (IRC: tbf) 2012-07-19 09:34:52 UTC
Created attachment 219209 [details] [review]
Add initial wrapping of GstDiscoverer
Comment 2 Mathias Hasselmann (IRC: tbf) 2012-07-19 09:35:15 UTC
Created attachment 219210 [details] [review]
Discoverer: Update gen.cpp for GstDiscoverer wrapping
Comment 3 Mathias Hasselmann (IRC: tbf) 2012-07-19 09:35:40 UTC
Created attachment 219211 [details] [review]
tests: Teach QCOMPARE() printing certain GStreamer
Comment 4 Mathias Hasselmann (IRC: tbf) 2012-07-19 09:36:04 UTC
Created attachment 219212 [details] [review]
tests: Add equality operators to QGst::Fraction
Comment 5 Mathias Hasselmann (IRC: tbf) 2012-07-19 09:36:26 UTC
Created attachment 219213 [details] [review]
tests: Add tests for QGst::Discoverer
Comment 6 Mathias Hasselmann (IRC: tbf) 2012-08-01 07:48:45 UTC
Any progress on reviewing this changes? Can I merge them?
Comment 7 George Kiagiadakis 2012-08-02 08:49:30 UTC
Review of attachment 219207 [details] [review]:

::: CMakeLists.txt
@@ +55,3 @@
 endif()
 
+find_package(GStreamer 0.10.33 COMPONENTS base pbutils)

You don't need to search for this component if you are not going to use it. If you *are* going to use it, though, you need a macro_log_feature() below like it is done for the other libraries.

::: cmake/modules/FindGStreamer.cmake
@@ +82,3 @@
         _find_gst_component(NET gstnet.h)
+    elseif (${_component} STREQUAL "pbutils")
+        _find_gst_component(PBUTILS pbutils.h)

This is in the wrong file, isn't it? According to the web, pbutils is part of gst-plugins-base, not gstreamer core.
Comment 8 Murray Cumming 2012-11-09 11:48:09 UTC
Yes, and that pbutils check was already in the FindGStreamerBase.cmake file. I have updated this
https://github.com/openismus/qt-gstreamer/commits/discoverer-contrib
(with a force push) in the commit here:
https://github.com/openismus/qt-gstreamer/commit/ad69261de04e826a1fde9233b9f34e9d9f5b1f6a

Sorry for the delay by us responding to your review, but could you continue with the review please? It would be great to get this accepted upstream.
Comment 9 Murray Cumming 2012-12-03 09:49:41 UTC
Please?
Comment 10 George Kiagiadakis 2012-12-06 09:36:49 UTC
Yes, I'm sorry for the delay as well. I had started reviewing the other patches as well, but got sidetracked and forgot about it. I have comments mainly for the main feature patch (https://github.com/openismus/qt-gstreamer/commit/98a845e9990ae5d8e2e7fe97452dcd9f1650a650). Since splinter seems to be broken and does not allow me to make comments on that patch, I will do it here:

discoverer.h:

+#if !QGLIB_HAVE_CXX0X
+# include <boost/preprocessor.hpp>
+#endif

This is useless, I don't see any boost preprocessor magic being used here.

+enum DiscovererResult {
+    DiscovererOk,
+    DiscovererUriInvalid,
+    DiscovererError,
+    DiscovererTimeout,
+    DiscovererBusy,
+    DiscovererMissingPlugins
+};

Enums should be in the enums.h file with the appropriate type registration macros.

+    QList<DiscovererStreamInfoPtr> subTitleStreams() const;

subtitleStreams() would be better imho (small t) - keeps subtitle as one word, like in other places in this API

+    /*! Allow asynchronous discovering of URIs to take place. An event loop must be
+     * available for QGst::Discoverer to properly work in asynchronous mode.
+     * \ingroup async
+     */
+    void start();

This needs a big fat warning that it requires a *GLIB* event loop and therefore it is only going to work on X11-based platforms (in Qt4 at least).

+QTGSTREAMER_EXPORT QDebug operator<<(QDebug debug, DiscovererStreamInfoPtr info);
+QTGSTREAMER_EXPORT QDebug operator<<(QDebug debug, DiscovererInfoPtr info);

const FooPtr & info please. There is no reason in incrementing the reference count for a debugging function.


discoverer.cpp:

+// FIXME: move to fraction.h
+static QDebug operator<<(QDebug debug, const Fraction &f)

Do move it to fraction.h please

+namespace Private {
+
+QGlib::RefCountedObject *wrapDiscovererInfo(void *info)
+{
+    return QGlib::constructWrapper(G_TYPE_FROM_INSTANCE(info), info);
+}
+
+} //namespace Private

This is not needed here. Remove it.


The test looks good, I trust it works.
I would also like the changes to qgsttest.h in https://github.com/openismus/qt-gstreamer/commit/768342b3ee5816c0f5ada645d765f65d6599a004 to be moved to the earlier commit https://github.com/openismus/qt-gstreamer/commit/d269da0501e50bb514f59b17a0230ad2093f0521 , to make sure the code compiles in all commits.

There are also some remaining comments to fix on https://bugzilla.gnome.org/show_bug.cgi?id=680235 , which goes along with this branch.

After all these have been fixed, this branch can be merged.

Thanks and sorry again for the delay from my side as well,
George
Comment 11 Murray Cumming 2012-12-11 12:37:17 UTC
I have made some of those changes in the branch.

> +QTGSTREAMER_EXPORT QDebug operator<<(QDebug debug, DiscovererStreamInfoPtr
info);
> +QTGSTREAMER_EXPORT QDebug operator<<(QDebug debug, DiscovererInfoPtr info);
>
> const FooPtr & info please. There is no reason in incrementing the reference
> count for a debugging function.

That leads to some ambiguous calls. I'll see if I can still make it work.

> +// FIXME: move to fraction.h
> +static QDebug operator<<(QDebug debug, const Fraction &f)
> 
> Do move it to fraction.h please

You mean, to a new file?
Comment 12 George Kiagiadakis 2012-12-11 12:51:46 UTC
(In reply to comment #11)
> I have made some of those changes in the branch.
> 
> > +QTGSTREAMER_EXPORT QDebug operator<<(QDebug debug, DiscovererStreamInfoPtr
> info);
> > +QTGSTREAMER_EXPORT QDebug operator<<(QDebug debug, DiscovererInfoPtr info);
> >
> > const FooPtr & info please. There is no reason in incrementing the reference
> > count for a debugging function.
> 
> That leads to some ambiguous calls. I'll see if I can still make it work.

Hm, I don't see why that would be ambiguous.

> > +// FIXME: move to fraction.h
> > +static QDebug operator<<(QDebug debug, const Fraction &f)
> > 
> > Do move it to fraction.h please
> 
> You mean, to a new file?

Sorry, I meant structs.h, together with the Fraction struct definition.
Comment 13 Mathias Hasselmann (IRC: tbf) 2012-12-12 11:36:01 UTC
(In reply to comment #10)

> +    /*! Allow asynchronous discovering of URIs to take place. An event loop
> must be
> +     * available for QGst::Discoverer to properly work in asynchronous mode.
> +     * \ingroup async
> +     */
> +    void start();
> 
> This needs a big fat warning that it requires a *GLIB* event loop and therefore
> it is only going to work on X11-based platforms (in Qt4 at least).
> 

I agree that GLib must be mentioned explicitly. In bold font even maybe. I don't entirely agree with the conclusions about requiring X11: We are using GStreamer already, so whatever imaginary non-X11 platform we deal with, you already have a fully functional GLib event loop. Only thing that's missing is the integration with the Qt event loop. So it should be sufficient to take QEventDispatcherGlib and adopt it for the non-X11 platform.

http://qt.gitorious.org/qt/qt/blobs/4.8/src/corelib/kernel/qeventdispatcher_glib.cpp
http://qt.gitorious.org/qt/qt/blobs/4.8/src/corelib/kernel/kernel.pri

Actually I don't see any references to X11 in that code. So it might be sufficient to just take this code and plug it.
Comment 14 Murray Cumming 2012-12-12 11:47:04 UTC
I have made all the changes, apart from that documentation change, in the branch:
https://github.com/openismus/qt-gstreamer/commits/discoverer-contrib
Comment 15 George Kiagiadakis 2012-12-12 21:15:34 UTC
Thanks, I have commited everything in master, together with some additional fixes that were needed.

(In reply to comment #13)
> I agree that GLib must be mentioned explicitly. In bold font even maybe. I
> don't entirely agree with the conclusions about requiring X11: We are using
> GStreamer already, so whatever imaginary non-X11 platform we deal with, you
> already have a fully functional GLib event loop. Only thing that's missing is
> the integration with the Qt event loop. So it should be sufficient to take
> QEventDispatcherGlib and adopt it for the non-X11 platform.
> 
> http://qt.gitorious.org/qt/qt/blobs/4.8/src/corelib/kernel/qeventdispatcher_glib.cpp
> http://qt.gitorious.org/qt/qt/blobs/4.8/src/corelib/kernel/kernel.pri
> 
> Actually I don't see any references to X11 in that code. So it might be
> sufficient to just take this code and plug it.

Yes, of course, I didn't mean it depends on X11, but just that Qt (4.x at least) doesn't come with this feature on non-X11 platforms. In any case, I've added this documentation note myself, without mentioning X11 explicitly.