@@ -559,6 +559,6 @@ const FFCodec ff_jpegls_decoder = {
.init = ff_mjpeg_decode_init,
.close = ff_mjpeg_decode_end,
FF_CODEC_DECODE_CB(ff_mjpeg_decode_frame),
- .p.capabilities = AV_CODEC_CAP_DR1,
+ .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS,
.caps_internal = FF_CODEC_CAP_INIT_CLEANUP,
};
@@ -54,6 +54,7 @@
#include "exif.h"
#include "bytestream.h"
#include "tiff_common.h"
+#include "thread.h"
static int init_default_huffman_tables(MJpegDecodeContext *s)
@@ -712,7 +713,7 @@ int ff_mjpeg_decode_sof(MJpegDecodeContext *s)
s->avctx->pix_fmt,
AV_PIX_FMT_NONE,
};
- s->hwaccel_pix_fmt = ff_get_format(s->avctx, pix_fmts);
+ s->hwaccel_pix_fmt = ff_thread_get_format(s->avctx, pix_fmts);
if (s->hwaccel_pix_fmt < 0)
return AVERROR(EINVAL);
@@ -728,7 +729,7 @@ int ff_mjpeg_decode_sof(MJpegDecodeContext *s)
}
av_frame_unref(s->picture_ptr);
- if (ff_get_buffer(s->avctx, s->picture_ptr, AV_GET_BUFFER_FLAG_REF) < 0)
+ if (ff_thread_get_buffer(s->avctx, s->picture_ptr, AV_GET_BUFFER_FLAG_REF) < 0)
return -1;
s->picture_ptr->pict_type = AV_PICTURE_TYPE_I;
s->picture_ptr->key_frame = 1;
@@ -2954,7 +2955,7 @@ const FFCodec ff_mjpeg_decoder = {
.close = ff_mjpeg_decode_end,
FF_CODEC_DECODE_CB(ff_mjpeg_decode_frame),
.flush = decode_flush,
- .p.capabilities = AV_CODEC_CAP_DR1,
+ .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS,
.p.max_lowres = 3,
.p.priv_class = &mjpegdec_class,
.p.profiles = NULL_IF_CONFIG_SMALL(ff_mjpeg_profiles),
@@ -2983,7 +2984,7 @@ const FFCodec ff_thp_decoder = {
.close = ff_mjpeg_decode_end,
FF_CODEC_DECODE_CB(ff_mjpeg_decode_frame),
.flush = decode_flush,
- .p.capabilities = AV_CODEC_CAP_DR1,
+ .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS,
.p.max_lowres = 3,
.caps_internal = FF_CODEC_CAP_INIT_CLEANUP,
};
@@ -3062,7 +3063,7 @@ const FFCodec ff_smvjpeg_decoder = {
.close = ff_mjpeg_decode_end,
FF_CODEC_RECEIVE_FRAME_CB(smvjpeg_receive_frame),
.flush = decode_flush,
- .p.capabilities = AV_CODEC_CAP_DR1,
+ .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS,
.caps_internal = FF_CODEC_CAP_EXPORTS_CROPPING |
FF_CODEC_CAP_SETS_PKT_DTS | FF_CODEC_CAP_INIT_CLEANUP,
};
@@ -103,7 +103,7 @@ const FFCodec ff_sp5x_decoder = {
.init = ff_mjpeg_decode_init,
.close = ff_mjpeg_decode_end,
FF_CODEC_DECODE_CB(sp5x_decode_frame),
- .p.capabilities = AV_CODEC_CAP_DR1,
+ .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS,
.p.max_lowres = 3,
.caps_internal = FF_CODEC_CAP_INIT_CLEANUP,
};
@@ -119,7 +119,7 @@ const FFCodec ff_amv_decoder = {
.close = ff_mjpeg_decode_end,
FF_CODEC_DECODE_CB(sp5x_decode_frame),
.p.max_lowres = 3,
- .p.capabilities = AV_CODEC_CAP_DR1,
+ .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS,
.caps_internal = FF_CODEC_CAP_INIT_CLEANUP,
};
#endif