diff options
author | Benjamin Otte <otte@gnome.org> | 2004-01-12 02:19:57 +0000 |
---|---|---|
committer | Benjamin Otte <otte@gnome.org> | 2004-01-12 02:19:57 +0000 |
commit | 1adb86a5d6b2f1bb96568f6135e1fdb4d451e4cd (patch) | |
tree | c6a5591aa3d71d3cb1f58fba000e966970d6853d /sys/v4l2/gstv4l2tuner.c | |
parent | 09984b518a5f6bbb91cec7568a8d2d28132439a6 (diff) | |
download | gst-plugins-bad-1adb86a5d6b2f1bb96568f6135e1fdb4d451e4cd.tar.gz gst-plugins-bad-1adb86a5d6b2f1bb96568f6135e1fdb4d451e4cd.tar.bz2 gst-plugins-bad-1adb86a5d6b2f1bb96568f6135e1fdb4d451e4cd.zip |
sys/v4l2/: add norm, channel and frequency properties.
Original commit message from CVS:
2004-01-12 Benjamin Otte <in7y118@public.uni-hamburg.de>
* sys/v4l2/gstv4l2element.c: (gst_v4l2element_class_init),
(gst_v4l2element_dispose), (gst_v4l2element_set_property),
(gst_v4l2element_get_property):
* sys/v4l2/v4l2_calls.c: (gst_v4l2_set_defaults), (gst_v4l2_open):
add norm, channel and frequency properties.
* sys/v4l2/gstv4l2tuner.c:
fixes for tuner interface changes
* sys/v4l2/gstv4l2element.h:
* sys/v4l2/gstv4l2src.c:
* sys/v4l2/gstv4l2src.h:
* sys/v4l2/v4l2src_calls.c:
* sys/v4l2/v4l2src_calls.h:
rework v4l2src to work with saa1734 cards and allow mmaped buffers.
Diffstat (limited to 'sys/v4l2/gstv4l2tuner.c')
-rw-r--r-- | sys/v4l2/gstv4l2tuner.c | 32 |
1 files changed, 20 insertions, 12 deletions
diff --git a/sys/v4l2/gstv4l2tuner.c b/sys/v4l2/gstv4l2tuner.c index 9cde6daa..f4f2cd64 100644 --- a/sys/v4l2/gstv4l2tuner.c +++ b/sys/v4l2/gstv4l2tuner.c @@ -40,14 +40,14 @@ static const GList * gst_v4l2_tuner_list_channels (GstTuner *mixer); static void gst_v4l2_tuner_set_channel (GstTuner *mixer, GstTunerChannel *channel); -static const GstTunerChannel * +static GstTunerChannel * gst_v4l2_tuner_get_channel (GstTuner *mixer); static const GList * gst_v4l2_tuner_list_norms (GstTuner *mixer); static void gst_v4l2_tuner_set_norm (GstTuner *mixer, GstTunerNorm *norm); -static const GstTunerNorm * +static GstTunerNorm * gst_v4l2_tuner_get_norm (GstTuner *mixer); static void gst_v4l2_tuner_set_frequency (GstTuner *mixer, @@ -205,13 +205,15 @@ gst_v4l2_tuner_set_channel (GstTuner *mixer, g_return_if_fail (gst_v4l2_tuner_contains_channel (v4l2element, v4l2channel)); /* ... or output, if we're a sink... */ - if (gst_v4l2_tuner_is_sink (v4l2element)) - gst_v4l2_set_output (v4l2element, v4l2channel->index); - else - gst_v4l2_set_input (v4l2element, v4l2channel->index); + if (gst_v4l2_tuner_is_sink (v4l2element) ? + gst_v4l2_set_output (v4l2element, v4l2channel->index) : + gst_v4l2_set_input (v4l2element, v4l2channel->index)) { + gst_tuner_channel_changed (mixer, channel); + g_object_notify (G_OBJECT (v4l2element), "channel"); + } } -static const GstTunerChannel * +static GstTunerChannel * gst_v4l2_tuner_get_channel (GstTuner *mixer) { GstV4l2Element *v4l2element = GST_V4L2ELEMENT (mixer); @@ -229,7 +231,7 @@ gst_v4l2_tuner_get_channel (GstTuner *mixer) for (item = v4l2element->channels; item != NULL; item = item->next) { if (channel == GST_V4L2_TUNER_CHANNEL (item->data)->index) - return (const GstTunerChannel *) item->data; + return (GstTunerChannel *) item->data; } return NULL; @@ -265,10 +267,13 @@ gst_v4l2_tuner_set_norm (GstTuner *mixer, g_return_if_fail (GST_V4L2_IS_OPEN (v4l2element)); g_return_if_fail (gst_v4l2_tuner_contains_norm (v4l2element, v4l2norm)); - gst_v4l2_set_norm (v4l2element, v4l2norm->index); + if (gst_v4l2_set_norm (v4l2element, v4l2norm->index)) { + gst_tuner_norm_changed (mixer, norm); + g_object_notify (G_OBJECT (v4l2element), "norm"); + } } -static const GstTunerNorm * +static GstTunerNorm * gst_v4l2_tuner_get_norm (GstTuner *mixer) { GstV4l2Element *v4l2element = GST_V4L2ELEMENT (mixer); @@ -282,7 +287,7 @@ gst_v4l2_tuner_get_norm (GstTuner *mixer) for (item = v4l2element->norms; item != NULL; item = item->next) { if (norm == GST_V4L2_TUNER_NORM (item->data)->index) - return (const GstTunerNorm *) item->data; + return (GstTunerNorm *) item->data; } return NULL; @@ -306,7 +311,10 @@ gst_v4l2_tuner_set_frequency (GstTuner *mixer, gst_v4l2_get_input (v4l2element, &chan); if (chan == GST_V4L2_TUNER_CHANNEL (channel)->index && GST_TUNER_CHANNEL_HAS_FLAG (channel, GST_TUNER_CHANNEL_FREQUENCY)) { - gst_v4l2_set_frequency (v4l2element, v4l2channel->tuner, frequency); + if (gst_v4l2_set_frequency (v4l2element, v4l2channel->tuner, frequency)) { + gst_tuner_frequency_changed (mixer, channel, frequency); + g_object_notify (G_OBJECT (v4l2element), "frequency"); + } } } |