2001-12-26 21:51:41 +00:00
|
|
|
/* GStreamer
|
|
|
|
* Copyright (C) <2001> David I. Lehn <dlehn@users.sourceforge.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.
|
|
|
|
*/
|
|
|
|
|
2003-01-31 00:18:23 +00:00
|
|
|
#ifdef HAVE_CONFIG_H
|
|
|
|
#include "config.h"
|
|
|
|
#endif
|
|
|
|
|
2001-12-26 21:51:41 +00:00
|
|
|
#include <string.h>
|
|
|
|
|
|
|
|
#include <stdlib.h>
|
2004-02-03 02:40:15 +00:00
|
|
|
#include "_stdint.h"
|
2003-04-04 20:46:06 +00:00
|
|
|
|
2001-12-26 21:51:41 +00:00
|
|
|
#include <gst/gst.h>
|
Surround sound support.
Original commit message from CVS:
* ext/a52dec/gsta52dec.c: (gst_a52dec_channels), (gst_a52dec_push),
(gst_a52dec_reneg), (gst_a52dec_loop), (plugin_init):
* ext/alsa/gstalsa.c: (gst_alsa_get_caps):
* ext/alsa/gstalsaplugin.c: (plugin_init):
* ext/dts/gstdtsdec.c: (gst_dtsdec_channels),
(gst_dtsdec_renegotiate), (gst_dtsdec_loop), (plugin_init):
* ext/faad/gstfaad.c: (gst_faad_init), (gst_faad_chanpos_from_gst),
(gst_faad_chanpos_to_gst), (gst_faad_sinkconnect),
(gst_faad_srcgetcaps), (gst_faad_srcconnect), (gst_faad_chain),
(gst_faad_change_state), (plugin_init):
* ext/faad/gstfaad.h:
* ext/vorbis/vorbis.c: (plugin_init):
* ext/vorbis/vorbisdec.c: (vorbis_dec_chain):
* gst-libs/gst/audio/Makefile.am:
* gst-libs/gst/audio/audio.c: (plugin_init):
* gst-libs/gst/audio/multichannel.c:
(gst_audio_check_channel_positions),
(gst_audio_get_channel_positions),
(gst_audio_set_channel_positions),
(gst_audio_set_structure_channel_positions_list),
(add_list_to_struct), (gst_audio_set_caps_channel_positions_list),
(gst_audio_fixate_channel_positions):
* gst-libs/gst/audio/multichannel.h:
* gst-libs/gst/audio/testchannels.c: (main):
* gst/audioconvert/gstaudioconvert.c:
(gst_audio_convert_class_init), (gst_audio_convert_init),
(gst_audio_convert_dispose), (gst_audio_convert_getcaps),
(gst_audio_convert_parse_caps), (gst_audio_convert_link),
(gst_audio_convert_fixate), (gst_audio_convert_channels):
* gst/audioconvert/plugin.c: (plugin_init):
Surround sound support.
2004-11-25 20:36:29 +00:00
|
|
|
#include <gst/audio/multichannel.h>
|
|
|
|
|
2001-12-26 21:51:41 +00:00
|
|
|
#include <a52dec/a52.h>
|
|
|
|
#include <a52dec/mm_accel.h>
|
|
|
|
#include "gsta52dec.h"
|
|
|
|
|
|
|
|
/* elementfactory information */
|
|
|
|
static GstElementDetails gst_a52dec_details = {
|
|
|
|
"ATSC A/52 audio decoder",
|
2004-05-09 14:37:15 +00:00
|
|
|
"Codec/Decoder/Audio",
|
2001-12-26 21:51:41 +00:00
|
|
|
"Decodes ATSC A/52 encoded audio streams",
|
|
|
|
"David I. Lehn <dlehn@users.sourceforge.net>",
|
|
|
|
};
|
|
|
|
|
Surround sound support.
Original commit message from CVS:
* ext/a52dec/gsta52dec.c: (gst_a52dec_channels), (gst_a52dec_push),
(gst_a52dec_reneg), (gst_a52dec_loop), (plugin_init):
* ext/alsa/gstalsa.c: (gst_alsa_get_caps):
* ext/alsa/gstalsaplugin.c: (plugin_init):
* ext/dts/gstdtsdec.c: (gst_dtsdec_channels),
(gst_dtsdec_renegotiate), (gst_dtsdec_loop), (plugin_init):
* ext/faad/gstfaad.c: (gst_faad_init), (gst_faad_chanpos_from_gst),
(gst_faad_chanpos_to_gst), (gst_faad_sinkconnect),
(gst_faad_srcgetcaps), (gst_faad_srcconnect), (gst_faad_chain),
(gst_faad_change_state), (plugin_init):
* ext/faad/gstfaad.h:
* ext/vorbis/vorbis.c: (plugin_init):
* ext/vorbis/vorbisdec.c: (vorbis_dec_chain):
* gst-libs/gst/audio/Makefile.am:
* gst-libs/gst/audio/audio.c: (plugin_init):
* gst-libs/gst/audio/multichannel.c:
(gst_audio_check_channel_positions),
(gst_audio_get_channel_positions),
(gst_audio_set_channel_positions),
(gst_audio_set_structure_channel_positions_list),
(add_list_to_struct), (gst_audio_set_caps_channel_positions_list),
(gst_audio_fixate_channel_positions):
* gst-libs/gst/audio/multichannel.h:
* gst-libs/gst/audio/testchannels.c: (main):
* gst/audioconvert/gstaudioconvert.c:
(gst_audio_convert_class_init), (gst_audio_convert_init),
(gst_audio_convert_dispose), (gst_audio_convert_getcaps),
(gst_audio_convert_parse_caps), (gst_audio_convert_link),
(gst_audio_convert_fixate), (gst_audio_convert_channels):
* gst/audioconvert/plugin.c: (plugin_init):
Surround sound support.
2004-11-25 20:36:29 +00:00
|
|
|
#ifdef LIBA52_DOUBLE
|
|
|
|
#define SAMPLE_WIDTH 64
|
|
|
|
#else
|
|
|
|
#define SAMPLE_WIDTH 32
|
|
|
|
#endif
|
|
|
|
|
2004-04-01 11:48:27 +00:00
|
|
|
GST_DEBUG_CATEGORY_STATIC (a52dec_debug);
|
|
|
|
#define GST_CAT_DEFAULT (a52dec_debug)
|
2001-12-26 21:51:41 +00:00
|
|
|
|
|
|
|
/* A52Dec signals and args */
|
|
|
|
enum
|
|
|
|
{
|
|
|
|
/* FILL ME */
|
|
|
|
LAST_SIGNAL
|
|
|
|
};
|
|
|
|
|
|
|
|
enum
|
|
|
|
{
|
|
|
|
ARG_0,
|
2004-05-21 23:28:57 +00:00
|
|
|
ARG_DRC
|
2001-12-26 21:51:41 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
/*
|
2004-05-10 00:27:36 +00:00
|
|
|
* "audio/a52", "audio/x-a52" and "audio/ac3" should not be used (deprecated names)
|
|
|
|
* Only use "audio/x-ac3" in new code.
|
2001-12-26 21:51:41 +00:00
|
|
|
*/
|
2004-03-14 22:34:30 +00:00
|
|
|
static GstStaticPadTemplate sink_factory = GST_STATIC_PAD_TEMPLATE ("sink",
|
|
|
|
GST_PAD_SINK,
|
|
|
|
GST_PAD_ALWAYS,
|
|
|
|
GST_STATIC_CAPS ("audio/x-ac3")
|
|
|
|
);
|
|
|
|
|
|
|
|
static GstStaticPadTemplate src_factory = GST_STATIC_PAD_TEMPLATE ("src",
|
|
|
|
GST_PAD_SRC,
|
|
|
|
GST_PAD_ALWAYS,
|
Surround sound support.
Original commit message from CVS:
* ext/a52dec/gsta52dec.c: (gst_a52dec_channels), (gst_a52dec_push),
(gst_a52dec_reneg), (gst_a52dec_loop), (plugin_init):
* ext/alsa/gstalsa.c: (gst_alsa_get_caps):
* ext/alsa/gstalsaplugin.c: (plugin_init):
* ext/dts/gstdtsdec.c: (gst_dtsdec_channels),
(gst_dtsdec_renegotiate), (gst_dtsdec_loop), (plugin_init):
* ext/faad/gstfaad.c: (gst_faad_init), (gst_faad_chanpos_from_gst),
(gst_faad_chanpos_to_gst), (gst_faad_sinkconnect),
(gst_faad_srcgetcaps), (gst_faad_srcconnect), (gst_faad_chain),
(gst_faad_change_state), (plugin_init):
* ext/faad/gstfaad.h:
* ext/vorbis/vorbis.c: (plugin_init):
* ext/vorbis/vorbisdec.c: (vorbis_dec_chain):
* gst-libs/gst/audio/Makefile.am:
* gst-libs/gst/audio/audio.c: (plugin_init):
* gst-libs/gst/audio/multichannel.c:
(gst_audio_check_channel_positions),
(gst_audio_get_channel_positions),
(gst_audio_set_channel_positions),
(gst_audio_set_structure_channel_positions_list),
(add_list_to_struct), (gst_audio_set_caps_channel_positions_list),
(gst_audio_fixate_channel_positions):
* gst-libs/gst/audio/multichannel.h:
* gst-libs/gst/audio/testchannels.c: (main):
* gst/audioconvert/gstaudioconvert.c:
(gst_audio_convert_class_init), (gst_audio_convert_init),
(gst_audio_convert_dispose), (gst_audio_convert_getcaps),
(gst_audio_convert_parse_caps), (gst_audio_convert_link),
(gst_audio_convert_fixate), (gst_audio_convert_channels):
* gst/audioconvert/plugin.c: (plugin_init):
Surround sound support.
2004-11-25 20:36:29 +00:00
|
|
|
GST_STATIC_CAPS ("audio/x-raw-float, "
|
2004-03-15 19:32:25 +00:00
|
|
|
"endianness = (int) BYTE_ORDER, "
|
Surround sound support.
Original commit message from CVS:
* ext/a52dec/gsta52dec.c: (gst_a52dec_channels), (gst_a52dec_push),
(gst_a52dec_reneg), (gst_a52dec_loop), (plugin_init):
* ext/alsa/gstalsa.c: (gst_alsa_get_caps):
* ext/alsa/gstalsaplugin.c: (plugin_init):
* ext/dts/gstdtsdec.c: (gst_dtsdec_channels),
(gst_dtsdec_renegotiate), (gst_dtsdec_loop), (plugin_init):
* ext/faad/gstfaad.c: (gst_faad_init), (gst_faad_chanpos_from_gst),
(gst_faad_chanpos_to_gst), (gst_faad_sinkconnect),
(gst_faad_srcgetcaps), (gst_faad_srcconnect), (gst_faad_chain),
(gst_faad_change_state), (plugin_init):
* ext/faad/gstfaad.h:
* ext/vorbis/vorbis.c: (plugin_init):
* ext/vorbis/vorbisdec.c: (vorbis_dec_chain):
* gst-libs/gst/audio/Makefile.am:
* gst-libs/gst/audio/audio.c: (plugin_init):
* gst-libs/gst/audio/multichannel.c:
(gst_audio_check_channel_positions),
(gst_audio_get_channel_positions),
(gst_audio_set_channel_positions),
(gst_audio_set_structure_channel_positions_list),
(add_list_to_struct), (gst_audio_set_caps_channel_positions_list),
(gst_audio_fixate_channel_positions):
* gst-libs/gst/audio/multichannel.h:
* gst-libs/gst/audio/testchannels.c: (main):
* gst/audioconvert/gstaudioconvert.c:
(gst_audio_convert_class_init), (gst_audio_convert_init),
(gst_audio_convert_dispose), (gst_audio_convert_getcaps),
(gst_audio_convert_parse_caps), (gst_audio_convert_link),
(gst_audio_convert_fixate), (gst_audio_convert_channels):
* gst/audioconvert/plugin.c: (plugin_init):
Surround sound support.
2004-11-25 20:36:29 +00:00
|
|
|
"width = (int) " G_STRINGIFY (SAMPLE_WIDTH) ", "
|
ext/a52dec/gsta52dec.c: Add buffer-frames=0.
Original commit message from CVS:
* ext/a52dec/gsta52dec.c: (gst_a52dec_reneg):
Add buffer-frames=0.
* ext/dvdread/dvdreadsrc.c: (dvdreadsrc_get_type),
(dvdreadsrc_init), (dvdreadsrc_get_event_mask),
(dvdreadsrc_get_query_types), (dvdreadsrc_get_formats),
(dvdreadsrc_srcpad_event), (dvdreadsrc_srcpad_query),
(_seek_title), (_seek_chapter), (get_next_cell_for), (_read),
(seek_sector), (dvdreadsrc_get), (dvdreadsrc_open_file),
(dvdreadsrc_change_state), (dvdreadsrc_uri_get_type),
(dvdreadsrc_uri_get_protocols), (dvdreadsrc_uri_get_uri),
(dvdreadsrc_uri_set_uri), (dvdreadsrc_uri_handler_init):
* ext/dvdread/dvdreadsrc.h:
Add seeking, querying for bytes, sectors, title, angle and
chapter. Handle multiple chapters. Relicense to LGPL because
Billy agreed on that (thanks Billy!).
2004-11-27 17:20:26 +00:00
|
|
|
"rate = (int) [ 4000, 96000 ], "
|
|
|
|
"channels = (int) [ 1, 6 ], " "buffer-frames = (int) 0")
|
2004-03-14 22:34:30 +00:00
|
|
|
);
|
|
|
|
|
|
|
|
static void gst_a52dec_base_init (gpointer g_class);
|
|
|
|
static void gst_a52dec_class_init (GstA52DecClass * klass);
|
|
|
|
static void gst_a52dec_init (GstA52Dec * a52dec);
|
|
|
|
|
|
|
|
static void gst_a52dec_loop (GstElement * element);
|
|
|
|
static GstElementStateReturn gst_a52dec_change_state (GstElement * element);
|
|
|
|
|
|
|
|
static void gst_a52dec_set_property (GObject * object, guint prop_id,
|
|
|
|
const GValue * value, GParamSpec * pspec);
|
|
|
|
static void gst_a52dec_get_property (GObject * object, guint prop_id,
|
|
|
|
GValue * value, GParamSpec * pspec);
|
2001-12-26 21:51:41 +00:00
|
|
|
|
|
|
|
static GstElementClass *parent_class = NULL;
|
2004-03-14 22:34:30 +00:00
|
|
|
|
2001-12-26 21:51:41 +00:00
|
|
|
/* static guint gst_a52dec_signals[LAST_SIGNAL] = { 0 }; */
|
|
|
|
|
|
|
|
GType
|
|
|
|
gst_a52dec_get_type (void)
|
|
|
|
{
|
|
|
|
static GType a52dec_type = 0;
|
|
|
|
|
|
|
|
if (!a52dec_type) {
|
|
|
|
static const GTypeInfo a52dec_info = {
|
2004-03-14 22:34:30 +00:00
|
|
|
sizeof (GstA52DecClass),
|
|
|
|
gst_a52dec_base_init,
|
2003-11-01 01:32:03 +00:00
|
|
|
NULL, (GClassInitFunc) gst_a52dec_class_init,
|
2001-12-26 21:51:41 +00:00
|
|
|
NULL,
|
|
|
|
NULL,
|
|
|
|
sizeof (GstA52Dec),
|
|
|
|
0,
|
|
|
|
(GInstanceInitFunc) gst_a52dec_init,
|
|
|
|
};
|
|
|
|
|
2004-03-14 22:34:30 +00:00
|
|
|
a52dec_type =
|
2004-03-15 19:32:25 +00:00
|
|
|
g_type_register_static (GST_TYPE_ELEMENT, "GstA52Dec", &a52dec_info, 0);
|
2004-04-01 11:48:27 +00:00
|
|
|
|
|
|
|
GST_DEBUG_CATEGORY_INIT (a52dec_debug, "a52dec", 0,
|
|
|
|
"AC3/A52 software decoder");
|
2001-12-26 21:51:41 +00:00
|
|
|
}
|
|
|
|
return a52dec_type;
|
|
|
|
}
|
|
|
|
|
2003-11-01 01:32:03 +00:00
|
|
|
static void
|
|
|
|
gst_a52dec_base_init (gpointer g_class)
|
|
|
|
{
|
|
|
|
GstElementClass *element_class = GST_ELEMENT_CLASS (g_class);
|
|
|
|
|
|
|
|
gst_element_class_add_pad_template (element_class,
|
2003-12-22 01:47:08 +00:00
|
|
|
gst_static_pad_template_get (&sink_factory));
|
2003-11-01 01:32:03 +00:00
|
|
|
gst_element_class_add_pad_template (element_class,
|
2003-12-22 01:47:08 +00:00
|
|
|
gst_static_pad_template_get (&src_factory));
|
2003-11-01 01:32:03 +00:00
|
|
|
gst_element_class_set_details (element_class, &gst_a52dec_details);
|
|
|
|
}
|
|
|
|
|
2001-12-26 21:51:41 +00:00
|
|
|
static void
|
|
|
|
gst_a52dec_class_init (GstA52DecClass * klass)
|
|
|
|
{
|
|
|
|
GObjectClass *gobject_class;
|
|
|
|
GstElementClass *gstelement_class;
|
|
|
|
|
|
|
|
gobject_class = (GObjectClass *) klass;
|
|
|
|
gstelement_class = (GstElementClass *) klass;
|
|
|
|
|
|
|
|
parent_class = g_type_class_ref (GST_TYPE_ELEMENT);
|
|
|
|
g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_DRC,
|
2004-03-14 22:34:30 +00:00
|
|
|
g_param_spec_boolean ("drc", "Dynamic Range Compression",
|
2004-03-15 19:32:25 +00:00
|
|
|
"Use Dynamic Range Compression", FALSE, G_PARAM_READWRITE));
|
2001-12-26 21:51:41 +00:00
|
|
|
|
|
|
|
gobject_class->set_property = gst_a52dec_set_property;
|
|
|
|
gobject_class->get_property = gst_a52dec_get_property;
|
|
|
|
|
|
|
|
gstelement_class->change_state = gst_a52dec_change_state;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gst_a52dec_init (GstA52Dec * a52dec)
|
|
|
|
{
|
|
|
|
/* create the sink and src pads */
|
2004-03-14 22:34:30 +00:00
|
|
|
a52dec->sinkpad =
|
|
|
|
gst_pad_new_from_template (gst_element_get_pad_template (GST_ELEMENT
|
2004-03-15 19:32:25 +00:00
|
|
|
(a52dec), "sink"), "sink");
|
2001-12-26 21:51:41 +00:00
|
|
|
gst_element_add_pad (GST_ELEMENT (a52dec), a52dec->sinkpad);
|
|
|
|
gst_element_set_loop_function ((GstElement *) a52dec, gst_a52dec_loop);
|
|
|
|
|
2004-03-14 22:34:30 +00:00
|
|
|
a52dec->srcpad =
|
|
|
|
gst_pad_new_from_template (gst_element_get_pad_template (GST_ELEMENT
|
2004-03-15 19:32:25 +00:00
|
|
|
(a52dec), "src"), "src");
|
2004-01-02 07:09:23 +00:00
|
|
|
gst_pad_use_explicit_caps (a52dec->srcpad);
|
2001-12-26 21:51:41 +00:00
|
|
|
gst_element_add_pad (GST_ELEMENT (a52dec), a52dec->srcpad);
|
|
|
|
|
2004-04-01 11:48:27 +00:00
|
|
|
GST_FLAG_SET (GST_ELEMENT (a52dec), GST_ELEMENT_EVENT_AWARE);
|
2001-12-26 21:51:41 +00:00
|
|
|
a52dec->dynamic_range_compression = FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
2004-11-27 19:41:26 +00:00
|
|
|
gst_a52dec_channels (int flags, GstAudioChannelPosition ** _pos)
|
2001-12-26 21:51:41 +00:00
|
|
|
{
|
|
|
|
int chans = 0;
|
2004-11-27 19:41:26 +00:00
|
|
|
GstAudioChannelPosition *pos = NULL;
|
2001-12-26 21:51:41 +00:00
|
|
|
|
Surround sound support.
Original commit message from CVS:
* ext/a52dec/gsta52dec.c: (gst_a52dec_channels), (gst_a52dec_push),
(gst_a52dec_reneg), (gst_a52dec_loop), (plugin_init):
* ext/alsa/gstalsa.c: (gst_alsa_get_caps):
* ext/alsa/gstalsaplugin.c: (plugin_init):
* ext/dts/gstdtsdec.c: (gst_dtsdec_channels),
(gst_dtsdec_renegotiate), (gst_dtsdec_loop), (plugin_init):
* ext/faad/gstfaad.c: (gst_faad_init), (gst_faad_chanpos_from_gst),
(gst_faad_chanpos_to_gst), (gst_faad_sinkconnect),
(gst_faad_srcgetcaps), (gst_faad_srcconnect), (gst_faad_chain),
(gst_faad_change_state), (plugin_init):
* ext/faad/gstfaad.h:
* ext/vorbis/vorbis.c: (plugin_init):
* ext/vorbis/vorbisdec.c: (vorbis_dec_chain):
* gst-libs/gst/audio/Makefile.am:
* gst-libs/gst/audio/audio.c: (plugin_init):
* gst-libs/gst/audio/multichannel.c:
(gst_audio_check_channel_positions),
(gst_audio_get_channel_positions),
(gst_audio_set_channel_positions),
(gst_audio_set_structure_channel_positions_list),
(add_list_to_struct), (gst_audio_set_caps_channel_positions_list),
(gst_audio_fixate_channel_positions):
* gst-libs/gst/audio/multichannel.h:
* gst-libs/gst/audio/testchannels.c: (main):
* gst/audioconvert/gstaudioconvert.c:
(gst_audio_convert_class_init), (gst_audio_convert_init),
(gst_audio_convert_dispose), (gst_audio_convert_getcaps),
(gst_audio_convert_parse_caps), (gst_audio_convert_link),
(gst_audio_convert_fixate), (gst_audio_convert_channels):
* gst/audioconvert/plugin.c: (plugin_init):
Surround sound support.
2004-11-25 20:36:29 +00:00
|
|
|
/* allocated just for safety. Number makes no sense */
|
2004-11-27 19:41:26 +00:00
|
|
|
if (_pos) {
|
|
|
|
pos = g_new (GstAudioChannelPosition, 6);
|
|
|
|
*_pos = pos;
|
Surround sound support.
Original commit message from CVS:
* ext/a52dec/gsta52dec.c: (gst_a52dec_channels), (gst_a52dec_push),
(gst_a52dec_reneg), (gst_a52dec_loop), (plugin_init):
* ext/alsa/gstalsa.c: (gst_alsa_get_caps):
* ext/alsa/gstalsaplugin.c: (plugin_init):
* ext/dts/gstdtsdec.c: (gst_dtsdec_channels),
(gst_dtsdec_renegotiate), (gst_dtsdec_loop), (plugin_init):
* ext/faad/gstfaad.c: (gst_faad_init), (gst_faad_chanpos_from_gst),
(gst_faad_chanpos_to_gst), (gst_faad_sinkconnect),
(gst_faad_srcgetcaps), (gst_faad_srcconnect), (gst_faad_chain),
(gst_faad_change_state), (plugin_init):
* ext/faad/gstfaad.h:
* ext/vorbis/vorbis.c: (plugin_init):
* ext/vorbis/vorbisdec.c: (vorbis_dec_chain):
* gst-libs/gst/audio/Makefile.am:
* gst-libs/gst/audio/audio.c: (plugin_init):
* gst-libs/gst/audio/multichannel.c:
(gst_audio_check_channel_positions),
(gst_audio_get_channel_positions),
(gst_audio_set_channel_positions),
(gst_audio_set_structure_channel_positions_list),
(add_list_to_struct), (gst_audio_set_caps_channel_positions_list),
(gst_audio_fixate_channel_positions):
* gst-libs/gst/audio/multichannel.h:
* gst-libs/gst/audio/testchannels.c: (main):
* gst/audioconvert/gstaudioconvert.c:
(gst_audio_convert_class_init), (gst_audio_convert_init),
(gst_audio_convert_dispose), (gst_audio_convert_getcaps),
(gst_audio_convert_parse_caps), (gst_audio_convert_link),
(gst_audio_convert_fixate), (gst_audio_convert_channels):
* gst/audioconvert/plugin.c: (plugin_init):
Surround sound support.
2004-11-25 20:36:29 +00:00
|
|
|
}
|
|
|
|
|
2001-12-26 21:51:41 +00:00
|
|
|
if (flags & A52_LFE) {
|
|
|
|
chans += 1;
|
2004-11-27 19:41:26 +00:00
|
|
|
if (pos) {
|
|
|
|
pos[0] = GST_AUDIO_CHANNEL_POSITION_LFE;
|
|
|
|
}
|
2001-12-26 21:51:41 +00:00
|
|
|
}
|
|
|
|
flags &= A52_CHANNEL_MASK;
|
|
|
|
switch (flags) {
|
|
|
|
case A52_3F2R:
|
Surround sound support.
Original commit message from CVS:
* ext/a52dec/gsta52dec.c: (gst_a52dec_channels), (gst_a52dec_push),
(gst_a52dec_reneg), (gst_a52dec_loop), (plugin_init):
* ext/alsa/gstalsa.c: (gst_alsa_get_caps):
* ext/alsa/gstalsaplugin.c: (plugin_init):
* ext/dts/gstdtsdec.c: (gst_dtsdec_channels),
(gst_dtsdec_renegotiate), (gst_dtsdec_loop), (plugin_init):
* ext/faad/gstfaad.c: (gst_faad_init), (gst_faad_chanpos_from_gst),
(gst_faad_chanpos_to_gst), (gst_faad_sinkconnect),
(gst_faad_srcgetcaps), (gst_faad_srcconnect), (gst_faad_chain),
(gst_faad_change_state), (plugin_init):
* ext/faad/gstfaad.h:
* ext/vorbis/vorbis.c: (plugin_init):
* ext/vorbis/vorbisdec.c: (vorbis_dec_chain):
* gst-libs/gst/audio/Makefile.am:
* gst-libs/gst/audio/audio.c: (plugin_init):
* gst-libs/gst/audio/multichannel.c:
(gst_audio_check_channel_positions),
(gst_audio_get_channel_positions),
(gst_audio_set_channel_positions),
(gst_audio_set_structure_channel_positions_list),
(add_list_to_struct), (gst_audio_set_caps_channel_positions_list),
(gst_audio_fixate_channel_positions):
* gst-libs/gst/audio/multichannel.h:
* gst-libs/gst/audio/testchannels.c: (main):
* gst/audioconvert/gstaudioconvert.c:
(gst_audio_convert_class_init), (gst_audio_convert_init),
(gst_audio_convert_dispose), (gst_audio_convert_getcaps),
(gst_audio_convert_parse_caps), (gst_audio_convert_link),
(gst_audio_convert_fixate), (gst_audio_convert_channels):
* gst/audioconvert/plugin.c: (plugin_init):
Surround sound support.
2004-11-25 20:36:29 +00:00
|
|
|
if (pos) {
|
2004-11-27 19:41:26 +00:00
|
|
|
pos[0 + chans] = GST_AUDIO_CHANNEL_POSITION_FRONT_LEFT;
|
|
|
|
pos[1 + chans] = GST_AUDIO_CHANNEL_POSITION_FRONT_CENTER;
|
|
|
|
pos[2 + chans] = GST_AUDIO_CHANNEL_POSITION_FRONT_RIGHT;
|
|
|
|
pos[3 + chans] = GST_AUDIO_CHANNEL_POSITION_REAR_LEFT;
|
|
|
|
pos[4 + chans] = GST_AUDIO_CHANNEL_POSITION_REAR_RIGHT;
|
Surround sound support.
Original commit message from CVS:
* ext/a52dec/gsta52dec.c: (gst_a52dec_channels), (gst_a52dec_push),
(gst_a52dec_reneg), (gst_a52dec_loop), (plugin_init):
* ext/alsa/gstalsa.c: (gst_alsa_get_caps):
* ext/alsa/gstalsaplugin.c: (plugin_init):
* ext/dts/gstdtsdec.c: (gst_dtsdec_channels),
(gst_dtsdec_renegotiate), (gst_dtsdec_loop), (plugin_init):
* ext/faad/gstfaad.c: (gst_faad_init), (gst_faad_chanpos_from_gst),
(gst_faad_chanpos_to_gst), (gst_faad_sinkconnect),
(gst_faad_srcgetcaps), (gst_faad_srcconnect), (gst_faad_chain),
(gst_faad_change_state), (plugin_init):
* ext/faad/gstfaad.h:
* ext/vorbis/vorbis.c: (plugin_init):
* ext/vorbis/vorbisdec.c: (vorbis_dec_chain):
* gst-libs/gst/audio/Makefile.am:
* gst-libs/gst/audio/audio.c: (plugin_init):
* gst-libs/gst/audio/multichannel.c:
(gst_audio_check_channel_positions),
(gst_audio_get_channel_positions),
(gst_audio_set_channel_positions),
(gst_audio_set_structure_channel_positions_list),
(add_list_to_struct), (gst_audio_set_caps_channel_positions_list),
(gst_audio_fixate_channel_positions):
* gst-libs/gst/audio/multichannel.h:
* gst-libs/gst/audio/testchannels.c: (main):
* gst/audioconvert/gstaudioconvert.c:
(gst_audio_convert_class_init), (gst_audio_convert_init),
(gst_audio_convert_dispose), (gst_audio_convert_getcaps),
(gst_audio_convert_parse_caps), (gst_audio_convert_link),
(gst_audio_convert_fixate), (gst_audio_convert_channels):
* gst/audioconvert/plugin.c: (plugin_init):
Surround sound support.
2004-11-25 20:36:29 +00:00
|
|
|
}
|
2001-12-26 21:51:41 +00:00
|
|
|
chans += 5;
|
|
|
|
break;
|
|
|
|
case A52_2F2R:
|
Surround sound support.
Original commit message from CVS:
* ext/a52dec/gsta52dec.c: (gst_a52dec_channels), (gst_a52dec_push),
(gst_a52dec_reneg), (gst_a52dec_loop), (plugin_init):
* ext/alsa/gstalsa.c: (gst_alsa_get_caps):
* ext/alsa/gstalsaplugin.c: (plugin_init):
* ext/dts/gstdtsdec.c: (gst_dtsdec_channels),
(gst_dtsdec_renegotiate), (gst_dtsdec_loop), (plugin_init):
* ext/faad/gstfaad.c: (gst_faad_init), (gst_faad_chanpos_from_gst),
(gst_faad_chanpos_to_gst), (gst_faad_sinkconnect),
(gst_faad_srcgetcaps), (gst_faad_srcconnect), (gst_faad_chain),
(gst_faad_change_state), (plugin_init):
* ext/faad/gstfaad.h:
* ext/vorbis/vorbis.c: (plugin_init):
* ext/vorbis/vorbisdec.c: (vorbis_dec_chain):
* gst-libs/gst/audio/Makefile.am:
* gst-libs/gst/audio/audio.c: (plugin_init):
* gst-libs/gst/audio/multichannel.c:
(gst_audio_check_channel_positions),
(gst_audio_get_channel_positions),
(gst_audio_set_channel_positions),
(gst_audio_set_structure_channel_positions_list),
(add_list_to_struct), (gst_audio_set_caps_channel_positions_list),
(gst_audio_fixate_channel_positions):
* gst-libs/gst/audio/multichannel.h:
* gst-libs/gst/audio/testchannels.c: (main):
* gst/audioconvert/gstaudioconvert.c:
(gst_audio_convert_class_init), (gst_audio_convert_init),
(gst_audio_convert_dispose), (gst_audio_convert_getcaps),
(gst_audio_convert_parse_caps), (gst_audio_convert_link),
(gst_audio_convert_fixate), (gst_audio_convert_channels):
* gst/audioconvert/plugin.c: (plugin_init):
Surround sound support.
2004-11-25 20:36:29 +00:00
|
|
|
if (pos) {
|
2004-11-27 19:41:26 +00:00
|
|
|
pos[0 + chans] = GST_AUDIO_CHANNEL_POSITION_FRONT_LEFT;
|
|
|
|
pos[1 + chans] = GST_AUDIO_CHANNEL_POSITION_FRONT_RIGHT;
|
|
|
|
pos[2 + chans] = GST_AUDIO_CHANNEL_POSITION_REAR_LEFT;
|
|
|
|
pos[3 + chans] = GST_AUDIO_CHANNEL_POSITION_REAR_RIGHT;
|
Surround sound support.
Original commit message from CVS:
* ext/a52dec/gsta52dec.c: (gst_a52dec_channels), (gst_a52dec_push),
(gst_a52dec_reneg), (gst_a52dec_loop), (plugin_init):
* ext/alsa/gstalsa.c: (gst_alsa_get_caps):
* ext/alsa/gstalsaplugin.c: (plugin_init):
* ext/dts/gstdtsdec.c: (gst_dtsdec_channels),
(gst_dtsdec_renegotiate), (gst_dtsdec_loop), (plugin_init):
* ext/faad/gstfaad.c: (gst_faad_init), (gst_faad_chanpos_from_gst),
(gst_faad_chanpos_to_gst), (gst_faad_sinkconnect),
(gst_faad_srcgetcaps), (gst_faad_srcconnect), (gst_faad_chain),
(gst_faad_change_state), (plugin_init):
* ext/faad/gstfaad.h:
* ext/vorbis/vorbis.c: (plugin_init):
* ext/vorbis/vorbisdec.c: (vorbis_dec_chain):
* gst-libs/gst/audio/Makefile.am:
* gst-libs/gst/audio/audio.c: (plugin_init):
* gst-libs/gst/audio/multichannel.c:
(gst_audio_check_channel_positions),
(gst_audio_get_channel_positions),
(gst_audio_set_channel_positions),
(gst_audio_set_structure_channel_positions_list),
(add_list_to_struct), (gst_audio_set_caps_channel_positions_list),
(gst_audio_fixate_channel_positions):
* gst-libs/gst/audio/multichannel.h:
* gst-libs/gst/audio/testchannels.c: (main):
* gst/audioconvert/gstaudioconvert.c:
(gst_audio_convert_class_init), (gst_audio_convert_init),
(gst_audio_convert_dispose), (gst_audio_convert_getcaps),
(gst_audio_convert_parse_caps), (gst_audio_convert_link),
(gst_audio_convert_fixate), (gst_audio_convert_channels):
* gst/audioconvert/plugin.c: (plugin_init):
Surround sound support.
2004-11-25 20:36:29 +00:00
|
|
|
}
|
|
|
|
chans += 4;
|
|
|
|
break;
|
2001-12-26 21:51:41 +00:00
|
|
|
case A52_3F1R:
|
Surround sound support.
Original commit message from CVS:
* ext/a52dec/gsta52dec.c: (gst_a52dec_channels), (gst_a52dec_push),
(gst_a52dec_reneg), (gst_a52dec_loop), (plugin_init):
* ext/alsa/gstalsa.c: (gst_alsa_get_caps):
* ext/alsa/gstalsaplugin.c: (plugin_init):
* ext/dts/gstdtsdec.c: (gst_dtsdec_channels),
(gst_dtsdec_renegotiate), (gst_dtsdec_loop), (plugin_init):
* ext/faad/gstfaad.c: (gst_faad_init), (gst_faad_chanpos_from_gst),
(gst_faad_chanpos_to_gst), (gst_faad_sinkconnect),
(gst_faad_srcgetcaps), (gst_faad_srcconnect), (gst_faad_chain),
(gst_faad_change_state), (plugin_init):
* ext/faad/gstfaad.h:
* ext/vorbis/vorbis.c: (plugin_init):
* ext/vorbis/vorbisdec.c: (vorbis_dec_chain):
* gst-libs/gst/audio/Makefile.am:
* gst-libs/gst/audio/audio.c: (plugin_init):
* gst-libs/gst/audio/multichannel.c:
(gst_audio_check_channel_positions),
(gst_audio_get_channel_positions),
(gst_audio_set_channel_positions),
(gst_audio_set_structure_channel_positions_list),
(add_list_to_struct), (gst_audio_set_caps_channel_positions_list),
(gst_audio_fixate_channel_positions):
* gst-libs/gst/audio/multichannel.h:
* gst-libs/gst/audio/testchannels.c: (main):
* gst/audioconvert/gstaudioconvert.c:
(gst_audio_convert_class_init), (gst_audio_convert_init),
(gst_audio_convert_dispose), (gst_audio_convert_getcaps),
(gst_audio_convert_parse_caps), (gst_audio_convert_link),
(gst_audio_convert_fixate), (gst_audio_convert_channels):
* gst/audioconvert/plugin.c: (plugin_init):
Surround sound support.
2004-11-25 20:36:29 +00:00
|
|
|
if (pos) {
|
2004-11-27 19:41:26 +00:00
|
|
|
pos[0 + chans] = GST_AUDIO_CHANNEL_POSITION_FRONT_LEFT;
|
|
|
|
pos[1 + chans] = GST_AUDIO_CHANNEL_POSITION_FRONT_CENTER;
|
|
|
|
pos[2 + chans] = GST_AUDIO_CHANNEL_POSITION_FRONT_RIGHT;
|
|
|
|
pos[3 + chans] = GST_AUDIO_CHANNEL_POSITION_REAR_CENTER;
|
Surround sound support.
Original commit message from CVS:
* ext/a52dec/gsta52dec.c: (gst_a52dec_channels), (gst_a52dec_push),
(gst_a52dec_reneg), (gst_a52dec_loop), (plugin_init):
* ext/alsa/gstalsa.c: (gst_alsa_get_caps):
* ext/alsa/gstalsaplugin.c: (plugin_init):
* ext/dts/gstdtsdec.c: (gst_dtsdec_channels),
(gst_dtsdec_renegotiate), (gst_dtsdec_loop), (plugin_init):
* ext/faad/gstfaad.c: (gst_faad_init), (gst_faad_chanpos_from_gst),
(gst_faad_chanpos_to_gst), (gst_faad_sinkconnect),
(gst_faad_srcgetcaps), (gst_faad_srcconnect), (gst_faad_chain),
(gst_faad_change_state), (plugin_init):
* ext/faad/gstfaad.h:
* ext/vorbis/vorbis.c: (plugin_init):
* ext/vorbis/vorbisdec.c: (vorbis_dec_chain):
* gst-libs/gst/audio/Makefile.am:
* gst-libs/gst/audio/audio.c: (plugin_init):
* gst-libs/gst/audio/multichannel.c:
(gst_audio_check_channel_positions),
(gst_audio_get_channel_positions),
(gst_audio_set_channel_positions),
(gst_audio_set_structure_channel_positions_list),
(add_list_to_struct), (gst_audio_set_caps_channel_positions_list),
(gst_audio_fixate_channel_positions):
* gst-libs/gst/audio/multichannel.h:
* gst-libs/gst/audio/testchannels.c: (main):
* gst/audioconvert/gstaudioconvert.c:
(gst_audio_convert_class_init), (gst_audio_convert_init),
(gst_audio_convert_dispose), (gst_audio_convert_getcaps),
(gst_audio_convert_parse_caps), (gst_audio_convert_link),
(gst_audio_convert_fixate), (gst_audio_convert_channels):
* gst/audioconvert/plugin.c: (plugin_init):
Surround sound support.
2004-11-25 20:36:29 +00:00
|
|
|
}
|
2001-12-26 21:51:41 +00:00
|
|
|
chans += 4;
|
|
|
|
break;
|
|
|
|
case A52_2F1R:
|
Surround sound support.
Original commit message from CVS:
* ext/a52dec/gsta52dec.c: (gst_a52dec_channels), (gst_a52dec_push),
(gst_a52dec_reneg), (gst_a52dec_loop), (plugin_init):
* ext/alsa/gstalsa.c: (gst_alsa_get_caps):
* ext/alsa/gstalsaplugin.c: (plugin_init):
* ext/dts/gstdtsdec.c: (gst_dtsdec_channels),
(gst_dtsdec_renegotiate), (gst_dtsdec_loop), (plugin_init):
* ext/faad/gstfaad.c: (gst_faad_init), (gst_faad_chanpos_from_gst),
(gst_faad_chanpos_to_gst), (gst_faad_sinkconnect),
(gst_faad_srcgetcaps), (gst_faad_srcconnect), (gst_faad_chain),
(gst_faad_change_state), (plugin_init):
* ext/faad/gstfaad.h:
* ext/vorbis/vorbis.c: (plugin_init):
* ext/vorbis/vorbisdec.c: (vorbis_dec_chain):
* gst-libs/gst/audio/Makefile.am:
* gst-libs/gst/audio/audio.c: (plugin_init):
* gst-libs/gst/audio/multichannel.c:
(gst_audio_check_channel_positions),
(gst_audio_get_channel_positions),
(gst_audio_set_channel_positions),
(gst_audio_set_structure_channel_positions_list),
(add_list_to_struct), (gst_audio_set_caps_channel_positions_list),
(gst_audio_fixate_channel_positions):
* gst-libs/gst/audio/multichannel.h:
* gst-libs/gst/audio/testchannels.c: (main):
* gst/audioconvert/gstaudioconvert.c:
(gst_audio_convert_class_init), (gst_audio_convert_init),
(gst_audio_convert_dispose), (gst_audio_convert_getcaps),
(gst_audio_convert_parse_caps), (gst_audio_convert_link),
(gst_audio_convert_fixate), (gst_audio_convert_channels):
* gst/audioconvert/plugin.c: (plugin_init):
Surround sound support.
2004-11-25 20:36:29 +00:00
|
|
|
if (pos) {
|
2004-11-27 19:41:26 +00:00
|
|
|
pos[0 + chans] = GST_AUDIO_CHANNEL_POSITION_FRONT_LEFT;
|
|
|
|
pos[1 + chans] = GST_AUDIO_CHANNEL_POSITION_FRONT_RIGHT;
|
|
|
|
pos[2 + chans] = GST_AUDIO_CHANNEL_POSITION_REAR_CENTER;
|
Surround sound support.
Original commit message from CVS:
* ext/a52dec/gsta52dec.c: (gst_a52dec_channels), (gst_a52dec_push),
(gst_a52dec_reneg), (gst_a52dec_loop), (plugin_init):
* ext/alsa/gstalsa.c: (gst_alsa_get_caps):
* ext/alsa/gstalsaplugin.c: (plugin_init):
* ext/dts/gstdtsdec.c: (gst_dtsdec_channels),
(gst_dtsdec_renegotiate), (gst_dtsdec_loop), (plugin_init):
* ext/faad/gstfaad.c: (gst_faad_init), (gst_faad_chanpos_from_gst),
(gst_faad_chanpos_to_gst), (gst_faad_sinkconnect),
(gst_faad_srcgetcaps), (gst_faad_srcconnect), (gst_faad_chain),
(gst_faad_change_state), (plugin_init):
* ext/faad/gstfaad.h:
* ext/vorbis/vorbis.c: (plugin_init):
* ext/vorbis/vorbisdec.c: (vorbis_dec_chain):
* gst-libs/gst/audio/Makefile.am:
* gst-libs/gst/audio/audio.c: (plugin_init):
* gst-libs/gst/audio/multichannel.c:
(gst_audio_check_channel_positions),
(gst_audio_get_channel_positions),
(gst_audio_set_channel_positions),
(gst_audio_set_structure_channel_positions_list),
(add_list_to_struct), (gst_audio_set_caps_channel_positions_list),
(gst_audio_fixate_channel_positions):
* gst-libs/gst/audio/multichannel.h:
* gst-libs/gst/audio/testchannels.c: (main):
* gst/audioconvert/gstaudioconvert.c:
(gst_audio_convert_class_init), (gst_audio_convert_init),
(gst_audio_convert_dispose), (gst_audio_convert_getcaps),
(gst_audio_convert_parse_caps), (gst_audio_convert_link),
(gst_audio_convert_fixate), (gst_audio_convert_channels):
* gst/audioconvert/plugin.c: (plugin_init):
Surround sound support.
2004-11-25 20:36:29 +00:00
|
|
|
}
|
|
|
|
chans += 3;
|
|
|
|
break;
|
2001-12-26 21:51:41 +00:00
|
|
|
case A52_3F:
|
Surround sound support.
Original commit message from CVS:
* ext/a52dec/gsta52dec.c: (gst_a52dec_channels), (gst_a52dec_push),
(gst_a52dec_reneg), (gst_a52dec_loop), (plugin_init):
* ext/alsa/gstalsa.c: (gst_alsa_get_caps):
* ext/alsa/gstalsaplugin.c: (plugin_init):
* ext/dts/gstdtsdec.c: (gst_dtsdec_channels),
(gst_dtsdec_renegotiate), (gst_dtsdec_loop), (plugin_init):
* ext/faad/gstfaad.c: (gst_faad_init), (gst_faad_chanpos_from_gst),
(gst_faad_chanpos_to_gst), (gst_faad_sinkconnect),
(gst_faad_srcgetcaps), (gst_faad_srcconnect), (gst_faad_chain),
(gst_faad_change_state), (plugin_init):
* ext/faad/gstfaad.h:
* ext/vorbis/vorbis.c: (plugin_init):
* ext/vorbis/vorbisdec.c: (vorbis_dec_chain):
* gst-libs/gst/audio/Makefile.am:
* gst-libs/gst/audio/audio.c: (plugin_init):
* gst-libs/gst/audio/multichannel.c:
(gst_audio_check_channel_positions),
(gst_audio_get_channel_positions),
(gst_audio_set_channel_positions),
(gst_audio_set_structure_channel_positions_list),
(add_list_to_struct), (gst_audio_set_caps_channel_positions_list),
(gst_audio_fixate_channel_positions):
* gst-libs/gst/audio/multichannel.h:
* gst-libs/gst/audio/testchannels.c: (main):
* gst/audioconvert/gstaudioconvert.c:
(gst_audio_convert_class_init), (gst_audio_convert_init),
(gst_audio_convert_dispose), (gst_audio_convert_getcaps),
(gst_audio_convert_parse_caps), (gst_audio_convert_link),
(gst_audio_convert_fixate), (gst_audio_convert_channels):
* gst/audioconvert/plugin.c: (plugin_init):
Surround sound support.
2004-11-25 20:36:29 +00:00
|
|
|
if (pos) {
|
2004-11-27 19:41:26 +00:00
|
|
|
pos[0 + chans] = GST_AUDIO_CHANNEL_POSITION_FRONT_LEFT;
|
|
|
|
pos[1 + chans] = GST_AUDIO_CHANNEL_POSITION_FRONT_CENTER;
|
|
|
|
pos[2 + chans] = GST_AUDIO_CHANNEL_POSITION_FRONT_RIGHT;
|
Surround sound support.
Original commit message from CVS:
* ext/a52dec/gsta52dec.c: (gst_a52dec_channels), (gst_a52dec_push),
(gst_a52dec_reneg), (gst_a52dec_loop), (plugin_init):
* ext/alsa/gstalsa.c: (gst_alsa_get_caps):
* ext/alsa/gstalsaplugin.c: (plugin_init):
* ext/dts/gstdtsdec.c: (gst_dtsdec_channels),
(gst_dtsdec_renegotiate), (gst_dtsdec_loop), (plugin_init):
* ext/faad/gstfaad.c: (gst_faad_init), (gst_faad_chanpos_from_gst),
(gst_faad_chanpos_to_gst), (gst_faad_sinkconnect),
(gst_faad_srcgetcaps), (gst_faad_srcconnect), (gst_faad_chain),
(gst_faad_change_state), (plugin_init):
* ext/faad/gstfaad.h:
* ext/vorbis/vorbis.c: (plugin_init):
* ext/vorbis/vorbisdec.c: (vorbis_dec_chain):
* gst-libs/gst/audio/Makefile.am:
* gst-libs/gst/audio/audio.c: (plugin_init):
* gst-libs/gst/audio/multichannel.c:
(gst_audio_check_channel_positions),
(gst_audio_get_channel_positions),
(gst_audio_set_channel_positions),
(gst_audio_set_structure_channel_positions_list),
(add_list_to_struct), (gst_audio_set_caps_channel_positions_list),
(gst_audio_fixate_channel_positions):
* gst-libs/gst/audio/multichannel.h:
* gst-libs/gst/audio/testchannels.c: (main):
* gst/audioconvert/gstaudioconvert.c:
(gst_audio_convert_class_init), (gst_audio_convert_init),
(gst_audio_convert_dispose), (gst_audio_convert_getcaps),
(gst_audio_convert_parse_caps), (gst_audio_convert_link),
(gst_audio_convert_fixate), (gst_audio_convert_channels):
* gst/audioconvert/plugin.c: (plugin_init):
Surround sound support.
2004-11-25 20:36:29 +00:00
|
|
|
}
|
2001-12-26 21:51:41 +00:00
|
|
|
chans += 3;
|
Surround sound support.
Original commit message from CVS:
* ext/a52dec/gsta52dec.c: (gst_a52dec_channels), (gst_a52dec_push),
(gst_a52dec_reneg), (gst_a52dec_loop), (plugin_init):
* ext/alsa/gstalsa.c: (gst_alsa_get_caps):
* ext/alsa/gstalsaplugin.c: (plugin_init):
* ext/dts/gstdtsdec.c: (gst_dtsdec_channels),
(gst_dtsdec_renegotiate), (gst_dtsdec_loop), (plugin_init):
* ext/faad/gstfaad.c: (gst_faad_init), (gst_faad_chanpos_from_gst),
(gst_faad_chanpos_to_gst), (gst_faad_sinkconnect),
(gst_faad_srcgetcaps), (gst_faad_srcconnect), (gst_faad_chain),
(gst_faad_change_state), (plugin_init):
* ext/faad/gstfaad.h:
* ext/vorbis/vorbis.c: (plugin_init):
* ext/vorbis/vorbisdec.c: (vorbis_dec_chain):
* gst-libs/gst/audio/Makefile.am:
* gst-libs/gst/audio/audio.c: (plugin_init):
* gst-libs/gst/audio/multichannel.c:
(gst_audio_check_channel_positions),
(gst_audio_get_channel_positions),
(gst_audio_set_channel_positions),
(gst_audio_set_structure_channel_positions_list),
(add_list_to_struct), (gst_audio_set_caps_channel_positions_list),
(gst_audio_fixate_channel_positions):
* gst-libs/gst/audio/multichannel.h:
* gst-libs/gst/audio/testchannels.c: (main):
* gst/audioconvert/gstaudioconvert.c:
(gst_audio_convert_class_init), (gst_audio_convert_init),
(gst_audio_convert_dispose), (gst_audio_convert_getcaps),
(gst_audio_convert_parse_caps), (gst_audio_convert_link),
(gst_audio_convert_fixate), (gst_audio_convert_channels):
* gst/audioconvert/plugin.c: (plugin_init):
Surround sound support.
2004-11-25 20:36:29 +00:00
|
|
|
break;
|
|
|
|
/*case A52_CHANNEL: */
|
2001-12-26 21:51:41 +00:00
|
|
|
case A52_STEREO:
|
|
|
|
case A52_DOLBY:
|
Surround sound support.
Original commit message from CVS:
* ext/a52dec/gsta52dec.c: (gst_a52dec_channels), (gst_a52dec_push),
(gst_a52dec_reneg), (gst_a52dec_loop), (plugin_init):
* ext/alsa/gstalsa.c: (gst_alsa_get_caps):
* ext/alsa/gstalsaplugin.c: (plugin_init):
* ext/dts/gstdtsdec.c: (gst_dtsdec_channels),
(gst_dtsdec_renegotiate), (gst_dtsdec_loop), (plugin_init):
* ext/faad/gstfaad.c: (gst_faad_init), (gst_faad_chanpos_from_gst),
(gst_faad_chanpos_to_gst), (gst_faad_sinkconnect),
(gst_faad_srcgetcaps), (gst_faad_srcconnect), (gst_faad_chain),
(gst_faad_change_state), (plugin_init):
* ext/faad/gstfaad.h:
* ext/vorbis/vorbis.c: (plugin_init):
* ext/vorbis/vorbisdec.c: (vorbis_dec_chain):
* gst-libs/gst/audio/Makefile.am:
* gst-libs/gst/audio/audio.c: (plugin_init):
* gst-libs/gst/audio/multichannel.c:
(gst_audio_check_channel_positions),
(gst_audio_get_channel_positions),
(gst_audio_set_channel_positions),
(gst_audio_set_structure_channel_positions_list),
(add_list_to_struct), (gst_audio_set_caps_channel_positions_list),
(gst_audio_fixate_channel_positions):
* gst-libs/gst/audio/multichannel.h:
* gst-libs/gst/audio/testchannels.c: (main):
* gst/audioconvert/gstaudioconvert.c:
(gst_audio_convert_class_init), (gst_audio_convert_init),
(gst_audio_convert_dispose), (gst_audio_convert_getcaps),
(gst_audio_convert_parse_caps), (gst_audio_convert_link),
(gst_audio_convert_fixate), (gst_audio_convert_channels):
* gst/audioconvert/plugin.c: (plugin_init):
Surround sound support.
2004-11-25 20:36:29 +00:00
|
|
|
if (pos) {
|
2004-11-27 19:41:26 +00:00
|
|
|
pos[0 + chans] = GST_AUDIO_CHANNEL_POSITION_FRONT_LEFT;
|
|
|
|
pos[1 + chans] = GST_AUDIO_CHANNEL_POSITION_FRONT_RIGHT;
|
Surround sound support.
Original commit message from CVS:
* ext/a52dec/gsta52dec.c: (gst_a52dec_channels), (gst_a52dec_push),
(gst_a52dec_reneg), (gst_a52dec_loop), (plugin_init):
* ext/alsa/gstalsa.c: (gst_alsa_get_caps):
* ext/alsa/gstalsaplugin.c: (plugin_init):
* ext/dts/gstdtsdec.c: (gst_dtsdec_channels),
(gst_dtsdec_renegotiate), (gst_dtsdec_loop), (plugin_init):
* ext/faad/gstfaad.c: (gst_faad_init), (gst_faad_chanpos_from_gst),
(gst_faad_chanpos_to_gst), (gst_faad_sinkconnect),
(gst_faad_srcgetcaps), (gst_faad_srcconnect), (gst_faad_chain),
(gst_faad_change_state), (plugin_init):
* ext/faad/gstfaad.h:
* ext/vorbis/vorbis.c: (plugin_init):
* ext/vorbis/vorbisdec.c: (vorbis_dec_chain):
* gst-libs/gst/audio/Makefile.am:
* gst-libs/gst/audio/audio.c: (plugin_init):
* gst-libs/gst/audio/multichannel.c:
(gst_audio_check_channel_positions),
(gst_audio_get_channel_positions),
(gst_audio_set_channel_positions),
(gst_audio_set_structure_channel_positions_list),
(add_list_to_struct), (gst_audio_set_caps_channel_positions_list),
(gst_audio_fixate_channel_positions):
* gst-libs/gst/audio/multichannel.h:
* gst-libs/gst/audio/testchannels.c: (main):
* gst/audioconvert/gstaudioconvert.c:
(gst_audio_convert_class_init), (gst_audio_convert_init),
(gst_audio_convert_dispose), (gst_audio_convert_getcaps),
(gst_audio_convert_parse_caps), (gst_audio_convert_link),
(gst_audio_convert_fixate), (gst_audio_convert_channels):
* gst/audioconvert/plugin.c: (plugin_init):
Surround sound support.
2004-11-25 20:36:29 +00:00
|
|
|
}
|
2001-12-26 21:51:41 +00:00
|
|
|
chans += 2;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
/* error */
|
2002-12-31 17:03:29 +00:00
|
|
|
g_warning ("a52dec invalid flags %d", flags);
|
Surround sound support.
Original commit message from CVS:
* ext/a52dec/gsta52dec.c: (gst_a52dec_channels), (gst_a52dec_push),
(gst_a52dec_reneg), (gst_a52dec_loop), (plugin_init):
* ext/alsa/gstalsa.c: (gst_alsa_get_caps):
* ext/alsa/gstalsaplugin.c: (plugin_init):
* ext/dts/gstdtsdec.c: (gst_dtsdec_channels),
(gst_dtsdec_renegotiate), (gst_dtsdec_loop), (plugin_init):
* ext/faad/gstfaad.c: (gst_faad_init), (gst_faad_chanpos_from_gst),
(gst_faad_chanpos_to_gst), (gst_faad_sinkconnect),
(gst_faad_srcgetcaps), (gst_faad_srcconnect), (gst_faad_chain),
(gst_faad_change_state), (plugin_init):
* ext/faad/gstfaad.h:
* ext/vorbis/vorbis.c: (plugin_init):
* ext/vorbis/vorbisdec.c: (vorbis_dec_chain):
* gst-libs/gst/audio/Makefile.am:
* gst-libs/gst/audio/audio.c: (plugin_init):
* gst-libs/gst/audio/multichannel.c:
(gst_audio_check_channel_positions),
(gst_audio_get_channel_positions),
(gst_audio_set_channel_positions),
(gst_audio_set_structure_channel_positions_list),
(add_list_to_struct), (gst_audio_set_caps_channel_positions_list),
(gst_audio_fixate_channel_positions):
* gst-libs/gst/audio/multichannel.h:
* gst-libs/gst/audio/testchannels.c: (main):
* gst/audioconvert/gstaudioconvert.c:
(gst_audio_convert_class_init), (gst_audio_convert_init),
(gst_audio_convert_dispose), (gst_audio_convert_getcaps),
(gst_audio_convert_parse_caps), (gst_audio_convert_link),
(gst_audio_convert_fixate), (gst_audio_convert_channels):
* gst/audioconvert/plugin.c: (plugin_init):
Surround sound support.
2004-11-25 20:36:29 +00:00
|
|
|
g_free (pos);
|
2001-12-26 21:51:41 +00:00
|
|
|
return 0;
|
|
|
|
}
|
Surround sound support.
Original commit message from CVS:
* ext/a52dec/gsta52dec.c: (gst_a52dec_channels), (gst_a52dec_push),
(gst_a52dec_reneg), (gst_a52dec_loop), (plugin_init):
* ext/alsa/gstalsa.c: (gst_alsa_get_caps):
* ext/alsa/gstalsaplugin.c: (plugin_init):
* ext/dts/gstdtsdec.c: (gst_dtsdec_channels),
(gst_dtsdec_renegotiate), (gst_dtsdec_loop), (plugin_init):
* ext/faad/gstfaad.c: (gst_faad_init), (gst_faad_chanpos_from_gst),
(gst_faad_chanpos_to_gst), (gst_faad_sinkconnect),
(gst_faad_srcgetcaps), (gst_faad_srcconnect), (gst_faad_chain),
(gst_faad_change_state), (plugin_init):
* ext/faad/gstfaad.h:
* ext/vorbis/vorbis.c: (plugin_init):
* ext/vorbis/vorbisdec.c: (vorbis_dec_chain):
* gst-libs/gst/audio/Makefile.am:
* gst-libs/gst/audio/audio.c: (plugin_init):
* gst-libs/gst/audio/multichannel.c:
(gst_audio_check_channel_positions),
(gst_audio_get_channel_positions),
(gst_audio_set_channel_positions),
(gst_audio_set_structure_channel_positions_list),
(add_list_to_struct), (gst_audio_set_caps_channel_positions_list),
(gst_audio_fixate_channel_positions):
* gst-libs/gst/audio/multichannel.h:
* gst-libs/gst/audio/testchannels.c: (main):
* gst/audioconvert/gstaudioconvert.c:
(gst_audio_convert_class_init), (gst_audio_convert_init),
(gst_audio_convert_dispose), (gst_audio_convert_getcaps),
(gst_audio_convert_parse_caps), (gst_audio_convert_link),
(gst_audio_convert_fixate), (gst_audio_convert_channels):
* gst/audioconvert/plugin.c: (plugin_init):
Surround sound support.
2004-11-25 20:36:29 +00:00
|
|
|
|
2001-12-26 21:51:41 +00:00
|
|
|
return chans;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
Surround sound support.
Original commit message from CVS:
* ext/a52dec/gsta52dec.c: (gst_a52dec_channels), (gst_a52dec_push),
(gst_a52dec_reneg), (gst_a52dec_loop), (plugin_init):
* ext/alsa/gstalsa.c: (gst_alsa_get_caps):
* ext/alsa/gstalsaplugin.c: (plugin_init):
* ext/dts/gstdtsdec.c: (gst_dtsdec_channels),
(gst_dtsdec_renegotiate), (gst_dtsdec_loop), (plugin_init):
* ext/faad/gstfaad.c: (gst_faad_init), (gst_faad_chanpos_from_gst),
(gst_faad_chanpos_to_gst), (gst_faad_sinkconnect),
(gst_faad_srcgetcaps), (gst_faad_srcconnect), (gst_faad_chain),
(gst_faad_change_state), (plugin_init):
* ext/faad/gstfaad.h:
* ext/vorbis/vorbis.c: (plugin_init):
* ext/vorbis/vorbisdec.c: (vorbis_dec_chain):
* gst-libs/gst/audio/Makefile.am:
* gst-libs/gst/audio/audio.c: (plugin_init):
* gst-libs/gst/audio/multichannel.c:
(gst_audio_check_channel_positions),
(gst_audio_get_channel_positions),
(gst_audio_set_channel_positions),
(gst_audio_set_structure_channel_positions_list),
(add_list_to_struct), (gst_audio_set_caps_channel_positions_list),
(gst_audio_fixate_channel_positions):
* gst-libs/gst/audio/multichannel.h:
* gst-libs/gst/audio/testchannels.c: (main):
* gst/audioconvert/gstaudioconvert.c:
(gst_audio_convert_class_init), (gst_audio_convert_init),
(gst_audio_convert_dispose), (gst_audio_convert_getcaps),
(gst_audio_convert_parse_caps), (gst_audio_convert_link),
(gst_audio_convert_fixate), (gst_audio_convert_channels):
* gst/audioconvert/plugin.c: (plugin_init):
Surround sound support.
2004-11-25 20:36:29 +00:00
|
|
|
gst_a52dec_push (GstPad * srcpad, int flags, sample_t * samples,
|
2004-04-01 11:48:27 +00:00
|
|
|
GstClockTime timestamp)
|
2001-12-26 21:51:41 +00:00
|
|
|
{
|
|
|
|
GstBuffer *buf;
|
Surround sound support.
Original commit message from CVS:
* ext/a52dec/gsta52dec.c: (gst_a52dec_channels), (gst_a52dec_push),
(gst_a52dec_reneg), (gst_a52dec_loop), (plugin_init):
* ext/alsa/gstalsa.c: (gst_alsa_get_caps):
* ext/alsa/gstalsaplugin.c: (plugin_init):
* ext/dts/gstdtsdec.c: (gst_dtsdec_channels),
(gst_dtsdec_renegotiate), (gst_dtsdec_loop), (plugin_init):
* ext/faad/gstfaad.c: (gst_faad_init), (gst_faad_chanpos_from_gst),
(gst_faad_chanpos_to_gst), (gst_faad_sinkconnect),
(gst_faad_srcgetcaps), (gst_faad_srcconnect), (gst_faad_chain),
(gst_faad_change_state), (plugin_init):
* ext/faad/gstfaad.h:
* ext/vorbis/vorbis.c: (plugin_init):
* ext/vorbis/vorbisdec.c: (vorbis_dec_chain):
* gst-libs/gst/audio/Makefile.am:
* gst-libs/gst/audio/audio.c: (plugin_init):
* gst-libs/gst/audio/multichannel.c:
(gst_audio_check_channel_positions),
(gst_audio_get_channel_positions),
(gst_audio_set_channel_positions),
(gst_audio_set_structure_channel_positions_list),
(add_list_to_struct), (gst_audio_set_caps_channel_positions_list),
(gst_audio_fixate_channel_positions):
* gst-libs/gst/audio/multichannel.h:
* gst-libs/gst/audio/testchannels.c: (main):
* gst/audioconvert/gstaudioconvert.c:
(gst_audio_convert_class_init), (gst_audio_convert_init),
(gst_audio_convert_dispose), (gst_audio_convert_getcaps),
(gst_audio_convert_parse_caps), (gst_audio_convert_link),
(gst_audio_convert_fixate), (gst_audio_convert_channels):
* gst/audioconvert/plugin.c: (plugin_init):
Surround sound support.
2004-11-25 20:36:29 +00:00
|
|
|
int chans, n, c;
|
2001-12-26 21:51:41 +00:00
|
|
|
|
Surround sound support.
Original commit message from CVS:
* ext/a52dec/gsta52dec.c: (gst_a52dec_channels), (gst_a52dec_push),
(gst_a52dec_reneg), (gst_a52dec_loop), (plugin_init):
* ext/alsa/gstalsa.c: (gst_alsa_get_caps):
* ext/alsa/gstalsaplugin.c: (plugin_init):
* ext/dts/gstdtsdec.c: (gst_dtsdec_channels),
(gst_dtsdec_renegotiate), (gst_dtsdec_loop), (plugin_init):
* ext/faad/gstfaad.c: (gst_faad_init), (gst_faad_chanpos_from_gst),
(gst_faad_chanpos_to_gst), (gst_faad_sinkconnect),
(gst_faad_srcgetcaps), (gst_faad_srcconnect), (gst_faad_chain),
(gst_faad_change_state), (plugin_init):
* ext/faad/gstfaad.h:
* ext/vorbis/vorbis.c: (plugin_init):
* ext/vorbis/vorbisdec.c: (vorbis_dec_chain):
* gst-libs/gst/audio/Makefile.am:
* gst-libs/gst/audio/audio.c: (plugin_init):
* gst-libs/gst/audio/multichannel.c:
(gst_audio_check_channel_positions),
(gst_audio_get_channel_positions),
(gst_audio_set_channel_positions),
(gst_audio_set_structure_channel_positions_list),
(add_list_to_struct), (gst_audio_set_caps_channel_positions_list),
(gst_audio_fixate_channel_positions):
* gst-libs/gst/audio/multichannel.h:
* gst-libs/gst/audio/testchannels.c: (main):
* gst/audioconvert/gstaudioconvert.c:
(gst_audio_convert_class_init), (gst_audio_convert_init),
(gst_audio_convert_dispose), (gst_audio_convert_getcaps),
(gst_audio_convert_parse_caps), (gst_audio_convert_link),
(gst_audio_convert_fixate), (gst_audio_convert_channels):
* gst/audioconvert/plugin.c: (plugin_init):
Surround sound support.
2004-11-25 20:36:29 +00:00
|
|
|
flags &= (A52_CHANNEL_MASK | A52_LFE);
|
|
|
|
chans = gst_a52dec_channels (flags, NULL);
|
2001-12-26 21:51:41 +00:00
|
|
|
if (!chans) {
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
buf = gst_buffer_new ();
|
Surround sound support.
Original commit message from CVS:
* ext/a52dec/gsta52dec.c: (gst_a52dec_channels), (gst_a52dec_push),
(gst_a52dec_reneg), (gst_a52dec_loop), (plugin_init):
* ext/alsa/gstalsa.c: (gst_alsa_get_caps):
* ext/alsa/gstalsaplugin.c: (plugin_init):
* ext/dts/gstdtsdec.c: (gst_dtsdec_channels),
(gst_dtsdec_renegotiate), (gst_dtsdec_loop), (plugin_init):
* ext/faad/gstfaad.c: (gst_faad_init), (gst_faad_chanpos_from_gst),
(gst_faad_chanpos_to_gst), (gst_faad_sinkconnect),
(gst_faad_srcgetcaps), (gst_faad_srcconnect), (gst_faad_chain),
(gst_faad_change_state), (plugin_init):
* ext/faad/gstfaad.h:
* ext/vorbis/vorbis.c: (plugin_init):
* ext/vorbis/vorbisdec.c: (vorbis_dec_chain):
* gst-libs/gst/audio/Makefile.am:
* gst-libs/gst/audio/audio.c: (plugin_init):
* gst-libs/gst/audio/multichannel.c:
(gst_audio_check_channel_positions),
(gst_audio_get_channel_positions),
(gst_audio_set_channel_positions),
(gst_audio_set_structure_channel_positions_list),
(add_list_to_struct), (gst_audio_set_caps_channel_positions_list),
(gst_audio_fixate_channel_positions):
* gst-libs/gst/audio/multichannel.h:
* gst-libs/gst/audio/testchannels.c: (main):
* gst/audioconvert/gstaudioconvert.c:
(gst_audio_convert_class_init), (gst_audio_convert_init),
(gst_audio_convert_dispose), (gst_audio_convert_getcaps),
(gst_audio_convert_parse_caps), (gst_audio_convert_link),
(gst_audio_convert_fixate), (gst_audio_convert_channels):
* gst/audioconvert/plugin.c: (plugin_init):
Surround sound support.
2004-11-25 20:36:29 +00:00
|
|
|
GST_BUFFER_SIZE (buf) = 256 * chans * (SAMPLE_WIDTH / 8);
|
2001-12-26 21:51:41 +00:00
|
|
|
GST_BUFFER_DATA (buf) = g_malloc (GST_BUFFER_SIZE (buf));
|
Surround sound support.
Original commit message from CVS:
* ext/a52dec/gsta52dec.c: (gst_a52dec_channels), (gst_a52dec_push),
(gst_a52dec_reneg), (gst_a52dec_loop), (plugin_init):
* ext/alsa/gstalsa.c: (gst_alsa_get_caps):
* ext/alsa/gstalsaplugin.c: (plugin_init):
* ext/dts/gstdtsdec.c: (gst_dtsdec_channels),
(gst_dtsdec_renegotiate), (gst_dtsdec_loop), (plugin_init):
* ext/faad/gstfaad.c: (gst_faad_init), (gst_faad_chanpos_from_gst),
(gst_faad_chanpos_to_gst), (gst_faad_sinkconnect),
(gst_faad_srcgetcaps), (gst_faad_srcconnect), (gst_faad_chain),
(gst_faad_change_state), (plugin_init):
* ext/faad/gstfaad.h:
* ext/vorbis/vorbis.c: (plugin_init):
* ext/vorbis/vorbisdec.c: (vorbis_dec_chain):
* gst-libs/gst/audio/Makefile.am:
* gst-libs/gst/audio/audio.c: (plugin_init):
* gst-libs/gst/audio/multichannel.c:
(gst_audio_check_channel_positions),
(gst_audio_get_channel_positions),
(gst_audio_set_channel_positions),
(gst_audio_set_structure_channel_positions_list),
(add_list_to_struct), (gst_audio_set_caps_channel_positions_list),
(gst_audio_fixate_channel_positions):
* gst-libs/gst/audio/multichannel.h:
* gst-libs/gst/audio/testchannels.c: (main):
* gst/audioconvert/gstaudioconvert.c:
(gst_audio_convert_class_init), (gst_audio_convert_init),
(gst_audio_convert_dispose), (gst_audio_convert_getcaps),
(gst_audio_convert_parse_caps), (gst_audio_convert_link),
(gst_audio_convert_fixate), (gst_audio_convert_channels):
* gst/audioconvert/plugin.c: (plugin_init):
Surround sound support.
2004-11-25 20:36:29 +00:00
|
|
|
for (n = 0; n < 256; n++) {
|
|
|
|
for (c = 0; c < chans; c++) {
|
|
|
|
((sample_t *) GST_BUFFER_DATA (buf))[n * chans + c] =
|
|
|
|
samples[c * 256 + n];
|
|
|
|
}
|
|
|
|
}
|
2001-12-26 21:51:41 +00:00
|
|
|
GST_BUFFER_TIMESTAMP (buf) = timestamp;
|
|
|
|
|
2003-10-08 16:08:10 +00:00
|
|
|
gst_pad_push (srcpad, GST_DATA (buf));
|
2001-12-26 21:51:41 +00:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* END modified a52dec conversion code */
|
|
|
|
|
Surround sound support.
Original commit message from CVS:
* ext/a52dec/gsta52dec.c: (gst_a52dec_channels), (gst_a52dec_push),
(gst_a52dec_reneg), (gst_a52dec_loop), (plugin_init):
* ext/alsa/gstalsa.c: (gst_alsa_get_caps):
* ext/alsa/gstalsaplugin.c: (plugin_init):
* ext/dts/gstdtsdec.c: (gst_dtsdec_channels),
(gst_dtsdec_renegotiate), (gst_dtsdec_loop), (plugin_init):
* ext/faad/gstfaad.c: (gst_faad_init), (gst_faad_chanpos_from_gst),
(gst_faad_chanpos_to_gst), (gst_faad_sinkconnect),
(gst_faad_srcgetcaps), (gst_faad_srcconnect), (gst_faad_chain),
(gst_faad_change_state), (plugin_init):
* ext/faad/gstfaad.h:
* ext/vorbis/vorbis.c: (plugin_init):
* ext/vorbis/vorbisdec.c: (vorbis_dec_chain):
* gst-libs/gst/audio/Makefile.am:
* gst-libs/gst/audio/audio.c: (plugin_init):
* gst-libs/gst/audio/multichannel.c:
(gst_audio_check_channel_positions),
(gst_audio_get_channel_positions),
(gst_audio_set_channel_positions),
(gst_audio_set_structure_channel_positions_list),
(add_list_to_struct), (gst_audio_set_caps_channel_positions_list),
(gst_audio_fixate_channel_positions):
* gst-libs/gst/audio/multichannel.h:
* gst-libs/gst/audio/testchannels.c: (main):
* gst/audioconvert/gstaudioconvert.c:
(gst_audio_convert_class_init), (gst_audio_convert_init),
(gst_audio_convert_dispose), (gst_audio_convert_getcaps),
(gst_audio_convert_parse_caps), (gst_audio_convert_link),
(gst_audio_convert_fixate), (gst_audio_convert_channels):
* gst/audioconvert/plugin.c: (plugin_init):
Surround sound support.
2004-11-25 20:36:29 +00:00
|
|
|
static gboolean
|
|
|
|
gst_a52dec_reneg (GstPad * pad)
|
2001-12-26 21:51:41 +00:00
|
|
|
{
|
Surround sound support.
Original commit message from CVS:
* ext/a52dec/gsta52dec.c: (gst_a52dec_channels), (gst_a52dec_push),
(gst_a52dec_reneg), (gst_a52dec_loop), (plugin_init):
* ext/alsa/gstalsa.c: (gst_alsa_get_caps):
* ext/alsa/gstalsaplugin.c: (plugin_init):
* ext/dts/gstdtsdec.c: (gst_dtsdec_channels),
(gst_dtsdec_renegotiate), (gst_dtsdec_loop), (plugin_init):
* ext/faad/gstfaad.c: (gst_faad_init), (gst_faad_chanpos_from_gst),
(gst_faad_chanpos_to_gst), (gst_faad_sinkconnect),
(gst_faad_srcgetcaps), (gst_faad_srcconnect), (gst_faad_chain),
(gst_faad_change_state), (plugin_init):
* ext/faad/gstfaad.h:
* ext/vorbis/vorbis.c: (plugin_init):
* ext/vorbis/vorbisdec.c: (vorbis_dec_chain):
* gst-libs/gst/audio/Makefile.am:
* gst-libs/gst/audio/audio.c: (plugin_init):
* gst-libs/gst/audio/multichannel.c:
(gst_audio_check_channel_positions),
(gst_audio_get_channel_positions),
(gst_audio_set_channel_positions),
(gst_audio_set_structure_channel_positions_list),
(add_list_to_struct), (gst_audio_set_caps_channel_positions_list),
(gst_audio_fixate_channel_positions):
* gst-libs/gst/audio/multichannel.h:
* gst-libs/gst/audio/testchannels.c: (main):
* gst/audioconvert/gstaudioconvert.c:
(gst_audio_convert_class_init), (gst_audio_convert_init),
(gst_audio_convert_dispose), (gst_audio_convert_getcaps),
(gst_audio_convert_parse_caps), (gst_audio_convert_link),
(gst_audio_convert_fixate), (gst_audio_convert_channels):
* gst/audioconvert/plugin.c: (plugin_init):
Surround sound support.
2004-11-25 20:36:29 +00:00
|
|
|
GstAudioChannelPosition *pos;
|
|
|
|
GstA52Dec *a52dec = GST_A52DEC (gst_pad_get_parent (pad));
|
|
|
|
gint channels = gst_a52dec_channels (a52dec->using_channels, &pos);
|
|
|
|
GstCaps *caps;
|
|
|
|
|
|
|
|
if (!channels)
|
|
|
|
return FALSE;
|
|
|
|
|
|
|
|
GST_INFO ("a52dec: reneg channels:%d rate:%d\n",
|
|
|
|
channels, a52dec->sample_rate);
|
|
|
|
|
|
|
|
caps = gst_caps_new_simple ("audio/x-raw-float",
|
|
|
|
"endianness", G_TYPE_INT, G_BYTE_ORDER,
|
|
|
|
"width", G_TYPE_INT, SAMPLE_WIDTH,
|
|
|
|
"channels", G_TYPE_INT, channels,
|
ext/a52dec/gsta52dec.c: Add buffer-frames=0.
Original commit message from CVS:
* ext/a52dec/gsta52dec.c: (gst_a52dec_reneg):
Add buffer-frames=0.
* ext/dvdread/dvdreadsrc.c: (dvdreadsrc_get_type),
(dvdreadsrc_init), (dvdreadsrc_get_event_mask),
(dvdreadsrc_get_query_types), (dvdreadsrc_get_formats),
(dvdreadsrc_srcpad_event), (dvdreadsrc_srcpad_query),
(_seek_title), (_seek_chapter), (get_next_cell_for), (_read),
(seek_sector), (dvdreadsrc_get), (dvdreadsrc_open_file),
(dvdreadsrc_change_state), (dvdreadsrc_uri_get_type),
(dvdreadsrc_uri_get_protocols), (dvdreadsrc_uri_get_uri),
(dvdreadsrc_uri_set_uri), (dvdreadsrc_uri_handler_init):
* ext/dvdread/dvdreadsrc.h:
Add seeking, querying for bytes, sectors, title, angle and
chapter. Handle multiple chapters. Relicense to LGPL because
Billy agreed on that (thanks Billy!).
2004-11-27 17:20:26 +00:00
|
|
|
"rate", G_TYPE_INT, a52dec->sample_rate,
|
|
|
|
"buffer-frames", G_TYPE_INT, 0, NULL);
|
Surround sound support.
Original commit message from CVS:
* ext/a52dec/gsta52dec.c: (gst_a52dec_channels), (gst_a52dec_push),
(gst_a52dec_reneg), (gst_a52dec_loop), (plugin_init):
* ext/alsa/gstalsa.c: (gst_alsa_get_caps):
* ext/alsa/gstalsaplugin.c: (plugin_init):
* ext/dts/gstdtsdec.c: (gst_dtsdec_channels),
(gst_dtsdec_renegotiate), (gst_dtsdec_loop), (plugin_init):
* ext/faad/gstfaad.c: (gst_faad_init), (gst_faad_chanpos_from_gst),
(gst_faad_chanpos_to_gst), (gst_faad_sinkconnect),
(gst_faad_srcgetcaps), (gst_faad_srcconnect), (gst_faad_chain),
(gst_faad_change_state), (plugin_init):
* ext/faad/gstfaad.h:
* ext/vorbis/vorbis.c: (plugin_init):
* ext/vorbis/vorbisdec.c: (vorbis_dec_chain):
* gst-libs/gst/audio/Makefile.am:
* gst-libs/gst/audio/audio.c: (plugin_init):
* gst-libs/gst/audio/multichannel.c:
(gst_audio_check_channel_positions),
(gst_audio_get_channel_positions),
(gst_audio_set_channel_positions),
(gst_audio_set_structure_channel_positions_list),
(add_list_to_struct), (gst_audio_set_caps_channel_positions_list),
(gst_audio_fixate_channel_positions):
* gst-libs/gst/audio/multichannel.h:
* gst-libs/gst/audio/testchannels.c: (main):
* gst/audioconvert/gstaudioconvert.c:
(gst_audio_convert_class_init), (gst_audio_convert_init),
(gst_audio_convert_dispose), (gst_audio_convert_getcaps),
(gst_audio_convert_parse_caps), (gst_audio_convert_link),
(gst_audio_convert_fixate), (gst_audio_convert_channels):
* gst/audioconvert/plugin.c: (plugin_init):
Surround sound support.
2004-11-25 20:36:29 +00:00
|
|
|
gst_audio_set_channel_positions (gst_caps_get_structure (caps, 0), pos);
|
|
|
|
g_free (pos);
|
|
|
|
|
|
|
|
return gst_pad_set_explicit_caps (pad, caps);
|
2001-12-26 21:51:41 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2004-03-14 22:34:30 +00:00
|
|
|
gst_a52dec_handle_event (GstA52Dec * a52dec)
|
2001-12-26 21:51:41 +00:00
|
|
|
{
|
|
|
|
guint32 remaining;
|
|
|
|
GstEvent *event;
|
|
|
|
|
|
|
|
gst_bytestream_get_status (a52dec->bs, &remaining, &event);
|
|
|
|
|
2002-05-26 17:36:24 +00:00
|
|
|
if (!event) {
|
|
|
|
g_warning ("a52dec: no bytestream event");
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2004-04-01 11:48:27 +00:00
|
|
|
GST_LOG ("Handling event of type %d timestamp %llu", GST_EVENT_TYPE (event),
|
|
|
|
GST_EVENT_TIMESTAMP (event));
|
2001-12-26 21:51:41 +00:00
|
|
|
switch (GST_EVENT_TYPE (event)) {
|
|
|
|
case GST_EVENT_DISCONTINUOUS:
|
2004-04-01 11:48:27 +00:00
|
|
|
case GST_EVENT_FLUSH:
|
2001-12-26 21:51:41 +00:00
|
|
|
gst_bytestream_flush_fast (a52dec->bs, remaining);
|
2004-04-01 11:48:27 +00:00
|
|
|
break;
|
2001-12-26 21:51:41 +00:00
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
2004-04-01 11:48:27 +00:00
|
|
|
gst_pad_event_default (a52dec->sinkpad, event);
|
2001-12-26 21:51:41 +00:00
|
|
|
}
|
|
|
|
|
2002-12-31 17:03:29 +00:00
|
|
|
static void
|
2004-03-14 22:34:30 +00:00
|
|
|
gst_a52dec_update_streaminfo (GstA52Dec * a52dec)
|
2002-12-31 17:03:29 +00:00
|
|
|
{
|
2004-04-01 11:48:27 +00:00
|
|
|
GstTagList *taglist;
|
2004-03-14 22:34:30 +00:00
|
|
|
|
2004-04-01 11:48:27 +00:00
|
|
|
taglist = gst_tag_list_new ();
|
2002-12-31 17:03:29 +00:00
|
|
|
|
2004-04-01 11:48:27 +00:00
|
|
|
gst_tag_list_add (taglist, GST_TAG_MERGE_APPEND,
|
|
|
|
GST_TAG_BITRATE, (guint) a52dec->bit_rate, NULL);
|
2002-12-31 17:03:29 +00:00
|
|
|
|
2004-04-01 11:48:27 +00:00
|
|
|
gst_element_found_tags_for_pad (GST_ELEMENT (a52dec),
|
|
|
|
GST_PAD (a52dec->srcpad), a52dec->current_ts, taglist);
|
2002-12-31 17:03:29 +00:00
|
|
|
}
|
|
|
|
|
2001-12-26 21:51:41 +00:00
|
|
|
static void
|
2004-03-14 22:34:30 +00:00
|
|
|
gst_a52dec_loop (GstElement * element)
|
2001-12-26 21:51:41 +00:00
|
|
|
{
|
|
|
|
GstA52Dec *a52dec;
|
|
|
|
guint8 *data;
|
|
|
|
int i, length, flags, sample_rate, bit_rate;
|
2002-09-21 12:07:43 +00:00
|
|
|
int channels;
|
2001-12-26 21:51:41 +00:00
|
|
|
GstBuffer *buf;
|
2002-05-26 10:00:21 +00:00
|
|
|
guint32 got_bytes;
|
2002-09-21 12:07:43 +00:00
|
|
|
gboolean need_reneg;
|
2004-04-01 11:48:27 +00:00
|
|
|
GstClockTime timestamp = 0;
|
2001-12-26 21:51:41 +00:00
|
|
|
|
|
|
|
a52dec = GST_A52DEC (element);
|
|
|
|
|
|
|
|
/* find and read header */
|
2004-04-01 11:48:27 +00:00
|
|
|
do {
|
|
|
|
gint skipped_bytes = 0;
|
|
|
|
|
|
|
|
while (skipped_bytes < 3840) {
|
|
|
|
got_bytes = gst_bytestream_peek_bytes (a52dec->bs, &data, 7);
|
|
|
|
if (got_bytes < 7) {
|
|
|
|
gst_a52dec_handle_event (a52dec);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
length = a52_syncinfo (data, &flags, &sample_rate, &bit_rate);
|
|
|
|
if (length == 0) {
|
|
|
|
/* slide window to next 7 bytesa */
|
|
|
|
gst_bytestream_flush_fast (a52dec->bs, 1);
|
|
|
|
skipped_bytes++;
|
|
|
|
GST_LOG ("Skipped");
|
|
|
|
} else
|
|
|
|
break;
|
2001-12-26 21:51:41 +00:00
|
|
|
}
|
|
|
|
}
|
2004-04-01 11:48:27 +00:00
|
|
|
while (0);
|
2001-12-26 21:51:41 +00:00
|
|
|
|
2002-09-21 12:07:43 +00:00
|
|
|
need_reneg = FALSE;
|
2001-12-26 21:51:41 +00:00
|
|
|
|
2002-09-21 12:07:43 +00:00
|
|
|
if (a52dec->sample_rate != sample_rate) {
|
|
|
|
need_reneg = TRUE;
|
2001-12-26 21:51:41 +00:00
|
|
|
a52dec->sample_rate = sample_rate;
|
|
|
|
}
|
|
|
|
|
2002-09-21 12:07:43 +00:00
|
|
|
a52dec->stream_channels = flags & A52_CHANNEL_MASK;
|
|
|
|
|
2002-12-31 17:03:29 +00:00
|
|
|
if (bit_rate != a52dec->bit_rate) {
|
|
|
|
a52dec->bit_rate = bit_rate;
|
2004-04-01 11:48:27 +00:00
|
|
|
gst_a52dec_update_streaminfo (a52dec);
|
2002-12-31 17:03:29 +00:00
|
|
|
}
|
2002-09-21 12:07:43 +00:00
|
|
|
|
2001-12-26 21:51:41 +00:00
|
|
|
/* read the header + rest of frame */
|
2002-05-15 18:54:14 +00:00
|
|
|
got_bytes = gst_bytestream_read (a52dec->bs, &buf, length);
|
|
|
|
if (got_bytes < length) {
|
2001-12-26 21:51:41 +00:00
|
|
|
gst_a52dec_handle_event (a52dec);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
data = GST_BUFFER_DATA (buf);
|
2002-12-31 16:32:32 +00:00
|
|
|
timestamp = gst_bytestream_get_timestamp (a52dec->bs);
|
2004-04-01 11:48:27 +00:00
|
|
|
if (GST_CLOCK_TIME_IS_VALID (timestamp)) {
|
|
|
|
if (timestamp == a52dec->last_ts) {
|
|
|
|
timestamp = a52dec->current_ts;
|
|
|
|
} else {
|
|
|
|
a52dec->last_ts = timestamp;
|
|
|
|
}
|
2003-01-18 17:06:01 +00:00
|
|
|
}
|
2001-12-26 21:51:41 +00:00
|
|
|
|
|
|
|
/* process */
|
2004-11-27 20:22:42 +00:00
|
|
|
flags = a52dec->request_channels; /* | A52_ADJUST_LEVEL; */
|
2001-12-26 21:51:41 +00:00
|
|
|
a52dec->level = 1;
|
|
|
|
|
|
|
|
if (a52_frame (a52dec->state, data, &flags, &a52dec->level, a52dec->bias)) {
|
2004-04-01 11:48:27 +00:00
|
|
|
GST_WARNING ("a52_frame error");
|
2001-12-26 21:51:41 +00:00
|
|
|
goto end;
|
|
|
|
}
|
|
|
|
|
2002-09-21 12:07:43 +00:00
|
|
|
channels = flags & A52_CHANNEL_MASK;
|
|
|
|
|
|
|
|
if (a52dec->using_channels != channels) {
|
|
|
|
need_reneg = TRUE;
|
|
|
|
a52dec->using_channels = channels;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (need_reneg == TRUE) {
|
2003-06-29 19:46:09 +00:00
|
|
|
GST_DEBUG ("a52dec reneg: sample_rate:%d stream_chans:%d using_chans:%d\n",
|
2004-03-15 19:32:25 +00:00
|
|
|
a52dec->sample_rate, a52dec->stream_channels, a52dec->using_channels);
|
Surround sound support.
Original commit message from CVS:
* ext/a52dec/gsta52dec.c: (gst_a52dec_channels), (gst_a52dec_push),
(gst_a52dec_reneg), (gst_a52dec_loop), (plugin_init):
* ext/alsa/gstalsa.c: (gst_alsa_get_caps):
* ext/alsa/gstalsaplugin.c: (plugin_init):
* ext/dts/gstdtsdec.c: (gst_dtsdec_channels),
(gst_dtsdec_renegotiate), (gst_dtsdec_loop), (plugin_init):
* ext/faad/gstfaad.c: (gst_faad_init), (gst_faad_chanpos_from_gst),
(gst_faad_chanpos_to_gst), (gst_faad_sinkconnect),
(gst_faad_srcgetcaps), (gst_faad_srcconnect), (gst_faad_chain),
(gst_faad_change_state), (plugin_init):
* ext/faad/gstfaad.h:
* ext/vorbis/vorbis.c: (plugin_init):
* ext/vorbis/vorbisdec.c: (vorbis_dec_chain):
* gst-libs/gst/audio/Makefile.am:
* gst-libs/gst/audio/audio.c: (plugin_init):
* gst-libs/gst/audio/multichannel.c:
(gst_audio_check_channel_positions),
(gst_audio_get_channel_positions),
(gst_audio_set_channel_positions),
(gst_audio_set_structure_channel_positions_list),
(add_list_to_struct), (gst_audio_set_caps_channel_positions_list),
(gst_audio_fixate_channel_positions):
* gst-libs/gst/audio/multichannel.h:
* gst-libs/gst/audio/testchannels.c: (main):
* gst/audioconvert/gstaudioconvert.c:
(gst_audio_convert_class_init), (gst_audio_convert_init),
(gst_audio_convert_dispose), (gst_audio_convert_getcaps),
(gst_audio_convert_parse_caps), (gst_audio_convert_link),
(gst_audio_convert_fixate), (gst_audio_convert_channels):
* gst/audioconvert/plugin.c: (plugin_init):
Surround sound support.
2004-11-25 20:36:29 +00:00
|
|
|
if (!gst_a52dec_reneg (a52dec->srcpad))
|
|
|
|
goto end;
|
2001-12-26 21:51:41 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if (a52dec->dynamic_range_compression == FALSE) {
|
|
|
|
a52_dynrng (a52dec->state, NULL, NULL);
|
|
|
|
}
|
|
|
|
|
|
|
|
for (i = 0; i < 6; i++) {
|
2002-03-21 23:45:58 +00:00
|
|
|
if (a52_block (a52dec->state)) {
|
2004-04-01 11:48:27 +00:00
|
|
|
GST_WARNING ("a52_block error %d", i);
|
2001-12-26 21:51:41 +00:00
|
|
|
continue;
|
|
|
|
}
|
|
|
|
/* push on */
|
2004-04-01 11:48:27 +00:00
|
|
|
|
2004-03-14 22:34:30 +00:00
|
|
|
if (gst_a52dec_push (a52dec->srcpad, a52dec->using_channels,
|
2004-03-15 19:32:25 +00:00
|
|
|
a52dec->samples, timestamp)) {
|
2004-04-01 11:48:27 +00:00
|
|
|
GST_WARNING ("a52dec push error");
|
2004-03-14 22:34:30 +00:00
|
|
|
} else {
|
2004-04-01 11:48:27 +00:00
|
|
|
|
|
|
|
if (i % 2)
|
|
|
|
timestamp += 256 * GST_SECOND / a52dec->sample_rate;
|
2003-01-18 17:06:01 +00:00
|
|
|
}
|
2001-12-26 21:51:41 +00:00
|
|
|
}
|
2004-04-01 11:48:27 +00:00
|
|
|
|
2003-01-18 17:06:01 +00:00
|
|
|
a52dec->current_ts = timestamp;
|
2001-12-26 21:51:41 +00:00
|
|
|
|
|
|
|
end:
|
|
|
|
gst_buffer_unref (buf);
|
|
|
|
}
|
|
|
|
|
|
|
|
static GstElementStateReturn
|
|
|
|
gst_a52dec_change_state (GstElement * element)
|
|
|
|
{
|
|
|
|
GstA52Dec *a52dec = GST_A52DEC (element);
|
2004-04-01 11:48:27 +00:00
|
|
|
GstCPUFlags cpuflags;
|
|
|
|
uint32_t a52_cpuflags = 0;
|
2001-12-26 21:51:41 +00:00
|
|
|
|
|
|
|
switch (GST_STATE_TRANSITION (element)) {
|
|
|
|
case GST_STATE_NULL_TO_READY:
|
2004-04-01 11:48:27 +00:00
|
|
|
a52dec->bs = gst_bytestream_new (a52dec->sinkpad);
|
|
|
|
cpuflags = gst_cpu_get_flags ();
|
|
|
|
if (cpuflags & GST_CPU_FLAG_MMX)
|
|
|
|
a52_cpuflags |= MM_ACCEL_X86_MMX;
|
|
|
|
if (cpuflags & GST_CPU_FLAG_3DNOW)
|
|
|
|
a52_cpuflags |= MM_ACCEL_X86_3DNOW;
|
|
|
|
if (cpuflags & GST_CPU_FLAG_MMXEXT)
|
|
|
|
a52_cpuflags |= MM_ACCEL_X86_MMXEXT;
|
|
|
|
|
|
|
|
a52dec->state = a52_init (a52_cpuflags);
|
2001-12-26 21:51:41 +00:00
|
|
|
break;
|
|
|
|
case GST_STATE_READY_TO_PAUSED:
|
2002-03-21 23:45:58 +00:00
|
|
|
a52dec->samples = a52_samples (a52dec->state);
|
2001-12-26 21:51:41 +00:00
|
|
|
a52dec->bit_rate = -1;
|
|
|
|
a52dec->sample_rate = -1;
|
2002-09-21 12:07:43 +00:00
|
|
|
a52dec->stream_channels = A52_CHANNEL;
|
2004-11-27 19:41:26 +00:00
|
|
|
a52dec->request_channels = A52_3F2R | A52_LFE;
|
2002-09-21 12:07:43 +00:00
|
|
|
a52dec->using_channels = A52_CHANNEL;
|
2001-12-26 21:51:41 +00:00
|
|
|
a52dec->level = 1;
|
2004-11-27 20:22:42 +00:00
|
|
|
a52dec->bias = 0;
|
2004-04-01 11:48:27 +00:00
|
|
|
a52dec->last_ts = 0;
|
2003-01-18 17:09:22 +00:00
|
|
|
a52dec->current_ts = 0;
|
2004-04-01 11:48:27 +00:00
|
|
|
a52dec->last_timestamp = 0;
|
|
|
|
a52dec->last_diff = 0;
|
|
|
|
|
2001-12-26 21:51:41 +00:00
|
|
|
break;
|
|
|
|
case GST_STATE_PAUSED_TO_PLAYING:
|
|
|
|
break;
|
|
|
|
case GST_STATE_PLAYING_TO_PAUSED:
|
|
|
|
break;
|
|
|
|
case GST_STATE_PAUSED_TO_READY:
|
|
|
|
gst_bytestream_destroy (a52dec->bs);
|
|
|
|
a52dec->bs = NULL;
|
2002-03-21 23:45:58 +00:00
|
|
|
a52dec->samples = NULL;
|
2001-12-26 21:51:41 +00:00
|
|
|
break;
|
|
|
|
case GST_STATE_READY_TO_NULL:
|
2004-04-01 11:48:27 +00:00
|
|
|
a52_free (a52dec->state);
|
|
|
|
a52dec->state = NULL;
|
2001-12-26 21:51:41 +00:00
|
|
|
break;
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
GST_ELEMENT_CLASS (parent_class)->change_state (element);
|
|
|
|
|
|
|
|
return GST_STATE_SUCCESS;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2004-03-14 22:34:30 +00:00
|
|
|
gst_a52dec_set_property (GObject * object, guint prop_id, const GValue * value,
|
|
|
|
GParamSpec * pspec)
|
2001-12-26 21:51:41 +00:00
|
|
|
{
|
|
|
|
GstA52Dec *src;
|
|
|
|
|
|
|
|
/* it's not null if we got it, but it might not be ours */
|
|
|
|
g_return_if_fail (GST_IS_A52DEC (object));
|
|
|
|
src = GST_A52DEC (object);
|
|
|
|
|
|
|
|
switch (prop_id) {
|
|
|
|
case ARG_DRC:
|
|
|
|
src->dynamic_range_compression = g_value_get_boolean (value);
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2004-03-14 22:34:30 +00:00
|
|
|
gst_a52dec_get_property (GObject * object, guint prop_id, GValue * value,
|
|
|
|
GParamSpec * pspec)
|
2001-12-26 21:51:41 +00:00
|
|
|
{
|
|
|
|
GstA52Dec *src;
|
|
|
|
|
|
|
|
/* it's not null if we got it, but it might not be ours */
|
|
|
|
g_return_if_fail (GST_IS_A52DEC (object));
|
|
|
|
src = GST_A52DEC (object);
|
|
|
|
|
|
|
|
switch (prop_id) {
|
|
|
|
case ARG_DRC:
|
2002-03-21 23:45:58 +00:00
|
|
|
g_value_set_boolean (value, src->dynamic_range_compression);
|
2001-12-26 21:51:41 +00:00
|
|
|
break;
|
|
|
|
default:
|
|
|
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static gboolean
|
2003-11-01 01:32:03 +00:00
|
|
|
plugin_init (GstPlugin * plugin)
|
2001-12-26 21:51:41 +00:00
|
|
|
{
|
|
|
|
|
Surround sound support.
Original commit message from CVS:
* ext/a52dec/gsta52dec.c: (gst_a52dec_channels), (gst_a52dec_push),
(gst_a52dec_reneg), (gst_a52dec_loop), (plugin_init):
* ext/alsa/gstalsa.c: (gst_alsa_get_caps):
* ext/alsa/gstalsaplugin.c: (plugin_init):
* ext/dts/gstdtsdec.c: (gst_dtsdec_channels),
(gst_dtsdec_renegotiate), (gst_dtsdec_loop), (plugin_init):
* ext/faad/gstfaad.c: (gst_faad_init), (gst_faad_chanpos_from_gst),
(gst_faad_chanpos_to_gst), (gst_faad_sinkconnect),
(gst_faad_srcgetcaps), (gst_faad_srcconnect), (gst_faad_chain),
(gst_faad_change_state), (plugin_init):
* ext/faad/gstfaad.h:
* ext/vorbis/vorbis.c: (plugin_init):
* ext/vorbis/vorbisdec.c: (vorbis_dec_chain):
* gst-libs/gst/audio/Makefile.am:
* gst-libs/gst/audio/audio.c: (plugin_init):
* gst-libs/gst/audio/multichannel.c:
(gst_audio_check_channel_positions),
(gst_audio_get_channel_positions),
(gst_audio_set_channel_positions),
(gst_audio_set_structure_channel_positions_list),
(add_list_to_struct), (gst_audio_set_caps_channel_positions_list),
(gst_audio_fixate_channel_positions):
* gst-libs/gst/audio/multichannel.h:
* gst-libs/gst/audio/testchannels.c: (main):
* gst/audioconvert/gstaudioconvert.c:
(gst_audio_convert_class_init), (gst_audio_convert_init),
(gst_audio_convert_dispose), (gst_audio_convert_getcaps),
(gst_audio_convert_parse_caps), (gst_audio_convert_link),
(gst_audio_convert_fixate), (gst_audio_convert_channels):
* gst/audioconvert/plugin.c: (plugin_init):
Surround sound support.
2004-11-25 20:36:29 +00:00
|
|
|
if (!gst_library_load ("gstbytestream") || !gst_library_load ("gstaudio"))
|
2003-10-28 20:52:41 +00:00
|
|
|
return FALSE;
|
|
|
|
|
2004-03-14 22:34:30 +00:00
|
|
|
if (!gst_element_register (plugin, "a52dec", GST_RANK_PRIMARY,
|
2004-03-15 19:32:25 +00:00
|
|
|
GST_TYPE_A52DEC))
|
2003-11-01 01:32:03 +00:00
|
|
|
return FALSE;
|
2001-12-26 21:51:41 +00:00
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
2004-03-14 22:34:30 +00:00
|
|
|
GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,
|
|
|
|
GST_VERSION_MINOR,
|
|
|
|
"a52dec",
|
|
|
|
"Decodes ATSC A/52 encoded audio streams",
|
|
|
|
plugin_init, VERSION, "GPL", GST_PACKAGE, GST_ORIGIN);
|