From 18a21051a23261d08306e1d27fcc47edf44e2586 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Wed, 1 Feb 2012 16:23:31 +0100 Subject: [PATCH] gsm: Use new audio encoder/decoder base class API for srcpad caps --- ext/gsm/gstgsmdec.c | 11 ++++------- ext/gsm/gstgsmenc.c | 2 +- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/ext/gsm/gstgsmdec.c b/ext/gsm/gstgsmdec.c index 502eb17427..954594f8aa 100644 --- a/ext/gsm/gstgsmdec.c +++ b/ext/gsm/gstgsmdec.c @@ -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; diff --git a/ext/gsm/gstgsmenc.c b/ext/gsm/gstgsmenc.c index 3df26dc11e..a25d65719b 100644 --- a/ext/gsm/gstgsmenc.c +++ b/ext/gsm/gstgsmenc.c @@ -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);