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 Wide-Band (AMR-WB) plugin
|
|
|
|
* Copyright (C) 2006 Edgard Lima <edgard.lima@indt.org.br>
|
|
|
|
*
|
|
|
|
* 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-05 08:45:32 +00:00
|
|
|
/**
|
2007-07-03 09:18:22 +00:00
|
|
|
* SECTION:element-amrwbenc
|
|
|
|
* @see_also: #GstAmrwbDec, #GstAmrwbParse
|
|
|
|
*
|
2008-06-13 11:59:23 +00:00
|
|
|
* AMR wideband encoder based on the
|
2007-07-03 09:18:22 +00:00
|
|
|
* <ulink url="http://www.penguin.cz/~utx/amr">reference codec implementation</ulink>.
|
2008-06-13 11:59:23 +00:00
|
|
|
*
|
|
|
|
* <refsect2>
|
2007-07-03 09:18:22 +00:00
|
|
|
* <title>Example launch line</title>
|
2008-06-13 11:59:23 +00:00
|
|
|
* |[
|
2007-07-03 09:18:22 +00:00
|
|
|
* gst-launch filesrc location=abc.wav ! wavparse ! audioresample ! audioconvert ! amrwbenc ! filesink location=abc.amr
|
2008-06-13 11:59:23 +00:00
|
|
|
* ]|
|
2007-07-03 09:18:22 +00:00
|
|
|
* Please not that the above stream misses the header, that is needed to play
|
|
|
|
* the stream.
|
|
|
|
* </refsect2>
|
|
|
|
*/
|
|
|
|
|
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 "gstamrwbenc.h"
|
|
|
|
|
2007-09-16 07:28:18 +00:00
|
|
|
/* these defines are not in all .h files */
|
|
|
|
#ifndef MR660
|
|
|
|
#define MR660 0
|
|
|
|
#define MR885 1
|
|
|
|
#define MR1265 2
|
|
|
|
#define MR1425 2
|
|
|
|
#define MR1585 3
|
|
|
|
#define MR1825 4
|
|
|
|
#define MR1985 5
|
|
|
|
#define MR2305 6
|
|
|
|
#define MR2385 7
|
|
|
|
#define MRDTX 8
|
|
|
|
#endif
|
|
|
|
|
|
|
|
static GType
|
2010-03-23 10:10:05 +00:00
|
|
|
gst_amrwbenc_bandmode_get_type (void)
|
2007-09-16 07:28:18 +00:00
|
|
|
{
|
|
|
|
static GType gst_amrwbenc_bandmode_type = 0;
|
|
|
|
static GEnumValue gst_amrwbenc_bandmode[] = {
|
|
|
|
{MR660, "MR660", "MR660"},
|
|
|
|
{MR885, "MR885", "MR885"},
|
|
|
|
{MR1265, "MR1265", "MR1265"},
|
|
|
|
{MR1425, "MR1425", "MR1425"},
|
|
|
|
{MR1585, "MR1585", "MR1585"},
|
|
|
|
{MR1825, "MR1825", "MR1825"},
|
|
|
|
{MR1985, "MR1985", "MR1985"},
|
|
|
|
{MR2305, "MR2305", "MR2305"},
|
|
|
|
{MR2385, "MR2385", "MR2385"},
|
|
|
|
{MRDTX, "MRDTX", "MRDTX"},
|
|
|
|
{0, NULL, NULL},
|
|
|
|
};
|
|
|
|
if (!gst_amrwbenc_bandmode_type) {
|
|
|
|
gst_amrwbenc_bandmode_type =
|
2009-08-24 17:16:15 +00:00
|
|
|
g_enum_register_static ("GstAmrWbEncBandMode", gst_amrwbenc_bandmode);
|
2007-09-16 07:28:18 +00:00
|
|
|
}
|
|
|
|
return gst_amrwbenc_bandmode_type;
|
|
|
|
}
|
|
|
|
|
|
|
|
#define GST_AMRWBENC_BANDMODE_TYPE (gst_amrwbenc_bandmode_get_type())
|
|
|
|
|
|
|
|
#define BANDMODE_DEFAULT MR660
|
|
|
|
|
|
|
|
enum
|
|
|
|
{
|
|
|
|
PROP_0,
|
|
|
|
PROP_BANDMODE
|
|
|
|
};
|
|
|
|
|
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 GstStaticPadTemplate sink_template = GST_STATIC_PAD_TEMPLATE ("sink",
|
|
|
|
GST_PAD_SINK,
|
|
|
|
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")
|
|
|
|
);
|
|
|
|
|
|
|
|
static GstStaticPadTemplate src_template = GST_STATIC_PAD_TEMPLATE ("src",
|
|
|
|
GST_PAD_SRC,
|
|
|
|
GST_PAD_ALWAYS,
|
|
|
|
GST_STATIC_CAPS ("audio/AMR-WB, "
|
|
|
|
"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_amrwbenc_debug);
|
|
|
|
#define GST_CAT_DEFAULT gst_amrwbenc_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
|
|
|
static void gst_amrwbenc_finalize (GObject * object);
|
|
|
|
|
|
|
|
static GstFlowReturn gst_amrwbenc_chain (GstPad * pad, GstBuffer * buffer);
|
|
|
|
static gboolean gst_amrwbenc_setcaps (GstPad * pad, GstCaps * caps);
|
|
|
|
static GstStateChangeReturn gst_amrwbenc_state_change (GstElement * element,
|
|
|
|
GstStateChange transition);
|
|
|
|
|
2009-07-27 17:55:27 +00:00
|
|
|
static void
|
|
|
|
_do_init (GType object_type)
|
|
|
|
{
|
|
|
|
const GInterfaceInfo preset_interface_info = {
|
|
|
|
NULL, /* interface init */
|
|
|
|
NULL, /* interface finalize */
|
|
|
|
NULL /* interface_data */
|
|
|
|
};
|
|
|
|
|
|
|
|
g_type_add_interface_static (object_type, GST_TYPE_PRESET,
|
|
|
|
&preset_interface_info);
|
|
|
|
|
2009-07-27 17:59:32 +00:00
|
|
|
GST_DEBUG_CATEGORY_INIT (gst_amrwbenc_debug, "amrwbenc", 0,
|
2009-07-27 17:55:27 +00:00
|
|
|
"AMR-WB audio encoder");
|
|
|
|
}
|
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
|
|
|
|
2009-08-24 17:16:15 +00:00
|
|
|
#define GstAmrWbEnc GstAmrwbEnc
|
|
|
|
#define GstAmrWbEncClass GstAmrwbEncClass
|
|
|
|
|
|
|
|
GST_BOILERPLATE_FULL (GstAmrWbEnc, gst_amrwbenc, GstElement, GST_TYPE_ELEMENT,
|
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
|
|
|
_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
|
|
|
|
2007-09-16 07:28:18 +00:00
|
|
|
static void
|
|
|
|
gst_amrwbenc_set_property (GObject * object, guint prop_id,
|
|
|
|
const GValue * value, GParamSpec * pspec)
|
|
|
|
{
|
|
|
|
GstAmrwbEnc *self = GST_AMRWBENC (object);
|
|
|
|
|
|
|
|
switch (prop_id) {
|
|
|
|
case PROP_BANDMODE:
|
|
|
|
self->bandmode = g_value_get_enum (value);
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gst_amrwbenc_get_property (GObject * object, guint prop_id,
|
|
|
|
GValue * value, GParamSpec * pspec)
|
|
|
|
{
|
|
|
|
GstAmrwbEnc *self = GST_AMRWBENC (object);
|
|
|
|
|
|
|
|
switch (prop_id) {
|
|
|
|
case PROP_BANDMODE:
|
|
|
|
g_value_set_enum (value, self->bandmode);
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2006-05-06 00:15:59 +00:00
|
|
|
static void
|
|
|
|
gst_amrwbenc_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);
|
|
|
|
|
|
|
|
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));
|
|
|
|
|
2010-03-18 16:30:26 +00:00
|
|
|
gst_element_class_set_details_simple (element_class, "AMR-WB audio encoder",
|
|
|
|
"Codec/Encoder/Audio",
|
|
|
|
"Adaptive Multi-Rate Wideband audio encoder",
|
|
|
|
"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
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gst_amrwbenc_class_init (GstAmrwbEncClass * klass)
|
|
|
|
{
|
|
|
|
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
|
|
|
GstElementClass *element_class = GST_ELEMENT_CLASS (klass);
|
|
|
|
|
|
|
|
object_class->finalize = gst_amrwbenc_finalize;
|
2007-09-16 07:28:18 +00:00
|
|
|
object_class->set_property = gst_amrwbenc_set_property;
|
|
|
|
object_class->get_property = gst_amrwbenc_get_property;
|
|
|
|
|
|
|
|
g_object_class_install_property (object_class, PROP_BANDMODE,
|
|
|
|
g_param_spec_enum ("band-mode", "Band Mode",
|
|
|
|
"Encoding Band Mode (Kbps)", GST_AMRWBENC_BANDMODE_TYPE,
|
|
|
|
BANDMODE_DEFAULT, G_PARAM_READWRITE | G_PARAM_CONSTRUCT));
|
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
|
|
|
element_class->change_state = GST_DEBUG_FUNCPTR (gst_amrwbenc_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_amrwbenc_init (GstAmrwbEnc * amrwbenc, GstAmrwbEncClass * klass)
|
|
|
|
{
|
|
|
|
/* create the sink pad */
|
2007-06-22 10:46:33 +00:00
|
|
|
amrwbenc->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 (amrwbenc->sinkpad, gst_amrwbenc_setcaps);
|
|
|
|
gst_pad_set_chain_function (amrwbenc->sinkpad, gst_amrwbenc_chain);
|
|
|
|
gst_element_add_pad (GST_ELEMENT (amrwbenc), amrwbenc->sinkpad);
|
|
|
|
|
|
|
|
/* create the src pad */
|
2007-06-22 10:46:33 +00:00
|
|
|
amrwbenc->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 (amrwbenc->srcpad);
|
|
|
|
gst_element_add_pad (GST_ELEMENT (amrwbenc), amrwbenc->srcpad);
|
|
|
|
|
|
|
|
amrwbenc->adapter = gst_adapter_new ();
|
|
|
|
|
|
|
|
/* init rest */
|
|
|
|
amrwbenc->handle = NULL;
|
|
|
|
amrwbenc->channels = 0;
|
|
|
|
amrwbenc->rate = 0;
|
|
|
|
amrwbenc->ts = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gst_amrwbenc_finalize (GObject * object)
|
|
|
|
{
|
|
|
|
GstAmrwbEnc *amrwbenc;
|
|
|
|
|
|
|
|
amrwbenc = GST_AMRWBENC (object);
|
|
|
|
|
|
|
|
g_object_unref (G_OBJECT (amrwbenc->adapter));
|
|
|
|
amrwbenc->adapter = NULL;
|
|
|
|
|
|
|
|
G_OBJECT_CLASS (parent_class)->finalize (object);
|
|
|
|
}
|
|
|
|
|
|
|
|
static gboolean
|
|
|
|
gst_amrwbenc_setcaps (GstPad * pad, GstCaps * caps)
|
|
|
|
{
|
|
|
|
GstStructure *structure;
|
|
|
|
GstAmrwbEnc *amrwbenc;
|
|
|
|
GstCaps *copy;
|
|
|
|
|
|
|
|
amrwbenc = GST_AMRWBENC (GST_PAD_PARENT (pad));
|
|
|
|
|
|
|
|
structure = gst_caps_get_structure (caps, 0);
|
|
|
|
|
|
|
|
/* get channel count */
|
|
|
|
gst_structure_get_int (structure, "channels", &amrwbenc->channels);
|
|
|
|
gst_structure_get_int (structure, "rate", &amrwbenc->rate);
|
|
|
|
|
|
|
|
/* this is not wrong but will sound bad */
|
|
|
|
if (amrwbenc->channels != 1) {
|
|
|
|
GST_WARNING ("amrwbdec is only optimized for mono channels");
|
|
|
|
}
|
|
|
|
if (amrwbenc->rate != 16000) {
|
|
|
|
GST_WARNING ("amrwbdec is only optimized for 16000 Hz samplerate");
|
|
|
|
}
|
|
|
|
|
|
|
|
/* create reverse caps */
|
|
|
|
copy = gst_caps_new_simple ("audio/AMR-WB",
|
|
|
|
"channels", G_TYPE_INT, amrwbenc->channels,
|
|
|
|
"rate", G_TYPE_INT, amrwbenc->rate, NULL);
|
|
|
|
|
|
|
|
gst_pad_set_caps (amrwbenc->srcpad, copy);
|
|
|
|
gst_caps_unref (copy);
|
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static GstFlowReturn
|
|
|
|
gst_amrwbenc_chain (GstPad * pad, GstBuffer * buffer)
|
|
|
|
{
|
|
|
|
GstAmrwbEnc *amrwbenc;
|
|
|
|
GstFlowReturn ret = GST_FLOW_OK;
|
|
|
|
const int buffer_size = sizeof (Word16) * L_FRAME16k;
|
|
|
|
|
|
|
|
amrwbenc = GST_AMRWBENC (gst_pad_get_parent (pad));
|
|
|
|
|
|
|
|
g_return_val_if_fail (amrwbenc->handle, GST_FLOW_WRONG_STATE);
|
|
|
|
|
|
|
|
if (amrwbenc->rate == 0 || amrwbenc->channels == 0) {
|
|
|
|
ret = GST_FLOW_NOT_NEGOTIATED;
|
|
|
|
goto done;
|
|
|
|
}
|
|
|
|
|
2008-10-09 10:01:37 +00:00
|
|
|
/* discontinuity clears adapter, FIXME, maybe we can set some
|
|
|
|
* encoder flag to mask the discont. */
|
|
|
|
if (GST_BUFFER_FLAG_IS_SET (buffer, GST_BUFFER_FLAG_DISCONT)) {
|
|
|
|
gst_adapter_clear (amrwbenc->adapter);
|
|
|
|
amrwbenc->ts = 0;
|
|
|
|
amrwbenc->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
|
|
|
if (GST_BUFFER_TIMESTAMP_IS_VALID (buffer))
|
|
|
|
amrwbenc->ts = GST_BUFFER_TIMESTAMP (buffer);
|
|
|
|
|
|
|
|
ret = GST_FLOW_OK;
|
|
|
|
gst_adapter_push (amrwbenc->adapter, buffer);
|
|
|
|
|
|
|
|
/* Collect samples until we have enough for an output frame */
|
|
|
|
while (gst_adapter_available (amrwbenc->adapter) >= buffer_size) {
|
|
|
|
GstBuffer *out;
|
|
|
|
guint8 *data;
|
|
|
|
gint outsize;
|
|
|
|
|
|
|
|
out = gst_buffer_new_and_alloc (buffer_size);
|
|
|
|
GST_BUFFER_DURATION (out) = GST_SECOND * L_FRAME16k /
|
|
|
|
(amrwbenc->rate * amrwbenc->channels);
|
|
|
|
GST_BUFFER_TIMESTAMP (out) = amrwbenc->ts;
|
2008-10-09 10:01:37 +00:00
|
|
|
if (amrwbenc->ts != -1) {
|
|
|
|
amrwbenc->ts += GST_BUFFER_DURATION (out);
|
|
|
|
}
|
|
|
|
if (amrwbenc->discont) {
|
|
|
|
GST_BUFFER_FLAG_SET (out, GST_BUFFER_FLAG_DISCONT);
|
|
|
|
amrwbenc->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_get_caps (amrwbenc->srcpad));
|
|
|
|
|
|
|
|
data = (guint8 *) gst_adapter_peek (amrwbenc->adapter, buffer_size);
|
|
|
|
|
|
|
|
/* encode */
|
2007-09-16 07:28:18 +00:00
|
|
|
outsize =
|
|
|
|
E_IF_encode (amrwbenc->handle, amrwbenc->bandmode, (Word16 *) 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
|
|
|
(UWord8 *) GST_BUFFER_DATA (out), 0);
|
|
|
|
|
|
|
|
gst_adapter_flush (amrwbenc->adapter, buffer_size);
|
|
|
|
GST_BUFFER_SIZE (out) = outsize;
|
|
|
|
|
2008-10-09 10:01:37 +00:00
|
|
|
/* play */
|
|
|
|
if ((ret = gst_pad_push (amrwbenc->srcpad, out)) != GST_FLOW_OK)
|
|
|
|
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
|
|
|
}
|
|
|
|
|
|
|
|
done:
|
|
|
|
|
|
|
|
gst_object_unref (amrwbenc);
|
|
|
|
return ret;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
static GstStateChangeReturn
|
|
|
|
gst_amrwbenc_state_change (GstElement * element, GstStateChange transition)
|
|
|
|
{
|
|
|
|
GstAmrwbEnc *amrwbenc;
|
|
|
|
GstStateChangeReturn ret;
|
|
|
|
|
|
|
|
amrwbenc = GST_AMRWBENC (element);
|
|
|
|
|
|
|
|
switch (transition) {
|
|
|
|
case GST_STATE_CHANGE_NULL_TO_READY:
|
|
|
|
if (!(amrwbenc->handle = E_IF_init ()))
|
|
|
|
return GST_STATE_CHANGE_FAILURE;
|
|
|
|
break;
|
|
|
|
case GST_STATE_CHANGE_READY_TO_PAUSED:
|
2008-10-09 10:01:37 +00:00
|
|
|
amrwbenc->rate = 0;
|
|
|
|
amrwbenc->channels = 0;
|
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
|
|
|
amrwbenc->ts = 0;
|
2008-10-09 10:01:37 +00:00
|
|
|
amrwbenc->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_adapter_clear (amrwbenc->adapter);
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
ret = GST_ELEMENT_CLASS (parent_class)->change_state (element, transition);
|
|
|
|
|
|
|
|
switch (transition) {
|
|
|
|
case GST_STATE_CHANGE_READY_TO_NULL:
|
|
|
|
E_IF_exit (amrwbenc->handle);
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
return ret;
|
|
|
|
}
|