#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;
}