|
|
@ -21,6 +21,7 @@ |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
|
|
|
|
|
|
|
|
#include "avcodec.h" |
|
|
|
#include "avcodec.h" |
|
|
|
|
|
|
|
#include "encode.h" |
|
|
|
#include "internal.h" |
|
|
|
#include "internal.h" |
|
|
|
#include "libavutil/intreadwrite.h" |
|
|
|
#include "libavutil/intreadwrite.h" |
|
|
|
|
|
|
|
|
|
|
@ -62,7 +63,7 @@ static int avui_encode_frame(AVCodecContext *avctx, AVPacket *pkt, |
|
|
|
skip = 16; |
|
|
|
skip = 16; |
|
|
|
} |
|
|
|
} |
|
|
|
size = 2 * avctx->width * (avctx->height + skip) + 8 * interlaced; |
|
|
|
size = 2 * avctx->width * (avctx->height + skip) + 8 * interlaced; |
|
|
|
if ((ret = ff_alloc_packet2(avctx, pkt, size, size)) < 0) |
|
|
|
if ((ret = ff_get_encode_buffer(avctx, pkt, size, 0)) < 0) |
|
|
|
return ret; |
|
|
|
return ret; |
|
|
|
dst = pkt->data; |
|
|
|
dst = pkt->data; |
|
|
|
if (!interlaced) { |
|
|
|
if (!interlaced) { |
|
|
@ -98,7 +99,7 @@ const AVCodec ff_avui_encoder = { |
|
|
|
.id = AV_CODEC_ID_AVUI, |
|
|
|
.id = AV_CODEC_ID_AVUI, |
|
|
|
.init = avui_encode_init, |
|
|
|
.init = avui_encode_init, |
|
|
|
.encode2 = avui_encode_frame, |
|
|
|
.encode2 = avui_encode_frame, |
|
|
|
.capabilities = AV_CODEC_CAP_EXPERIMENTAL, |
|
|
|
.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_EXPERIMENTAL, |
|
|
|
.pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_UYVY422, AV_PIX_FMT_NONE }, |
|
|
|
.pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_UYVY422, AV_PIX_FMT_NONE }, |
|
|
|
.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, |
|
|
|
.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, |
|
|
|
}; |
|
|
|
}; |
|
|
|