diff options
Diffstat (limited to 'ext/mpeg2enc/gstmpeg2encpicturereader.cc')
-rw-r--r-- | ext/mpeg2enc/gstmpeg2encpicturereader.cc | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/ext/mpeg2enc/gstmpeg2encpicturereader.cc b/ext/mpeg2enc/gstmpeg2encpicturereader.cc index ce5a9875d..282158f7e 100644 --- a/ext/mpeg2enc/gstmpeg2encpicturereader.cc +++ b/ext/mpeg2enc/gstmpeg2encpicturereader.cc @@ -117,13 +117,15 @@ bool guint8 *frame; GstMpeg2enc *enc; GstVideoFrame vframe; + GstVideoCodecFrame *inframe; enc = GST_MPEG2ENC (element); GST_MPEG2ENC_MUTEX_LOCK (enc); + inframe = (GstVideoCodecFrame *)g_queue_pop_head (enc->frames); /* hang around until the element provides us with a buffer */ - while (!enc->buffer) { + while (!inframe) { if (enc->eos) { GST_MPEG2ENC_MUTEX_UNLOCK (enc); /* inform the mpeg encoding loop that it can give up */ @@ -132,7 +134,8 @@ bool GST_MPEG2ENC_WAIT (enc); } - gst_video_frame_map (&vframe, &enc->vinfo, enc->buffer, GST_MAP_READ); + gst_video_frame_map (&vframe, &enc->input_state->info, inframe->input_buffer, GST_MAP_READ); + // frame = GST_BUFFER_DATA (enc->buffer); #if GST_MJPEGTOOLS_API < 10900 n = frames_read % input_imgs_buf_size; @@ -176,8 +179,8 @@ bool frame += s; } gst_video_frame_unmap (&vframe); - gst_buffer_unref (enc->buffer); - enc->buffer = NULL; + + gst_video_codec_frame_unref (inframe); /* inform the element the buffer has been processed */ GST_MPEG2ENC_SIGNAL (enc); |