videoencoder: Add a reference to frame passed to subclass
We have one reference owned by the internal frame list and one reference passed to the subclass.
This commit is contained in:
parent
8217575af1
commit
67a4c0c7b2
@ -1185,6 +1185,7 @@ gst_video_encoder_chain (GstPad * pad, GstObject * parent, GstBuffer * buf)
|
|||||||
GST_LOG_OBJECT (encoder, "passing frame pfn %d to subclass",
|
GST_LOG_OBJECT (encoder, "passing frame pfn %d to subclass",
|
||||||
frame->presentation_frame_number);
|
frame->presentation_frame_number);
|
||||||
|
|
||||||
|
gst_video_codec_frame_ref (frame);
|
||||||
ret = klass->handle_frame (encoder, frame);
|
ret = klass->handle_frame (encoder, frame);
|
||||||
|
|
||||||
done:
|
done:
|
||||||
@ -1496,7 +1497,9 @@ gst_video_encoder_finish_frame (GstVideoEncoder * encoder,
|
|||||||
done:
|
done:
|
||||||
/* handed out */
|
/* handed out */
|
||||||
priv->frames = g_list_remove (priv->frames, frame);
|
priv->frames = g_list_remove (priv->frames, frame);
|
||||||
|
/* Remove the reference from the list and the reference that
|
||||||
|
* was provided to us */
|
||||||
|
gst_video_codec_frame_unref (frame);
|
||||||
gst_video_codec_frame_unref (frame);
|
gst_video_codec_frame_unref (frame);
|
||||||
|
|
||||||
GST_VIDEO_ENCODER_STREAM_UNLOCK (encoder);
|
GST_VIDEO_ENCODER_STREAM_UNLOCK (encoder);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user