|
|
@ -39,6 +39,7 @@ static av_cold int utvideo_encode_init(AVCodecContext *avctx) |
|
|
|
UtVideoContext *utv = (UtVideoContext *)avctx->priv_data; |
|
|
|
UtVideoContext *utv = (UtVideoContext *)avctx->priv_data; |
|
|
|
UtVideoExtra *info; |
|
|
|
UtVideoExtra *info; |
|
|
|
uint32_t flags, in_format; |
|
|
|
uint32_t flags, in_format; |
|
|
|
|
|
|
|
int ret; |
|
|
|
|
|
|
|
|
|
|
|
switch (avctx->pix_fmt) { |
|
|
|
switch (avctx->pix_fmt) { |
|
|
|
case AV_PIX_FMT_YUV420P: |
|
|
|
case AV_PIX_FMT_YUV420P: |
|
|
@ -94,8 +95,11 @@ static av_cold int utvideo_encode_init(AVCodecContext *avctx) |
|
|
|
* We use this buffer to hold the data that Ut Video returns, |
|
|
|
* We use this buffer to hold the data that Ut Video returns, |
|
|
|
* since we cannot decode planes separately with it. |
|
|
|
* since we cannot decode planes separately with it. |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
utv->buf_size = avpicture_get_size(avctx->pix_fmt, |
|
|
|
ret = avpicture_get_size(avctx->pix_fmt, avctx->width, avctx->height); |
|
|
|
avctx->width, avctx->height); |
|
|
|
if (ret < 0) |
|
|
|
|
|
|
|
return ret; |
|
|
|
|
|
|
|
utv->buf_size = ret; |
|
|
|
|
|
|
|
|
|
|
|
utv->buffer = (uint8_t *)av_malloc(utv->buf_size); |
|
|
|
utv->buffer = (uint8_t *)av_malloc(utv->buf_size); |
|
|
|
|
|
|
|
|
|
|
|
if (utv->buffer == NULL) { |
|
|
|
if (utv->buffer == NULL) { |
|
|
|