[Swfdec-commits] 4 commits - swfdec/swfdec_audio_decoder_adpcm.c swfdec/swfdec_audio_decoder.c swfdec/swfdec_audio_decoder_gst.c swfdec/swfdec_audio_decoder.h swfdec/swfdec_audio_decoder_uncompressed.c swfdec/swfdec_audio_flv.c swfdec/swfdec_audio_stream.c swfdec/swfdec_sound.c tools/dump.c

Benjamin Otte company at kemper.freedesktop.org
Thu Oct 16 08:20:04 PDT 2008


 swfdec/swfdec_audio_decoder.c              |    6 ++++--
 swfdec/swfdec_audio_decoder.h              |   12 ++++++++++--
 swfdec/swfdec_audio_decoder_adpcm.c        |    2 +-
 swfdec/swfdec_audio_decoder_gst.c          |    2 +-
 swfdec/swfdec_audio_decoder_uncompressed.c |    2 +-
 swfdec/swfdec_audio_flv.c                  |    2 +-
 swfdec/swfdec_audio_stream.c               |    2 +-
 swfdec/swfdec_sound.c                      |    2 +-
 tools/dump.c                               |   20 ++++++++++++++++++--
 9 files changed, 38 insertions(+), 12 deletions(-)

New commits:
commit 76353c2e8d7dd014b42f03b0edc04ea5f0d216bd
Author: Benjamin Otte <otte at gnome.org>
Date:   Thu Oct 16 16:27:45 2008 +0200

    add Speex from Flash 10

diff --git a/swfdec/swfdec_audio_decoder.h b/swfdec/swfdec_audio_decoder.h
index b576a70..8c7fb5d 100644
--- a/swfdec/swfdec_audio_decoder.h
+++ b/swfdec/swfdec_audio_decoder.h
@@ -36,6 +36,7 @@ G_BEGIN_DECLS
 #define SWFDEC_AUDIO_CODEC_ALAW 7
 #define SWFDEC_AUDIO_CODEC_MULAW 8
 #define SWFDEC_AUDIO_CODEC_AAC 10
+#define SWFDEC_AUDIO_CODEC_SPEEX 11
 #define SWFDEC_AUDIO_CODEC_MP3_8KHZ 14
 
 
diff --git a/tools/dump.c b/tools/dump.c
index 13759b4..d70f9f7 100644
--- a/tools/dump.c
+++ b/tools/dump.c
@@ -71,6 +71,8 @@ get_audio_format_name (guint codec)
       return "u-law";
     case SWFDEC_AUDIO_CODEC_AAC:
       return "AAC";
+    case SWFDEC_AUDIO_CODEC_SPEEX:
+      return "Speex";
     case SWFDEC_AUDIO_CODEC_MP3_8KHZ:
       return "MP3 8kHz";
     default:
commit 09b1dea7ff9ddd000dbe0c953be2cf17600157d8
Author: Benjamin Otte <otte at gnome.org>
Date:   Thu Oct 16 15:20:47 2008 +0200

    add new codecs

