diff options
author | Mike Melanson <mike@multimedia.cx> | 2002-11-11 05:01:31 +0000 |
---|---|---|
committer | Mike Melanson <mike@multimedia.cx> | 2002-11-11 05:01:31 +0000 |
commit | 723e89bc51bad662a67940a7ba0504832de5a490 (patch) | |
tree | 066531a0fc0c023b75a3951e698fb65e11db21af | |
parent | 061a0924abacaaaadd0d062258ae83d6e3b40562 (diff) | |
download | xine-lib-723e89bc51bad662a67940a7ba0504832de5a490.tar.gz xine-lib-723e89bc51bad662a67940a7ba0504832de5a490.tar.bz2 |
native audio codecs now report themselves in the stream/meta info fields
CVS patchset: 3231
CVS date: 2002/11/11 05:01:31
-rw-r--r-- | src/libxineadec/adpcm.c | 48 | ||||
-rw-r--r-- | src/libxineadec/fooaudio.c | 6 | ||||
-rw-r--r-- | src/libxineadec/gsm610.c | 6 | ||||
-rw-r--r-- | src/libxineadec/logpcm.c | 8 | ||||
-rw-r--r-- | src/libxineadec/roqaudio.c | 7 |
5 files changed, 70 insertions, 5 deletions
diff --git a/src/libxineadec/adpcm.c b/src/libxineadec/adpcm.c index e9c2f7817..f5c86a461 100644 --- a/src/libxineadec/adpcm.c +++ b/src/libxineadec/adpcm.c @@ -24,7 +24,7 @@ * formats can be found here: * http://www.pcisys.net/~melanson/codecs/ * - * $Id: adpcm.c,v 1.21 2002/11/03 06:08:54 tmmm Exp $ + * $Id: adpcm.c,v 1.22 2002/11/11 05:01:31 tmmm Exp $ */ #include <stdio.h> @@ -1079,6 +1079,52 @@ static void adpcm_decode_data (audio_decoder_t *this_gen, buf_element_t *buf) { this->bufsize = AUDIOBUFSIZE; this->size = 0; + /* load the stream information */ + switch (buf->type) { + + case BUF_AUDIO_MSADPCM: + this->stream->meta_info[XINE_META_INFO_AUDIOCODEC] = + strdup("Microsoft ADPCM"); + break; + + case BUF_AUDIO_MSIMAADPCM: + this->stream->meta_info[XINE_META_INFO_AUDIOCODEC] = + strdup("Microsoft IMA ADPCM"); + break; + + case BUF_AUDIO_QTIMAADPCM: + this->stream->meta_info[XINE_META_INFO_AUDIOCODEC] = + strdup("QT IMA ADPCM"); + break; + + case BUF_AUDIO_DK3ADPCM: + this->stream->meta_info[XINE_META_INFO_AUDIOCODEC] = + strdup("Duck DK3 ADPCM"); + break; + + case BUF_AUDIO_DK4ADPCM: + this->stream->meta_info[XINE_META_INFO_AUDIOCODEC] = + strdup("Duck DK4 ADPCM"); + break; + + case BUF_AUDIO_SMJPEG_IMA: + this->stream->meta_info[XINE_META_INFO_AUDIOCODEC] = + strdup("SMJPEG IMA ADPCM"); + break; + + case BUF_AUDIO_VQA_IMA: + this->stream->meta_info[XINE_META_INFO_AUDIOCODEC] = + strdup("VQA IMA ADPCM"); + break; + + case BUF_AUDIO_EA_ADPCM: + this->stream->meta_info[XINE_META_INFO_AUDIOCODEC] = + strdup("EA ADPCM"); + break; + + } + this->stream->stream_info[XINE_STREAM_INFO_AUDIO_HANDLED] = 1; + /* if the data was transported in an MS-type file (packet size will be * non-0 indicating an audio header), create a decode buffer */ if (buf->size) { diff --git a/src/libxineadec/fooaudio.c b/src/libxineadec/fooaudio.c index a1805179d..5368d6b5f 100644 --- a/src/libxineadec/fooaudio.c +++ b/src/libxineadec/fooaudio.c @@ -21,7 +21,7 @@ * player. It really works too! It will output a continuous sine wave in * place of the data it should actually send. * - * $Id: fooaudio.c,v 1.1 2002/11/02 20:55:23 tmmm Exp $ + * $Id: fooaudio.c,v 1.2 2002/11/11 05:01:35 tmmm Exp $ */ #include <stdio.h> @@ -97,6 +97,10 @@ static void fooaudio_decode_data (audio_decoder_t *this_gen, buf_element_t *buf) this->bufsize = AUDIOBUFSIZE; this->size = 0; + /* take this opportunity to initialize stream/meta information */ + this->stream->meta_info[XINE_META_INFO_AUDIOCODEC] = strdup("fooaudio"); + this->stream->stream_info[XINE_STREAM_INFO_AUDIO_HANDLED] = 1; + /* peform any other required initialization */ this->last_pts = -1; this->iteration = 0; diff --git a/src/libxineadec/gsm610.c b/src/libxineadec/gsm610.c index dbaba6d7e..c4b286919 100644 --- a/src/libxineadec/gsm610.c +++ b/src/libxineadec/gsm610.c @@ -44,7 +44,7 @@ * Carsten Bormann * -------------------------------------------------------------------- * - * $Id: gsm610.c,v 1.3 2002/11/03 06:08:54 tmmm Exp $ + * $Id: gsm610.c,v 1.4 2002/11/11 05:01:32 tmmm Exp $ * */ @@ -108,6 +108,10 @@ static void gsm610_decode_data (audio_decoder_t *this_gen, buf_element_t *buf) { this->bufsize = AUDIOBUFSIZE; this->size = 0; + /* stream/meta info */ + this->stream->meta_info[XINE_META_INFO_AUDIOCODEC] = strdup("GSM 6.10"); + this->stream->stream_info[XINE_STREAM_INFO_AUDIO_HANDLED] = 1; + return; } diff --git a/src/libxineadec/logpcm.c b/src/libxineadec/logpcm.c index 348cba9c9..a8671c9db 100644 --- a/src/libxineadec/logpcm.c +++ b/src/libxineadec/logpcm.c @@ -30,7 +30,7 @@ * http://sox.sourceforge.net/ * which listed the code as being lifted from Sun Microsystems. * - * $Id: logpcm.c,v 1.7 2002/11/03 06:08:54 tmmm Exp $ + * $Id: logpcm.c,v 1.8 2002/11/11 05:01:32 tmmm Exp $ * */ @@ -159,6 +159,12 @@ static void logpcm_decode_data (audio_decoder_t *this_gen, buf_element_t *buf) { this->bufsize = AUDIOBUFSIZE; this->size = 0; + /* stream/meta info */ + this->stream->meta_info[XINE_META_INFO_AUDIOCODEC] = + (buf->type == BUF_AUDIO_MULAW) ? strdup("mu-law log PCM") : + strdup("A-law log PCM"); + this->stream->stream_info[XINE_STREAM_INFO_AUDIO_HANDLED] = 1; + /* pre-calculate the possible log values */ if (buf->type == BUF_AUDIO_MULAW) for (i = 0; i < 256; i++) diff --git a/src/libxineadec/roqaudio.c b/src/libxineadec/roqaudio.c index d46fb6e4e..71e07d1e3 100644 --- a/src/libxineadec/roqaudio.c +++ b/src/libxineadec/roqaudio.c @@ -21,7 +21,7 @@ * For more information regarding the RoQ file format, visit: * http://www.csse.monash.edu.au/~timf/ * - * $Id: roqaudio.c,v 1.10 2002/11/03 06:08:54 tmmm Exp $ + * $Id: roqaudio.c,v 1.11 2002/11/11 05:01:33 tmmm Exp $ * */ @@ -82,6 +82,11 @@ static void roqaudio_decode_data (audio_decoder_t *this_gen, buf_element_t *buf) this->bufsize = AUDIOBUFSIZE; this->size = 0; + /* stream/meta info */ + this->stream->meta_info[XINE_META_INFO_AUDIOCODEC] = + strdup("RoQ DPCM Audio"); + this->stream->stream_info[XINE_STREAM_INFO_AUDIO_HANDLED] = 1; + return; } |