Unified · Split
| @@ -33,6 +33,7 @@ · 32 unmodified lines | ||
| 33 | 33 | #include "huffyuvdsp.h" |
| 34 | 34 | #include "internal.h" |
| 35 | 35 | #include "mathops.h" |
| 36 | +#include "thread.h" | |
| 36 | 37 | |
| 37 | 38 | typedef struct VBLEContext { |
| 38 | 39 | AVCodecContext *avctx; |
| @@ -125,6 +126,7 @@ static int vble_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, · 86 unmodified lines | ||
| 125 | 126 | int offset = 0; |
| 126 | 127 | int width_uv = avctx->width / 2, height_uv = avctx->height / 2; |
| 127 | 128 | int ret; |
| 129 | + ThreadFrame frame = { .f = data }; | |
| 128 | 130 | |
| 129 | 131 | if (avpkt->size < 4 || avpkt->size - 4 > INT_MAX/8) { |
| 130 | 132 | 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, · 1 unmodified line | ||
| 132 | 134 | } |
| 133 | 135 | |
| 134 | 136 | /* Allocate buffer */ |
| 135 | − if ((ret = ff_get_buffer(avctx, pic, 0)) < 0) | |
| 137 | + if ((ret = ff_thread_get_buffer(avctx, &frame, 0)) < 0) | |
| 136 | 138 | return ret; |
| 137 | 139 | |
| 138 | 140 | /* Set flags */ |
| @@ -212,5 +214,6 @@ AVCodec ff_vble_decoder = { · 73 unmodified lines | ||
| 212 | 214 | .init = vble_decode_init, |
| 213 | 215 | .close = vble_decode_close, |
| 214 | 216 | .decode = vble_decode_frame, |
| 215 | − .capabilities = AV_CODEC_CAP_DR1, | |
| 217 | + .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS, | |
| 218 | + .init_thread_copy = ONLY_IF_THREADS_ENABLED(vble_decode_init), | |
| 216 | 219 | }; |