diff --git a/tools/dump.c b/tools/dump.c
index eb56c4b..13759b4 100644
--- a/tools/dump.c
+++ b/tools/dump.c
@@ -1,7 +1,7 @@
 /* Swfdec
  * Copyright (C) 2003-2006 David Schleef <ds at schleef.org>
  *		 2005-2006 Eric Anholt <eric at anholt.net>
- *		 2006-2007 Benjamin Otte <otte at gnome.org>
+ *		 2006-2008 Benjamin Otte <otte at gnome.org>
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
@@ -51,14 +51,28 @@ static const char *
 get_audio_format_name (guint codec)
 {
   switch (codec) {
+    case SWFDEC_AUDIO_CODEC_UNDEFINED:
+      return "Undefined";
     case SWFDEC_AUDIO_CODEC_ADPCM:
       return "ADPCM";
     case SWFDEC_AUDIO_CODEC_MP3:
       return "MP3";
     case SWFDEC_AUDIO_CODEC_UNCOMPRESSED:
-      return "uncompressed";
+      return "Uncompressed";
+    case SWFDEC_AUDIO_CODEC_NELLYMOSER_16KHZ:
+      return "Nellymoser 16kHz";
+    case SWFDEC_AUDIO_CODEC_NELLYMOSER_8KHZ:
+      return "Nellymoser 8kHz";
     case SWFDEC_AUDIO_CODEC_NELLYMOSER:
       return "Nellymoser";
+    case SWFDEC_AUDIO_CODEC_ALAW:
+      return "a-law";
+    case SWFDEC_AUDIO_CODEC_MULAW:
+      return "u-law";
+    case SWFDEC_AUDIO_CODEC_AAC:
+      return "AAC";
+    case SWFDEC_AUDIO_CODEC_MP3_8KHZ:
+      return "MP3 8kHz";
     default:
       return "Unknown";
   }
commit c2479b15ddc5db4add8660cc3bade20132170f27
Author: Benjamin Otte <otte at gnome.org>
Date:   Thu Oct 16 15:20:20 2008 +0200

    add codecs from the FLV specification

diff --git a/swfdec/swfdec_audio_decoder.h b/swfdec/swfdec_audio_decoder.h
index ca2474a..b576a70 100644
--- a/swfdec/swfdec_audio_decoder.h
+++ b/swfdec/swfdec_audio_decoder.h
@@ -30,8 +30,13 @@ G_BEGIN_DECLS
 #define SWFDEC_AUDIO_CODEC_ADPCM 1
 #define SWFDEC_AUDIO_CODEC_MP3 2
 #define SWFDEC_AUDIO_CODEC_UNCOMPRESSED 3
+#define SWFDEC_AUDIO_CODEC_NELLYMOSER_16KHZ 4
 #define SWFDEC_AUDIO_CODEC_NELLYMOSER_8KHZ 5
 #define SWFDEC_AUDIO_CODEC_NELLYMOSER 6
+#define SWFDEC_AUDIO_CODEC_ALAW 7
+#define SWFDEC_AUDIO_CODEC_MULAW 8
+#define SWFDEC_AUDIO_CODEC_AAC 10
+#define SWFDEC_AUDIO_CODEC_MP3_8KHZ 14
 
 
 typedef struct _SwfdecAudioDecoder SwfdecAudioDecoder;
commit 4742a6015fce9f5dc0f61b4399b32d2bc88cefe4
Author: Benjamin Otte <otte at gnome.org>
Date:   Thu Oct 16 15:07:22 2008 +0200

    make creating audio decoders take codec data, too

diff --git a/swfdec/swfdec_audio_decoder.c b/swfdec/swfdec_audio_decoder.c
index 72be732..c0b666b 100644
--- a/swfdec/swfdec_audio_decoder.c
+++ b/swfdec/swfdec_audio_decoder.c
@@ -83,6 +83,8 @@ swfdec_audio_decoder_prepare (guint codec, SwfdecAudioFormat format, char **miss
  * swfdec_audio_decoder_new:
  * @codec: codec id
  * @format: #SwfdecAudioCodec to decode
+ * @data: setup data for the codec or %NULL for none. Setup data is only 
+ *        required for AAC audio.
  *
  * Creates a decoder suitable for decoding @format. If no decoder is available
  * for the given for mat, %NULL is returned.
@@ -90,7 +92,7 @@ swfdec_audio_decoder_prepare (guint codec, SwfdecAudioFormat format, char **miss
  * Returns: a new decoder or %NULL
  **/
 SwfdecAudioDecoder *
-swfdec_audio_decoder_new (guint codec, SwfdecAudioFormat format)
+swfdec_audio_decoder_new (guint codec, SwfdecAudioFormat format, SwfdecBuffer *data)
 {
   SwfdecAudioDecoder *ret = NULL;
   GSList *walk;
@@ -99,7 +101,7 @@ swfdec_audio_decoder_new (guint codec, SwfdecAudioFormat format)
 
   for (walk = audio_codecs; walk; walk = walk->next) {
     SwfdecAudioDecoderClass *klass = g_type_class_ref (GPOINTER_TO_SIZE (walk->data));
-    ret = klass->create (codec, format);
+    ret = klass->create (codec, format, data);
     g_type_class_unref (klass);
     if (ret)
       break;
diff --git a/swfdec/swfdec_audio_decoder.h b/swfdec/swfdec_audio_decoder.h
index e0e2960..ca2474a 100644
--- a/swfdec/swfdec_audio_decoder.h
+++ b/swfdec/swfdec_audio_decoder.h
@@ -64,7 +64,8 @@ struct _SwfdecAudioDecoderClass
                                          SwfdecAudioFormat      format,
 					 char **                missing);
   SwfdecAudioDecoder *	(* create)	(guint                  codec,
-					 SwfdecAudioFormat      format);
+					 SwfdecAudioFormat      format,
+					 SwfdecBuffer *		data);
 
   void			(* push)	(SwfdecAudioDecoder *	decoder,
 					 SwfdecBuffer *		buffer);
@@ -79,7 +80,8 @@ gboolean		swfdec_audio_decoder_prepare	(guint			codec,
 							 SwfdecAudioFormat	format,
 							 char **		missing);
 SwfdecAudioDecoder *   	swfdec_audio_decoder_new      	(guint			codec,
-							 SwfdecAudioFormat	format);
+							 SwfdecAudioFormat	format,
+							 SwfdecBuffer *		data);
 
 void			swfdec_audio_decoder_push	(SwfdecAudioDecoder *	decoder,
 							 SwfdecBuffer *		buffer);
