]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/libutvideo.cpp
Merge remote-tracking branch 'qatar/master'
[ffmpeg] / libavcodec / libutvideo.cpp
index 7126c369e63fedb7d9be1a5cfb0b7a0a0aefdf5b..1089d3e879fd9a0bc9a7d1c374d809b60ebb04b2 100644 (file)
@@ -43,6 +43,7 @@ typedef struct {
 
 typedef struct {
     CCodec *codec;
+    unsigned int buf_size;
     uint8_t *output;
 } UtVideoContext;
 
@@ -52,7 +53,6 @@ static av_cold int utvideo_decode_init(AVCodecContext *avctx)
     UtVideoExtra info;
     int format;
     int begin_ret;
-    unsigned int buf_size;
 
     if (avctx->extradata_size != 4*4) {
         av_log(avctx, AV_LOG_ERROR, "Extradata size mismatch.\n");
@@ -90,8 +90,8 @@ static av_cold int utvideo_decode_init(AVCodecContext *avctx)
     }
 
     /* Only allocate the buffer once */
-    buf_size = avpicture_get_size(avctx->pix_fmt, avctx->width, avctx->height);
-    utv->output = (uint8_t *)av_malloc(buf_size * sizeof(uint8_t));
+    utv->buf_size = avpicture_get_size(avctx->pix_fmt, avctx->width, avctx->height);
+    utv->output = (uint8_t *)av_malloc(utv->buf_size * sizeof(uint8_t));
 
     if (utv->output == NULL) {
         av_log(avctx, AV_LOG_ERROR, "Unable to allocate output buffer.\n");
@@ -189,17 +189,27 @@ static av_cold int utvideo_decode_close(AVCodecContext *avctx)
 
 AVCodec ff_libutvideo_decoder = {
     "libutvideo",
+    NULL_IF_CONFIG_SMALL("Ut Video"),
     AVMEDIA_TYPE_VIDEO,
     CODEC_ID_UTVIDEO,
+    0,    //capabilities
+    NULL, //supported_framerates
+    NULL, //pix_fmts
+    NULL, //supported_samplerates
+    NULL, //sample_fmts
+    NULL, //channel_layouts
+    0,    //max_lowres
+    NULL, //priv_class
+    NULL, //profiles
     sizeof(UtVideoContext),
+    NULL, //next
+    NULL, //init_thread_copy
+    NULL, //update_thread_context
+    NULL, //defaults
+    NULL, //init_static_data
     utvideo_decode_init,
-    NULL,
-    utvideo_decode_close,
+    NULL, //encode
+    NULL, //encode2
     utvideo_decode_frame,
-    NULL,
-    NULL,
-    NULL,
-    NULL,
-    NULL,
-    NULL_IF_CONFIG_SMALL("Ut Video"),
+    utvideo_decode_close,
 };