Added new plugin amrwb parse.
Original commit message from CVS:
Patch by: Renato Araujo Oliveira Filho <renatox at gmail dot com>
* configure.ac:
* ext/Makefile.am:
* ext/amrwb/Makefile.am:
* ext/amrwb/README:
* ext/amrwb/amrwb-code/Makefile.am:
* ext/amrwb/amrwb-code/run.sh:
* ext/amrwb/gstamrwb.c: (plugin_init):
* ext/amrwb/gstamrwbdec.c: (gst_amrwbdec_base_init),
(gst_amrwbdec_class_init), (gst_amrwbdec_init),
(gst_amrwbdec_setcaps), (gst_amrwbdec_event), (gst_amrwbdec_chain),
(gst_amrwbdec_state_change):
* ext/amrwb/gstamrwbdec.h:
* ext/amrwb/gstamrwbenc.c: (gst_amrwbenc_base_init),
(gst_amrwbenc_class_init), (gst_amrwbenc_init),
(gst_amrwbenc_finalize), (gst_amrwbenc_setcaps),
(gst_amrwbenc_chain), (gst_amrwbenc_state_change):
* ext/amrwb/gstamrwbenc.h:
* ext/amrwb/gstamrwbparse.c: (gst_amrwbparse_base_init),
(gst_amrwbparse_class_init), (gst_amrwbparse_init),
(gst_amrwbparse_querytypes), (gst_amrwbparse_query),
(gst_amrwbparse_chain), (gst_amrwbparse_read_header),
(gst_amrwbparse_loop), (gst_amrwbparse_sink_activate),
(gst_amrwbparse_sink_activate_pull), (gst_amrwbparse_state_change):
* ext/amrwb/gstamrwbparse.h:
Added new plugin amrwb parse.
Renamed audio/AMR to audio/AMR-WB as per spec.
Fixes #333307
2006-03-29 16:50:08 +00:00
|
|
|
/* GStreamer Adaptive Multi-Rate Narrow-Band (AMR-NB) plugin
|
|
|
|
* Copyright (C) 2004 Ronald Bultje <rbultje@ronald.bitfreak.net>
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Library General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Library General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Library General Public
|
|
|
|
* License along with this library; if not, write to the
|
|
|
|
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
|
|
|
* Boston, MA 02111-1307, USA.
|
|
|
|
*/
|
|
|
|
|
2007-07-03 09:18:22 +00:00
|
|
|
/**
|
|
|
|
* SECTION:element-amrwbdec
|
|
|
|
* @see_also: #GstAmrwbEnc, #GstAmrwbParse
|
|
|
|
*
|
|
|
|
* <refsect2>
|
|
|
|
* <para>
|
|
|
|
* This is an AMR wideband decoder based on the
|
|
|
|
* <ulink url="http://www.penguin.cz/~utx/amr">reference codec implementation</ulink>.
|
|
|
|
* </para>
|
|
|
|
* <title>Example launch line</title>
|
|
|
|
* <para>
|
|
|
|
* <programlisting>
|
2007-06-20 08:42:17 +00:00
|
|
|
* gst-launch filesrc location=abc.amr ! amrwbparse ! amrwbdec ! audioresample ! audioconvert ! alsasink
|
2007-07-03 09:18:22 +00:00
|
|
|
* </programlisting>
|
|
|
|
* </para>
|
|
|
|
* </refsect2>
|
2007-05-16 13:50:51 +00:00
|
|
|
*/
|
|
|
|
|
Added new plugin amrwb parse.
Original commit message from CVS:
Patch by: Renato Araujo Oliveira Filho <renatox at gmail dot com>
* configure.ac:
* ext/Makefile.am:
* ext/amrwb/Makefile.am:
* ext/amrwb/README:
* ext/amrwb/amrwb-code/Makefile.am:
* ext/amrwb/amrwb-code/run.sh:
* ext/amrwb/gstamrwb.c: (plugin_init):
* ext/amrwb/gstamrwbdec.c: (gst_amrwbdec_base_init),
(gst_amrwbdec_class_init), (gst_amrwbdec_init),
(gst_amrwbdec_setcaps), (gst_amrwbdec_event), (gst_amrwbdec_chain),
(gst_amrwbdec_state_change):
* ext/amrwb/gstamrwbdec.h:
* ext/amrwb/gstamrwbenc.c: (gst_amrwbenc_base_init),
(gst_amrwbenc_class_init), (gst_amrwbenc_init),
(gst_amrwbenc_finalize), (gst_amrwbenc_setcaps),
(gst_amrwbenc_chain), (gst_amrwbenc_state_change):
* ext/amrwb/gstamrwbenc.h:
* ext/amrwb/gstamrwbparse.c: (gst_amrwbparse_base_init),
(gst_amrwbparse_class_init), (gst_amrwbparse_init),
(gst_amrwbparse_querytypes), (gst_amrwbparse_query),
(gst_amrwbparse_chain), (gst_amrwbparse_read_header),
(gst_amrwbparse_loop), (gst_amrwbparse_sink_activate),
(gst_amrwbparse_sink_activate_pull), (gst_amrwbparse_state_change):
* ext/amrwb/gstamrwbparse.h:
Added new plugin amrwb parse.
Renamed audio/AMR to audio/AMR-WB as per spec.
Fixes #333307
2006-03-29 16:50:08 +00:00
|
|
|
#ifdef HAVE_CONFIG_H
|
|
|
|
#include "config.h"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include "gstamrwbdec.h"
|
|
|
|
|
|
|
|
static GstStaticPadTemplate sink_template = GST_STATIC_PAD_TEMPLATE ("sink",
|
|
|
|
GST_PAD_SINK,
|
|
|
|
GST_PAD_ALWAYS,
|
|
|
|
GST_STATIC_CAPS ("audio/AMR-WB, "
|
|
|
|
"rate = (int) 16000, " "channels = (int) 1")
|
|
|
|
);
|
|
|
|
|
|
|
|
static GstStaticPadTemplate src_template = GST_STATIC_PAD_TEMPLATE ("src",
|
|
|
|
GST_PAD_SRC,
|
|
|
|
GST_PAD_ALWAYS,
|
|
|
|
GST_STATIC_CAPS ("audio/x-raw-int, "
|
|
|
|
"width = (int) 16, "
|
|
|
|
"depth = (int) 16, "
|
|
|
|
"signed = (boolean) TRUE, "
|
|
|
|
"endianness = (int) BYTE_ORDER, "
|
|
|
|
"rate = (int) 16000, " "channels = (int) 1")
|
|
|
|
);
|
|
|
|
|
ext/amrwb/gstamrwbdec.c (gst_amrwbdec_debug, GST_CAT_DEFAULT, _do_init, gst_amrwbdec_base_init, gst_amrwbdec_class_in...
Original commit message from CVS:
* ext/amrwb/gstamrwbdec.c (gst_amrwbdec_debug, GST_CAT_DEFAULT,
_do_init, gst_amrwbdec_base_init, gst_amrwbdec_class_init):
* ext/amrwb/gstamrwbenc.c (gst_amrwbenc_debug, GST_CAT_DEFAULT,
_do_init, gst_amrwbenc_base_init, gst_amrwbenc_class_init):
* ext/amrwb/gstamrwbparse.c (gst_amrwbparse_debug, GST_CAT_DEFAULT,
_do_init, gst_amrwbparse_base_init, gst_amrwbparse_class_init):
First round of cleanups, that use GST_BOILERPLATE, GST_ELEMENT_DETAILS,
GST_DEBUG_FUNCPTR and add log-category.
2007-05-18 09:35:28 +00:00
|
|
|
GST_DEBUG_CATEGORY_STATIC (gst_amrwbdec_debug);
|
|
|
|
#define GST_CAT_DEFAULT gst_amrwbdec_debug
|
Added new plugin amrwb parse.
Original commit message from CVS:
Patch by: Renato Araujo Oliveira Filho <renatox at gmail dot com>
* configure.ac:
* ext/Makefile.am:
* ext/amrwb/Makefile.am:
* ext/amrwb/README:
* ext/amrwb/amrwb-code/Makefile.am:
* ext/amrwb/amrwb-code/run.sh:
* ext/amrwb/gstamrwb.c: (plugin_init):
* ext/amrwb/gstamrwbdec.c: (gst_amrwbdec_base_init),
(gst_amrwbdec_class_init), (gst_amrwbdec_init),
(gst_amrwbdec_setcaps), (gst_amrwbdec_event), (gst_amrwbdec_chain),
(gst_amrwbdec_state_change):
* ext/amrwb/gstamrwbdec.h:
* ext/amrwb/gstamrwbenc.c: (gst_amrwbenc_base_init),
(gst_amrwbenc_class_init), (gst_amrwbenc_init),
(gst_amrwbenc_finalize), (gst_amrwbenc_setcaps),
(gst_amrwbenc_chain), (gst_amrwbenc_state_change):
* ext/amrwb/gstamrwbenc.h:
* ext/amrwb/gstamrwbparse.c: (gst_amrwbparse_base_init),
(gst_amrwbparse_class_init), (gst_amrwbparse_init),
(gst_amrwbparse_querytypes), (gst_amrwbparse_query),
(gst_amrwbparse_chain), (gst_amrwbparse_read_header),
(gst_amrwbparse_loop), (gst_amrwbparse_sink_activate),
(gst_amrwbparse_sink_activate_pull), (gst_amrwbparse_state_change):
* ext/amrwb/gstamrwbparse.h:
Added new plugin amrwb parse.
Renamed audio/AMR to audio/AMR-WB as per spec.
Fixes #333307
2006-03-29 16:50:08 +00:00
|
|
|
|
ext/amrwb/gstamrwbdec.c (gst_amrwbdec_debug, GST_CAT_DEFAULT, _do_init, gst_amrwbdec_base_init, gst_amrwbdec_class_in...
Original commit message from CVS:
* ext/amrwb/gstamrwbdec.c (gst_amrwbdec_debug, GST_CAT_DEFAULT,
_do_init, gst_amrwbdec_base_init, gst_amrwbdec_class_init):
* ext/amrwb/gstamrwbenc.c (gst_amrwbenc_debug, GST_CAT_DEFAULT,
_do_init, gst_amrwbenc_base_init, gst_amrwbenc_class_init):
* ext/amrwb/gstamrwbparse.c (gst_amrwbparse_debug, GST_CAT_DEFAULT,
_do_init, gst_amrwbparse_base_init, gst_amrwbparse_class_init):
First round of cleanups, that use GST_BOILERPLATE, GST_ELEMENT_DETAILS,
GST_DEBUG_FUNCPTR and add log-category.
2007-05-18 09:35:28 +00:00
|
|
|
extern const UWord8 block_size[];
|
Added new plugin amrwb parse.
Original commit message from CVS:
Patch by: Renato Araujo Oliveira Filho <renatox at gmail dot com>
* configure.ac:
* ext/Makefile.am:
* ext/amrwb/Makefile.am:
* ext/amrwb/README:
* ext/amrwb/amrwb-code/Makefile.am:
* ext/amrwb/amrwb-code/run.sh:
* ext/amrwb/gstamrwb.c: (plugin_init):
* ext/amrwb/gstamrwbdec.c: (gst_amrwbdec_base_init),
(gst_amrwbdec_class_init), (gst_amrwbdec_init),
(gst_amrwbdec_setcaps), (gst_amrwbdec_event), (gst_amrwbdec_chain),
(gst_amrwbdec_state_change):
* ext/amrwb/gstamrwbdec.h:
* ext/amrwb/gstamrwbenc.c: (gst_amrwbenc_base_init),
(gst_amrwbenc_class_init), (gst_amrwbenc_init),
(gst_amrwbenc_finalize), (gst_amrwbenc_setcaps),
(gst_amrwbenc_chain), (gst_amrwbenc_state_change):
* ext/amrwb/gstamrwbenc.h:
* ext/amrwb/gstamrwbparse.c: (gst_amrwbparse_base_init),
(gst_amrwbparse_class_init), (gst_amrwbparse_init),
(gst_amrwbparse_querytypes), (gst_amrwbparse_query),
(gst_amrwbparse_chain), (gst_amrwbparse_read_header),
(gst_amrwbparse_loop), (gst_amrwbparse_sink_activate),
(gst_amrwbparse_sink_activate_pull), (gst_amrwbparse_state_change):
* ext/amrwb/gstamrwbparse.h:
Added new plugin amrwb parse.
Renamed audio/AMR to audio/AMR-WB as per spec.
Fixes #333307
2006-03-29 16:50:08 +00:00
|
|
|
|
|
|
|
static gboolean gst_amrwbdec_event (GstPad * pad, GstEvent * event);
|
|
|
|
static GstFlowReturn gst_amrwbdec_chain (GstPad * pad, GstBuffer * buffer);
|
|
|
|
static gboolean gst_amrwbdec_setcaps (GstPad * pad, GstCaps * caps);
|
|
|
|
static GstStateChangeReturn gst_amrwbdec_state_change (GstElement * element,
|
|
|
|
GstStateChange transition);
|
|
|
|
|
2007-06-20 08:42:17 +00:00
|
|
|
static void gst_amrwbdec_finalize (GObject * object);
|
|
|
|
|
ext/amrwb/gstamrwbdec.c (gst_amrwbdec_debug, GST_CAT_DEFAULT, _do_init, gst_amrwbdec_base_init, gst_amrwbdec_class_in...
Original commit message from CVS:
* ext/amrwb/gstamrwbdec.c (gst_amrwbdec_debug, GST_CAT_DEFAULT,
_do_init, gst_amrwbdec_base_init, gst_amrwbdec_class_init):
* ext/amrwb/gstamrwbenc.c (gst_amrwbenc_debug, GST_CAT_DEFAULT,
_do_init, gst_amrwbenc_base_init, gst_amrwbenc_class_init):
* ext/amrwb/gstamrwbparse.c (gst_amrwbparse_debug, GST_CAT_DEFAULT,
_do_init, gst_amrwbparse_base_init, gst_amrwbparse_class_init):
First round of cleanups, that use GST_BOILERPLATE, GST_ELEMENT_DETAILS,
GST_DEBUG_FUNCPTR and add log-category.
2007-05-18 09:35:28 +00:00
|
|
|
#define _do_init(bla) \
|
|
|
|
GST_DEBUG_CATEGORY_INIT (gst_amrwbdec_debug, "amrwbdec", 0, "AMR-WB audio decoder");
|
|
|
|
|
|
|
|
GST_BOILERPLATE_FULL (GstAmrwbDec, gst_amrwbdec, GstElement, GST_TYPE_ELEMENT,
|
|
|
|
_do_init);
|
Added new plugin amrwb parse.
Original commit message from CVS:
Patch by: Renato Araujo Oliveira Filho <renatox at gmail dot com>
* configure.ac:
* ext/Makefile.am:
* ext/amrwb/Makefile.am:
* ext/amrwb/README:
* ext/amrwb/amrwb-code/Makefile.am:
* ext/amrwb/amrwb-code/run.sh:
* ext/amrwb/gstamrwb.c: (plugin_init):
* ext/amrwb/gstamrwbdec.c: (gst_amrwbdec_base_init),
(gst_amrwbdec_class_init), (gst_amrwbdec_init),
(gst_amrwbdec_setcaps), (gst_amrwbdec_event), (gst_amrwbdec_chain),
(gst_amrwbdec_state_change):
* ext/amrwb/gstamrwbdec.h:
* ext/amrwb/gstamrwbenc.c: (gst_amrwbenc_base_init),
(gst_amrwbenc_class_init), (gst_amrwbenc_init),
(gst_amrwbenc_finalize), (gst_amrwbenc_setcaps),
(gst_amrwbenc_chain), (gst_amrwbenc_state_change):
* ext/amrwb/gstamrwbenc.h:
* ext/amrwb/gstamrwbparse.c: (gst_amrwbparse_base_init),
(gst_amrwbparse_class_init), (gst_amrwbparse_init),
(gst_amrwbparse_querytypes), (gst_amrwbparse_query),
(gst_amrwbparse_chain), (gst_amrwbparse_read_header),
(gst_amrwbparse_loop), (gst_amrwbparse_sink_activate),
(gst_amrwbparse_sink_activate_pull), (gst_amrwbparse_state_change):
* ext/amrwb/gstamrwbparse.h:
Added new plugin amrwb parse.
Renamed audio/AMR to audio/AMR-WB as per spec.
Fixes #333307
2006-03-29 16:50:08 +00:00
|
|
|
|
2006-05-06 00:15:59 +00:00
|
|
|
static void
|
|
|
|
gst_amrwbdec_base_init (gpointer klass)
|
Added new plugin amrwb parse.
Original commit message from CVS:
Patch by: Renato Araujo Oliveira Filho <renatox at gmail dot com>
* configure.ac:
* ext/Makefile.am:
* ext/amrwb/Makefile.am:
* ext/amrwb/README:
* ext/amrwb/amrwb-code/Makefile.am:
* ext/amrwb/amrwb-code/run.sh:
* ext/amrwb/gstamrwb.c: (plugin_init):
* ext/amrwb/gstamrwbdec.c: (gst_amrwbdec_base_init),
(gst_amrwbdec_class_init), (gst_amrwbdec_init),
(gst_amrwbdec_setcaps), (gst_amrwbdec_event), (gst_amrwbdec_chain),
(gst_amrwbdec_state_change):
* ext/amrwb/gstamrwbdec.h:
* ext/amrwb/gstamrwbenc.c: (gst_amrwbenc_base_init),
(gst_amrwbenc_class_init), (gst_amrwbenc_init),
(gst_amrwbenc_finalize), (gst_amrwbenc_setcaps),
(gst_amrwbenc_chain), (gst_amrwbenc_state_change):
* ext/amrwb/gstamrwbenc.h:
* ext/amrwb/gstamrwbparse.c: (gst_amrwbparse_base_init),
(gst_amrwbparse_class_init), (gst_amrwbparse_init),
(gst_amrwbparse_querytypes), (gst_amrwbparse_query),
(gst_amrwbparse_chain), (gst_amrwbparse_read_header),
(gst_amrwbparse_loop), (gst_amrwbparse_sink_activate),
(gst_amrwbparse_sink_activate_pull), (gst_amrwbparse_state_change):
* ext/amrwb/gstamrwbparse.h:
Added new plugin amrwb parse.
Renamed audio/AMR to audio/AMR-WB as per spec.
Fixes #333307
2006-03-29 16:50:08 +00:00
|
|
|
{
|
|
|
|
GstElementClass *element_class = GST_ELEMENT_CLASS (klass);
|
ext/amrwb/gstamrwbdec.c (gst_amrwbdec_debug, GST_CAT_DEFAULT, _do_init, gst_amrwbdec_base_init, gst_amrwbdec_class_in...
Original commit message from CVS:
* ext/amrwb/gstamrwbdec.c (gst_amrwbdec_debug, GST_CAT_DEFAULT,
_do_init, gst_amrwbdec_base_init, gst_amrwbdec_class_init):
* ext/amrwb/gstamrwbenc.c (gst_amrwbenc_debug, GST_CAT_DEFAULT,
_do_init, gst_amrwbenc_base_init, gst_amrwbenc_class_init):
* ext/amrwb/gstamrwbparse.c (gst_amrwbparse_debug, GST_CAT_DEFAULT,
_do_init, gst_amrwbparse_base_init, gst_amrwbparse_class_init):
First round of cleanups, that use GST_BOILERPLATE, GST_ELEMENT_DETAILS,
GST_DEBUG_FUNCPTR and add log-category.
2007-05-18 09:35:28 +00:00
|
|
|
GstElementDetails details = GST_ELEMENT_DETAILS ("AMR-WB audio decoder",
|
|
|
|
"Codec/Decoder/Audio",
|
|
|
|
"Adaptive Multi-Rate Wideband audio decoder",
|
|
|
|
"Renato Araujo <renato.filho@indt.org.br>");
|
Added new plugin amrwb parse.
Original commit message from CVS:
Patch by: Renato Araujo Oliveira Filho <renatox at gmail dot com>
* configure.ac:
* ext/Makefile.am:
* ext/amrwb/Makefile.am:
* ext/amrwb/README:
* ext/amrwb/amrwb-code/Makefile.am:
* ext/amrwb/amrwb-code/run.sh:
* ext/amrwb/gstamrwb.c: (plugin_init):
* ext/amrwb/gstamrwbdec.c: (gst_amrwbdec_base_init),
(gst_amrwbdec_class_init), (gst_amrwbdec_init),
(gst_amrwbdec_setcaps), (gst_amrwbdec_event), (gst_amrwbdec_chain),
(gst_amrwbdec_state_change):
* ext/amrwb/gstamrwbdec.h:
* ext/amrwb/gstamrwbenc.c: (gst_amrwbenc_base_init),
(gst_amrwbenc_class_init), (gst_amrwbenc_init),
(gst_amrwbenc_finalize), (gst_amrwbenc_setcaps),
(gst_amrwbenc_chain), (gst_amrwbenc_state_change):
* ext/amrwb/gstamrwbenc.h:
* ext/amrwb/gstamrwbparse.c: (gst_amrwbparse_base_init),
(gst_amrwbparse_class_init), (gst_amrwbparse_init),
(gst_amrwbparse_querytypes), (gst_amrwbparse_query),
(gst_amrwbparse_chain), (gst_amrwbparse_read_header),
(gst_amrwbparse_loop), (gst_amrwbparse_sink_activate),
(gst_amrwbparse_sink_activate_pull), (gst_amrwbparse_state_change):
* ext/amrwb/gstamrwbparse.h:
Added new plugin amrwb parse.
Renamed audio/AMR to audio/AMR-WB as per spec.
Fixes #333307
2006-03-29 16:50:08 +00:00
|
|
|
|
|
|
|
gst_element_class_add_pad_template (element_class,
|
|
|
|
gst_static_pad_template_get (&sink_template));
|
|
|
|
gst_element_class_add_pad_template (element_class,
|
|
|
|
gst_static_pad_template_get (&src_template));
|
|
|
|
|
ext/amrwb/gstamrwbdec.c (gst_amrwbdec_debug, GST_CAT_DEFAULT, _do_init, gst_amrwbdec_base_init, gst_amrwbdec_class_in...
Original commit message from CVS:
* ext/amrwb/gstamrwbdec.c (gst_amrwbdec_debug, GST_CAT_DEFAULT,
_do_init, gst_amrwbdec_base_init, gst_amrwbdec_class_init):
* ext/amrwb/gstamrwbenc.c (gst_amrwbenc_debug, GST_CAT_DEFAULT,
_do_init, gst_amrwbenc_base_init, gst_amrwbenc_class_init):
* ext/amrwb/gstamrwbparse.c (gst_amrwbparse_debug, GST_CAT_DEFAULT,
_do_init, gst_amrwbparse_base_init, gst_amrwbparse_class_init):
First round of cleanups, that use GST_BOILERPLATE, GST_ELEMENT_DETAILS,
GST_DEBUG_FUNCPTR and add log-category.
2007-05-18 09:35:28 +00:00
|
|
|
gst_element_class_set_details (element_class, &details);
|
Added new plugin amrwb parse.
Original commit message from CVS:
Patch by: Renato Araujo Oliveira Filho <renatox at gmail dot com>
* configure.ac:
* ext/Makefile.am:
* ext/amrwb/Makefile.am:
* ext/amrwb/README:
* ext/amrwb/amrwb-code/Makefile.am:
* ext/amrwb/amrwb-code/run.sh:
* ext/amrwb/gstamrwb.c: (plugin_init):
* ext/amrwb/gstamrwbdec.c: (gst_amrwbdec_base_init),
(gst_amrwbdec_class_init), (gst_amrwbdec_init),
(gst_amrwbdec_setcaps), (gst_amrwbdec_event), (gst_amrwbdec_chain),
(gst_amrwbdec_state_change):
* ext/amrwb/gstamrwbdec.h:
* ext/amrwb/gstamrwbenc.c: (gst_amrwbenc_base_init),
(gst_amrwbenc_class_init), (gst_amrwbenc_init),
(gst_amrwbenc_finalize), (gst_amrwbenc_setcaps),
(gst_amrwbenc_chain), (gst_amrwbenc_state_change):
* ext/amrwb/gstamrwbenc.h:
* ext/amrwb/gstamrwbparse.c: (gst_amrwbparse_base_init),
(gst_amrwbparse_class_init), (gst_amrwbparse_init),
(gst_amrwbparse_querytypes), (gst_amrwbparse_query),
(gst_amrwbparse_chain), (gst_amrwbparse_read_header),
(gst_amrwbparse_loop), (gst_amrwbparse_sink_activate),
(gst_amrwbparse_sink_activate_pull), (gst_amrwbparse_state_change):
* ext/amrwb/gstamrwbparse.h:
Added new plugin amrwb parse.
Renamed audio/AMR to audio/AMR-WB as per spec.
Fixes #333307
2006-03-29 16:50:08 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gst_amrwbdec_class_init (GstAmrwbDecClass * klass)
|
|
|
|
{
|
2007-06-20 08:42:17 +00:00
|
|
|
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
Added new plugin amrwb parse.
Original commit message from CVS:
Patch by: Renato Araujo Oliveira Filho <renatox at gmail dot com>
* configure.ac:
* ext/Makefile.am:
* ext/amrwb/Makefile.am:
* ext/amrwb/README:
* ext/amrwb/amrwb-code/Makefile.am:
* ext/amrwb/amrwb-code/run.sh:
* ext/amrwb/gstamrwb.c: (plugin_init):
* ext/amrwb/gstamrwbdec.c: (gst_amrwbdec_base_init),
(gst_amrwbdec_class_init), (gst_amrwbdec_init),
(gst_amrwbdec_setcaps), (gst_amrwbdec_event), (gst_amrwbdec_chain),
(gst_amrwbdec_state_change):
* ext/amrwb/gstamrwbdec.h:
* ext/amrwb/gstamrwbenc.c: (gst_amrwbenc_base_init),
(gst_amrwbenc_class_init), (gst_amrwbenc_init),
(gst_amrwbenc_finalize), (gst_amrwbenc_setcaps),
(gst_amrwbenc_chain), (gst_amrwbenc_state_change):
* ext/amrwb/gstamrwbenc.h:
* ext/amrwb/gstamrwbparse.c: (gst_amrwbparse_base_init),
(gst_amrwbparse_class_init), (gst_amrwbparse_init),
(gst_amrwbparse_querytypes), (gst_amrwbparse_query),
(gst_amrwbparse_chain), (gst_amrwbparse_read_header),
(gst_amrwbparse_loop), (gst_amrwbparse_sink_activate),
(gst_amrwbparse_sink_activate_pull), (gst_amrwbparse_state_change):
* ext/amrwb/gstamrwbparse.h:
Added new plugin amrwb parse.
Renamed audio/AMR to audio/AMR-WB as per spec.
Fixes #333307
2006-03-29 16:50:08 +00:00
|
|
|
GstElementClass *element_class = GST_ELEMENT_CLASS (klass);
|
|
|
|
|
2007-06-20 08:42:17 +00:00
|
|
|
object_class->finalize = gst_amrwbdec_finalize;
|
|
|
|
|
ext/amrwb/gstamrwbdec.c (gst_amrwbdec_debug, GST_CAT_DEFAULT, _do_init, gst_amrwbdec_base_init, gst_amrwbdec_class_in...
Original commit message from CVS:
* ext/amrwb/gstamrwbdec.c (gst_amrwbdec_debug, GST_CAT_DEFAULT,
_do_init, gst_amrwbdec_base_init, gst_amrwbdec_class_init):
* ext/amrwb/gstamrwbenc.c (gst_amrwbenc_debug, GST_CAT_DEFAULT,
_do_init, gst_amrwbenc_base_init, gst_amrwbenc_class_init):
* ext/amrwb/gstamrwbparse.c (gst_amrwbparse_debug, GST_CAT_DEFAULT,
_do_init, gst_amrwbparse_base_init, gst_amrwbparse_class_init):
First round of cleanups, that use GST_BOILERPLATE, GST_ELEMENT_DETAILS,
GST_DEBUG_FUNCPTR and add log-category.
2007-05-18 09:35:28 +00:00
|
|
|
element_class->change_state = GST_DEBUG_FUNCPTR (gst_amrwbdec_state_change);
|
Added new plugin amrwb parse.
Original commit message from CVS:
Patch by: Renato Araujo Oliveira Filho <renatox at gmail dot com>
* configure.ac:
* ext/Makefile.am:
* ext/amrwb/Makefile.am:
* ext/amrwb/README:
* ext/amrwb/amrwb-code/Makefile.am:
* ext/amrwb/amrwb-code/run.sh:
* ext/amrwb/gstamrwb.c: (plugin_init):
* ext/amrwb/gstamrwbdec.c: (gst_amrwbdec_base_init),
(gst_amrwbdec_class_init), (gst_amrwbdec_init),
(gst_amrwbdec_setcaps), (gst_amrwbdec_event), (gst_amrwbdec_chain),
(gst_amrwbdec_state_change):
* ext/amrwb/gstamrwbdec.h:
* ext/amrwb/gstamrwbenc.c: (gst_amrwbenc_base_init),
(gst_amrwbenc_class_init), (gst_amrwbenc_init),
(gst_amrwbenc_finalize), (gst_amrwbenc_setcaps),
(gst_amrwbenc_chain), (gst_amrwbenc_state_change):
* ext/amrwb/gstamrwbenc.h:
* ext/amrwb/gstamrwbparse.c: (gst_amrwbparse_base_init),
(gst_amrwbparse_class_init), (gst_amrwbparse_init),
(gst_amrwbparse_querytypes), (gst_amrwbparse_query),
(gst_amrwbparse_chain), (gst_amrwbparse_read_header),
(gst_amrwbparse_loop), (gst_amrwbparse_sink_activate),
(gst_amrwbparse_sink_activate_pull), (gst_amrwbparse_state_change):
* ext/amrwb/gstamrwbparse.h:
Added new plugin amrwb parse.
Renamed audio/AMR to audio/AMR-WB as per spec.
Fixes #333307
2006-03-29 16:50:08 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gst_amrwbdec_init (GstAmrwbDec * amrwbdec, GstAmrwbDecClass * klass)
|
|
|
|
{
|
|
|
|
/* create the sink pad */
|
2007-06-22 10:46:33 +00:00
|
|
|
amrwbdec->sinkpad = gst_pad_new_from_static_template (&sink_template, "sink");
|
Added new plugin amrwb parse.
Original commit message from CVS:
Patch by: Renato Araujo Oliveira Filho <renatox at gmail dot com>
* configure.ac:
* ext/Makefile.am:
* ext/amrwb/Makefile.am:
* ext/amrwb/README:
* ext/amrwb/amrwb-code/Makefile.am:
* ext/amrwb/amrwb-code/run.sh:
* ext/amrwb/gstamrwb.c: (plugin_init):
* ext/amrwb/gstamrwbdec.c: (gst_amrwbdec_base_init),
(gst_amrwbdec_class_init), (gst_amrwbdec_init),
(gst_amrwbdec_setcaps), (gst_amrwbdec_event), (gst_amrwbdec_chain),
(gst_amrwbdec_state_change):
* ext/amrwb/gstamrwbdec.h:
* ext/amrwb/gstamrwbenc.c: (gst_amrwbenc_base_init),
(gst_amrwbenc_class_init), (gst_amrwbenc_init),
(gst_amrwbenc_finalize), (gst_amrwbenc_setcaps),
(gst_amrwbenc_chain), (gst_amrwbenc_state_change):
* ext/amrwb/gstamrwbenc.h:
* ext/amrwb/gstamrwbparse.c: (gst_amrwbparse_base_init),
(gst_amrwbparse_class_init), (gst_amrwbparse_init),
(gst_amrwbparse_querytypes), (gst_amrwbparse_query),
(gst_amrwbparse_chain), (gst_amrwbparse_read_header),
(gst_amrwbparse_loop), (gst_amrwbparse_sink_activate),
(gst_amrwbparse_sink_activate_pull), (gst_amrwbparse_state_change):
* ext/amrwb/gstamrwbparse.h:
Added new plugin amrwb parse.
Renamed audio/AMR to audio/AMR-WB as per spec.
Fixes #333307
2006-03-29 16:50:08 +00:00
|
|
|
gst_pad_set_setcaps_function (amrwbdec->sinkpad, gst_amrwbdec_setcaps);
|
|
|
|
gst_pad_set_event_function (amrwbdec->sinkpad, gst_amrwbdec_event);
|
|
|
|
gst_pad_set_chain_function (amrwbdec->sinkpad, gst_amrwbdec_chain);
|
|
|
|
gst_element_add_pad (GST_ELEMENT (amrwbdec), amrwbdec->sinkpad);
|
|
|
|
|
|
|
|
/* create the src pad */
|
2007-06-22 10:46:33 +00:00
|
|
|
amrwbdec->srcpad = gst_pad_new_from_static_template (&src_template, "src");
|
Added new plugin amrwb parse.
Original commit message from CVS:
Patch by: Renato Araujo Oliveira Filho <renatox at gmail dot com>
* configure.ac:
* ext/Makefile.am:
* ext/amrwb/Makefile.am:
* ext/amrwb/README:
* ext/amrwb/amrwb-code/Makefile.am:
* ext/amrwb/amrwb-code/run.sh:
* ext/amrwb/gstamrwb.c: (plugin_init):
* ext/amrwb/gstamrwbdec.c: (gst_amrwbdec_base_init),
(gst_amrwbdec_class_init), (gst_amrwbdec_init),
(gst_amrwbdec_setcaps), (gst_amrwbdec_event), (gst_amrwbdec_chain),
(gst_amrwbdec_state_change):
* ext/amrwb/gstamrwbdec.h:
* ext/amrwb/gstamrwbenc.c: (gst_amrwbenc_base_init),
(gst_amrwbenc_class_init), (gst_amrwbenc_init),
(gst_amrwbenc_finalize), (gst_amrwbenc_setcaps),
(gst_amrwbenc_chain), (gst_amrwbenc_state_change):
* ext/amrwb/gstamrwbenc.h:
* ext/amrwb/gstamrwbparse.c: (gst_amrwbparse_base_init),
(gst_amrwbparse_class_init), (gst_amrwbparse_init),
(gst_amrwbparse_querytypes), (gst_amrwbparse_query),
(gst_amrwbparse_chain), (gst_amrwbparse_read_header),
(gst_amrwbparse_loop), (gst_amrwbparse_sink_activate),
(gst_amrwbparse_sink_activate_pull), (gst_amrwbparse_state_change):
* ext/amrwb/gstamrwbparse.h:
Added new plugin amrwb parse.
Renamed audio/AMR to audio/AMR-WB as per spec.
Fixes #333307
2006-03-29 16:50:08 +00:00
|
|
|
gst_pad_use_fixed_caps (amrwbdec->srcpad);
|
|
|
|
gst_element_add_pad (GST_ELEMENT (amrwbdec), amrwbdec->srcpad);
|
|
|
|
|
|
|
|
amrwbdec->adapter = gst_adapter_new ();
|
|
|
|
|
|
|
|
/* init rest */
|
|
|
|
amrwbdec->handle = NULL;
|
|
|
|
amrwbdec->channels = 0;
|
|
|
|
amrwbdec->rate = 0;
|
|
|
|
amrwbdec->duration = 0;
|
|
|
|
amrwbdec->ts = -1;
|
|
|
|
}
|
|
|
|
|
2007-06-20 08:42:17 +00:00
|
|
|
static void
|
|
|
|
gst_amrwbdec_finalize (GObject * object)
|
|
|
|
{
|
|
|
|
GstAmrwbDec *amrwbdec;
|
|
|
|
|
|
|
|
amrwbdec = GST_AMRWBDEC (object);
|
|
|
|
|
|
|
|
gst_adapter_clear (amrwbdec->adapter);
|
|
|
|
g_object_unref (amrwbdec->adapter);
|
|
|
|
|
|
|
|
G_OBJECT_CLASS (parent_class)->finalize (object);
|
|
|
|
}
|
|
|
|
|
Added new plugin amrwb parse.
Original commit message from CVS:
Patch by: Renato Araujo Oliveira Filho <renatox at gmail dot com>
* configure.ac:
* ext/Makefile.am:
* ext/amrwb/Makefile.am:
* ext/amrwb/README:
* ext/amrwb/amrwb-code/Makefile.am:
* ext/amrwb/amrwb-code/run.sh:
* ext/amrwb/gstamrwb.c: (plugin_init):
* ext/amrwb/gstamrwbdec.c: (gst_amrwbdec_base_init),
(gst_amrwbdec_class_init), (gst_amrwbdec_init),
(gst_amrwbdec_setcaps), (gst_amrwbdec_event), (gst_amrwbdec_chain),
(gst_amrwbdec_state_change):
* ext/amrwb/gstamrwbdec.h:
* ext/amrwb/gstamrwbenc.c: (gst_amrwbenc_base_init),
(gst_amrwbenc_class_init), (gst_amrwbenc_init),
(gst_amrwbenc_finalize), (gst_amrwbenc_setcaps),
(gst_amrwbenc_chain), (gst_amrwbenc_state_change):
* ext/amrwb/gstamrwbenc.h:
* ext/amrwb/gstamrwbparse.c: (gst_amrwbparse_base_init),
(gst_amrwbparse_class_init), (gst_amrwbparse_init),
(gst_amrwbparse_querytypes), (gst_amrwbparse_query),
(gst_amrwbparse_chain), (gst_amrwbparse_read_header),
(gst_amrwbparse_loop), (gst_amrwbparse_sink_activate),
(gst_amrwbparse_sink_activate_pull), (gst_amrwbparse_state_change):
* ext/amrwb/gstamrwbparse.h:
Added new plugin amrwb parse.
Renamed audio/AMR to audio/AMR-WB as per spec.
Fixes #333307
2006-03-29 16:50:08 +00:00
|
|
|
static gboolean
|
|
|
|
gst_amrwbdec_setcaps (GstPad * pad, GstCaps * caps)
|
|
|
|
{
|
|
|
|
GstStructure *structure;
|
|
|
|
GstAmrwbDec *amrwbdec;
|
|
|
|
GstCaps *copy;
|
|
|
|
|
|
|
|
amrwbdec = GST_AMRWBDEC (gst_pad_get_parent (pad));
|
|
|
|
|
|
|
|
structure = gst_caps_get_structure (caps, 0);
|
|
|
|
|
|
|
|
/* get channel count */
|
|
|
|
gst_structure_get_int (structure, "channels", &amrwbdec->channels);
|
|
|
|
gst_structure_get_int (structure, "rate", &amrwbdec->rate);
|
|
|
|
|
|
|
|
/* create reverse caps */
|
|
|
|
copy = gst_caps_new_simple ("audio/x-raw-int",
|
|
|
|
"channels", G_TYPE_INT, amrwbdec->channels,
|
|
|
|
"width", G_TYPE_INT, 16,
|
|
|
|
"depth", G_TYPE_INT, 16,
|
|
|
|
"endianness", G_TYPE_INT, G_BYTE_ORDER,
|
|
|
|
"rate", G_TYPE_INT, amrwbdec->rate, "signed", G_TYPE_BOOLEAN, TRUE, NULL);
|
|
|
|
|
|
|
|
amrwbdec->duration = gst_util_uint64_scale_int (GST_SECOND, L_FRAME16k,
|
|
|
|
amrwbdec->rate * amrwbdec->channels);
|
|
|
|
|
|
|
|
gst_pad_set_caps (amrwbdec->srcpad, copy);
|
|
|
|
gst_caps_unref (copy);
|
|
|
|
|
|
|
|
gst_object_unref (amrwbdec);
|
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static gboolean
|
|
|
|
gst_amrwbdec_event (GstPad * pad, GstEvent * event)
|
|
|
|
{
|
|
|
|
GstAmrwbDec *amrwbdec;
|
|
|
|
gboolean ret = TRUE;
|
|
|
|
|
|
|
|
amrwbdec = GST_AMRWBDEC (gst_pad_get_parent (pad));
|
|
|
|
|
|
|
|
switch (GST_EVENT_TYPE (event)) {
|
|
|
|
case GST_EVENT_FLUSH_START:
|
|
|
|
ret = gst_pad_push_event (amrwbdec->srcpad, event);
|
|
|
|
break;
|
|
|
|
case GST_EVENT_FLUSH_STOP:
|
|
|
|
ret = gst_pad_push_event (amrwbdec->srcpad, event);
|
|
|
|
gst_adapter_clear (amrwbdec->adapter);
|
|
|
|
amrwbdec->ts = -1;
|
|
|
|
break;
|
|
|
|
case GST_EVENT_EOS:
|
|
|
|
gst_adapter_clear (amrwbdec->adapter);
|
|
|
|
ret = gst_pad_push_event (amrwbdec->srcpad, event);
|
|
|
|
break;
|
2007-06-20 08:42:17 +00:00
|
|
|
case GST_EVENT_NEWSEGMENT:
|
|
|
|
{
|
|
|
|
GstFormat format;
|
|
|
|
gdouble rate, arate;
|
|
|
|
gint64 start, stop, time;
|
|
|
|
gboolean update;
|
|
|
|
|
|
|
|
gst_event_parse_new_segment_full (event, &update, &rate, &arate, &format,
|
|
|
|
&start, &stop, &time);
|
|
|
|
|
|
|
|
/* we need time for now */
|
|
|
|
if (format != GST_FORMAT_TIME)
|
|
|
|
goto newseg_wrong_format;
|
|
|
|
|
|
|
|
GST_DEBUG_OBJECT (amrwbdec,
|
|
|
|
"newsegment: update %d, rate %g, arate %g, start %" GST_TIME_FORMAT
|
|
|
|
", stop %" GST_TIME_FORMAT ", time %" GST_TIME_FORMAT,
|
|
|
|
update, rate, arate, GST_TIME_ARGS (start), GST_TIME_ARGS (stop),
|
|
|
|
GST_TIME_ARGS (time));
|
|
|
|
|
|
|
|
/* now configure the values */
|
|
|
|
gst_segment_set_newsegment_full (&amrwbdec->segment, update,
|
|
|
|
rate, arate, format, start, stop, time);
|
|
|
|
ret = gst_pad_push_event (amrwbdec->srcpad, event);
|
|
|
|
}
|
|
|
|
break;
|
Added new plugin amrwb parse.
Original commit message from CVS:
Patch by: Renato Araujo Oliveira Filho <renatox at gmail dot com>
* configure.ac:
* ext/Makefile.am:
* ext/amrwb/Makefile.am:
* ext/amrwb/README:
* ext/amrwb/amrwb-code/Makefile.am:
* ext/amrwb/amrwb-code/run.sh:
* ext/amrwb/gstamrwb.c: (plugin_init):
* ext/amrwb/gstamrwbdec.c: (gst_amrwbdec_base_init),
(gst_amrwbdec_class_init), (gst_amrwbdec_init),
(gst_amrwbdec_setcaps), (gst_amrwbdec_event), (gst_amrwbdec_chain),
(gst_amrwbdec_state_change):
* ext/amrwb/gstamrwbdec.h:
* ext/amrwb/gstamrwbenc.c: (gst_amrwbenc_base_init),
(gst_amrwbenc_class_init), (gst_amrwbenc_init),
(gst_amrwbenc_finalize), (gst_amrwbenc_setcaps),
(gst_amrwbenc_chain), (gst_amrwbenc_state_change):
* ext/amrwb/gstamrwbenc.h:
* ext/amrwb/gstamrwbparse.c: (gst_amrwbparse_base_init),
(gst_amrwbparse_class_init), (gst_amrwbparse_init),
(gst_amrwbparse_querytypes), (gst_amrwbparse_query),
(gst_amrwbparse_chain), (gst_amrwbparse_read_header),
(gst_amrwbparse_loop), (gst_amrwbparse_sink_activate),
(gst_amrwbparse_sink_activate_pull), (gst_amrwbparse_state_change):
* ext/amrwb/gstamrwbparse.h:
Added new plugin amrwb parse.
Renamed audio/AMR to audio/AMR-WB as per spec.
Fixes #333307
2006-03-29 16:50:08 +00:00
|
|
|
default:
|
|
|
|
ret = gst_pad_push_event (amrwbdec->srcpad, event);
|
|
|
|
break;
|
|
|
|
}
|
2007-06-20 08:42:17 +00:00
|
|
|
done:
|
Added new plugin amrwb parse.
Original commit message from CVS:
Patch by: Renato Araujo Oliveira Filho <renatox at gmail dot com>
* configure.ac:
* ext/Makefile.am:
* ext/amrwb/Makefile.am:
* ext/amrwb/README:
* ext/amrwb/amrwb-code/Makefile.am:
* ext/amrwb/amrwb-code/run.sh:
* ext/amrwb/gstamrwb.c: (plugin_init):
* ext/amrwb/gstamrwbdec.c: (gst_amrwbdec_base_init),
(gst_amrwbdec_class_init), (gst_amrwbdec_init),
(gst_amrwbdec_setcaps), (gst_amrwbdec_event), (gst_amrwbdec_chain),
(gst_amrwbdec_state_change):
* ext/amrwb/gstamrwbdec.h:
* ext/amrwb/gstamrwbenc.c: (gst_amrwbenc_base_init),
(gst_amrwbenc_class_init), (gst_amrwbenc_init),
(gst_amrwbenc_finalize), (gst_amrwbenc_setcaps),
(gst_amrwbenc_chain), (gst_amrwbenc_state_change):
* ext/amrwb/gstamrwbenc.h:
* ext/amrwb/gstamrwbparse.c: (gst_amrwbparse_base_init),
(gst_amrwbparse_class_init), (gst_amrwbparse_init),
(gst_amrwbparse_querytypes), (gst_amrwbparse_query),
(gst_amrwbparse_chain), (gst_amrwbparse_read_header),
(gst_amrwbparse_loop), (gst_amrwbparse_sink_activate),
(gst_amrwbparse_sink_activate_pull), (gst_amrwbparse_state_change):
* ext/amrwb/gstamrwbparse.h:
Added new plugin amrwb parse.
Renamed audio/AMR to audio/AMR-WB as per spec.
Fixes #333307
2006-03-29 16:50:08 +00:00
|
|
|
gst_object_unref (amrwbdec);
|
|
|
|
|
|
|
|
return ret;
|
2007-06-20 08:42:17 +00:00
|
|
|
|
|
|
|
/* ERRORS */
|
|
|
|
newseg_wrong_format:
|
|
|
|
{
|
|
|
|
GST_DEBUG_OBJECT (amrwbdec, "received non TIME newsegment");
|
|
|
|
goto done;
|
|
|
|
}
|
Added new plugin amrwb parse.
Original commit message from CVS:
Patch by: Renato Araujo Oliveira Filho <renatox at gmail dot com>
* configure.ac:
* ext/Makefile.am:
* ext/amrwb/Makefile.am:
* ext/amrwb/README:
* ext/amrwb/amrwb-code/Makefile.am:
* ext/amrwb/amrwb-code/run.sh:
* ext/amrwb/gstamrwb.c: (plugin_init):
* ext/amrwb/gstamrwbdec.c: (gst_amrwbdec_base_init),
(gst_amrwbdec_class_init), (gst_amrwbdec_init),
(gst_amrwbdec_setcaps), (gst_amrwbdec_event), (gst_amrwbdec_chain),
(gst_amrwbdec_state_change):
* ext/amrwb/gstamrwbdec.h:
* ext/amrwb/gstamrwbenc.c: (gst_amrwbenc_base_init),
(gst_amrwbenc_class_init), (gst_amrwbenc_init),
(gst_amrwbenc_finalize), (gst_amrwbenc_setcaps),
(gst_amrwbenc_chain), (gst_amrwbenc_state_change):
* ext/amrwb/gstamrwbenc.h:
* ext/amrwb/gstamrwbparse.c: (gst_amrwbparse_base_init),
(gst_amrwbparse_class_init), (gst_amrwbparse_init),
(gst_amrwbparse_querytypes), (gst_amrwbparse_query),
(gst_amrwbparse_chain), (gst_amrwbparse_read_header),
(gst_amrwbparse_loop), (gst_amrwbparse_sink_activate),
(gst_amrwbparse_sink_activate_pull), (gst_amrwbparse_state_change):
* ext/amrwb/gstamrwbparse.h:
Added new plugin amrwb parse.
Renamed audio/AMR to audio/AMR-WB as per spec.
Fixes #333307
2006-03-29 16:50:08 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static GstFlowReturn
|
|
|
|
gst_amrwbdec_chain (GstPad * pad, GstBuffer * buffer)
|
|
|
|
{
|
|
|
|
GstAmrwbDec *amrwbdec;
|
|
|
|
GstFlowReturn ret = GST_FLOW_OK;
|
|
|
|
|
|
|
|
amrwbdec = GST_AMRWBDEC (gst_pad_get_parent (pad));
|
|
|
|
|
2007-06-20 08:42:17 +00:00
|
|
|
if (amrwbdec->rate == 0 || amrwbdec->channels == 0)
|
|
|
|
goto not_negotiated;
|
Added new plugin amrwb parse.
Original commit message from CVS:
Patch by: Renato Araujo Oliveira Filho <renatox at gmail dot com>
* configure.ac:
* ext/Makefile.am:
* ext/amrwb/Makefile.am:
* ext/amrwb/README:
* ext/amrwb/amrwb-code/Makefile.am:
* ext/amrwb/amrwb-code/run.sh:
* ext/amrwb/gstamrwb.c: (plugin_init):
* ext/amrwb/gstamrwbdec.c: (gst_amrwbdec_base_init),
(gst_amrwbdec_class_init), (gst_amrwbdec_init),
(gst_amrwbdec_setcaps), (gst_amrwbdec_event), (gst_amrwbdec_chain),
(gst_amrwbdec_state_change):
* ext/amrwb/gstamrwbdec.h:
* ext/amrwb/gstamrwbenc.c: (gst_amrwbenc_base_init),
(gst_amrwbenc_class_init), (gst_amrwbenc_init),
(gst_amrwbenc_finalize), (gst_amrwbenc_setcaps),
(gst_amrwbenc_chain), (gst_amrwbenc_state_change):
* ext/amrwb/gstamrwbenc.h:
* ext/amrwb/gstamrwbparse.c: (gst_amrwbparse_base_init),
(gst_amrwbparse_class_init), (gst_amrwbparse_init),
(gst_amrwbparse_querytypes), (gst_amrwbparse_query),
(gst_amrwbparse_chain), (gst_amrwbparse_read_header),
(gst_amrwbparse_loop), (gst_amrwbparse_sink_activate),
(gst_amrwbparse_sink_activate_pull), (gst_amrwbparse_state_change):
* ext/amrwb/gstamrwbparse.h:
Added new plugin amrwb parse.
Renamed audio/AMR to audio/AMR-WB as per spec.
Fixes #333307
2006-03-29 16:50:08 +00:00
|
|
|
|
2007-06-20 08:42:17 +00:00
|
|
|
/* discontinuity, don't combine samples before and after the
|
|
|
|
* DISCONT */
|
|
|
|
if (GST_BUFFER_FLAG_IS_SET (buffer, GST_BUFFER_FLAG_DISCONT)) {
|
|
|
|
gst_adapter_clear (amrwbdec->adapter);
|
|
|
|
amrwbdec->ts = -1;
|
|
|
|
amrwbdec->discont = TRUE;
|
|
|
|
}
|
Added new plugin amrwb parse.
Original commit message from CVS:
Patch by: Renato Araujo Oliveira Filho <renatox at gmail dot com>
* configure.ac:
* ext/Makefile.am:
* ext/amrwb/Makefile.am:
* ext/amrwb/README:
* ext/amrwb/amrwb-code/Makefile.am:
* ext/amrwb/amrwb-code/run.sh:
* ext/amrwb/gstamrwb.c: (plugin_init):
* ext/amrwb/gstamrwbdec.c: (gst_amrwbdec_base_init),
(gst_amrwbdec_class_init), (gst_amrwbdec_init),
(gst_amrwbdec_setcaps), (gst_amrwbdec_event), (gst_amrwbdec_chain),
(gst_amrwbdec_state_change):
* ext/amrwb/gstamrwbdec.h:
* ext/amrwb/gstamrwbenc.c: (gst_amrwbenc_base_init),
(gst_amrwbenc_class_init), (gst_amrwbenc_init),
(gst_amrwbenc_finalize), (gst_amrwbenc_setcaps),
(gst_amrwbenc_chain), (gst_amrwbenc_state_change):
* ext/amrwb/gstamrwbenc.h:
* ext/amrwb/gstamrwbparse.c: (gst_amrwbparse_base_init),
(gst_amrwbparse_class_init), (gst_amrwbparse_init),
(gst_amrwbparse_querytypes), (gst_amrwbparse_query),
(gst_amrwbparse_chain), (gst_amrwbparse_read_header),
(gst_amrwbparse_loop), (gst_amrwbparse_sink_activate),
(gst_amrwbparse_sink_activate_pull), (gst_amrwbparse_state_change):
* ext/amrwb/gstamrwbparse.h:
Added new plugin amrwb parse.
Renamed audio/AMR to audio/AMR-WB as per spec.
Fixes #333307
2006-03-29 16:50:08 +00:00
|
|
|
|
2007-06-20 08:42:17 +00:00
|
|
|
/* take latest timestamp, FIXME timestamp is the one of the
|
|
|
|
* first buffer in the adapter. */
|
Added new plugin amrwb parse.
Original commit message from CVS:
Patch by: Renato Araujo Oliveira Filho <renatox at gmail dot com>
* configure.ac:
* ext/Makefile.am:
* ext/amrwb/Makefile.am:
* ext/amrwb/README:
* ext/amrwb/amrwb-code/Makefile.am:
* ext/amrwb/amrwb-code/run.sh:
* ext/amrwb/gstamrwb.c: (plugin_init):
* ext/amrwb/gstamrwbdec.c: (gst_amrwbdec_base_init),
(gst_amrwbdec_class_init), (gst_amrwbdec_init),
(gst_amrwbdec_setcaps), (gst_amrwbdec_event), (gst_amrwbdec_chain),
(gst_amrwbdec_state_change):
* ext/amrwb/gstamrwbdec.h:
* ext/amrwb/gstamrwbenc.c: (gst_amrwbenc_base_init),
(gst_amrwbenc_class_init), (gst_amrwbenc_init),
(gst_amrwbenc_finalize), (gst_amrwbenc_setcaps),
(gst_amrwbenc_chain), (gst_amrwbenc_state_change):
* ext/amrwb/gstamrwbenc.h:
* ext/amrwb/gstamrwbparse.c: (gst_amrwbparse_base_init),
(gst_amrwbparse_class_init), (gst_amrwbparse_init),
(gst_amrwbparse_querytypes), (gst_amrwbparse_query),
(gst_amrwbparse_chain), (gst_amrwbparse_read_header),
(gst_amrwbparse_loop), (gst_amrwbparse_sink_activate),
(gst_amrwbparse_sink_activate_pull), (gst_amrwbparse_state_change):
* ext/amrwb/gstamrwbparse.h:
Added new plugin amrwb parse.
Renamed audio/AMR to audio/AMR-WB as per spec.
Fixes #333307
2006-03-29 16:50:08 +00:00
|
|
|
if (GST_BUFFER_TIMESTAMP_IS_VALID (buffer))
|
|
|
|
amrwbdec->ts = GST_BUFFER_TIMESTAMP (buffer);
|
|
|
|
|
|
|
|
gst_adapter_push (amrwbdec->adapter, buffer);
|
|
|
|
|
|
|
|
while (TRUE) {
|
|
|
|
GstBuffer *out;
|
2007-06-20 08:42:17 +00:00
|
|
|
const guint8 *data;
|
|
|
|
gint block, mode;
|
Added new plugin amrwb parse.
Original commit message from CVS:
Patch by: Renato Araujo Oliveira Filho <renatox at gmail dot com>
* configure.ac:
* ext/Makefile.am:
* ext/amrwb/Makefile.am:
* ext/amrwb/README:
* ext/amrwb/amrwb-code/Makefile.am:
* ext/amrwb/amrwb-code/run.sh:
* ext/amrwb/gstamrwb.c: (plugin_init):
* ext/amrwb/gstamrwbdec.c: (gst_amrwbdec_base_init),
(gst_amrwbdec_class_init), (gst_amrwbdec_init),
(gst_amrwbdec_setcaps), (gst_amrwbdec_event), (gst_amrwbdec_chain),
(gst_amrwbdec_state_change):
* ext/amrwb/gstamrwbdec.h:
* ext/amrwb/gstamrwbenc.c: (gst_amrwbenc_base_init),
(gst_amrwbenc_class_init), (gst_amrwbenc_init),
(gst_amrwbenc_finalize), (gst_amrwbenc_setcaps),
(gst_amrwbenc_chain), (gst_amrwbenc_state_change):
* ext/amrwb/gstamrwbenc.h:
* ext/amrwb/gstamrwbparse.c: (gst_amrwbparse_base_init),
(gst_amrwbparse_class_init), (gst_amrwbparse_init),
(gst_amrwbparse_querytypes), (gst_amrwbparse_query),
(gst_amrwbparse_chain), (gst_amrwbparse_read_header),
(gst_amrwbparse_loop), (gst_amrwbparse_sink_activate),
(gst_amrwbparse_sink_activate_pull), (gst_amrwbparse_state_change):
* ext/amrwb/gstamrwbparse.h:
Added new plugin amrwb parse.
Renamed audio/AMR to audio/AMR-WB as per spec.
Fixes #333307
2006-03-29 16:50:08 +00:00
|
|
|
|
2007-06-20 08:42:17 +00:00
|
|
|
/* need to peek data to get the size */
|
Added new plugin amrwb parse.
Original commit message from CVS:
Patch by: Renato Araujo Oliveira Filho <renatox at gmail dot com>
* configure.ac:
* ext/Makefile.am:
* ext/amrwb/Makefile.am:
* ext/amrwb/README:
* ext/amrwb/amrwb-code/Makefile.am:
* ext/amrwb/amrwb-code/run.sh:
* ext/amrwb/gstamrwb.c: (plugin_init):
* ext/amrwb/gstamrwbdec.c: (gst_amrwbdec_base_init),
(gst_amrwbdec_class_init), (gst_amrwbdec_init),
(gst_amrwbdec_setcaps), (gst_amrwbdec_event), (gst_amrwbdec_chain),
(gst_amrwbdec_state_change):
* ext/amrwb/gstamrwbdec.h:
* ext/amrwb/gstamrwbenc.c: (gst_amrwbenc_base_init),
(gst_amrwbenc_class_init), (gst_amrwbenc_init),
(gst_amrwbenc_finalize), (gst_amrwbenc_setcaps),
(gst_amrwbenc_chain), (gst_amrwbenc_state_change):
* ext/amrwb/gstamrwbenc.h:
* ext/amrwb/gstamrwbparse.c: (gst_amrwbparse_base_init),
(gst_amrwbparse_class_init), (gst_amrwbparse_init),
(gst_amrwbparse_querytypes), (gst_amrwbparse_query),
(gst_amrwbparse_chain), (gst_amrwbparse_read_header),
(gst_amrwbparse_loop), (gst_amrwbparse_sink_activate),
(gst_amrwbparse_sink_activate_pull), (gst_amrwbparse_state_change):
* ext/amrwb/gstamrwbparse.h:
Added new plugin amrwb parse.
Renamed audio/AMR to audio/AMR-WB as per spec.
Fixes #333307
2006-03-29 16:50:08 +00:00
|
|
|
if (gst_adapter_available (amrwbdec->adapter) < 1)
|
|
|
|
break;
|
2007-06-20 08:42:17 +00:00
|
|
|
data = gst_adapter_peek (amrwbdec->adapter, 1);
|
Added new plugin amrwb parse.
Original commit message from CVS:
Patch by: Renato Araujo Oliveira Filho <renatox at gmail dot com>
* configure.ac:
* ext/Makefile.am:
* ext/amrwb/Makefile.am:
* ext/amrwb/README:
* ext/amrwb/amrwb-code/Makefile.am:
* ext/amrwb/amrwb-code/run.sh:
* ext/amrwb/gstamrwb.c: (plugin_init):
* ext/amrwb/gstamrwbdec.c: (gst_amrwbdec_base_init),
(gst_amrwbdec_class_init), (gst_amrwbdec_init),
(gst_amrwbdec_setcaps), (gst_amrwbdec_event), (gst_amrwbdec_chain),
(gst_amrwbdec_state_change):
* ext/amrwb/gstamrwbdec.h:
* ext/amrwb/gstamrwbenc.c: (gst_amrwbenc_base_init),
(gst_amrwbenc_class_init), (gst_amrwbenc_init),
(gst_amrwbenc_finalize), (gst_amrwbenc_setcaps),
(gst_amrwbenc_chain), (gst_amrwbenc_state_change):
* ext/amrwb/gstamrwbenc.h:
* ext/amrwb/gstamrwbparse.c: (gst_amrwbparse_base_init),
(gst_amrwbparse_class_init), (gst_amrwbparse_init),
(gst_amrwbparse_querytypes), (gst_amrwbparse_query),
(gst_amrwbparse_chain), (gst_amrwbparse_read_header),
(gst_amrwbparse_loop), (gst_amrwbparse_sink_activate),
(gst_amrwbparse_sink_activate_pull), (gst_amrwbparse_state_change):
* ext/amrwb/gstamrwbparse.h:
Added new plugin amrwb parse.
Renamed audio/AMR to audio/AMR-WB as per spec.
Fixes #333307
2006-03-29 16:50:08 +00:00
|
|
|
|
|
|
|
/* get size */
|
2007-06-20 08:42:17 +00:00
|
|
|
mode = (data[0] >> 3) & 0x0F;
|
Added new plugin amrwb parse.
Original commit message from CVS:
Patch by: Renato Araujo Oliveira Filho <renatox at gmail dot com>
* configure.ac:
* ext/Makefile.am:
* ext/amrwb/Makefile.am:
* ext/amrwb/README:
* ext/amrwb/amrwb-code/Makefile.am:
* ext/amrwb/amrwb-code/run.sh:
* ext/amrwb/gstamrwb.c: (plugin_init):
* ext/amrwb/gstamrwbdec.c: (gst_amrwbdec_base_init),
(gst_amrwbdec_class_init), (gst_amrwbdec_init),
(gst_amrwbdec_setcaps), (gst_amrwbdec_event), (gst_amrwbdec_chain),
(gst_amrwbdec_state_change):
* ext/amrwb/gstamrwbdec.h:
* ext/amrwb/gstamrwbenc.c: (gst_amrwbenc_base_init),
(gst_amrwbenc_class_init), (gst_amrwbenc_init),
(gst_amrwbenc_finalize), (gst_amrwbenc_setcaps),
(gst_amrwbenc_chain), (gst_amrwbenc_state_change):
* ext/amrwb/gstamrwbenc.h:
* ext/amrwb/gstamrwbparse.c: (gst_amrwbparse_base_init),
(gst_amrwbparse_class_init), (gst_amrwbparse_init),
(gst_amrwbparse_querytypes), (gst_amrwbparse_query),
(gst_amrwbparse_chain), (gst_amrwbparse_read_header),
(gst_amrwbparse_loop), (gst_amrwbparse_sink_activate),
(gst_amrwbparse_sink_activate_pull), (gst_amrwbparse_state_change):
* ext/amrwb/gstamrwbparse.h:
Added new plugin amrwb parse.
Renamed audio/AMR to audio/AMR-WB as per spec.
Fixes #333307
2006-03-29 16:50:08 +00:00
|
|
|
block = block_size[mode];
|
|
|
|
|
2007-06-20 08:42:17 +00:00
|
|
|
GST_DEBUG_OBJECT (amrwbdec, "mode %d, block %d", mode, block);
|
|
|
|
|
|
|
|
if (!block || gst_adapter_available (amrwbdec->adapter) < block)
|
Added new plugin amrwb parse.
Original commit message from CVS:
Patch by: Renato Araujo Oliveira Filho <renatox at gmail dot com>
* configure.ac:
* ext/Makefile.am:
* ext/amrwb/Makefile.am:
* ext/amrwb/README:
* ext/amrwb/amrwb-code/Makefile.am:
* ext/amrwb/amrwb-code/run.sh:
* ext/amrwb/gstamrwb.c: (plugin_init):
* ext/amrwb/gstamrwbdec.c: (gst_amrwbdec_base_init),
(gst_amrwbdec_class_init), (gst_amrwbdec_init),
(gst_amrwbdec_setcaps), (gst_amrwbdec_event), (gst_amrwbdec_chain),
(gst_amrwbdec_state_change):
* ext/amrwb/gstamrwbdec.h:
* ext/amrwb/gstamrwbenc.c: (gst_amrwbenc_base_init),
(gst_amrwbenc_class_init), (gst_amrwbenc_init),
(gst_amrwbenc_finalize), (gst_amrwbenc_setcaps),
(gst_amrwbenc_chain), (gst_amrwbenc_state_change):
* ext/amrwb/gstamrwbenc.h:
* ext/amrwb/gstamrwbparse.c: (gst_amrwbparse_base_init),
(gst_amrwbparse_class_init), (gst_amrwbparse_init),
(gst_amrwbparse_querytypes), (gst_amrwbparse_query),
(gst_amrwbparse_chain), (gst_amrwbparse_read_header),
(gst_amrwbparse_loop), (gst_amrwbparse_sink_activate),
(gst_amrwbparse_sink_activate_pull), (gst_amrwbparse_state_change):
* ext/amrwb/gstamrwbparse.h:
Added new plugin amrwb parse.
Renamed audio/AMR to audio/AMR-WB as per spec.
Fixes #333307
2006-03-29 16:50:08 +00:00
|
|
|
break;
|
|
|
|
|
2007-06-20 08:42:17 +00:00
|
|
|
/* the library seems to write into the source data, hence the copy. */
|
|
|
|
data = gst_adapter_take (amrwbdec->adapter, block);
|
Added new plugin amrwb parse.
Original commit message from CVS:
Patch by: Renato Araujo Oliveira Filho <renatox at gmail dot com>
* configure.ac:
* ext/Makefile.am:
* ext/amrwb/Makefile.am:
* ext/amrwb/README:
* ext/amrwb/amrwb-code/Makefile.am:
* ext/amrwb/amrwb-code/run.sh:
* ext/amrwb/gstamrwb.c: (plugin_init):
* ext/amrwb/gstamrwbdec.c: (gst_amrwbdec_base_init),
(gst_amrwbdec_class_init), (gst_amrwbdec_init),
(gst_amrwbdec_setcaps), (gst_amrwbdec_event), (gst_amrwbdec_chain),
(gst_amrwbdec_state_change):
* ext/amrwb/gstamrwbdec.h:
* ext/amrwb/gstamrwbenc.c: (gst_amrwbenc_base_init),
(gst_amrwbenc_class_init), (gst_amrwbenc_init),
(gst_amrwbenc_finalize), (gst_amrwbenc_setcaps),
(gst_amrwbenc_chain), (gst_amrwbenc_state_change):
* ext/amrwb/gstamrwbenc.h:
* ext/amrwb/gstamrwbparse.c: (gst_amrwbparse_base_init),
(gst_amrwbparse_class_init), (gst_amrwbparse_init),
(gst_amrwbparse_querytypes), (gst_amrwbparse_query),
(gst_amrwbparse_chain), (gst_amrwbparse_read_header),
(gst_amrwbparse_loop), (gst_amrwbparse_sink_activate),
(gst_amrwbparse_sink_activate_pull), (gst_amrwbparse_state_change):
* ext/amrwb/gstamrwbparse.h:
Added new plugin amrwb parse.
Renamed audio/AMR to audio/AMR-WB as per spec.
Fixes #333307
2006-03-29 16:50:08 +00:00
|
|
|
|
|
|
|
/* get output */
|
2007-06-20 08:42:17 +00:00
|
|
|
out = gst_buffer_new_and_alloc (sizeof (gint16) * L_FRAME16k);
|
Added new plugin amrwb parse.
Original commit message from CVS:
Patch by: Renato Araujo Oliveira Filho <renatox at gmail dot com>
* configure.ac:
* ext/Makefile.am:
* ext/amrwb/Makefile.am:
* ext/amrwb/README:
* ext/amrwb/amrwb-code/Makefile.am:
* ext/amrwb/amrwb-code/run.sh:
* ext/amrwb/gstamrwb.c: (plugin_init):
* ext/amrwb/gstamrwbdec.c: (gst_amrwbdec_base_init),
(gst_amrwbdec_class_init), (gst_amrwbdec_init),
(gst_amrwbdec_setcaps), (gst_amrwbdec_event), (gst_amrwbdec_chain),
(gst_amrwbdec_state_change):
* ext/amrwb/gstamrwbdec.h:
* ext/amrwb/gstamrwbenc.c: (gst_amrwbenc_base_init),
(gst_amrwbenc_class_init), (gst_amrwbenc_init),
(gst_amrwbenc_finalize), (gst_amrwbenc_setcaps),
(gst_amrwbenc_chain), (gst_amrwbenc_state_change):
* ext/amrwb/gstamrwbenc.h:
* ext/amrwb/gstamrwbparse.c: (gst_amrwbparse_base_init),
(gst_amrwbparse_class_init), (gst_amrwbparse_init),
(gst_amrwbparse_querytypes), (gst_amrwbparse_query),
(gst_amrwbparse_chain), (gst_amrwbparse_read_header),
(gst_amrwbparse_loop), (gst_amrwbparse_sink_activate),
(gst_amrwbparse_sink_activate_pull), (gst_amrwbparse_state_change):
* ext/amrwb/gstamrwbparse.h:
Added new plugin amrwb parse.
Renamed audio/AMR to audio/AMR-WB as per spec.
Fixes #333307
2006-03-29 16:50:08 +00:00
|
|
|
|
|
|
|
GST_BUFFER_DURATION (out) = amrwbdec->duration;
|
|
|
|
GST_BUFFER_TIMESTAMP (out) = amrwbdec->ts;
|
|
|
|
|
|
|
|
if (amrwbdec->ts != -1)
|
2007-06-20 08:42:17 +00:00
|
|
|
amrwbdec->ts += amrwbdec->duration;
|
|
|
|
if (amrwbdec->discont) {
|
|
|
|
GST_BUFFER_FLAG_SET (out, GST_BUFFER_FLAG_DISCONT);
|
|
|
|
amrwbdec->discont = FALSE;
|
|
|
|
}
|
Added new plugin amrwb parse.
Original commit message from CVS:
Patch by: Renato Araujo Oliveira Filho <renatox at gmail dot com>
* configure.ac:
* ext/Makefile.am:
* ext/amrwb/Makefile.am:
* ext/amrwb/README:
* ext/amrwb/amrwb-code/Makefile.am:
* ext/amrwb/amrwb-code/run.sh:
* ext/amrwb/gstamrwb.c: (plugin_init):
* ext/amrwb/gstamrwbdec.c: (gst_amrwbdec_base_init),
(gst_amrwbdec_class_init), (gst_amrwbdec_init),
(gst_amrwbdec_setcaps), (gst_amrwbdec_event), (gst_amrwbdec_chain),
(gst_amrwbdec_state_change):
* ext/amrwb/gstamrwbdec.h:
* ext/amrwb/gstamrwbenc.c: (gst_amrwbenc_base_init),
(gst_amrwbenc_class_init), (gst_amrwbenc_init),
(gst_amrwbenc_finalize), (gst_amrwbenc_setcaps),
(gst_amrwbenc_chain), (gst_amrwbenc_state_change):
* ext/amrwb/gstamrwbenc.h:
* ext/amrwb/gstamrwbparse.c: (gst_amrwbparse_base_init),
(gst_amrwbparse_class_init), (gst_amrwbparse_init),
(gst_amrwbparse_querytypes), (gst_amrwbparse_query),
(gst_amrwbparse_chain), (gst_amrwbparse_read_header),
(gst_amrwbparse_loop), (gst_amrwbparse_sink_activate),
(gst_amrwbparse_sink_activate_pull), (gst_amrwbparse_state_change):
* ext/amrwb/gstamrwbparse.h:
Added new plugin amrwb parse.
Renamed audio/AMR to audio/AMR-WB as per spec.
Fixes #333307
2006-03-29 16:50:08 +00:00
|
|
|
|
|
|
|
gst_buffer_set_caps (out, GST_PAD_CAPS (amrwbdec->srcpad));
|
|
|
|
|
|
|
|
/* decode */
|
2008-06-12 13:51:51 +00:00
|
|
|
D_IF_decode (amrwbdec->handle, (UWord8 *) data,
|
Added new plugin amrwb parse.
Original commit message from CVS:
Patch by: Renato Araujo Oliveira Filho <renatox at gmail dot com>
* configure.ac:
* ext/Makefile.am:
* ext/amrwb/Makefile.am:
* ext/amrwb/README:
* ext/amrwb/amrwb-code/Makefile.am:
* ext/amrwb/amrwb-code/run.sh:
* ext/amrwb/gstamrwb.c: (plugin_init):
* ext/amrwb/gstamrwbdec.c: (gst_amrwbdec_base_init),
(gst_amrwbdec_class_init), (gst_amrwbdec_init),
(gst_amrwbdec_setcaps), (gst_amrwbdec_event), (gst_amrwbdec_chain),
(gst_amrwbdec_state_change):
* ext/amrwb/gstamrwbdec.h:
* ext/amrwb/gstamrwbenc.c: (gst_amrwbenc_base_init),
(gst_amrwbenc_class_init), (gst_amrwbenc_init),
(gst_amrwbenc_finalize), (gst_amrwbenc_setcaps),
(gst_amrwbenc_chain), (gst_amrwbenc_state_change):
* ext/amrwb/gstamrwbenc.h:
* ext/amrwb/gstamrwbparse.c: (gst_amrwbparse_base_init),
(gst_amrwbparse_class_init), (gst_amrwbparse_init),
(gst_amrwbparse_querytypes), (gst_amrwbparse_query),
(gst_amrwbparse_chain), (gst_amrwbparse_read_header),
(gst_amrwbparse_loop), (gst_amrwbparse_sink_activate),
(gst_amrwbparse_sink_activate_pull), (gst_amrwbparse_state_change):
* ext/amrwb/gstamrwbparse.h:
Added new plugin amrwb parse.
Renamed audio/AMR to audio/AMR-WB as per spec.
Fixes #333307
2006-03-29 16:50:08 +00:00
|
|
|
(Word16 *) GST_BUFFER_DATA (out), _good_frame);
|
|
|
|
|
2007-06-20 08:42:17 +00:00
|
|
|
g_free ((gpointer) data);
|
Added new plugin amrwb parse.
Original commit message from CVS:
Patch by: Renato Araujo Oliveira Filho <renatox at gmail dot com>
* configure.ac:
* ext/Makefile.am:
* ext/amrwb/Makefile.am:
* ext/amrwb/README:
* ext/amrwb/amrwb-code/Makefile.am:
* ext/amrwb/amrwb-code/run.sh:
* ext/amrwb/gstamrwb.c: (plugin_init):
* ext/amrwb/gstamrwbdec.c: (gst_amrwbdec_base_init),
(gst_amrwbdec_class_init), (gst_amrwbdec_init),
(gst_amrwbdec_setcaps), (gst_amrwbdec_event), (gst_amrwbdec_chain),
(gst_amrwbdec_state_change):
* ext/amrwb/gstamrwbdec.h:
* ext/amrwb/gstamrwbenc.c: (gst_amrwbenc_base_init),
(gst_amrwbenc_class_init), (gst_amrwbenc_init),
(gst_amrwbenc_finalize), (gst_amrwbenc_setcaps),
(gst_amrwbenc_chain), (gst_amrwbenc_state_change):
* ext/amrwb/gstamrwbenc.h:
* ext/amrwb/gstamrwbparse.c: (gst_amrwbparse_base_init),
(gst_amrwbparse_class_init), (gst_amrwbparse_init),
(gst_amrwbparse_querytypes), (gst_amrwbparse_query),
(gst_amrwbparse_chain), (gst_amrwbparse_read_header),
(gst_amrwbparse_loop), (gst_amrwbparse_sink_activate),
(gst_amrwbparse_sink_activate_pull), (gst_amrwbparse_state_change):
* ext/amrwb/gstamrwbparse.h:
Added new plugin amrwb parse.
Renamed audio/AMR to audio/AMR-WB as per spec.
Fixes #333307
2006-03-29 16:50:08 +00:00
|
|
|
|
2007-06-20 08:42:17 +00:00
|
|
|
/* send out */
|
Added new plugin amrwb parse.
Original commit message from CVS:
Patch by: Renato Araujo Oliveira Filho <renatox at gmail dot com>
* configure.ac:
* ext/Makefile.am:
* ext/amrwb/Makefile.am:
* ext/amrwb/README:
* ext/amrwb/amrwb-code/Makefile.am:
* ext/amrwb/amrwb-code/run.sh:
* ext/amrwb/gstamrwb.c: (plugin_init):
* ext/amrwb/gstamrwbdec.c: (gst_amrwbdec_base_init),
(gst_amrwbdec_class_init), (gst_amrwbdec_init),
(gst_amrwbdec_setcaps), (gst_amrwbdec_event), (gst_amrwbdec_chain),
(gst_amrwbdec_state_change):
* ext/amrwb/gstamrwbdec.h:
* ext/amrwb/gstamrwbenc.c: (gst_amrwbenc_base_init),
(gst_amrwbenc_class_init), (gst_amrwbenc_init),
(gst_amrwbenc_finalize), (gst_amrwbenc_setcaps),
(gst_amrwbenc_chain), (gst_amrwbenc_state_change):
* ext/amrwb/gstamrwbenc.h:
* ext/amrwb/gstamrwbparse.c: (gst_amrwbparse_base_init),
(gst_amrwbparse_class_init), (gst_amrwbparse_init),
(gst_amrwbparse_querytypes), (gst_amrwbparse_query),
(gst_amrwbparse_chain), (gst_amrwbparse_read_header),
(gst_amrwbparse_loop), (gst_amrwbparse_sink_activate),
(gst_amrwbparse_sink_activate_pull), (gst_amrwbparse_state_change):
* ext/amrwb/gstamrwbparse.h:
Added new plugin amrwb parse.
Renamed audio/AMR to audio/AMR-WB as per spec.
Fixes #333307
2006-03-29 16:50:08 +00:00
|
|
|
ret = gst_pad_push (amrwbdec->srcpad, out);
|
|
|
|
}
|
|
|
|
|
|
|
|
gst_object_unref (amrwbdec);
|
|
|
|
return ret;
|
|
|
|
|
2007-06-20 08:42:17 +00:00
|
|
|
/* ERRORS */
|
|
|
|
not_negotiated:
|
|
|
|
{
|
|
|
|
GST_ELEMENT_ERROR (amrwbdec, STREAM, TYPE_NOT_FOUND, (NULL),
|
|
|
|
("Decoder is not initialized"));
|
|
|
|
gst_object_unref (amrwbdec);
|
|
|
|
return GST_FLOW_NOT_NEGOTIATED;
|
|
|
|
}
|
Added new plugin amrwb parse.
Original commit message from CVS:
Patch by: Renato Araujo Oliveira Filho <renatox at gmail dot com>
* configure.ac:
* ext/Makefile.am:
* ext/amrwb/Makefile.am:
* ext/amrwb/README:
* ext/amrwb/amrwb-code/Makefile.am:
* ext/amrwb/amrwb-code/run.sh:
* ext/amrwb/gstamrwb.c: (plugin_init):
* ext/amrwb/gstamrwbdec.c: (gst_amrwbdec_base_init),
(gst_amrwbdec_class_init), (gst_amrwbdec_init),
(gst_amrwbdec_setcaps), (gst_amrwbdec_event), (gst_amrwbdec_chain),
(gst_amrwbdec_state_change):
* ext/amrwb/gstamrwbdec.h:
* ext/amrwb/gstamrwbenc.c: (gst_amrwbenc_base_init),
(gst_amrwbenc_class_init), (gst_amrwbenc_init),
(gst_amrwbenc_finalize), (gst_amrwbenc_setcaps),
(gst_amrwbenc_chain), (gst_amrwbenc_state_change):
* ext/amrwb/gstamrwbenc.h:
* ext/amrwb/gstamrwbparse.c: (gst_amrwbparse_base_init),
(gst_amrwbparse_class_init), (gst_amrwbparse_init),
(gst_amrwbparse_querytypes), (gst_amrwbparse_query),
(gst_amrwbparse_chain), (gst_amrwbparse_read_header),
(gst_amrwbparse_loop), (gst_amrwbparse_sink_activate),
(gst_amrwbparse_sink_activate_pull), (gst_amrwbparse_state_change):
* ext/amrwb/gstamrwbparse.h:
Added new plugin amrwb parse.
Renamed audio/AMR to audio/AMR-WB as per spec.
Fixes #333307
2006-03-29 16:50:08 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static GstStateChangeReturn
|
|
|
|
gst_amrwbdec_state_change (GstElement * element, GstStateChange transition)
|
|
|
|
{
|
|
|
|
GstAmrwbDec *amrwbdec;
|
|
|
|
GstStateChangeReturn ret;
|
|
|
|
|
|
|
|
amrwbdec = GST_AMRWBDEC (element);
|
|
|
|
|
|
|
|
switch (transition) {
|
|
|
|
case GST_STATE_CHANGE_NULL_TO_READY:
|
|
|
|
if (!(amrwbdec->handle = D_IF_init ()))
|
|
|
|
goto init_failed;
|
|
|
|
break;
|
|
|
|
case GST_STATE_CHANGE_READY_TO_PAUSED:
|
|
|
|
gst_adapter_clear (amrwbdec->adapter);
|
|
|
|
amrwbdec->rate = 0;
|
|
|
|
amrwbdec->channels = 0;
|
|
|
|
amrwbdec->ts = -1;
|
2007-06-20 08:42:17 +00:00
|
|
|
amrwbdec->discont = TRUE;
|
|
|
|
gst_segment_init (&amrwbdec->segment, GST_FORMAT_TIME);
|
Added new plugin amrwb parse.
Original commit message from CVS:
Patch by: Renato Araujo Oliveira Filho <renatox at gmail dot com>
* configure.ac:
* ext/Makefile.am:
* ext/amrwb/Makefile.am:
* ext/amrwb/README:
* ext/amrwb/amrwb-code/Makefile.am:
* ext/amrwb/amrwb-code/run.sh:
* ext/amrwb/gstamrwb.c: (plugin_init):
* ext/amrwb/gstamrwbdec.c: (gst_amrwbdec_base_init),
(gst_amrwbdec_class_init), (gst_amrwbdec_init),
(gst_amrwbdec_setcaps), (gst_amrwbdec_event), (gst_amrwbdec_chain),
(gst_amrwbdec_state_change):
* ext/amrwb/gstamrwbdec.h:
* ext/amrwb/gstamrwbenc.c: (gst_amrwbenc_base_init),
(gst_amrwbenc_class_init), (gst_amrwbenc_init),
(gst_amrwbenc_finalize), (gst_amrwbenc_setcaps),
(gst_amrwbenc_chain), (gst_amrwbenc_state_change):
* ext/amrwb/gstamrwbenc.h:
* ext/amrwb/gstamrwbparse.c: (gst_amrwbparse_base_init),
(gst_amrwbparse_class_init), (gst_amrwbparse_init),
(gst_amrwbparse_querytypes), (gst_amrwbparse_query),
(gst_amrwbparse_chain), (gst_amrwbparse_read_header),
(gst_amrwbparse_loop), (gst_amrwbparse_sink_activate),
(gst_amrwbparse_sink_activate_pull), (gst_amrwbparse_state_change):
* ext/amrwb/gstamrwbparse.h:
Added new plugin amrwb parse.
Renamed audio/AMR to audio/AMR-WB as per spec.
Fixes #333307
2006-03-29 16:50:08 +00:00
|
|
|
break;
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
ret = GST_ELEMENT_CLASS (parent_class)->change_state (element, transition);
|
|
|
|
|
|
|
|
switch (transition) {
|
|
|
|
case GST_STATE_CHANGE_READY_TO_NULL:
|
|
|
|
D_IF_exit (amrwbdec->handle);
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
return ret;
|
|
|
|
|
|
|
|
/* ERRORS */
|
|
|
|
init_failed:
|
|
|
|
{
|
|
|
|
GST_ELEMENT_ERROR (amrwbdec, LIBRARY, INIT, (NULL),
|
|
|
|
("Failed to open AMR Decoder"));
|
|
|
|
return GST_STATE_CHANGE_FAILURE;
|
|
|
|
}
|
|
|
|
}
|