Commit 18a21051 authored by Sebastian Dröge's avatar Sebastian Dröge

gsm: Use new audio encoder/decoder base class API for srcpad caps

parent cf0f205c
......@@ -134,10 +134,10 @@ static gboolean
gst_gsmdec_set_format (GstAudioDecoder * dec, GstCaps * caps)
{
GstGSMDec *gsmdec;
GstCaps *srccaps;
GstStructure *s;
gboolean ret = FALSE;
gint rate;
GstAudioInfo info;
gsmdec = GST_GSMDEC (dec);
......@@ -164,13 +164,10 @@ gst_gsmdec_set_format (GstAudioDecoder * dec, GstCaps * caps)
gsm_option (gsmdec->state, GSM_OPT_WAV49, &gsmdec->use_wav49);
/* Setting up src caps based on the input sample rate. */
srccaps = gst_caps_new_simple ("audio/x-raw",
"format", G_TYPE_STRING, GST_AUDIO_NE (S16),
"layout", G_TYPE_STRING, "interleaved",
"rate", G_TYPE_INT, rate, "channels", G_TYPE_INT, 1, NULL);
gst_audio_info_init (&info);
gst_audio_info_set_format (&info, GST_AUDIO_FORMAT_S16, rate, 1, NULL);
ret = gst_audio_decoder_set_outcaps (dec, srccaps);
gst_caps_unref (srccaps);
ret = gst_audio_decoder_set_output_format (dec, &info);
return ret;
......
......@@ -133,7 +133,7 @@ gst_gsmenc_set_format (GstAudioEncoder * benc, GstAudioInfo * info)
GstCaps *srccaps;
srccaps = gst_static_pad_template_get_caps (&gsmenc_src_template);
gst_pad_set_caps (GST_AUDIO_ENCODER_SRC_PAD (benc), srccaps);
gst_audio_encoder_set_output_format (GST_AUDIO_ENCODER (benc), srccaps);
/* report needs to base class */
gst_audio_encoder_set_frame_samples_min (benc, 160);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment