mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-11 09:55:36 +00:00
audioencoder: Add gst_audio_encoder_set_output_format() function for consistency
This commit is contained in:
parent
dbd43c7dd3
commit
0370b0dc12
2 changed files with 36 additions and 0 deletions
|
@ -2169,3 +2169,36 @@ gst_audio_encoder_merge_tags (GstAudioEncoder * enc,
|
||||||
gst_tag_list_free (otags);
|
gst_tag_list_free (otags);
|
||||||
GST_OBJECT_UNLOCK (enc);
|
GST_OBJECT_UNLOCK (enc);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* gst_audio_encoder_set_output_format:
|
||||||
|
* @enc: a #GstAudioEncoder
|
||||||
|
* @caps: #GstCaps
|
||||||
|
*
|
||||||
|
* Configure output caps on the srcpad of @enc.
|
||||||
|
*
|
||||||
|
* Returns: %TRUE on success.
|
||||||
|
**/
|
||||||
|
gboolean
|
||||||
|
gst_audio_encoder_set_output_format (GstAudioEncoder * enc, GstCaps * caps)
|
||||||
|
{
|
||||||
|
gboolean res = FALSE;
|
||||||
|
|
||||||
|
GST_DEBUG_OBJECT (enc, "Setting srcpad caps %" GST_PTR_FORMAT, caps);
|
||||||
|
|
||||||
|
if (!gst_caps_is_fixed (caps))
|
||||||
|
goto refuse_caps;
|
||||||
|
|
||||||
|
res = gst_pad_set_caps (enc->srcpad, caps);
|
||||||
|
|
||||||
|
done:
|
||||||
|
return res;
|
||||||
|
|
||||||
|
/* ERRORS */
|
||||||
|
refuse_caps:
|
||||||
|
{
|
||||||
|
GST_WARNING_OBJECT (enc, "refused caps %" GST_PTR_FORMAT, caps);
|
||||||
|
res = FALSE;
|
||||||
|
goto done;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -197,6 +197,9 @@ GstFlowReturn gst_audio_encoder_finish_frame (GstAudioEncoder * enc,
|
||||||
GstCaps * gst_audio_encoder_proxy_getcaps (GstAudioEncoder * enc,
|
GstCaps * gst_audio_encoder_proxy_getcaps (GstAudioEncoder * enc,
|
||||||
GstCaps * caps);
|
GstCaps * caps);
|
||||||
|
|
||||||
|
gboolean gst_audio_encoder_set_output_format (GstAudioEncoder * enc,
|
||||||
|
GstCaps * caps);
|
||||||
|
|
||||||
|
|
||||||
/* context parameters */
|
/* context parameters */
|
||||||
GstAudioInfo * gst_audio_encoder_get_audio_info (GstAudioEncoder * enc);
|
GstAudioInfo * gst_audio_encoder_get_audio_info (GstAudioEncoder * enc);
|
||||||
|
|
Loading…
Reference in a new issue