vtenc: no need for queue_length with try_pop
This commit is contained in:
parent
1f7681dd0a
commit
faf903720a
@ -740,6 +740,7 @@ static GstFlowReturn
|
|||||||
gst_vtenc_finish (GstVideoEncoder * enc)
|
gst_vtenc_finish (GstVideoEncoder * enc)
|
||||||
{
|
{
|
||||||
GstVTEnc *self = GST_VTENC_CAST (enc);
|
GstVTEnc *self = GST_VTENC_CAST (enc);
|
||||||
|
GstVideoCodecFrame *outframe;
|
||||||
GstFlowReturn ret = GST_FLOW_OK;
|
GstFlowReturn ret = GST_FLOW_OK;
|
||||||
OSStatus vt_status;
|
OSStatus vt_status;
|
||||||
|
|
||||||
@ -757,9 +758,7 @@ gst_vtenc_finish (GstVideoEncoder * enc)
|
|||||||
(int) vt_status);
|
(int) vt_status);
|
||||||
}
|
}
|
||||||
|
|
||||||
while (g_async_queue_length (self->cur_outframes) > 0) {
|
while ((outframe = g_async_queue_try_pop (self->cur_outframes))) {
|
||||||
GstVideoCodecFrame *outframe = g_async_queue_try_pop (self->cur_outframes);
|
|
||||||
|
|
||||||
ret =
|
ret =
|
||||||
gst_video_encoder_finish_frame (GST_VIDEO_ENCODER_CAST (self),
|
gst_video_encoder_finish_frame (GST_VIDEO_ENCODER_CAST (self),
|
||||||
outframe);
|
outframe);
|
||||||
@ -1049,6 +1048,7 @@ gst_vtenc_encode_frame (GstVTEnc * self, GstVideoCodecFrame * frame)
|
|||||||
CMTime ts, duration;
|
CMTime ts, duration;
|
||||||
GstCoreMediaMeta *meta;
|
GstCoreMediaMeta *meta;
|
||||||
CVPixelBufferRef pbuf = NULL;
|
CVPixelBufferRef pbuf = NULL;
|
||||||
|
GstVideoCodecFrame *outframe;
|
||||||
OSStatus vt_status;
|
OSStatus vt_status;
|
||||||
GstFlowReturn ret = GST_FLOW_OK;
|
GstFlowReturn ret = GST_FLOW_OK;
|
||||||
guint i;
|
guint i;
|
||||||
@ -1205,9 +1205,7 @@ gst_vtenc_encode_frame (GstVTEnc * self, GstVideoCodecFrame * frame)
|
|||||||
CVPixelBufferRelease (pbuf);
|
CVPixelBufferRelease (pbuf);
|
||||||
|
|
||||||
i = 0;
|
i = 0;
|
||||||
while (g_async_queue_length (self->cur_outframes) > 0) {
|
while ((outframe = g_async_queue_try_pop (self->cur_outframes))) {
|
||||||
GstVideoCodecFrame *outframe = g_async_queue_try_pop (self->cur_outframes);
|
|
||||||
|
|
||||||
/* Try to renegotiate once */
|
/* Try to renegotiate once */
|
||||||
if (i == 0) {
|
if (i == 0) {
|
||||||
meta = gst_buffer_get_core_media_meta (outframe->output_buffer);
|
meta = gst_buffer_get_core_media_meta (outframe->output_buffer);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user