gsm: Use new audio encoder/decoder base class API for srcpad caps
This commit is contained in:
parent
cf0f205cca
commit
18a21051a2
@ -134,10 +134,10 @@ static gboolean
|
|||||||
gst_gsmdec_set_format (GstAudioDecoder * dec, GstCaps * caps)
|
gst_gsmdec_set_format (GstAudioDecoder * dec, GstCaps * caps)
|
||||||
{
|
{
|
||||||
GstGSMDec *gsmdec;
|
GstGSMDec *gsmdec;
|
||||||
GstCaps *srccaps;
|
|
||||||
GstStructure *s;
|
GstStructure *s;
|
||||||
gboolean ret = FALSE;
|
gboolean ret = FALSE;
|
||||||
gint rate;
|
gint rate;
|
||||||
|
GstAudioInfo info;
|
||||||
|
|
||||||
gsmdec = GST_GSMDEC (dec);
|
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);
|
gsm_option (gsmdec->state, GSM_OPT_WAV49, &gsmdec->use_wav49);
|
||||||
|
|
||||||
/* Setting up src caps based on the input sample rate. */
|
/* Setting up src caps based on the input sample rate. */
|
||||||
srccaps = gst_caps_new_simple ("audio/x-raw",
|
gst_audio_info_init (&info);
|
||||||
"format", G_TYPE_STRING, GST_AUDIO_NE (S16),
|
gst_audio_info_set_format (&info, GST_AUDIO_FORMAT_S16, rate, 1, NULL);
|
||||||
"layout", G_TYPE_STRING, "interleaved",
|
|
||||||
"rate", G_TYPE_INT, rate, "channels", G_TYPE_INT, 1, NULL);
|
|
||||||
|
|
||||||
ret = gst_audio_decoder_set_outcaps (dec, srccaps);
|
ret = gst_audio_decoder_set_output_format (dec, &info);
|
||||||
gst_caps_unref (srccaps);
|
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
|
@ -133,7 +133,7 @@ gst_gsmenc_set_format (GstAudioEncoder * benc, GstAudioInfo * info)
|
|||||||
GstCaps *srccaps;
|
GstCaps *srccaps;
|
||||||
|
|
||||||
srccaps = gst_static_pad_template_get_caps (&gsmenc_src_template);
|
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 */
|
/* report needs to base class */
|
||||||
gst_audio_encoder_set_frame_samples_min (benc, 160);
|
gst_audio_encoder_set_frame_samples_min (benc, 160);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user