diff options
author | Andy Wingo <wingo@pobox.com> | 2003-09-30 12:47:48 +0000 |
---|---|---|
committer | Andy Wingo <wingo@pobox.com> | 2003-09-30 12:47:48 +0000 |
commit | 5d09662e9ef4b35b94856b3476c80860c546aa7d (patch) | |
tree | e673c38cce784e0fea231de0a0fe1383d7391094 /gst/wavenc/gstwavenc.c | |
parent | 124fa6ae423e4da11dc5d82e322654fccf45d0b6 (diff) |
In the intfloat conversion elements, there were bugs when the float buffer was bigger than the int buffer (in frames)...
Original commit message from CVS:
In the intfloat conversion elements, there were bugs when the float buffer was
bigger than the int buffer (in frames). That's now fixed, some style issues are
"fixed" (subjectively), mallocs are removed from int2float's processing loop,
and the default buffer size was raised to 256 frames to give better performance in
the default case.
Wavenc was modified to not set an event handler on its sink pad. It deals
with EOS in its chain function instead.
Diffstat (limited to 'gst/wavenc/gstwavenc.c')
-rw-r--r-- | gst/wavenc/gstwavenc.c | 55 |
1 files changed, 15 insertions, 40 deletions
diff --git a/gst/wavenc/gstwavenc.c b/gst/wavenc/gstwavenc.c index 7f3b933a..4d9a44d1 100644 --- a/gst/wavenc/gstwavenc.c +++ b/gst/wavenc/gstwavenc.c @@ -113,17 +113,6 @@ GST_PAD_TEMPLATE_FACTORY (src_factory, static GstElementClass *parent_class = NULL; -static const GstEventMask * -gst_wavenc_get_event_masks (GstPad *pad) -{ - static const GstEventMask src_event_masks[] = { - { GST_EVENT_EOS, 0 }, - { 0, } - }; - - return src_event_masks; -} - static GType gst_wavenc_get_type (void) { @@ -267,33 +256,6 @@ gst_wavenc_stop_file (GstWavEnc *wavenc) gst_pad_push (wavenc->srcpad, outbuf); } -static gboolean -gst_wavenc_handle_event (GstPad *pad, - GstEvent *event) -{ - GstWavEnc *wavenc; - GstEventType type; - - wavenc = GST_WAVENC (gst_pad_get_parent (pad)); - - type = event ? GST_EVENT_TYPE (event) : GST_EVENT_UNKNOWN; - - switch (type) { - case GST_EVENT_EOS: - wavenc->pad_eos = TRUE; - gst_wavenc_stop_file (wavenc); - gst_pad_push (wavenc->srcpad, - GST_BUFFER (gst_event_new (GST_EVENT_EOS))); - gst_element_set_eos (GST_ELEMENT (wavenc)); - break; - - default: - break; - } - - return TRUE; -} - static void gst_wavenc_init (GstWavEnc *wavenc) { @@ -301,14 +263,14 @@ gst_wavenc_init (GstWavEnc *wavenc) gst_element_add_pad (GST_ELEMENT (wavenc), wavenc->sinkpad); gst_pad_set_chain_function (wavenc->sinkpad, gst_wavenc_chain); gst_pad_set_link_function (wavenc->sinkpad, gst_wavenc_sinkconnect); - gst_pad_set_event_function (wavenc->sinkpad, gst_wavenc_handle_event); - gst_pad_set_event_mask_function (wavenc->sinkpad, gst_wavenc_get_event_masks); wavenc->srcpad = gst_pad_new_from_template (srctemplate, "src"); gst_element_add_pad (GST_ELEMENT (wavenc), wavenc->srcpad); wavenc->setup = FALSE; wavenc->flush_header = TRUE; + + GST_FLAG_SET (wavenc, GST_ELEMENT_EVENT_AWARE); } static void @@ -325,6 +287,19 @@ gst_wavenc_chain (GstPad *pad, return; } + if (GST_IS_EVENT (buf)) { + if (GST_EVENT_TYPE (buf) == GST_EVENT_EOS) { + wavenc->pad_eos = TRUE; + gst_wavenc_stop_file (wavenc); + gst_pad_push (wavenc->srcpad, + GST_BUFFER (gst_event_new (GST_EVENT_EOS))); + gst_element_set_eos (GST_ELEMENT (wavenc)); + } else { + gst_pad_event_default (wavenc->srcpad, GST_EVENT (buf)); + } + return; + } + if (GST_PAD_IS_USABLE (wavenc->srcpad)) { if (wavenc->flush_header) { GstBuffer *outbuf; |