summaryrefslogtreecommitdiffstats
path: root/ext
diff options
context:
space:
mode:
authorTim-Philipp Müller <tim@centricular.net>2005-05-05 16:23:20 +0000
committerTim-Philipp Müller <tim@centricular.net>2005-05-05 16:23:20 +0000
commit5ea79c29563d2fb55d21a49f4804206a66de5fb5 (patch)
tree7805be2060d219d85c768bfe408d2bee5fa1531d /ext
parent49f86d3ee6242be6f324edc2cbf36089ff5a2640 (diff)
downloadgst-plugins-bad-5ea79c29563d2fb55d21a49f4804206a66de5fb5.tar.gz
gst-plugins-bad-5ea79c29563d2fb55d21a49f4804206a66de5fb5.tar.bz2
gst-plugins-bad-5ea79c29563d2fb55d21a49f4804206a66de5fb5.zip
More gcc-4.0 fixes.
Original commit message from CVS: * ext/nas/nassink.c: (gst_nassink_init), (gst_nassink_sync_parms), (gst_nassink_sinkconnect), (gst_nassink_chain_handle_event), (gst_nassink_chain): * sys/glsink/glimagesink.c: (gst_glimagesink_buffer_alloc): * sys/v4l/gstv4ltuner.c: (gst_v4l_tuner_signal_strength): * sys/v4l/gstv4lxoverlay.c: (gst_v4l_xoverlay_open): * sys/v4l2/gstv4l2element.c: (gst_v4l2element_get_property): * sys/v4l2/gstv4l2xoverlay.c: (gst_v4l2_xoverlay_open): * sys/v4l2/v4l2_calls.c: (gst_v4l2_fill_lists): * sys/v4lradio/gstv4lradiotuner.c: (gst_v4lradio_tuner_signal_strength): * sys/ximage/ximagesink.c: (gst_ximagesink_buffer_alloc): * sys/xvimage/xvimagesink.c: (gst_xvimagesink_get_xv_support), (gst_xvimagesink_sink_link), (gst_xvimagesink_buffer_alloc): More gcc-4.0 fixes.
Diffstat (limited to 'ext')
-rw-r--r--ext/nas/nassink.c45
1 files changed, 43 insertions, 2 deletions
diff --git a/ext/nas/nassink.c b/ext/nas/nassink.c
index a47292a9..722d17cc 100644
--- a/ext/nas/nassink.c
+++ b/ext/nas/nassink.c
@@ -170,6 +170,8 @@ gst_nassink_init (GstNassink * nassink)
gst_pad_set_getcaps_function (nassink->sinkpad, gst_nassink_getcaps);
gst_pad_set_fixate_function (nassink->sinkpad, gst_nassink_fixate);
+ GST_FLAG_SET (nassink, GST_ELEMENT_EVENT_AWARE);
+
nassink->mute = FALSE;
nassink->depth = 16;
nassink->tracks = 2;
@@ -357,9 +359,39 @@ gst_nassink_sinkconnect (GstPad * pad, const GstCaps * caps)
}
static void
+gst_nassink_chain_handle_event (GstNassink * nassink, GstPad * pad,
+ GstEvent * event)
+{
+ switch (GST_EVENT_TYPE (event)) {
+ case GST_EVENT_EOS:
+/*
+ gst_audio_clock_set_active (GST_AUDIO_CLOCK (esdsink->provided_clock),
+ FALSE);
+*/
+ gst_pad_event_default (pad, event);
+ return;
+ case GST_EVENT_DISCONTINUOUS:
+ /* evil hack */
+ gst_nassink_close_audio (nassink);
+ gst_nassink_open_audio (nassink);
+ nassink->flow = AuGetScratchFlow (nassink->audio, NULL);
+ if (nassink->flow == 0) {
+ GST_CAT_DEBUG (NAS, "couldn't get flow");
+ // return -1 (throw error?)
+ }
+ gst_pad_event_default (pad, event);
+ return;
+ default:
+ gst_pad_event_default (pad, event);
+ return;
+ }
+ gst_event_unref (event);
+}
+
+static void
gst_nassink_chain (GstPad * pad, GstData * _data)
{
- GstBuffer *buf = GST_BUFFER (_data);
+ GstBuffer *buf;
int pos = 0;
int remaining;
int available;
@@ -367,12 +399,21 @@ gst_nassink_chain (GstPad * pad, GstData * _data)
g_return_if_fail (pad != NULL);
g_return_if_fail (GST_IS_PAD (pad));
- g_return_if_fail (buf != NULL);
+ g_return_if_fail (_data != NULL);
nassink = GST_NASSINK (gst_pad_get_parent (pad));
+ if (GST_IS_EVENT (_data)) {
+ gst_nassink_chain_handle_event (nassink, pad, GST_EVENT (_data));
+ return;
+ }
+
+ if (nassink->buf == NULL)
+ gst_nassink_sync_parms (nassink); // FIXME: if return false, error
+
g_return_if_fail (nassink->buf != NULL);
+ buf = GST_BUFFER (_data);
if (GST_BUFFER_DATA (buf) != NULL) {
if (!nassink->mute && nassink->audio != NULL) {