FFmpeg
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions | Variables
movtextdec.c File Reference
#include "avcodec.h"
#include "ass.h"
#include "libavutil/avstring.h"
#include "libavutil/common.h"
#include "libavutil/bprint.h"
#include "libavutil/intreadwrite.h"
#include "libavutil/mem.h"

Go to the source code of this file.

Data Structures

struct  MovTextDefault
 
struct  FontRecord
 
struct  StyleBox
 
struct  HighlightBox
 
struct  HilightcolorBox
 
struct  TextWrapBox
 
struct  MovTextContext
 
struct  Box
 

Macros

#define STYLE_FLAG_BOLD   (1<<0)
 
#define STYLE_FLAG_ITALIC   (1<<1)
 
#define STYLE_FLAG_UNDERLINE   (1<<2)
 
#define BOX_SIZE_INITIAL   40
 
#define STYL_BOX   (1<<0)
 
#define HLIT_BOX   (1<<1)
 
#define HCLR_BOX   (1<<2)
 
#define TWRP_BOX   (1<<3)
 
#define BOTTOM_LEFT   1
 
#define BOTTOM_CENTER   2
 
#define BOTTOM_RIGHT   3
 
#define MIDDLE_LEFT   4
 
#define MIDDLE_CENTER   5
 
#define MIDDLE_RIGHT   6
 
#define TOP_LEFT   7
 
#define TOP_CENTER   8
 
#define TOP_RIGHT   9
 

Functions

static void mov_text_cleanup (MovTextContext *m)
 
static void mov_text_cleanup_ftab (MovTextContext *m)
 
static int mov_text_tx3g (AVCodecContext *avctx, MovTextContext *m)
 
static int decode_twrp (const uint8_t *tsmb, MovTextContext *m, AVPacket *avpkt)
 
static int decode_hlit (const uint8_t *tsmb, MovTextContext *m, AVPacket *avpkt)
 
static int decode_hclr (const uint8_t *tsmb, MovTextContext *m, AVPacket *avpkt)
 
static int decode_styl (const uint8_t *tsmb, MovTextContext *m, AVPacket *avpkt)
 
static int text_to_ass (AVBPrint *buf, const char *text, const char *text_end, MovTextContext *m)
 
static int mov_text_init (AVCodecContext *avctx)
 
static int mov_text_decode_frame (AVCodecContext *avctx, void *data, int *got_sub_ptr, AVPacket *avpkt)
 
static int mov_text_decode_close (AVCodecContext *avctx)
 

Variables

static const Box box_types []
 
static const size_t box_count = FF_ARRAY_ELEMS(box_types)
 
AVCodec ff_movtext_decoder
 

Macro Definition Documentation

#define STYLE_FLAG_BOLD   (1<<0)

Definition at line 30 of file movtextdec.c.

Referenced by mov_text_tx3g(), and text_to_ass().

#define STYLE_FLAG_ITALIC   (1<<1)

Definition at line 31 of file movtextdec.c.

Referenced by mov_text_tx3g(), and text_to_ass().

#define STYLE_FLAG_UNDERLINE   (1<<2)

Definition at line 32 of file movtextdec.c.

Referenced by mov_text_tx3g(), and text_to_ass().

#define BOX_SIZE_INITIAL   40

Definition at line 34 of file movtextdec.c.

Referenced by mov_text_tx3g().

#define STYL_BOX   (1<<0)

Definition at line 36 of file movtextdec.c.

Referenced by decode_styl(), mov_text_cleanup(), and text_to_ass().

#define HLIT_BOX   (1<<1)

Definition at line 37 of file movtextdec.c.

Referenced by decode_hlit(), and text_to_ass().

#define HCLR_BOX   (1<<2)

Definition at line 38 of file movtextdec.c.

Referenced by decode_hclr(), and text_to_ass().

#define TWRP_BOX   (1<<3)

Definition at line 39 of file movtextdec.c.

Referenced by decode_twrp(), and text_to_ass().

#define BOTTOM_LEFT   1

Definition at line 41 of file movtextdec.c.

Referenced by mov_text_tx3g().

#define BOTTOM_CENTER   2

Definition at line 42 of file movtextdec.c.

Referenced by mov_text_tx3g().

#define BOTTOM_RIGHT   3

Definition at line 43 of file movtextdec.c.

Referenced by mov_text_tx3g().

#define MIDDLE_LEFT   4

Definition at line 44 of file movtextdec.c.

Referenced by mov_text_tx3g().

