[FFmpeg-cvslog] avcodec/omx: Remove remnants of old preallocated buffers

Andreas Rheinhardt git at videolan.org
Tue Jun 8 16:04:37 EEST 2021


ffmpeg | branch: master | Andreas Rheinhardt <andreas.rheinhardt at outlook.com> | Thu Apr 29 23:33:41 2021 +0200| [eeedc8817a8d7c1264fc952ffdbba501be3c679e] | committer: Andreas Rheinhardt

avcodec/omx: Remove remnants of old preallocated buffers

There are no preallocated buffer packets any more; this feature only
worked with the old encode API and only until said API was turned into
a wrapper for the new API in 93016f5d1d280f9cb7856883af287fa66affc04c.
So remove its remnants.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at outlook.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=eeedc8817a8d7c1264fc952ffdbba501be3c679e
---

 libavcodec/omx.c | 15 ---------------
 1 file changed, 15 deletions(-)

diff --git a/libavcodec/omx.c b/libavcodec/omx.c
index 3a113723d3..1e48579d4b 100644
--- a/libavcodec/omx.c
+++ b/libavcodec/omx.c
@@ -863,9 +863,6 @@ static int omx_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
             avctx->extradata_size += buffer->nFilledLen;
             memset(avctx->extradata + avctx->extradata_size, 0, AV_INPUT_BUFFER_PADDING_SIZE);
         } else {
-            if (!(buffer->nFlags & OMX_BUFFERFLAG_ENDOFFRAME) || !pkt->data) {
-                // If the output packet isn't preallocated, just concatenate everything in our
-                // own buffer
                 int newsize = s->output_buf_size + buffer->nFilledLen + AV_INPUT_BUFFER_PADDING_SIZE;
                 if ((ret = av_reallocp(&s->output_buf, newsize)) < 0) {
                     s->output_buf_size = 0;
@@ -885,18 +882,6 @@ static int omx_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
 #if CONFIG_OMX_RPI
                 had_partial = 1;
 #endif
-            } else {
-                // End of frame, and the caller provided a preallocated frame
-                if ((ret = ff_alloc_packet2(avctx, pkt, s->output_buf_size + buffer->nFilledLen, 0)) < 0) {
-                    av_log(avctx, AV_LOG_ERROR, "Error getting output packet of size %d.\n",
-                           (int)(s->output_buf_size + buffer->nFilledLen));
-                    goto end;
-                }
-                memcpy(pkt->data, s->output_buf, s->output_buf_size);
-                memcpy(pkt->data + s->output_buf_size, buffer->pBuffer + buffer->nOffset, buffer->nFilledLen);
-                av_freep(&s->output_buf);
-                s->output_buf_size = 0;
-            }
             if (buffer->nFlags & OMX_BUFFERFLAG_ENDOFFRAME) {
                 pkt->pts = av_rescale_q(from_omx_ticks(buffer->nTimeStamp), AV_TIME_BASE_Q, avctx->time_base);
                 // We don't currently enable B-frames for the encoders, so set



More information about the ffmpeg-cvslog mailing list