FFmpeg
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions | Variables
movtextenc.c File Reference
#include <stdarg.h>
#include "avcodec.h"
#include "libavutil/avassert.h"
#include "libavutil/avstring.h"
#include "libavutil/intreadwrite.h"
#include "libavutil/mem.h"
#include "libavutil/common.h"
#include "ass_split.h"
#include "ass.h"

Go to the source code of this file.

Data Structures

struct  StyleBox
 
struct  HighlightBox
 
struct  HilightcolorBox
 
struct  MovTextContext
 
struct  Box
 

Macros

#define STYLE_FLAG_BOLD   (1<<0)
 
#define STYLE_FLAG_ITALIC   (1<<1)
 
#define STYLE_FLAG_UNDERLINE   (1<<2)
 
#define STYLE_RECORD_SIZE   12
 
#define SIZE_ADD   10
 
#define STYL_BOX   (1<<0)
 
#define HLIT_BOX   (1<<1)
 
#define HCLR_BOX   (1<<2)
 
#define av_bprint_append_any(buf, data, size)   av_bprint_append_data(buf, ((const char*)data), size)
 

Functions

static void mov_text_cleanup (MovTextContext *s)
 
static void encode_styl (MovTextContext *s, uint32_t tsmb_type)
 
static void encode_hlit (MovTextContext *s, uint32_t tsmb_type)
 
static void encode_hclr (MovTextContext *s, uint32_t tsmb_type)
 
static av_cold int mov_text_encode_init (AVCodecContext *avctx)
 
static void mov_text_style_cb (void *priv, const char style, int close)
 
static void mov_text_color_cb (void *priv, unsigned int color, unsigned int color_id)
 
static void mov_text_text_cb (void *priv, const char *text, int len)
 
static void mov_text_new_line_cb (void *priv, int forced)
 
static int mov_text_encode_frame (AVCodecContext *avctx, unsigned char *buf, int bufsize, const AVSubtitle *sub)
 
static int mov_text_encode_close (AVCodecContext *avctx)
 

Variables

static const Box box_types []
 
static const size_t box_count = FF_ARRAY_ELEMS(box_types)
 
static const ASSCodesCallbacks mov_text_callbacks
 
AVCodec ff_movtext_encoder
 

Macro Definition Documentation

#define STYLE_FLAG_BOLD   (1<<0)

Definition at line 32 of file movtextenc.c.

Referenced by mov_text_style_cb().

#define STYLE_FLAG_ITALIC   (1<<1)

Definition at line 33 of file movtextenc.c.

Referenced by mov_text_style_cb().

#define STYLE_FLAG_UNDERLINE   (1<<2)

Definition at line 34 of file movtextenc.c.

Referenced by mov_text_style_cb().

#define STYLE_RECORD_SIZE   12

Definition at line 35 of file movtextenc.c.

Referenced by encode_styl().

#define SIZE_ADD   10

Definition at line 36 of file movtextenc.c.

Referenced by encode_styl().

#define STYL_BOX   (1<<0)

Definition at line 38 of file movtextenc.c.

Referenced by encode_styl(), mov_text_cleanup(), and mov_text_style_cb().

#define HLIT_BOX   (1<<1)

Definition at line 39 of file movtextenc.c.

Referenced by encode_hlit(), and mov_text_color_cb().

#define HCLR_BOX   (1<<2)

Definition at line 40 of file movtextenc.c.

Referenced by encode_hclr(), and mov_text_color_cb().

#define av_bprint_append_any (   buf,
  data,
  size 
)    av_bprint_append_data(buf, ((const char*)data), size)

Definition at line 42 of file movtextenc.c.

Referenced by encode_hclr(), encode_hlit(), and encode_styl().

Function Documentation

static void mov_text_cleanup ( MovTextContext s)
static

Definition at line 80 of file movtextenc.c.

Referenced by encode_styl(), and mov_text_style_cb().

static void encode_styl ( MovTextContext s,
uint32_t  tsmb_type 
)
static

Definition at line 91 of file movtextenc.c.

static void encode_hlit ( MovTextContext s,
uint32_t  tsmb_type 
)
static

Definition at line 119 of file movtextenc.c.

static void encode_hclr ( MovTextContext s,
uint32_t  tsmb_type 
)
static

Definition at line 132 of file movtextenc.c.

static av_cold int mov_text_encode_init ( AVCodecContext avctx)
static

Definition at line 152 of file movtextenc.c.

static void mov_text_style_cb ( void priv,
const char  style,
int  close 
)
static

Definition at line 204 of file movtextenc.c.

static void mov_text_color_cb ( void priv,
unsigned int  color,
unsigned int  color_id 
)
static

Definition at line 282 of file movtextenc.c.

static void mov_text_text_cb ( void priv,
const char *  text,
int  len 
)
static

Definition at line 301 of file movtextenc.c.

static void mov_text_new_line_cb ( void priv,
int  forced 
)
static

Definition at line 308 of file movtextenc.c.

static int mov_text_encode_frame ( AVCodecContext avctx,
unsigned char *  buf,
int  bufsize,
const AVSubtitle sub 
)
static

Definition at line 322 of file movtextenc.c.

static int mov_text_encode_close ( AVCodecContext avctx)
static

Definition at line 392 of file movtextenc.c.

Variable Documentation

const Box box_types[]
static
Initial value:
= {
{ MKTAG('s','t','y','l'), encode_styl },
{ MKTAG('h','l','i','t'), encode_hlit },
{ MKTAG('h','c','l','r'), encode_hclr },
}
static void encode_hclr(MovTextContext *s, uint32_t tsmb_type)
Definition: movtextenc.c:132
static void encode_hlit(MovTextContext *s, uint32_t tsmb_type)
Definition: movtextenc.c:119
#define MKTAG(a, b, c, d)
Definition: common.h:342
static void encode_styl(MovTextContext *s, uint32_t tsmb_type)
Definition: movtextenc.c:91

Definition at line 144 of file movtextenc.c.

const size_t box_count = FF_ARRAY_ELEMS(box_types)
static

Definition at line 150 of file movtextenc.c.

Referenced by mov_text_encode_frame().

const ASSCodesCallbacks mov_text_callbacks
static
Initial value:
= {
.new_line = mov_text_new_line_cb,
}
static void mov_text_color_cb(void *priv, unsigned int color, unsigned int color_id)
Definition: movtextenc.c:282
static void mov_text_text_cb(void *priv, const char *text, int len)
Definition: movtextenc.c:301
static void mov_text_new_line_cb(void *priv, int forced)
Definition: movtextenc.c:308
static void mov_text_style_cb(void *priv, const char style, int close)
Definition: movtextenc.c:204

Definition at line 315 of file movtextenc.c.

AVCodec ff_movtext_encoder
Initial value:
= {
.name = "mov_text",
.long_name = NULL_IF_CONFIG_SMALL("3GPP Timed Text subtitle"),
.priv_data_size = sizeof(MovTextContext),
.encode_sub = mov_text_encode_frame,
}
static av_cold int init(AVCodecContext *avctx)
Definition: avrndec.c:35
static av_cold int mov_text_encode_init(AVCodecContext *avctx)
Definition: movtextenc.c:152
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
Definition: internal.h:180
static int mov_text_encode_frame(AVCodecContext *avctx, unsigned char *buf, int bufsize, const AVSubtitle *sub)
Definition: movtextenc.c:322
static int mov_text_encode_close(AVCodecContext *avctx)
Definition: movtextenc.c:392

Definition at line 400 of file movtextenc.c.