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 643403 - Add support for GStreamer tuner interface (patch)
Add support for GStreamer tuner interface (patch)
Status: RESOLVED OBSOLETE
Product: GStreamer
Classification: Platform
Component: qt-gstreamer
git master
Other All
: Normal enhancement
: NONE
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2011-02-27 11:05 UTC by schrangl
Modified: 2014-11-25 18:18 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch with implementation of wrappers for GstTuner & co. (8.06 KB, patch)
2011-02-27 11:05 UTC, schrangl
needs-work Details | Review
Add support for GStreamer tuner interface V2 (patch) (12.45 KB, patch)
2014-01-25 12:02 UTC, Pavel Bludov
none Details | Review

Description schrangl 2011-02-27 11:05:13 UTC
Created attachment 182034 [details] [review]
Patch with implementation of wrappers for GstTuner & co.

This patch adds support for the tuner interface. It has been tested somewhat and I have not encountered any bugs. However, most of the time I live in places without analogue TV reception, so my testing wasn't very thorough.
Comment 1 George Kiagiadakis 2011-03-07 10:59:39 UTC
Review of attachment 182034 [details] [review]:

Hello,

Thanks a lot for the patch and sorry for delaying this review. I have made some comments on some parts of the API which need fixing. The rest seems fine and I'll happily merge it once those small issues are fixed.

Best regards,
George

::: src/QGst/tuner.h
@@ +20,3 @@
+
+#include "global.h"
+#include "../QGlib/Object"

I'd prefer this to be #include "../QGlib/object.h" for consistency with the rest of the files.

@@ +31,3 @@
+    QGST_WRAPPER(TunerChannel)
+public:
+    enum TunerChannelFlag {

This enum and its flags declaration should be defined outside of the class scope, in enums.h

@@ +32,3 @@
+public:
+    enum TunerChannelFlag {
+      Input = 1<<0,

also the names will need to be changed to TunerChannelInput, etc..

@@ +56,3 @@
+public:
+    QString label() const;
+    QGlib::Value framerate() const;

This is a bit weird being a GValue. I suppose that this is always a GST_TYPE_FRACTION GValue containing the framerate? In this case, it would make sense to export it as QGst::Fraction instead of QGlib::Value...

@@ +67,3 @@
+public:
+    QList<TunerChannelPtr> channels() const;
+    TunerChannelPtr getChannel() const;

I think the name should be currentChannel() here.

@@ +68,3 @@
+    QList<TunerChannelPtr> channels() const;
+    TunerChannelPtr getChannel() const;
+    void setChannel(const TunerChannelPtr &channel);

...and setCurrentChannel() respectively.

@@ +69,3 @@
+    TunerChannelPtr getChannel() const;
+    void setChannel(const TunerChannelPtr &channel);
+    TunerChannelPtr findChannelByName(const QString &name) const;

Use const char* for string arguments. Channel names are not translatable strings anyway and in most cases the programmer uses a string literal here (i.e. findChannelByName("composite")), in which case QString adds an extra overhead.

@@ +72,3 @@
+
+    QList<TunerNormPtr> norms() const;
+    TunerNormPtr getNorm() const;

Similar to currentChannel(), I think this should be currentNorm()

@@ +73,3 @@
+    QList<TunerNormPtr> norms() const;
+    TunerNormPtr getNorm() const;
+    void setNorm(const TunerNormPtr &norm);

...and setCurrentNorm()

@@ +74,3 @@
+    TunerNormPtr getNorm() const;
+    void setNorm(const TunerNormPtr &norm);
+    TunerNormPtr findNormByName(const QString &name) const;

again, const char*

@@ +77,3 @@
+    
+    unsigned long frequency(const TunerChannelPtr &channel) const;
+    void setFrequency(unsigned long freq, const TunerChannelPtr &channel);

I think the channel argument here should be first, like in the C API.
Comment 2 Pavel Bludov 2014-01-25 12:02:16 UTC
Created attachment 267181 [details] [review]
 Add support for GStreamer tuner interface V2 (patch)

The original patch from Lukas Schrangl with changes according to the comments from George.
And a small test from me.

One important note:
In gst_tuner_find_channel_by_name (GstTuner * tuner, gchar * channel)
and gst_tuner_find_norm_by_name (GstTuner * tuner, gchar * norm)
for no good reason "channel" and "norm" parameters are not const gchar *,
so we have to make a copy.
Comment 3 Sebastian Dröge (slomo) 2014-01-25 14:04:45 UTC
This does not seem particularly useful as the GstTuner interface was removed for GStreamer 1.0 and qtgstreamer hopefully is ported soon too.