mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-04-26 06:54:49 +00:00
ext/amrnb/amrnbenc.*: Pass the discont flag from the input buffer on to the output buffer in the AMR encoder.
Original commit message from CVS: * ext/amrnb/amrnbenc.c: (gst_amrnbenc_chain), (gst_amrnbenc_state_change): * ext/amrnb/amrnbenc.h: Pass the discont flag from the input buffer on to the output buffer in the AMR encoder.
This commit is contained in:
parent
be573f752f
commit
0df8ea9ebd
3 changed files with 18 additions and 1 deletions
|
@ -1,3 +1,11 @@
|
||||||
|
2008-09-26 Wim Taymans <wim.taymans@collabora.co.uk>
|
||||||
|
|
||||||
|
* ext/amrnb/amrnbenc.c: (gst_amrnbenc_chain),
|
||||||
|
(gst_amrnbenc_state_change):
|
||||||
|
* ext/amrnb/amrnbenc.h:
|
||||||
|
Pass the discont flag from the input buffer on to the output buffer in
|
||||||
|
the AMR encoder.
|
||||||
|
|
||||||
2008-09-26 Wim Taymans <wim.taymans@collabora.co.uk>
|
2008-09-26 Wim Taymans <wim.taymans@collabora.co.uk>
|
||||||
|
|
||||||
Patch by: Benoit Fouet <benoit dot fouet at purplelabs dot com>
|
Patch by: Benoit Fouet <benoit dot fouet at purplelabs dot com>
|
||||||
|
|
|
@ -264,6 +264,7 @@ gst_amrnbenc_chain (GstPad * pad, GstBuffer * buffer)
|
||||||
if (GST_BUFFER_FLAG_IS_SET (buffer, GST_BUFFER_FLAG_DISCONT)) {
|
if (GST_BUFFER_FLAG_IS_SET (buffer, GST_BUFFER_FLAG_DISCONT)) {
|
||||||
gst_adapter_clear (amrnbenc->adapter);
|
gst_adapter_clear (amrnbenc->adapter);
|
||||||
amrnbenc->ts = 0;
|
amrnbenc->ts = 0;
|
||||||
|
amrnbenc->discont = TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* take latest timestamp, FIXME timestamp is the one of the
|
/* take latest timestamp, FIXME timestamp is the one of the
|
||||||
|
@ -284,8 +285,14 @@ gst_amrnbenc_chain (GstPad * pad, GstBuffer * buffer)
|
||||||
out = gst_buffer_new_and_alloc (32);
|
out = gst_buffer_new_and_alloc (32);
|
||||||
GST_BUFFER_DURATION (out) = amrnbenc->duration;
|
GST_BUFFER_DURATION (out) = amrnbenc->duration;
|
||||||
GST_BUFFER_TIMESTAMP (out) = amrnbenc->ts;
|
GST_BUFFER_TIMESTAMP (out) = amrnbenc->ts;
|
||||||
if (amrnbenc->ts != -1)
|
if (amrnbenc->ts != -1) {
|
||||||
amrnbenc->ts += amrnbenc->duration;
|
amrnbenc->ts += amrnbenc->duration;
|
||||||
|
}
|
||||||
|
if (amrnbenc->discont) {
|
||||||
|
GST_BUFFER_FLAG_SET (out, GST_BUFFER_FLAG_DISCONT);
|
||||||
|
amrnbenc->discont = FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
gst_buffer_set_caps (out, GST_PAD_CAPS (amrnbenc->srcpad));
|
gst_buffer_set_caps (out, GST_PAD_CAPS (amrnbenc->srcpad));
|
||||||
|
|
||||||
/* The AMR encoder actually writes into the source data buffers it gets */
|
/* The AMR encoder actually writes into the source data buffers it gets */
|
||||||
|
@ -332,6 +339,7 @@ gst_amrnbenc_state_change (GstElement * element, GstStateChange transition)
|
||||||
amrnbenc->rate = 0;
|
amrnbenc->rate = 0;
|
||||||
amrnbenc->channels = 0;
|
amrnbenc->channels = 0;
|
||||||
amrnbenc->ts = 0;
|
amrnbenc->ts = 0;
|
||||||
|
amrnbenc->discont = FALSE;
|
||||||
gst_adapter_clear (amrnbenc->adapter);
|
gst_adapter_clear (amrnbenc->adapter);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
|
|
@ -46,6 +46,7 @@ struct _GstAmrnbEnc {
|
||||||
/* pads */
|
/* pads */
|
||||||
GstPad *sinkpad, *srcpad;
|
GstPad *sinkpad, *srcpad;
|
||||||
guint64 ts;
|
guint64 ts;
|
||||||
|
gboolean discont;
|
||||||
|
|
||||||
GstAdapter *adapter;
|
GstAdapter *adapter;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue