{
GstStructure *structure;
GstAmrnbDec *amrnbdec;
- GstCaps *copy;
+ GstAudioInfo info;
amrnbdec = GST_AMRNBDEC (dec);
gst_structure_get_int (structure, "rate", &amrnbdec->rate);
/* create reverse caps */
- copy = gst_caps_new_simple ("audio/x-raw",
- "format", G_TYPE_STRING, GST_AUDIO_NE (S16),
- "layout", G_TYPE_STRING, "interleaved",
- "channels", G_TYPE_INT, amrnbdec->channels,
- "rate", G_TYPE_INT, amrnbdec->rate, NULL);
+ gst_audio_info_init (&info);
+ gst_audio_info_set_format (&info,
+ GST_AUDIO_FORMAT_S16, amrnbdec->rate, amrnbdec->channels, NULL);
- gst_audio_decoder_set_outcaps (dec, copy);
- gst_caps_unref (copy);
-
- return TRUE;
+ return gst_audio_decoder_set_output_format (dec, &info);
}
static GstFlowReturn
"channels", G_TYPE_INT, amrnbenc->channels,
"rate", G_TYPE_INT, amrnbenc->rate, NULL);
- gst_pad_set_caps (GST_AUDIO_ENCODER_SRC_PAD (amrnbenc), copy);
+ gst_audio_encoder_set_output_format (GST_AUDIO_ENCODER (amrnbenc), copy);
gst_caps_unref (copy);
/* report needs to base class: hand one frame at a time */