plugin_LTLIBRARIES = libgstflv.la
libgstflv_la_CFLAGS = $(GST_PLUGINS_BASE_CFLAGS) $(GST_BASE_CFLAGS) $(GST_CFLAGS)
-libgstflv_la_LIBADD = -lgstpbutils-@GST_MAJORMINOR@ \
+libgstflv_la_LIBADD = -lgstpbutils-@GST_MAJORMINOR@ -lgstaudio-@GST_MAJORMINOR@\
$(GST_PLUGINS_BASE_LIBS) $(GST_BASE_LIBS) $(GST_LIBS)
libgstflv_la_LDFLAGS = ${GST_PLUGIN_LDFLAGS}
libgstflv_la_SOURCES = gstflvdemux.c gstflvmux.c
#include <gst/base/gstbytereader.h>
#include <gst/pbutils/descriptions.h>
#include <gst/pbutils/pbutils.h>
+#include <gst/audio/audio.h>
/* FIXME: don't rely on own GstIndex */
#include "gstindex.c"
"audio/mpeg, mpegversion = (int) 1, layer = (int) 3, channels = (int) { 1, 2 }, rate = (int) { 5512, 8000, 11025, 22050, 44100 }, parsed = (boolean) TRUE; "
"audio/mpeg, mpegversion = (int) 4, framed = (boolean) TRUE; "
"audio/x-nellymoser, channels = (int) { 1, 2 }, rate = (int) { 5512, 8000, 11025, 16000, 22050, 44100 }; "
- "audio/x-raw-int, endianness = (int) LITTLE_ENDIAN, channels = (int) { 1, 2 }, width = (int) 8, depth = (int) 8, rate = (int) { 5512, 11025, 22050, 44100 }, signed = (boolean) FALSE; "
- "audio/x-raw-int, endianness = (int) LITTLE_ENDIAN, channels = (int) { 1, 2 }, width = (int) 16, depth = (int) 16, rate = (int) { 5512, 11025, 22050, 44100 }, signed = (boolean) TRUE; "
+ "audio/x-raw, format = (string) { U8, S16LE }, layout = (string) interleaved, channels = (int) { 1, 2 }, rate = (int) { 5512, 11025, 22050, 44100 }; "
"audio/x-alaw, channels = (int) { 1, 2 }, rate = (int) { 5512, 11025, 22050, 44100 }; "
"audio/x-mulaw, channels = (int) { 1, 2 }, rate = (int) { 5512, 11025, 22050, 44100 }; "
"audio/x-speex, channels = (int) { 1, 2 }, rate = (int) { 5512, 11025, 22050, 44100 };")
break;
case 0:
case 3:
+ {
+ GstAudioFormat format;
+
/* Assuming little endian for 0 (aka endianness of the
* system on which the file was created) as most people
* are probably using little endian machines */
- caps = gst_caps_new_simple ("audio/x-raw-int",
- "endianness", G_TYPE_INT, G_LITTLE_ENDIAN,
- "signed", G_TYPE_BOOLEAN, (width == 8) ? FALSE : TRUE,
- "width", G_TYPE_INT, width, "depth", G_TYPE_INT, width, NULL);
+ format = gst_audio_format_build_integer ((width == 8) ? FALSE : TRUE,
+ G_LITTLE_ENDIAN, width, width);
+
+ caps = gst_caps_new_simple ("audio/x-raw",
+ "format", G_TYPE_STRING, gst_audio_format_to_string (format),
+ "layout", G_TYPE_STRING, "interleaved", NULL);
break;
+ }
case 4:
case 5:
case 6:
#include <math.h>
#include <string.h>
+#include <gst/audio/audio.h>
+
#include "gstflvmux.h"
#include "amfdefs.h"
"audio/mpeg, mpegversion = (int) 1, layer = (int) 3, channels = (int) { 1, 2 }, rate = (int) { 5512, 8000, 11025, 22050, 44100 }, parsed = (boolean) TRUE; "
"audio/mpeg, mpegversion = (int) { 2, 4 }, framed = (boolean) TRUE; "
"audio/x-nellymoser, channels = (int) { 1, 2 }, rate = (int) { 5512, 8000, 11025, 16000, 22050, 44100 }; "
- "audio/x-raw-int, endianness = (int) LITTLE_ENDIAN, channels = (int) { 1, 2 }, width = (int) 8, depth = (int) 8, rate = (int) { 5512, 11025, 22050, 44100 }, signed = (boolean) FALSE; "
- "audio/x-raw-int, endianness = (int) LITTLE_ENDIAN, channels = (int) { 1, 2 }, width = (int) 16, depth = (int) 16, rate = (int) { 5512, 11025, 22050, 44100 }, signed = (boolean) TRUE; "
+ "audio/x-raw, format = (string) { U8, S16LE}, layout = (string) interleaved, channels = (int) { 1, 2 }, rate = (int) { 5512, 11025, 22050, 44100 }; "
"audio/x-alaw, channels = (int) { 1, 2 }, rate = (int) { 5512, 11025, 22050, 44100 }; "
"audio/x-mulaw, channels = (int) { 1, 2 }, rate = (int) { 5512, 11025, 22050, 44100 }; "
"audio/x-speex, channels = (int) { 1, 2 }, rate = (int) { 5512, 11025, 22050, 44100 };")
} else {
cpad->audio_codec = 6;
}
- } else if (strcmp (gst_structure_get_name (s), "audio/x-raw-int") == 0) {
- gint endianness;
+ } else if (strcmp (gst_structure_get_name (s), "audio/x-raw") == 0) {
+ GstAudioInfo info;
- if (gst_structure_get_int (s, "endianness", &endianness)
- && endianness == G_LITTLE_ENDIAN)
+ if (gst_audio_info_from_caps (&info, caps)) {
cpad->audio_codec = 3;
- else
+
+ if (GST_AUDIO_INFO_WIDTH (&info) == 8)
+ cpad->width = 0;
+ else if (GST_AUDIO_INFO_WIDTH (&info) == 16)
+ cpad->width = 1;
+ else
+ ret = FALSE;
+ } else
ret = FALSE;
} else if (strcmp (gst_structure_get_name (s), "audio/x-alaw") == 0) {
cpad->audio_codec = 7;
}
if (ret) {
- gint rate, channels, width;
+ gint rate, channels;
if (gst_structure_get_int (s, "rate", &rate)) {
if (cpad->audio_codec == 10)
ret = FALSE;
}
- if (gst_structure_get_int (s, "width", &width)) {
- if (cpad->audio_codec != 3)
- cpad->width = 1;
- else if (width == 8)
- cpad->width = 0;
- else if (width == 16)
- cpad->width = 1;
- else
- ret = FALSE;
- } else if (cpad->audio_codec != 3) {
+ if (cpad->audio_codec != 3)
cpad->width = 1;
- } else {
- ret = FALSE;
- }
}
if (ret && gst_structure_has_field (s, "codec_data")) {