aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec
diff options
context:
space:
mode:
authorPaul B Mahol <onemda@gmail.com>2016-05-21 23:21:17 +0200
committerPaul B Mahol <onemda@gmail.com>2016-05-26 12:22:45 +0200
commitd93495c95411b95cfc5c050dbabfcdff1c10890a (patch)
tree25210151c301737a20fd18295ef2a55302700ca7 /libavcodec
parent89e9393022373bf97d528e6e9f2601ad0b3d0fc1 (diff)
downloadffmpeg-d93495c95411b95cfc5c050dbabfcdff1c10890a.tar.gz
avcodec/vble: add frame threading support
Signed-off-by: Paul B Mahol <onemda@gmail.com>
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/vble.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/libavcodec/vble.c b/libavcodec/vble.c
index bb9c81c187..0340caddef 100644
--- a/libavcodec/vble.c
+++ b/libavcodec/vble.c
@@ -33,6 +33,7 @@
#include "huffyuvdsp.h"
#include "internal.h"
#include "mathops.h"
+#include "thread.h"
typedef struct VBLEContext {
AVCodecContext *avctx;
@@ -125,6 +126,7 @@ static int vble_decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
int offset = 0;
int width_uv = avctx->width / 2, height_uv = avctx->height / 2;
int ret;
+ ThreadFrame frame = { .f = data };
if (avpkt->size < 4 || avpkt->size - 4 > INT_MAX/8) {
av_log(avctx, AV_LOG_ERROR, "Invalid packet size\n");
@@ -132,7 +134,7 @@ static int vble_decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
}
/* Allocate buffer */
- if ((ret = ff_get_buffer(avctx, pic, 0)) < 0)
+ if ((ret = ff_thread_get_buffer(avctx, &frame, 0)) < 0)
return ret;
/* Set flags */
@@ -212,5 +214,6 @@ AVCodec ff_vble_decoder = {
.init = vble_decode_init,
.close = vble_decode_close,
.decode = vble_decode_frame,
- .capabilities = AV_CODEC_CAP_DR1,
+ .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS,
+ .init_thread_copy = ONLY_IF_THREADS_ENABLED(vble_decode_init),
};