plugin_LTLIBRARIES = libgstalaw.la libgstmulaw.la
libgstalaw_la_SOURCES = alaw-encode.c alaw-decode.c alaw.c
-libgstalaw_la_CFLAGS = $(GST_CFLAGS)
-libgstalaw_la_LIBADD = $(GST_LIBS)
+libgstalaw_la_CFLAGS = $(GST_CFLAGS) $(GST_PLUGINS_BASE_CFLAGS)
+libgstalaw_la_LIBADD = $(GST_LIBS) $(GST_BASE_LIBS) \
+ $(GST_PLUGINS_BASE_LIBS) -lgstaudio-$(GST_MAJORMINOR)
libgstalaw_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS)
libgstalaw_la_LIBTOOLFLAGS = --tag=disable-static
libgstmulaw_la_SOURCES = mulaw-encode.c mulaw-conversion.c mulaw-decode.c mulaw.c
-libgstmulaw_la_CFLAGS = $(GST_CFLAGS)
-libgstmulaw_la_LIBADD = $(GST_LIBS)
+libgstmulaw_la_CFLAGS = $(GST_CFLAGS) $(GST_PLUGINS_BASE_CFLAGS)
+libgstmulaw_la_LIBADD = $(GST_LIBS) $(GST_BASE_LIBS) \
+ $(GST_PLUGINS_BASE_LIBS) -lgstaudio-$(GST_MAJORMINOR)
libgstmulaw_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS)
libgstmulaw_la_LIBTOOLFLAGS = --tag=disable-static
#include "config.h"
#endif
+#include <gst/audio/audio.h>
+
#include "alaw-decode.h"
extern GstStaticPadTemplate alaw_dec_src_factory;
if (!ret)
return FALSE;
- outcaps = gst_caps_new_simple ("audio/x-raw-int",
- "width", G_TYPE_INT, 16,
- "depth", G_TYPE_INT, 16,
- "endianness", G_TYPE_INT, G_BYTE_ORDER,
- "signed", G_TYPE_BOOLEAN, TRUE,
+ outcaps = gst_caps_new_simple ("audio/x-raw",
+ "format", G_TYPE_STRING, GST_AUDIO_NE (S16),
"rate", G_TYPE_INT, rate, "channels", G_TYPE_INT, channels, NULL);
ret = gst_pad_set_caps (alawdec->srcpad, outcaps);
/* figure out the name of the caps we are going to return */
if (pad == alawdec->srcpad) {
- name = "audio/x-raw-int";
+ name = "audio/x-raw";
otherpad = alawdec->sinkpad;
} else {
name = "audio/x-alaw";
otherpad = alawdec->srcpad;
}
/* get caps from the peer, this can return NULL when there is no peer */
- othercaps = gst_pad_peer_query_caps (otherpad, filter);
+ othercaps = gst_pad_peer_query_caps (otherpad, NULL);
/* get the template caps to make sure we return something acceptable */
templ = gst_pad_get_pad_template_caps (pad);
if (pad == alawdec->sinkpad) {
/* remove the fields we don't want */
- gst_structure_remove_fields (structure, "width", "depth", "endianness",
- "signed", NULL);
+ gst_structure_remove_fields (structure, "format", NULL);
} else {
/* add fixed fields */
- gst_structure_set (structure, "width", G_TYPE_INT, 16,
- "depth", G_TYPE_INT, 16,
- "endianness", G_TYPE_INT, G_BYTE_ORDER,
- "signed", G_TYPE_BOOLEAN, TRUE, NULL);
+ gst_structure_set (structure, "format", G_TYPE_STRING,
+ GST_AUDIO_NE (S16), NULL);
}
}
/* filter against the allowed caps of the pad to return our result */
/* there was no peer, return the template caps */
result = gst_caps_copy (templ);
}
+ if (filter && result) {
+ GstCaps *temp;
+ temp = gst_caps_intersect (result, filter);
+ gst_caps_unref (result);
+ result = temp;
+ }
return result;
}
#include "config.h"
#endif
+#include <gst/audio/audio.h>
#include "alaw-encode.h"
GST_DEBUG_CATEGORY_STATIC (alaw_enc_debug);
name = "audio/x-alaw";
otherpad = alawenc->sinkpad;
} else {
- name = "audio/x-raw-int";
+ name = "audio/x-raw";
otherpad = alawenc->srcpad;
}
/* get caps from the peer, this can return NULL when there is no peer */
- othercaps = gst_pad_peer_query_caps (otherpad, filter);
+ othercaps = gst_pad_peer_query_caps (otherpad, NULL);
/* get the template caps to make sure we return something acceptable */
templ = gst_pad_get_pad_template_caps (pad);
if (pad == alawenc->srcpad) {
/* remove the fields we don't want */
- gst_structure_remove_fields (structure, "width", "depth", "endianness",
- "signed", NULL);
+ gst_structure_remove_fields (structure, "format", NULL);
} else {
/* add fixed fields */
- gst_structure_set (structure, "width", G_TYPE_INT, 16,
- "depth", G_TYPE_INT, 16,
- "endianness", G_TYPE_INT, G_BYTE_ORDER,
- "signed", G_TYPE_BOOLEAN, TRUE, NULL);
+ gst_structure_set (structure, "format", G_TYPE_STRING,
+ GST_AUDIO_NE (S16), NULL);
}
}
/* filter against the allowed caps of the pad to return our result */
/* there was no peer, return the template caps */
result = gst_caps_copy (templ);
}
+ if (filter && result) {
+ GstCaps *temp;
+
+ temp = gst_caps_intersect (result, filter);
+ gst_caps_unref (result);
+ result = temp;
+ }
return result;
}
#include "config.h"
#endif
+#include <gst/audio/audio.h>
+
#include "alaw-encode.h"
#include "alaw-decode.h"
-#if G_BYTE_ORDER == G_LITTLE_ENDIAN
-#define INT_FORMAT "S16LE"
-#else
-#define INT_FORMAT "S16BE"
-#endif
-
GstStaticPadTemplate alaw_dec_src_factory = GST_STATIC_PAD_TEMPLATE ("src",
GST_PAD_SRC,
GST_PAD_ALWAYS,
GST_STATIC_CAPS ("audio/x-raw, "
- "format = (string) " INT_FORMAT ", "
+ "format = (string) " GST_AUDIO_NE (S16) ", "
"rate = (int) [ 8000, 192000 ], " "channels = (int) [ 1, 2 ]")
);
GST_PAD_SINK,
GST_PAD_ALWAYS,
GST_STATIC_CAPS ("audio/x-raw, "
- "format = (string) " INT_FORMAT ", "
+ "format = (string) " GST_AUDIO_NE (S16) ", "
"rate = (int) [ 8000, 192000 ], " "channels = (int) [ 1, 2 ]")
);
#include "config.h"
#endif
#include <gst/gst.h>
+#include <gst/audio/audio.h>
#include "mulaw-decode.h"
#include "mulaw-conversion.h"
-#if G_BYTE_ORDER == G_LITTLE_ENDIAN
-#define INT_FORMAT "S16LE"
-#else
-#define INT_FORMAT "S16BE"
-#endif
-
extern GstStaticPadTemplate mulaw_dec_src_factory;
extern GstStaticPadTemplate mulaw_dec_sink_factory;
return FALSE;
outcaps = gst_caps_new_simple ("audio/x-raw",
- "format", G_TYPE_STRING, INT_FORMAT,
+ "format", G_TYPE_STRING, GST_AUDIO_NE (S16),
"rate", G_TYPE_INT, rate, "channels", G_TYPE_INT, channels, NULL);
ret = gst_pad_set_caps (mulawdec->srcpad, outcaps);
gst_caps_unref (outcaps);
otherpad = mulawdec->srcpad;
}
/* get caps from the peer, this can return NULL when there is no peer */
- othercaps = gst_pad_peer_query_caps (otherpad, filter);
+ othercaps = gst_pad_peer_query_caps (otherpad, NULL);
/* get the template caps to make sure we return something acceptable */
templ = gst_pad_get_pad_template_caps (pad);
gst_structure_remove_fields (structure, "format", NULL);
} else {
/* add fixed fields */
- gst_structure_set (structure, "format", G_TYPE_STRING, INT_FORMAT,
- NULL);
+ gst_structure_set (structure, "format", G_TYPE_STRING,
+ GST_AUDIO_NE (S16), NULL);
}
}
/* filter against the allowed caps of the pad to return our result */
/* there was no peer, return the template caps */
result = gst_caps_copy (templ);
}
+ if (filter && result) {
+ GstCaps *temp;
+
+ temp = gst_caps_intersect (result, filter);
+ gst_caps_unref (result);
+ result = temp;
+ }
return result;
}
#include "config.h"
#endif
#include <gst/gst.h>
+#include <gst/audio/audio.h>
+
#include "mulaw-encode.h"
#include "mulaw-conversion.h"
name = "audio/x-mulaw";
otherpad = mulawenc->sinkpad;
} else {
- name = "audio/x-raw-int";
+ name = "audio/x-raw";
otherpad = mulawenc->srcpad;
}
/* get caps from the peer, this can return NULL when there is no peer */
- othercaps = gst_pad_peer_query_caps (otherpad, filter);
+ othercaps = gst_pad_peer_query_caps (otherpad, NULL);
/* get the template caps to make sure we return something acceptable */
templ = gst_pad_get_pad_template_caps (pad);
if (pad == mulawenc->srcpad) {
/* remove the fields we don't want */
- gst_structure_remove_fields (structure, "width", "depth", "endianness",
- "signed", NULL);
+ gst_structure_remove_fields (structure, "format", NULL);
} else {
/* add fixed fields */
- gst_structure_set (structure, "width", G_TYPE_INT, 16,
- "depth", G_TYPE_INT, 16,
- "endianness", G_TYPE_INT, G_BYTE_ORDER,
- "signed", G_TYPE_BOOLEAN, TRUE, NULL);
+ gst_structure_set (structure, "format", G_TYPE_STRING,
+ GST_AUDIO_NE (S16), NULL);
}
}
/* filter against the allowed caps of the pad to return our result */
/* there was no peer, return the template caps */
result = gst_caps_copy (templ);
}
+ if (filter && result) {
+ GstCaps *temp;
+
+ temp = gst_caps_intersect (result, filter);
+ gst_caps_unref (result);
+ result = temp;
+ }
+
return result;
}