]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/libschroedingerdec.c
lavc: use designated initialisers for all codecs.
[ffmpeg] / libavcodec / libschroedingerdec.c
index 26f2c68a28a14c6e8556960e57b71488b370e91c..a9c1ca40f560d83a7f0c5191328a634acdf88667 100644 (file)
@@ -2,20 +2,20 @@
  * Dirac decoder support via Schroedinger libraries
  * Copyright (c) 2008 BBC, Anuradha Suraparaju <asuraparaju at gmail dot com >
  *
- * This file is part of FFmpeg.
+ * This file is part of Libav.
  *
- * FFmpeg is free software; you can redistribute it and/or
+ * Libav is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
  * License as published by the Free Software Foundation; either
  * version 2.1 of the License, or (at your option) any later version.
  *
- * FFmpeg is distributed in the hope that it will be useful,
+ * Libav is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
+ * License along with Libav; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
@@ -27,7 +27,7 @@
 * (http://dirac.sourceforge.net/specification.html).
 */
 
-#include "libavcore/imgutils.h"
+#include "libavutil/imgutils.h"
 #include "avcodec.h"
 #include "libdirac_libschro.h"
 #include "libschroedinger.h"
@@ -118,7 +118,7 @@ static SchroBuffer* FfmpegFindNextSchroParseUnit(FfmpegSchroParseUnitContext *pa
 }
 
 /**
-* Returns FFmpeg chroma format.
+* Returns Libav chroma format.
 */
 static enum PixelFormat GetFfmpegChromaFormat(SchroChromaFormat schro_pix_fmt)
 {
@@ -169,8 +169,8 @@ static void libschroedinger_handle_first_access_unit(AVCodecContext *avccontext)
 
     p_schro_params->format = schro_decoder_get_video_format(decoder);
 
-    /* Tell FFmpeg about sequence details. */
-    if (av_check_image_size(p_schro_params->format->width, p_schro_params->format->height,
+    /* Tell Libav about sequence details. */
+    if (av_image_check_size(p_schro_params->format->width, p_schro_params->format->height,
                             0, avccontext) < 0) {
         av_log(avccontext, AV_LOG_ERROR, "invalid dimensions (%dx%d)\n",
                p_schro_params->format->width, p_schro_params->format->height);
@@ -208,7 +208,6 @@ static int libschroedinger_decode_frame(AVCodecContext *avccontext,
 
     FfmpegSchroDecoderParams *p_schro_params = avccontext->priv_data;
     SchroDecoder *decoder = p_schro_params->decoder;
-    SchroVideoFormat *format;
     AVPicture *picture = data;
     SchroBuffer *enc_buf;
     SchroFrame* frame;
@@ -240,7 +239,6 @@ static int libschroedinger_decode_frame(AVCodecContext *avccontext,
             go = 1;
         } else
             outer = 0;
-        format = p_schro_params->format;
 
         while (go) {
             /* Parse data and process result. */
@@ -346,16 +344,15 @@ static void libschroedinger_flush(AVCodecContext *avccontext)
     p_schro_params->eos_signalled = 0;
 }
 
-AVCodec libschroedinger_decoder = {
-    "libschroedinger",
-    AVMEDIA_TYPE_VIDEO,
-    CODEC_ID_DIRAC,
-    sizeof(FfmpegSchroDecoderParams),
-    libschroedinger_decode_init,
-    NULL,
-    libschroedinger_decode_close,
-    libschroedinger_decode_frame,
-    CODEC_CAP_DELAY,
+AVCodec ff_libschroedinger_decoder = {
+    .name           = "libschroedinger",
+    .type           = AVMEDIA_TYPE_VIDEO,
+    .id             = CODEC_ID_DIRAC,
+    .priv_data_size = sizeof(FfmpegSchroDecoderParams),
+    .init           = libschroedinger_decode_init,
+    .close          = libschroedinger_decode_close,
+    .decode         = libschroedinger_decode_frame,
+    .capabilities   = CODEC_CAP_DELAY,
     .flush = libschroedinger_flush,
     .long_name = NULL_IF_CONFIG_SMALL("libschroedinger Dirac 2.2"),
 };