FFmpeg
Loading...
Searching...
No Matches
libaribb24.c File Reference
#include "avcodec.h"
#include "libavcodec/ass.h"
#include "codec_internal.h"
#include "libavutil/log.h"
#include "libavutil/mem.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)
 
#define OFFSET(x)
 
#define SD   AV_OPT_FLAG_SUBTITLE_PARAM | AV_OPT_FLAG_DECODING_PARAM
 

Functions

static unsigned int get_profile_font_size (AVCodecContext *avctx)
 
static void libaribb24_log (void *p, const char *msg)
 
static int libaribb24_generate_ass_header (AVCodecContext *avctx)
 
static av_cold int libaribb24_init (AVCodecContext *avctx)
 
static av_cold 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)
Value:
(((c) & 0xff) << 16 | ((c) & 0xff00) | (((c) >> 16) & 0xff))
static double c[64]

Definition at line 213 of file libaribb24.c.

Referenced by libaribb24_handle_regions().

◆ OFFSET

#define OFFSET ( x)
Value:

Definition at line 375 of file libaribb24.c.

◆ SD

Definition at line 376 of file libaribb24.c.

Function Documentation

◆ get_profile_font_size()

static unsigned int get_profile_font_size ( AVCodecContext * avctx)
static

Definition at line 48 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 66 of file libaribb24.c.

Referenced by libaribb24_init().

◆ libaribb24_generate_ass_header()

static int libaribb24_generate_ass_header ( AVCodecContext * avctx)
static

Definition at line 71 of file libaribb24.c.

Referenced by libaribb24_init().

◆ libaribb24_init()

static av_cold int libaribb24_init ( AVCodecContext * avctx)
static

Definition at line 147 of file libaribb24.c.

◆ libaribb24_close()

static av_cold int libaribb24_close ( AVCodecContext * avctx)
static

Definition at line 200 of file libaribb24.c.

◆ libaribb24_handle_regions()

static int libaribb24_handle_regions ( AVCodecContext * avctx,
AVSubtitle * sub )
static

Definition at line 215 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 294 of file libaribb24.c.

◆ libaribb24_flush()

static void libaribb24_flush ( AVCodecContext * avctx)
static

Definition at line 368 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 },
{ "default_profile", "default profile to use if not specified in the stream parameters",
OFFSET(default_profile), AV_OPT_TYPE_INT, { .i64 = AV_PROFILE_UNKNOWN }, AV_PROFILE_UNKNOWN, AV_PROFILE_ARIB_PROFILE_C, SD, .unit = "profile" },
{"a", "Profile A", 0, AV_OPT_TYPE_CONST, {.i64 = AV_PROFILE_ARIB_PROFILE_A}, INT_MIN, INT_MAX, SD, .unit = "profile"},
{"c", "Profile C", 0, AV_OPT_TYPE_CONST, {.i64 = AV_PROFILE_ARIB_PROFILE_C}, INT_MIN, INT_MAX, SD, .unit = "profile"},
{ NULL }
}
#define SD
#define NULL
Definition coverity.c:32
#define AV_PROFILE_ARIB_PROFILE_A
Definition defs.h:191
#define AV_PROFILE_UNKNOWN
Definition defs.h:65
#define AV_PROFILE_ARIB_PROFILE_C
Definition defs.h:192
#define OFFSET(x)
@ AV_OPT_TYPE_CONST
Special option type for declaring named constants.
Definition opt.h:298
@ AV_OPT_TYPE_INT
Underlying C type is int.
Definition opt.h:258
@ AV_OPT_TYPE_BOOL
Underlying C type is int.
Definition opt.h:326
@ AV_OPT_TYPE_STRING
Underlying C type is a uint8_t* that is either NULL or points to a C string allocated with the av_mal...
Definition opt.h:275

Definition at line 377 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,
}
const char * av_default_item_name(void *ptr)
Return the context name.
Definition log.c:241
#define LIBAVUTIL_VERSION_INT
Definition version.h:85

Definition at line 389 of file libaribb24.c.

◆ ff_libaribb24_decoder

const FFCodec ff_libaribb24_decoder
Initial value:
= {
.p.name = "libaribb24",
CODEC_LONG_NAME("libaribb24 ARIB STD-B24 caption decoder"),
.p.priv_class = &aribb24_class,
.p.wrapper_name = "libaribb24",
.priv_data_size = sizeof(Libaribb24Context),
.flush = libaribb24_flush,
}
static av_cold void close(AVCodecParserContext *s)
Definition apv_parser.c:197
#define FF_CODEC_CAP_NOT_INIT_THREADSAFE
The codec is not known to be init-threadsafe (i.e.
#define CODEC_LONG_NAME(str)
#define FF_CODEC_CAP_INIT_CLEANUP
The codec allows calling the close function for deallocation even if the init function returned a fai...
#define FF_CODEC_DECODE_SUB_CB(func)
int(* init)(AVBSFContext *ctx)
Definition dts2pts.c:608
@ AV_CODEC_ID_ARIB_CAPTION
Definition codec_id.h:591
@ AVMEDIA_TYPE_SUBTITLE
Definition avutil.h:203
static void libaribb24_flush(AVCodecContext *avctx)
Definition libaribb24.c:368
static av_cold int libaribb24_init(AVCodecContext *avctx)
Definition libaribb24.c:147
static av_cold int libaribb24_close(AVCodecContext *avctx)
Definition libaribb24.c:200
static int libaribb24_decode(AVCodecContext *avctx, AVSubtitle *sub, int *got_sub_ptr, const AVPacket *pkt)
Definition libaribb24.c:294
static const AVClass aribb24_class
Definition libaribb24.c:389

Definition at line 396 of file libaribb24.c.