FFmpeg
Data Structures | Macros | Functions | Variables
libaribb24.c File Reference
#include "avcodec.h"
#include "libavcodec/ass.h"
#include "codec_internal.h"
#include "libavutil/log.h"
#include "libavutil/opt.h"
#include <aribb24/aribb24.h>
#include <aribb24/parser.h>
#include <aribb24/decoder.h>

Go to the source code of this file.

Data Structures

struct  Libaribb24Context
 

Macros

#define RGB_TO_BGR(c)   (((c) & 0xff) << 16 | ((c) & 0xff00) | (((c) >> 16) & 0xff))
 
#define OFFSET(x)   offsetof(Libaribb24Context, x)
 
#define SD   AV_OPT_FLAG_SUBTITLE_PARAM | AV_OPT_FLAG_DECODING_PARAM
 

Functions

static unsigned int get_profile_font_size (int profile)
 
static void libaribb24_log (void *p, const char *msg)
 
static int libaribb24_generate_ass_header (AVCodecContext *avctx)
 
static int libaribb24_init (AVCodecContext *avctx)
 
static int libaribb24_close (AVCodecContext *avctx)
 
static int libaribb24_handle_regions (AVCodecContext *avctx, AVSubtitle *sub)
 
static int libaribb24_decode (AVCodecContext *avctx, AVSubtitle *sub, int *got_sub_ptr, const AVPacket *pkt)
 
static void libaribb24_flush (AVCodecContext *avctx)
 

Variables

static const AVOption options []
 
static const AVClass aribb24_class
 
const FFCodec ff_libaribb24_decoder
 

Macro Definition Documentation

◆ RGB_TO_BGR

#define RGB_TO_BGR (   c)    (((c) & 0xff) << 16 | ((c) & 0xff00) | (((c) >> 16) & 0xff))

Definition at line 206 of file libaribb24.c.

◆ OFFSET

#define OFFSET (   x)    offsetof(Libaribb24Context, x)

Definition at line 367 of file libaribb24.c.

◆ SD

Definition at line 368 of file libaribb24.c.

Function Documentation

◆ get_profile_font_size()

static unsigned int get_profile_font_size ( int  profile)
static

Definition at line 45 of file libaribb24.c.

Referenced by libaribb24_generate_ass_header(), and libaribb24_handle_regions().

◆ libaribb24_log()

static void libaribb24_log ( void *  p,
const char *  msg 
)
static

Definition at line 57 of file libaribb24.c.

Referenced by libaribb24_init().

◆ libaribb24_generate_ass_header()

static int libaribb24_generate_ass_header ( AVCodecContext avctx)
static

Definition at line 62 of file libaribb24.c.

Referenced by libaribb24_init().

◆ libaribb24_init()

static int libaribb24_init ( AVCodecContext avctx)
static

Definition at line 133 of file libaribb24.c.

◆ libaribb24_close()

static int libaribb24_close ( AVCodecContext avctx)
static

Definition at line 193 of file libaribb24.c.

◆ libaribb24_handle_regions()

static int libaribb24_handle_regions ( AVCodecContext avctx,
AVSubtitle sub 
)
static

Definition at line 208 of file libaribb24.c.

Referenced by libaribb24_decode().

◆ libaribb24_decode()

static int libaribb24_decode ( AVCodecContext avctx,
AVSubtitle sub,
int got_sub_ptr,
const AVPacket pkt 
)
static

Definition at line 286 of file libaribb24.c.

◆ libaribb24_flush()

static void libaribb24_flush ( AVCodecContext avctx)
static

Definition at line 360 of file libaribb24.c.

Variable Documentation

◆ options

const AVOption options[]
static
Initial value:
= {
{ "aribb24-base-path", "set the base path for the libaribb24 library",
OFFSET(aribb24_base_path), AV_OPT_TYPE_STRING, { .str = NULL }, 0, 0, SD },
{ "aribb24-skip-ruby-text", "skip ruby text blocks during decoding",
OFFSET(aribb24_skip_ruby), AV_OPT_TYPE_BOOL, { .i64 = 1 }, 0, 1, SD },
{ NULL }
}

Definition at line 369 of file libaribb24.c.

◆ aribb24_class

const AVClass aribb24_class
static
Initial value:
= {
.class_name = "libaribb24 decoder",
.item_name = av_default_item_name,
.option = options,
}

Definition at line 377 of file libaribb24.c.

◆ ff_libaribb24_decoder

const FFCodec ff_libaribb24_decoder
Initial value:
= {
.p.name = "libaribb24",
.p.long_name = NULL_IF_CONFIG_SMALL("libaribb24 ARIB STD-B24 caption decoder"),
.p.priv_class = &aribb24_class,
.p.wrapper_name = "libaribb24",
.priv_data_size = sizeof(Libaribb24Context),
.close = libaribb24_close,
.flush = libaribb24_flush,
}

Definition at line 384 of file libaribb24.c.

AVMEDIA_TYPE_SUBTITLE
@ AVMEDIA_TYPE_SUBTITLE
Definition: avutil.h:204
init
static int init
Definition: av_tx.c:47
SD
#define SD
Definition: libaribb24.c:368
AV_CODEC_ID_ARIB_CAPTION
@ AV_CODEC_ID_ARIB_CAPTION
Definition: codec_id.h:552
LIBAVUTIL_VERSION_INT
#define LIBAVUTIL_VERSION_INT
Definition: version.h:85
NULL
#define NULL
Definition: coverity.c:32
options
static const AVOption options[]
Definition: libaribb24.c:369
av_default_item_name
const char * av_default_item_name(void *ptr)
Return the context name.
Definition: log.c:237
NULL_IF_CONFIG_SMALL
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
Definition: internal.h:117
Libaribb24Context
Definition: libaribb24.c:32
libaribb24_flush
static void libaribb24_flush(AVCodecContext *avctx)
Definition: libaribb24.c:360
OFFSET
#define OFFSET(x)
Definition: libaribb24.c:367
libaribb24_close
static int libaribb24_close(AVCodecContext *avctx)
Definition: libaribb24.c:193
FF_CODEC_DECODE_SUB_CB
#define FF_CODEC_DECODE_SUB_CB(func)
Definition: codec_internal.h:257
AV_OPT_TYPE_BOOL
@ AV_OPT_TYPE_BOOL
Definition: opt.h:244
libaribb24_decode
static int libaribb24_decode(AVCodecContext *avctx, AVSubtitle *sub, int *got_sub_ptr, const AVPacket *pkt)
Definition: libaribb24.c:286
aribb24_class
static const AVClass aribb24_class
Definition: libaribb24.c:377
AV_OPT_TYPE_STRING
@ AV_OPT_TYPE_STRING
Definition: opt.h:229
libaribb24_init
static int libaribb24_init(AVCodecContext *avctx)
Definition: libaribb24.c:133