Merge pull request #2079 from jasaw/xu4-hw-h264

ffmpeg: make v4l2 buffer dequeue non-blocking (zero timeout)
This commit is contained in:
Calin Crisan 2019-09-02 09:18:29 +02:00 committed by GitHub
commit 83cd5fdb22
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -15,7 +15,7 @@ index efcb0426e4..8f9420e28d 100644
* 2. an input buffer is ready to be dequeued
*/
- avbuf = v4l2_dequeue_v4l2buf(ctx, -1);
+ avbuf = v4l2_dequeue_v4l2buf(ctx, ctx_to_m2mctx(ctx)->draining ? -1 : 50);
+ avbuf = v4l2_dequeue_v4l2buf(ctx, ctx_to_m2mctx(ctx)->draining ? -1 : 0);
if (!avbuf) {
if (ctx->done)
return AVERROR_EOF;
@ -24,7 +24,7 @@ index efcb0426e4..8f9420e28d 100644
* 2. an input buffer ready to be dequeued
*/
- avbuf = v4l2_dequeue_v4l2buf(ctx, -1);
+ avbuf = v4l2_dequeue_v4l2buf(ctx, ctx_to_m2mctx(ctx)->draining ? -1 : 50);
+ avbuf = v4l2_dequeue_v4l2buf(ctx, ctx_to_m2mctx(ctx)->draining ? -1 : 0);
if (!avbuf) {
if (ctx->done)
return AVERROR_EOF;