#define MIDDLE_CENTER   5

Definition at line 45 of file movtextdec.c.

Referenced by mov_text_tx3g().

#define MIDDLE_RIGHT   6

Definition at line 46 of file movtextdec.c.

Referenced by mov_text_tx3g().

#define TOP_LEFT   7

Definition at line 47 of file movtextdec.c.

Referenced by mov_text_tx3g().

#define TOP_CENTER   8

Definition at line 48 of file movtextdec.c.

Referenced by mov_text_tx3g().

#define TOP_RIGHT   9

Definition at line 49 of file movtextdec.c.

Referenced by mov_text_tx3g().

Function Documentation

static void mov_text_cleanup ( MovTextContext m)
static

Definition at line 110 of file movtextdec.c.

Referenced by decode_styl().

static void mov_text_cleanup_ftab ( MovTextContext m)
static

Definition at line 121 of file movtextdec.c.

Referenced by mov_text_decode_close(), and mov_text_tx3g().

static int mov_text_tx3g ( AVCodecContext avctx,
MovTextContext m 
)
static

Definition at line 136 of file movtextdec.c.

Referenced by mov_text_init().

static int decode_twrp ( const uint8_t tsmb,
MovTextContext m,
AVPacket avpkt 
)
static

Definition at line 253 of file movtextdec.c.

static int decode_hlit ( const uint8_t tsmb,
MovTextContext m,
AVPacket avpkt 
)
static

Definition at line 260 of file movtextdec.c.

static int decode_hclr ( const uint8_t tsmb,
MovTextContext m,
AVPacket avpkt 
)
static

Definition at line 270 of file movtextdec.c.

static int decode_styl ( const uint8_t tsmb,
MovTextContext m,
AVPacket avpkt 
)
static

Definition at line 278 of file movtextdec.c.

static int text_to_ass ( AVBPrint *  buf,
const char *  text,
const char *  text_end,
MovTextContext m 
)
static

Definition at line 324 of file movtextdec.c.

static int mov_text_init ( AVCodecContext avctx)
static

Definition at line 403 of file movtextdec.c.

static int mov_text_decode_frame ( AVCodecContext avctx,
void data,
int *  got_sub_ptr,
AVPacket avpkt 
)
static

Definition at line 421 of file movtextdec.c.

static int mov_text_decode_close ( AVCodecContext avctx)
static

Definition at line 516 of file movtextdec.c.

Variable Documentation

const Box box_types[]
static
Initial value:
= {
{ MKBETAG('s','t','y','l'), 2, decode_styl },
{ MKBETAG('h','l','i','t'), 4, decode_hlit },
{ MKBETAG('h','c','l','r'), 4, decode_hclr },
{ MKBETAG('t','w','r','p'), 1, decode_twrp }
}
static int decode_twrp(const uint8_t *tsmb, MovTextContext *m, AVPacket *avpkt)
Definition: movtextdec.c:253
static int decode_hlit(const uint8_t *tsmb, MovTextContext *m, AVPacket *avpkt)
Definition: movtextdec.c:260
static int decode_hclr(const uint8_t *tsmb, MovTextContext *m, AVPacket *avpkt)
Definition: movtextdec.c:270
static int decode_styl(const uint8_t *tsmb, MovTextContext *m, AVPacket *avpkt)
Definition: movtextdec.c:278
#define MKBETAG(a, b, c, d)
Definition: common.h:331

Definition at line 315 of file movtextdec.c.

const size_t box_count = FF_ARRAY_ELEMS(box_types)
static

Definition at line 322 of file movtextdec.c.

AVCodec ff_movtext_decoder
Initial value:
= {
.name = "mov_text",
.long_name = NULL_IF_CONFIG_SMALL("3GPP Timed Text subtitle"),
.priv_data_size = sizeof(MovTextContext),
}
static av_cold int init(AVCodecContext *avctx)
Definition: avrndec.c:35
static int mov_text_init(AVCodecContext *avctx)
Definition: movtextdec.c:403
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
Definition: internal.h:175
static int decode(AVCodecContext *avctx, void *data, int *got_sub, AVPacket *avpkt)
Definition: ccaption_dec.c:523
static int mov_text_decode_close(AVCodecContext *avctx)
Definition: movtextdec.c:516
static int mov_text_decode_frame(AVCodecContext *avctx, void *data, int *got_sub_ptr, AVPacket *avpkt)
Definition: movtextdec.c:421

Definition at line 523 of file movtextdec.c.