]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/ansi.c
jvdec: don't use deprecated CODEC_TYPE_*/PKT_FLAG_KEY
[ffmpeg] / libavcodec / ansi.c
index 6fa62cc680df4ad68efddeac22a2e83d29bf26a3..892cc34fbb17b9cc2e3a04b81f3857506ae854f7 100644 (file)
@@ -2,20 +2,20 @@
  * ASCII/ANSI art decoder
  * Copyright (c) 2010 Peter Ross <pross@xvid.org>
  *
- * 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
  */
 
  * ASCII/ANSI art decoder
  */
 
+#include "libavutil/lfg.h"
 #include "avcodec.h"
 #include "cga_data.h"
-#include <libavutil/lfg.h>
 
-#define ATTR_BOLD         0x01  /** Bold/Bright-foreground (mode 1) */
-#define ATTR_FAINT        0x02  /** Faint (mode 2) */
-#define ATTR_UNDERLINE    0x08  /** Underline (mode 4) */
-#define ATTR_BLINK        0x10  /** Blink/Bright-background (mode 5) */
-#define ATTR_REVERSE      0x40  /** Reverse (mode 7) */
-#define ATTR_CONCEALED    0x80  /** Concealed (mode 8) */
+#define ATTR_BOLD         0x01  /**< Bold/Bright-foreground (mode 1) */
+#define ATTR_FAINT        0x02  /**< Faint (mode 2) */
+#define ATTR_UNDERLINE    0x08  /**< Underline (mode 4) */
+#define ATTR_BLINK        0x10  /**< Blink/Bright-background (mode 5) */
+#define ATTR_REVERSE      0x40  /**< Reverse (mode 7) */
+#define ATTR_CONCEALED    0x80  /**< Concealed (mode 8) */
 
-#define DEFAULT_FG_COLOR     7  /** CGA color index */
+#define DEFAULT_FG_COLOR     7  /**< CGA color index */
 #define DEFAULT_BG_COLOR     0
-#define DEFAULT_SCREEN_MODE  3  /** 80x25 */
+#define DEFAULT_SCREEN_MODE  3  /**< 80x25 */
 
-#define FONT_WIDTH           8  /** Font width */
+#define FONT_WIDTH           8  /**< Font width */
 
 /** map ansi color index to cga palette index */
 static const uint8_t ansi_to_cga[16] = {
@@ -48,12 +48,15 @@ static const uint8_t ansi_to_cga[16] = {
 
 typedef struct {
     AVFrame frame;
-    int x, y;             /** cursor position (pixels) */
-    int sx, sy;           /** saved cursor position (pixels) */
-    const uint8_t* font;  /** font */
-    int font_height;      /** font height */
-    int attributes;       /** attribute flags */
-    int fg, bg;           /** foreground and background color */
+    int x;                /**< x cursor position (pixels) */
+    int y;                /**< y cursor position (pixels) */
+    int sx;               /**< saved x cursor position (pixels) */
+    int sy;               /**< saved y cursor position (pixels) */
+    const uint8_t* font;  /**< font */
+    int font_height;      /**< font height */
+    int attributes;       /**< attribute flags */
+    int fg;               /**< foreground color */
+    int bg;               /**< background color */
 
     /* ansi parser state machine */
     enum {
@@ -64,7 +67,7 @@ typedef struct {
     } state;
 #define MAX_NB_ARGS 4
     int args[MAX_NB_ARGS];
-    int nb_args;          /** number of arguments (may exceed MAX_NB_ARGS) */
+    int nb_args;          /**< number of arguments (may exceed MAX_NB_ARGS) */
 } AnsiContext;
 
 static av_cold int decode_init(AVCodecContext *avctx)
@@ -419,9 +422,9 @@ static av_cold int decode_close(AVCodecContext *avctx)
     return 0;
 }
 
-AVCodec ansi_decoder = {
+AVCodec ff_ansi_decoder = {
     .name           = "ansi",
-    .type           = CODEC_TYPE_VIDEO,
+    .type           = AVMEDIA_TYPE_VIDEO,
     .id             = CODEC_ID_ANSI,
     .priv_data_size = sizeof(AnsiContext),
     .init           = decode_init,