summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRonald S. Bultje <rbultje@ronald.bitfreak.net>2004-10-24 19:37:32 +0000
committerRonald S. Bultje <rbultje@ronald.bitfreak.net>2004-10-24 19:37:32 +0000
commita7515956d181c5a49caab0a17088d19a2667b15a (patch)
tree1edd89ec985441d26fbf78abfe2ccd336bd8e964
parent145270dd7ebc6aeb4ee246c34c1613e20366c685 (diff)
downloadgst-plugins-bad-a7515956d181c5a49caab0a17088d19a2667b15a.tar.gz
gst-plugins-bad-a7515956d181c5a49caab0a17088d19a2667b15a.tar.bz2
gst-plugins-bad-a7515956d181c5a49caab0a17088d19a2667b15a.zip
sys/v4l2/gstv4l2element.c: Fix properties (channel, norm, frequency).
Original commit message from CVS: * sys/v4l2/gstv4l2element.c: (gst_v4l2element_set_property): Fix properties (channel, norm, frequency).
-rw-r--r--ChangeLog5
-rw-r--r--sys/v4l2/gstv4l2element.c23
2 files changed, 17 insertions, 11 deletions
diff --git a/ChangeLog b/ChangeLog
index cfd9521e..0b4d1b8d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
2004-10-24 Ronald S. Bultje <rbultje@ronald.bitfreak.net>
+ * sys/v4l2/gstv4l2element.c: (gst_v4l2element_set_property):
+ Fix properties (channel, norm, frequency).
+
+2004-10-24 Ronald S. Bultje <rbultje@ronald.bitfreak.net>
+
* sys/v4l2/gstv4l2element.c: (gst_v4l2element_get_property):
Flag typo.
* sys/v4l2/v4l2_calls.c: (gst_v4l2_set_defaults):
diff --git a/sys/v4l2/gstv4l2element.c b/sys/v4l2/gstv4l2element.c
index a89e2bfb..8326125f 100644
--- a/sys/v4l2/gstv4l2element.c
+++ b/sys/v4l2/gstv4l2element.c
@@ -451,13 +451,10 @@ gst_v4l2element_set_property (GObject * object,
guint prop_id, const GValue * value, GParamSpec * pspec)
{
GstV4l2Element *v4l2element;
- GstTuner *tuner;
/* it's not null if we got it, but it might not be ours */
g_return_if_fail (GST_IS_V4L2ELEMENT (object));
v4l2element = GST_V4L2ELEMENT (object);
- /* stupid GstInterface */
- tuner = (GstTuner *) object;
switch (prop_id) {
case ARG_DEVICE:
@@ -469,7 +466,9 @@ gst_v4l2element_set_property (GObject * object,
break;
case ARG_NORM:
if (GST_V4L2_IS_OPEN (v4l2element)) {
- GstTunerNorm *norm = gst_tuner_get_norm (tuner);
+ GstTuner *tuner = GST_TUNER (v4l2element);
+ GstTunerNorm *norm = gst_tuner_find_norm_by_name (tuner,
+ (gchar *) g_value_get_string (value));
if (norm) {
gst_tuner_set_norm (tuner, norm);
@@ -482,7 +481,9 @@ gst_v4l2element_set_property (GObject * object,
break;
case ARG_CHANNEL:
if (GST_V4L2_IS_OPEN (v4l2element)) {
- GstTunerChannel *channel = gst_tuner_get_channel (tuner);
+ GstTuner *tuner = GST_TUNER (v4l2element);
+ GstTunerChannel *channel = gst_tuner_find_channel_by_name (tuner,
+ (gchar *) g_value_get_string (value));
if (channel) {
gst_tuner_set_channel (tuner, channel);
@@ -495,13 +496,13 @@ gst_v4l2element_set_property (GObject * object,
break;
case ARG_FREQUENCY:
if (GST_V4L2_IS_OPEN (v4l2element)) {
- GstTunerChannel *channel;
+ GstTuner *tuner = GST_TUNER (v4l2element);
+ GstTunerChannel *channel = gst_tuner_get_channel (tuner);
- if (!v4l2element->channel)
- return;
- channel = gst_tuner_get_channel (tuner);
- g_assert (channel);
- gst_tuner_set_frequency (tuner, channel, g_value_get_ulong (value));
+ if (channel &&
+ GST_TUNER_CHANNEL_HAS_FLAG (channel, GST_TUNER_CHANNEL_FREQUENCY)) {
+ gst_tuner_set_frequency (tuner, channel, g_value_get_ulong (value));
+ }
} else {
v4l2element->frequency = g_value_get_ulong (value);
g_object_notify (object, "frequency");