mirror of
https://github.com/motioneye-project/motioneyeos.git
synced 2025-07-28 21:56:31 +00:00
ffmpeg: upgrade to version 4.1.4
This commit is contained in:
parent
1ca7422217
commit
65f2815773
@ -1,54 +0,0 @@
|
||||
commit d338ad5e95e6d7b3c4131418d5a92b4717135dec
|
||||
Author: Jorge Ramirez-Ortiz <jorge.ramirez-ortiz@linaro.org>
|
||||
Date: Tue Oct 3 10:31:47 2017 +0200
|
||||
|
||||
avcodec/v4l2_context: remove unnecessary timeout while draining
|
||||
|
||||
This timeout was introduced to work around a bug in the test platform
|
||||
used to upstream the v4l2 support (DragonBoard 410c, Venus driver).
|
||||
|
||||
Signed-off-by: memeka <mihailescu2m@gmail.com>
|
||||
|
||||
diff --git a/libavcodec/v4l2_context.c b/libavcodec/v4l2_context.c
|
||||
index 652472fcd6..d5f9f8edac 100644
|
||||
--- a/libavcodec/v4l2_context.c
|
||||
+++ b/libavcodec/v4l2_context.c
|
||||
@@ -261,17 +261,15 @@ static V4L2Buffer* v4l2_dequeue_v4l2buf(V4L2Context *ctx, int timeout)
|
||||
if (V4L2_TYPE_IS_OUTPUT(ctx->type))
|
||||
pfd.events = POLLOUT | POLLWRNORM;
|
||||
|
||||
+ if (!V4L2_TYPE_IS_OUTPUT(ctx->type) && ctx_to_m2mctx(ctx)->draining)
|
||||
+ pfd.events = POLLIN | POLLRDNORM | POLLPRI;
|
||||
+
|
||||
for (;;) {
|
||||
ret = poll(&pfd, 1, timeout);
|
||||
if (ret > 0)
|
||||
break;
|
||||
if (errno == EINTR)
|
||||
continue;
|
||||
-
|
||||
- /* timeout is being used to indicate last valid bufer when draining */
|
||||
- if (ctx_to_m2mctx(ctx)->draining)
|
||||
- ctx->done = 1;
|
||||
-
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -559,7 +557,7 @@ int ff_v4l2_context_dequeue_frame(V4L2Context* ctx, AVFrame* frame)
|
||||
* 1. decoded frame available
|
||||
* 2. an input buffer is ready to be dequeued
|
||||
*/
|
||||
- avbuf = v4l2_dequeue_v4l2buf(ctx, ctx_to_m2mctx(ctx)->draining ? 200 : -1);
|
||||
+ avbuf = v4l2_dequeue_v4l2buf(ctx, -1);
|
||||
if (!avbuf) {
|
||||
if (ctx->done)
|
||||
return AVERROR_EOF;
|
||||
@@ -581,7 +579,7 @@ int ff_v4l2_context_dequeue_packet(V4L2Context* ctx, AVPacket* pkt)
|
||||
* 1. encoded packet available
|
||||
* 2. an input buffer ready to be dequeued
|
||||
*/
|
||||
- avbuf = v4l2_dequeue_v4l2buf(ctx, ctx_to_m2mctx(ctx)->draining ? 200 : -1);
|
||||
+ avbuf = v4l2_dequeue_v4l2buf(ctx, -1);
|
||||
if (!avbuf) {
|
||||
if (ctx->done)
|
||||
return AVERROR_EOF;
|
@ -1,63 +0,0 @@
|
||||
commit 18d00a8264b42b9bf9c11b539557ea8e6186aa8e
|
||||
Author: Jorge Ramirez-Ortiz <jorge.ramirez-ortiz@linaro.org>
|
||||
Date: Fri Oct 6 09:24:57 2017 +0200
|
||||
|
||||
avcodec/v4l2: fix segmentation fault on codec exit
|
||||
|
||||
It occurs when the codec is closed while buffer references still
|
||||
exist. This is a regression from the original patchset where support
|
||||
for this use-case was implemented.
|
||||
|
||||
Signed-off-by: memeka <mihailescu2m@gmail.com>
|
||||
|
||||
diff --git a/libavcodec/v4l2_buffers.c b/libavcodec/v4l2_buffers.c
|
||||
index ba70c5d14b..109f611c8a 100644
|
||||
--- a/libavcodec/v4l2_buffers.c
|
||||
+++ b/libavcodec/v4l2_buffers.c
|
||||
@@ -219,8 +219,17 @@ static void v4l2_free_buffer(void *opaque, uint8_t *unused)
|
||||
return;
|
||||
}
|
||||
|
||||
- if (!atomic_load(&s->refcount))
|
||||
- ff_v4l2_m2m_codec_end(s->avctx);
|
||||
+ if (!atomic_load(&s->refcount)) {
|
||||
+
|
||||
+ ff_v4l2_context_release(&s->capture);
|
||||
+ sem_destroy(&s->refsync);
|
||||
+
|
||||
+ /* release the hardware */
|
||||
+ if (close(s->fd) < 0 )
|
||||
+ av_log(s->avctx, AV_LOG_ERROR, "failure closing %s (%s)\n", s->devname, av_err2str(AVERROR(errno)));
|
||||
+
|
||||
+ s->fd = -1;
|
||||
+ }
|
||||
}
|
||||
|
||||
static int v4l2_buf_to_bufref(V4L2Buffer *in, int plane, AVBufferRef **buf)
|
||||
diff --git a/libavcodec/v4l2_m2m.c b/libavcodec/v4l2_m2m.c
|
||||
index bd96a6d979..b78e0315f6 100644
|
||||
--- a/libavcodec/v4l2_m2m.c
|
||||
+++ b/libavcodec/v4l2_m2m.c
|
||||
@@ -321,6 +321,9 @@ int ff_v4l2_m2m_codec_end(AVCodecContext *avctx)
|
||||
V4L2m2mContext* s = avctx->priv_data;
|
||||
int ret;
|
||||
|
||||
+ if (s->fd < 0)
|
||||
+ return 0;
|
||||
+
|
||||
ret = ff_v4l2_context_set_status(&s->output, VIDIOC_STREAMOFF);
|
||||
if (ret)
|
||||
av_log(avctx, AV_LOG_ERROR, "VIDIOC_STREAMOFF %s\n", s->output.name);
|
||||
@@ -331,8 +334,10 @@ int ff_v4l2_m2m_codec_end(AVCodecContext *avctx)
|
||||
|
||||
ff_v4l2_context_release(&s->output);
|
||||
|
||||
- if (atomic_load(&s->refcount))
|
||||
- av_log(avctx, AV_LOG_ERROR, "ff_v4l2m2m_codec_end leaving pending buffers\n");
|
||||
+ if (atomic_load(&s->refcount)) {
|
||||
+ av_log(avctx, AV_LOG_DEBUG, "ff_v4l2m2m_codec_end leaving pending buffers\n");
|
||||
+ return 0;
|
||||
+ }
|
||||
|
||||
ff_v4l2_context_release(&s->capture);
|
||||
sem_destroy(&s->refsync);
|
@ -1,34 +0,0 @@
|
||||
commit 530a3fc31b515fe1cdcbbd03ca884c84d72580b1
|
||||
Author: memeka <mihailescu2m@gmail.com>
|
||||
Date: Thu Oct 19 13:23:34 2017 +1030
|
||||
|
||||
avcodec/v4l2: change number of buffers for MFC encoder
|
||||
|
||||
Signed-off-by: memeka <mihailescu2m@gmail.com>
|
||||
|
||||
diff --git a/libavcodec/v4l2_m2m_dec.c b/libavcodec/v4l2_m2m_dec.c
|
||||
index 2d96f13954..266caa7bac 100644
|
||||
--- a/libavcodec/v4l2_m2m_dec.c
|
||||
+++ b/libavcodec/v4l2_m2m_dec.c
|
||||
@@ -288,7 +288,7 @@ static av_cold int v4l2_decode_init(AVCodecContext *avctx)
|
||||
static const AVOption options[] = {
|
||||
V4L_M2M_DEFAULT_OPTS,
|
||||
{ "num_capture_buffers", "Number of buffers in the capture context",
|
||||
- OFFSET(capture.num_buffers), AV_OPT_TYPE_INT, {.i64 = 20}, 20, INT_MAX, FLAGS },
|
||||
+ OFFSET(capture.num_buffers), AV_OPT_TYPE_INT, {.i64 = 16}, 16, INT_MAX, FLAGS },
|
||||
{ NULL},
|
||||
};
|
||||
|
||||
diff --git a/libavcodec/v4l2_m2m_enc.c b/libavcodec/v4l2_m2m_enc.c
|
||||
index 2c35f95847..ce4b45816e 100644
|
||||
--- a/libavcodec/v4l2_m2m_enc.c
|
||||
+++ b/libavcodec/v4l2_m2m_enc.c
|
||||
@@ -325,7 +325,7 @@ static av_cold int v4l2_encode_init(AVCodecContext *avctx)
|
||||
static const AVOption options[] = {
|
||||
V4L_M2M_DEFAULT_OPTS,
|
||||
{ "num_capture_buffers", "Number of buffers in the capture context",
|
||||
- OFFSET(capture.num_buffers), AV_OPT_TYPE_INT, {.i64 = 4 }, 4, INT_MAX, FLAGS },
|
||||
+ OFFSET(capture.num_buffers), AV_OPT_TYPE_INT, {.i64 = 8}, 8, INT_MAX, FLAGS },
|
||||
{ NULL },
|
||||
};
|
||||
|
@ -1,5 +1,5 @@
|
||||
# Locally calculated
|
||||
sha256 741cbd6394eaed370774ca4cc089eaafbc54d0824b9aa360d4b3b0cbcbc4a92c ffmpeg-3.4.5.tar.xz
|
||||
sha256 f1f049a82fcfbf156564e73a3935d7e750891fab2abf302e735104fd4050a7e1 ffmpeg-4.1.4.tar.xz
|
||||
sha256 8177f97513213526df2cf6184d8ff986c675afb514d4e68a404010521b880643 COPYING.GPLv2
|
||||
sha256 b634ab5640e258563c536e658cad87080553df6f34f62269a21d554844e58bfe COPYING.LGPLv2.1
|
||||
sha256 73d99bc83313fff665b426d6672b4e0479102bc402fe22314ac9ce94a38aa5ff LICENSE.md
|
||||
|
@ -4,7 +4,7 @@
|
||||
#
|
||||
################################################################################
|
||||
|
||||
FFMPEG_VERSION = 3.4.5
|
||||
FFMPEG_VERSION = 4.1.4
|
||||
FFMPEG_SOURCE = ffmpeg-$(FFMPEG_VERSION).tar.xz
|
||||
FFMPEG_SITE = http://ffmpeg.org/releases
|
||||
FFMPEG_INSTALL_STAGING = YES
|
||||
@ -84,12 +84,6 @@ else
|
||||
FFMPEG_CONF_OPTS += --disable-ffplay
|
||||
endif
|
||||
|
||||
ifeq ($(BR2_PACKAGE_FFMPEG_FFSERVER),y)
|
||||
FFMPEG_CONF_OPTS += --enable-ffserver
|
||||
else
|
||||
FFMPEG_CONF_OPTS += --disable-ffserver
|
||||
endif
|
||||
|
||||
ifeq ($(BR2_PACKAGE_FFMPEG_AVRESAMPLE),y)
|
||||
FFMPEG_CONF_OPTS += --enable-avresample
|
||||
else
|
||||
|
Loading…
x
Reference in New Issue
Block a user