Commit ed9cff9e authored by Hendrik Leppkes's avatar Hendrik Leppkes

Merge commit 'd1cd20e4'

* commit 'd1cd20e4':
  qsvenc: split encoding frames and reading from the async FIFO
Merged-by: 's avatarHendrik Leppkes <h.leppkes@gmail.com>
parents b5513441 d1cd20e4
......@@ -907,8 +907,8 @@ static void print_interlace_msg(AVCodecContext *avctx, QSVEncContext *q)
}
}
int ff_qsv_encode(AVCodecContext *avctx, QSVEncContext *q,
AVPacket *pkt, const AVFrame *frame, int *got_packet)
static int encode_frame(AVCodecContext *avctx, QSVEncContext *q,
const AVFrame *frame)
{
AVPacket new_pkt = { 0 };
mfxBitstream *bs;
......@@ -983,8 +983,24 @@ int ff_qsv_encode(AVCodecContext *avctx, QSVEncContext *q,
av_freep(&bs);
}
return 0;
}
int ff_qsv_encode(AVCodecContext *avctx, QSVEncContext *q,
AVPacket *pkt, const AVFrame *frame, int *got_packet)
{
int ret;
ret = encode_frame(avctx, q, frame);
if (ret < 0)
return ret;
if (!av_fifo_space(q->async_fifo) ||
(!frame && av_fifo_size(q->async_fifo))) {
AVPacket new_pkt;
mfxBitstream *bs;
mfxSyncPoint sync;
av_fifo_generic_read(q->async_fifo, &new_pkt, sizeof(new_pkt), NULL);
av_fifo_generic_read(q->async_fifo, &sync, sizeof(sync), NULL);
av_fifo_generic_read(q->async_fifo, &bs, sizeof(bs), NULL);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment