mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-11 09:55:36 +00:00
videoencoder: subclass 'set_format' should be optional
Aligns documentation with the code to make the subclass 'set_format' call optional.
This commit is contained in:
parent
1dee0f05a7
commit
ac6b805827
1 changed files with 4 additions and 5 deletions
|
@ -633,13 +633,10 @@ gst_video_encoder_setcaps (GstVideoEncoder * encoder, GstCaps * caps)
|
|||
{
|
||||
GstVideoEncoderClass *encoder_class;
|
||||
GstVideoCodecState *state;
|
||||
gboolean ret;
|
||||
gboolean ret = TRUE;
|
||||
|
||||
encoder_class = GST_VIDEO_ENCODER_GET_CLASS (encoder);
|
||||
|
||||
/* subclass should do something here ... */
|
||||
g_return_val_if_fail (encoder_class->set_format != NULL, FALSE);
|
||||
|
||||
GST_DEBUG_OBJECT (encoder, "setcaps %" GST_PTR_FORMAT, caps);
|
||||
|
||||
GST_VIDEO_ENCODER_STREAM_LOCK (encoder);
|
||||
|
@ -669,7 +666,9 @@ gst_video_encoder_setcaps (GstVideoEncoder * encoder, GstCaps * caps)
|
|||
}
|
||||
|
||||
/* and subclass should be ready to configure format at any time around */
|
||||
ret = encoder_class->set_format (encoder, state);
|
||||
if (encoder_class->set_format != NULL)
|
||||
ret = encoder_class->set_format (encoder, state);
|
||||
|
||||
if (ret) {
|
||||
if (encoder->priv->input_state)
|
||||
gst_video_codec_state_unref (encoder->priv->input_state);
|
||||
|
|
Loading…
Reference in a new issue