diff --git a/swfdec/swfdec_audio_decoder_adpcm.c b/swfdec/swfdec_audio_decoder_adpcm.c
index 18eaab1..255af88 100644
--- a/swfdec/swfdec_audio_decoder_adpcm.c
+++ b/swfdec/swfdec_audio_decoder_adpcm.c
@@ -34,7 +34,7 @@ swfdec_audio_decoder_adpcm_prepare (guint codec, SwfdecAudioFormat format, char
 }
 
 static SwfdecAudioDecoder *
-swfdec_audio_decoder_adpcm_create (guint codec, SwfdecAudioFormat format)
+swfdec_audio_decoder_adpcm_create (guint codec, SwfdecAudioFormat format, SwfdecBuffer *data)
 {
   if (codec != SWFDEC_AUDIO_CODEC_ADPCM)
     return NULL;
diff --git a/swfdec/swfdec_audio_decoder_gst.c b/swfdec/swfdec_audio_decoder_gst.c
index 9b29957..e22c05b 100644
--- a/swfdec/swfdec_audio_decoder_gst.c
+++ b/swfdec/swfdec_audio_decoder_gst.c
@@ -108,7 +108,7 @@ swfdec_audio_decoder_get_resampler (void)
 }
 
 static SwfdecAudioDecoder *
-swfdec_audio_decoder_gst_create (guint type, SwfdecAudioFormat format)
+swfdec_audio_decoder_gst_create (guint type, SwfdecAudioFormat format, SwfdecBuffer *data)
 {
   SwfdecAudioDecoderGst *player;
   GstCaps *srccaps, *sinkcaps;
diff --git a/swfdec/swfdec_audio_decoder_uncompressed.c b/swfdec/swfdec_audio_decoder_uncompressed.c
index 5371d9f..c6fe3fe 100644
--- a/swfdec/swfdec_audio_decoder_uncompressed.c
+++ b/swfdec/swfdec_audio_decoder_uncompressed.c
@@ -35,7 +35,7 @@ swfdec_audio_decoder_uncompressed_prepare (guint codec, SwfdecAudioFormat format
 }
 
 static SwfdecAudioDecoder *
-swfdec_audio_decoder_uncompressed_create (guint codec, SwfdecAudioFormat format)
+swfdec_audio_decoder_uncompressed_create (guint codec, SwfdecAudioFormat format, SwfdecBuffer *data)
 {
   if (codec != SWFDEC_AUDIO_CODEC_UNDEFINED &&
       codec != SWFDEC_AUDIO_CODEC_UNCOMPRESSED)
diff --git a/swfdec/swfdec_audio_flv.c b/swfdec/swfdec_audio_flv.c
index 2a49ee6..e5cd6be 100644
--- a/swfdec/swfdec_audio_flv.c
+++ b/swfdec/swfdec_audio_flv.c
@@ -92,7 +92,7 @@ swfdec_audio_flv_decode_one (SwfdecAudioFlv *flv)
       }
       flv->format = format;
       flv->in = in;
-      flv->decoder = swfdec_audio_decoder_new (flv->format, flv->in);
+      flv->decoder = swfdec_audio_decoder_new (flv->format, flv->in, NULL);
       if (flv->decoder == NULL)
 	return NULL;
     } else if (format != flv->format ||
diff --git a/swfdec/swfdec_audio_stream.c b/swfdec/swfdec_audio_stream.c
index 857fecd..0806350 100644
--- a/swfdec/swfdec_audio_stream.c
+++ b/swfdec/swfdec_audio_stream.c
@@ -203,7 +203,7 @@ swfdec_audio_stream_use_decoder (SwfdecAudioStream *stream,
     /* FIXME: send NULL buffer */
     g_object_unref (stream->decoder);
   }
-  stream->decoder = swfdec_audio_decoder_new (codec, format);
+  stream->decoder = swfdec_audio_decoder_new (codec, format, NULL);
 }
 
 void
diff --git a/swfdec/swfdec_sound.c b/swfdec/swfdec_sound.c
index d228e45..75891c6 100644
--- a/swfdec/swfdec_sound.c
+++ b/swfdec/swfdec_sound.c
@@ -192,7 +192,7 @@ swfdec_sound_get_decoded (SwfdecSound *sound)
   if (sound->encoded == NULL)
     return NULL;
 
-  decoder = swfdec_audio_decoder_new (sound->codec, sound->format);
+  decoder = swfdec_audio_decoder_new (sound->codec, sound->format, NULL);
   if (decoder == NULL)
     return NULL;
 


More information about the Swfdec-commits mailing list