summaryrefslogtreecommitdiff
path: root/ext/voaacenc
diff options
context:
space:
mode:
authorSebastian Dröge <sebastian.droege@collabora.co.uk>2011-05-27 10:41:02 +0200
committerSebastian Dröge <sebastian.droege@collabora.co.uk>2011-05-27 10:41:02 +0200
commit77f20353f86878fa85dd60c63d7e1d1a1a5ff0f6 (patch)
treee65696022617a302255f31b28941df5eaafaa105 /ext/voaacenc
parentda03a46861bda763e58f1fd2454f326d00c17e2e (diff)
downloadgstreamer-plugins-bad-77f20353f86878fa85dd60c63d7e1d1a1a5ff0f6.tar.gz
voaacenc: Make sure to also return only a subset of the pad template caps in getcaps
Diffstat (limited to 'ext/voaacenc')
-rw-r--r--ext/voaacenc/gstvoaacenc.c22
1 files changed, 19 insertions, 3 deletions
diff --git a/ext/voaacenc/gstvoaacenc.c b/ext/voaacenc/gstvoaacenc.c
index 38c8e0660..752f7a6ef 100644
--- a/ext/voaacenc/gstvoaacenc.c
+++ b/ext/voaacenc/gstvoaacenc.c
@@ -141,8 +141,22 @@ gst_voaacenc_generate_sink_caps (gpointer data)
};
GstCaps *caps = gst_caps_new_empty ();
gint i, c;
+ static const int rates[] = {
+ 8000, 11025, 12000, 16000, 22050, 24000,
+ 32000, 44100, 48000, 64000, 88200, 96000
+ };
+ GValue rates_arr = { 0, };
+ GValue tmp = { 0, };
+
+ g_value_init (&rates_arr, GST_TYPE_LIST);
+ g_value_init (&tmp, G_TYPE_INT);
+ for (i = 0; i < G_N_ELEMENTS (rates); i++) {
+ g_value_set_int (&tmp, rates[i]);
+ gst_value_list_append_value (&rates_arr, &tmp);
+ }
+ g_value_unset (&tmp);
- for (i = 0; i < VOAAC_ENC_MAX_CHANNELS; i++) {
+ for (i = 0; i < 2 /*VOAAC_ENC_MAX_CHANNELS */ ; i++) {
GValue chanpos = { 0 };
GValue pos = { 0 };
GstStructure *structure;
@@ -162,15 +176,17 @@ gst_voaacenc_generate_sink_caps (gpointer data)
"depth", G_TYPE_INT, 16,
"signed", G_TYPE_BOOLEAN, TRUE,
"endianness", G_TYPE_INT, G_BYTE_ORDER,
- "rate", GST_TYPE_INT_RANGE, 8000, 96000, "channels", G_TYPE_INT, i + 1,
- NULL);
+ "channels", G_TYPE_INT, i + 1, NULL);
+ gst_structure_set_value (structure, "rate", &rates_arr);
gst_structure_set_value (structure, "channel-positions", &chanpos);
g_value_unset (&chanpos);
gst_caps_append_structure (caps, structure);
}
+ g_value_unset (&rates_arr);
+
GST_DEBUG ("generated sink caps: %" GST_PTR_FORMAT, caps);
return caps;
}