FFmpeg
libaribb24.c
Go to the documentation of this file.
1 /*
2  * ARIB STD-B24 caption decoder using the libaribb24 library
3  * Copyright (c) 2019 Jan Ekström
4  *
5  * This file is part of FFmpeg.
6  *
7  * FFmpeg is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU Lesser General Public
9  * License as published by the Free Software Foundation; either
10  * version 2.1 of the License, or (at your option) any later version.
11  *
12  * FFmpeg is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15  * Lesser General Public License for more details.
16  *
17  * You should have received a copy of the GNU Lesser General Public
18  * License along with FFmpeg; if not, write to the Free Software
19  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20  */
21 
22 #include "avcodec.h"
23 #include "libavcodec/ass.h"
24 #include "codec_internal.h"
25 #include "libavutil/log.h"
26 #include "libavutil/opt.h"
27 
28 #include <aribb24/aribb24.h>
29 #include <aribb24/parser.h>
30 #include <aribb24/decoder.h>
31 
32 typedef struct Libaribb24Context {
33  AVClass *class;
34 
35  arib_instance_t *lib_instance;
36  arib_parser_t *parser;
37  arib_decoder_t *decoder;
38 
40 
42  unsigned int aribb24_skip_ruby;
43 
46 
47 static unsigned int get_profile_font_size(AVCodecContext *avctx)
48 {
49  Libaribb24Context *b24 = avctx->priv_data;
50  int profile = avctx->profile;
51 
53  profile = b24->default_profile;
54 
55  switch (profile) {
57  return 36;
59  return 18;
60  default:
61  return 0;
62  }
63 }
64 
65 static void libaribb24_log(void *p, const char *msg)
66 {
67  av_log((AVCodecContext *)p, AV_LOG_INFO, "%s\n", msg);
68 }
69 
71 {
72  Libaribb24Context *b24 = avctx->priv_data;
73  unsigned int plane_width = 0;
74  unsigned int plane_height = 0;
75  unsigned int font_size = 0;
76  int profile = avctx->profile;
77 
79  profile = b24->default_profile;
80 
81  switch (profile) {
83  plane_width = 960;
84  plane_height = 540;
85  break;
87  plane_width = 320;
88  plane_height = 180;
89  break;
90  default:
91  av_log(avctx, AV_LOG_ERROR, "Unknown or unsupported profile set!\n");
92  return AVERROR(EINVAL);
93  }
94 
95  font_size = get_profile_font_size(avctx);
96 
98  "[Script Info]\r\n"
99  "; Script generated by FFmpeg/Lavc%s\r\n"
100  "ScriptType: v4.00+\r\n"
101  "PlayResX: %d\r\n"
102  "PlayResY: %d\r\n"
103  "\r\n"
104  "[V4+ Styles]\r\n"
105 
106  /* ASSv4 header */
107  "Format: Name, "
108  "Fontname, Fontsize, "
109  "PrimaryColour, SecondaryColour, OutlineColour, BackColour, "
110  "Bold, Italic, Underline, StrikeOut, "
111  "ScaleX, ScaleY, "
112  "Spacing, Angle, "
113  "BorderStyle, Outline, Shadow, "
114  "Alignment, MarginL, MarginR, MarginV, "
115  "Encoding\r\n"
116 
117  "Style: "
118  "Default," /* Name */
119  "%s,%d," /* Font{name,size} */
120  "&H%x,&H%x,&H%x,&H%x," /* {Primary,Secondary,Outline,Back}Colour */
121  "%d,%d,%d,0," /* Bold, Italic, Underline, StrikeOut */
122  "100,100," /* Scale{X,Y} */
123  "0,0," /* Spacing, Angle */
124  "%d,1,0," /* BorderStyle, Outline, Shadow */
125  "%d,10,10,10," /* Alignment, Margin[LRV] */
126  "0\r\n" /* Encoding */
127 
128  "\r\n"
129  "[Events]\r\n"
130  "Format: Layer, Start, End, Style, Name, MarginL, MarginR, MarginV, Effect, Text\r\n",
132  plane_width, plane_height,
137 
138  if (!avctx->subtitle_header)
139  return AVERROR(ENOMEM);
140 
141  avctx->subtitle_header_size = strlen(avctx->subtitle_header);
142 
143  return 0;
144 }
145 
146 static int libaribb24_init(AVCodecContext *avctx)
147 {
148  Libaribb24Context *b24 = avctx->priv_data;
149  void(* arib_dec_init)(arib_decoder_t* decoder) = NULL;
150  int ret;
151  int profile = avctx->profile;
152 
153  if (!(b24->lib_instance = arib_instance_new(avctx))) {
154  av_log(avctx, AV_LOG_ERROR, "Failed to initialize libaribb24!\n");
155  return AVERROR_EXTERNAL;
156  }
157 
158  if (b24->aribb24_base_path) {
159  av_log(avctx, AV_LOG_INFO, "Setting the libaribb24 base path to '%s'\n",
160  b24->aribb24_base_path);
161  arib_set_base_path(b24->lib_instance, b24->aribb24_base_path);
162  }
163 
164  arib_register_messages_callback(b24->lib_instance, libaribb24_log);
165 
166  if (!(b24->parser = arib_get_parser(b24->lib_instance))) {
167  av_log(avctx, AV_LOG_ERROR, "Failed to initialize libaribb24 PES parser!\n");
168  return AVERROR_EXTERNAL;
169  }
170  if (!(b24->decoder = arib_get_decoder(b24->lib_instance))) {
171  av_log(avctx, AV_LOG_ERROR, "Failed to initialize libaribb24 decoder!\n");
172  return AVERROR_EXTERNAL;
173  }
174 
176  profile = b24->default_profile;
177 
178  switch (profile) {
180  arib_dec_init = arib_initialize_decoder_a_profile;
181  break;
183  arib_dec_init = arib_initialize_decoder_c_profile;
184  break;
185  default:
186  av_log(avctx, AV_LOG_ERROR, "Unknown or unsupported profile set!\n");
187  return AVERROR(EINVAL);
188  }
189 
190  arib_dec_init(b24->decoder);
191 
193  if (ret < 0)
194  return ret;
195 
196  return 0;
197 }
198 
200 {
201  Libaribb24Context *b24 = avctx->priv_data;
202 
203  if (b24->decoder)
204  arib_finalize_decoder(b24->decoder);
205 
206  if (b24->lib_instance)
207  arib_instance_destroy(b24->lib_instance);
208 
209  return 0;
210 }
211 
212 #define RGB_TO_BGR(c) (((c) & 0xff) << 16 | ((c) & 0xff00) | (((c) >> 16) & 0xff))
213 
215 {
216  Libaribb24Context *b24 = avctx->priv_data;
217  const arib_buf_region_t *region = arib_decoder_get_regions(b24->decoder);
218  unsigned int profile_font_size = get_profile_font_size(avctx);
219  AVBPrint buf;
220  int ret = 0;
221 
223 
224  while (region) {
225  ptrdiff_t region_length = region->p_end - region->p_start;
226  unsigned int ruby_region =
227  region->i_fontheight == (profile_font_size / 2);
228 
229  // ASS requires us to make the colors BGR, so we convert here
230  int foreground_bgr_color = RGB_TO_BGR(region->i_foreground_color);
231  int background_bgr_color = RGB_TO_BGR(region->i_background_color);
232 
233  if (region_length < 0) {
234  av_log(avctx, AV_LOG_ERROR, "Invalid negative region length!\n");
236  break;
237  }
238 
239  if (region_length == 0 || (ruby_region && b24->aribb24_skip_ruby)) {
240  goto next_region;
241  }
242 
243  // color and alpha
244  if (foreground_bgr_color != ASS_DEFAULT_COLOR)
245  av_bprintf(&buf, "{\\1c&H%06x&}", foreground_bgr_color);
246 
247  if (region->i_foreground_alpha != 0)
248  av_bprintf(&buf, "{\\1a&H%02x&}", region->i_foreground_alpha);
249 
250  if (background_bgr_color != ASS_DEFAULT_BACK_COLOR)
251  av_bprintf(&buf, "{\\3c&H%06x&}", background_bgr_color);
252 
253  if (region->i_background_alpha != 0)
254  av_bprintf(&buf, "{\\3a&H%02x&}", region->i_background_alpha);
255 
256  // font size
257  if (region->i_fontwidth != profile_font_size ||
258  region->i_fontheight != profile_font_size) {
259  av_bprintf(&buf, "{\\fscx%"PRId64"\\fscy%"PRId64"}",
260  av_rescale(region->i_fontwidth, 100,
261  profile_font_size),
262  av_rescale(region->i_fontheight, 100,
263  profile_font_size));
264  }
265 
266  // TODO: positioning
267 
268  av_bprint_append_data(&buf, region->p_start, region_length);
269 
270  av_bprintf(&buf, "{\\r}");
271 
272 next_region:
273  region = region->p_next;
274  }
275 
276  if (!av_bprint_is_complete(&buf))
277  ret = AVERROR(ENOMEM);
278 
279  if (ret == 0) {
280  av_log(avctx, AV_LOG_DEBUG, "Styled ASS line: %s\n",
281  buf.str);
282 
283  sub->format = 1; /* text */
284  ret = ff_ass_add_rect(sub, buf.str, b24->read_order++,
285  0, NULL, NULL);
286  }
287 
288  av_bprint_finalize(&buf, NULL);
289 
290  return ret;
291 }
292 
294  int *got_sub_ptr, const AVPacket *pkt)
295 {
296  Libaribb24Context *b24 = avctx->priv_data;
297  size_t parsed_data_size = 0;
298  size_t decoded_subtitle_size = 0;
299  const unsigned char *parsed_data = NULL;
300  char *decoded_subtitle = NULL;
301  time_t subtitle_duration = 0;
302  int ret = 0;
303 
304  if (pkt->size <= 0)
305  return pkt->size;
306 
307  arib_parse_pes(b24->parser, pkt->data, pkt->size);
308 
309  parsed_data = arib_parser_get_data(b24->parser,
310  &parsed_data_size);
311  if (!parsed_data || !parsed_data_size) {
312  av_log(avctx, AV_LOG_DEBUG, "No decode'able data was received from "
313  "packet (dts: %"PRId64", pts: %"PRId64").\n",
314  pkt->dts, pkt->pts);
315  return pkt->size;
316  }
317 
318  decoded_subtitle_size = parsed_data_size * 4;
319  if (!(decoded_subtitle = av_mallocz(decoded_subtitle_size + 1))) {
320  av_log(avctx, AV_LOG_ERROR,
321  "Failed to allocate buffer for decoded subtitle!\n");
322  return AVERROR(ENOMEM);
323  }
324 
325  decoded_subtitle_size = arib_decode_buffer(b24->decoder,
326  parsed_data,
327  parsed_data_size,
328  decoded_subtitle,
329  decoded_subtitle_size);
330 
331  subtitle_duration = arib_decoder_get_time(b24->decoder);
332 
333  if (avctx->pkt_timebase.num && pkt->pts != AV_NOPTS_VALUE)
334  sub->pts = av_rescale_q(pkt->pts,
335  avctx->pkt_timebase, AV_TIME_BASE_Q);
336 
337  sub->end_display_time = subtitle_duration ?
338  av_rescale_q(subtitle_duration,
340  (AVRational){1, 1000}) :
341  UINT32_MAX;
342 
343  av_log(avctx, AV_LOG_DEBUG,
344  "Result: '%s' (size: %zu, pkt_pts: %"PRId64", sub_pts: %"PRId64" "
345  "duration: %"PRIu32", pkt_timebase: %d/%d, time_base: %d/%d')\n",
346  decoded_subtitle ? decoded_subtitle : "<no subtitle>",
347  decoded_subtitle_size,
348  pkt->pts, sub->pts,
349  sub->end_display_time,
350  avctx->pkt_timebase.num, avctx->pkt_timebase.den,
351  avctx->time_base.num, avctx->time_base.den);
352 
353  if (decoded_subtitle)
354  ret = libaribb24_handle_regions(avctx, sub);
355 
356  *got_sub_ptr = sub->num_rects > 0;
357 
358  av_free(decoded_subtitle);
359 
360  // flush the region buffers, otherwise the linked list keeps getting
361  // longer and longer...
362  arib_finalize_decoder(b24->decoder);
363 
364  return ret < 0 ? ret : pkt->size;
365 }
366 
367 static void libaribb24_flush(AVCodecContext *avctx)
368 {
369  Libaribb24Context *b24 = avctx->priv_data;
370  if (!(avctx->flags2 & AV_CODEC_FLAG2_RO_FLUSH_NOOP))
371  b24->read_order = 0;
372 }
373 
374 #define OFFSET(x) offsetof(Libaribb24Context, x)
375 #define SD AV_OPT_FLAG_SUBTITLE_PARAM | AV_OPT_FLAG_DECODING_PARAM
376 static const AVOption options[] = {
377  { "aribb24-base-path", "set the base path for the libaribb24 library",
378  OFFSET(aribb24_base_path), AV_OPT_TYPE_STRING, { .str = NULL }, 0, 0, SD },
379  { "aribb24-skip-ruby-text", "skip ruby text blocks during decoding",
380  OFFSET(aribb24_skip_ruby), AV_OPT_TYPE_BOOL, { .i64 = 1 }, 0, 1, SD },
381  { "default_profile", "default profile to use if not specified in the stream parameters",
382  OFFSET(default_profile), AV_OPT_TYPE_INT, { .i64 = AV_PROFILE_UNKNOWN }, AV_PROFILE_UNKNOWN, AV_PROFILE_ARIB_PROFILE_C, SD, "profile" },
383  {"a", "Profile A", 0, AV_OPT_TYPE_CONST, {.i64 = AV_PROFILE_ARIB_PROFILE_A}, INT_MIN, INT_MAX, SD, "profile"},
384  {"c", "Profile C", 0, AV_OPT_TYPE_CONST, {.i64 = AV_PROFILE_ARIB_PROFILE_C}, INT_MIN, INT_MAX, SD, "profile"},
385  { NULL }
386 };
387 
388 static const AVClass aribb24_class = {
389  .class_name = "libaribb24 decoder",
390  .item_name = av_default_item_name,
391  .option = options,
392  .version = LIBAVUTIL_VERSION_INT,
393 };
394 
396  .p.name = "libaribb24",
397  CODEC_LONG_NAME("libaribb24 ARIB STD-B24 caption decoder"),
398  .p.type = AVMEDIA_TYPE_SUBTITLE,
399  .p.id = AV_CODEC_ID_ARIB_CAPTION,
400  .p.priv_class = &aribb24_class,
401  .p.wrapper_name = "libaribb24",
403  .priv_data_size = sizeof(Libaribb24Context),
405  .close = libaribb24_close,
407  .flush = libaribb24_flush,
408 };
LIBAVCODEC_VERSION
#define LIBAVCODEC_VERSION
Definition: version.h:38
AVSubtitle
Definition: avcodec.h:2269
AVMEDIA_TYPE_SUBTITLE
@ AVMEDIA_TYPE_SUBTITLE
Definition: avutil.h:204
AV_BPRINT_SIZE_UNLIMITED
#define AV_BPRINT_SIZE_UNLIMITED
FF_CODEC_CAP_INIT_CLEANUP
#define FF_CODEC_CAP_INIT_CLEANUP
The codec allows calling the close function for deallocation even if the init function returned a fai...
Definition: codec_internal.h:42
av_bprint_is_complete
static int av_bprint_is_complete(const AVBPrint *buf)
Test if the print buffer is complete (not truncated).
Definition: bprint.h:218
AVERROR
Filter the word “frame” indicates either a video frame or a group of audio as stored in an AVFrame structure Format for each input and each output the list of supported formats For video that means pixel format For audio that means channel sample they are references to shared objects When the negotiation mechanism computes the intersection of the formats supported at each end of a all references to both lists are replaced with a reference to the intersection And when a single format is eventually chosen for a link amongst the remaining all references to the list are updated That means that if a filter requires that its input and output have the same format amongst a supported all it has to do is use a reference to the same list of formats query_formats can leave some formats unset and return AVERROR(EAGAIN) to cause the negotiation mechanism toagain later. That can be used by filters with complex requirements to use the format negotiated on one link to set the formats supported on another. Frame references ownership and permissions
opt.h
av_bprint_init
void av_bprint_init(AVBPrint *buf, unsigned size_init, unsigned size_max)
Definition: bprint.c:69
Libaribb24Context::lib_instance
arib_instance_t * lib_instance
Definition: libaribb24.c:35
AV_TIME_BASE_Q
#define AV_TIME_BASE_Q
Internal time base represented as fractional value.
Definition: avutil.h:264
av_asprintf
char * av_asprintf(const char *fmt,...)
Definition: avstring.c:115
AVSubtitle::num_rects
unsigned num_rects
Definition: avcodec.h:2273
libaribb24_generate_ass_header
static int libaribb24_generate_ass_header(AVCodecContext *avctx)
Definition: libaribb24.c:70
ASS_DEFAULT_ALIGNMENT
#define ASS_DEFAULT_ALIGNMENT
Definition: ass.h:42
ff_ass_add_rect
int ff_ass_add_rect(AVSubtitle *sub, const char *dialog, int readorder, int layer, const char *style, const char *speaker)
Add an ASS dialog to a subtitle.
Definition: ass.c:159
AVPacket::data
uint8_t * data
Definition: packet.h:491
AVOption
AVOption.
Definition: opt.h:251
FF_CODEC_CAP_NOT_INIT_THREADSAFE
#define FF_CODEC_CAP_NOT_INIT_THREADSAFE
The codec is not known to be init-threadsafe (i.e.
Definition: codec_internal.h:34
FFCodec
Definition: codec_internal.h:127
AVCodecContext::subtitle_header
uint8_t * subtitle_header
Header containing style information for text subtitles.
Definition: avcodec.h:1776
ASS_DEFAULT_BORDERSTYLE
#define ASS_DEFAULT_BORDERSTYLE
Definition: ass.h:43
AV_PROFILE_ARIB_PROFILE_C
#define AV_PROFILE_ARIB_PROFILE_C
Definition: defs.h:187
Libaribb24Context::decoder
arib_decoder_t * decoder
Definition: libaribb24.c:37
AV_PROFILE_ARIB_PROFILE_A
#define AV_PROFILE_ARIB_PROFILE_A
Definition: defs.h:186
decoder
static const chunk_decoder decoder[8]
Definition: dfa.c:331
FFCodec::p
AVCodec p
The public AVCodec.
Definition: codec_internal.h:131
RGB_TO_BGR
#define RGB_TO_BGR(c)
Definition: libaribb24.c:212
Libaribb24Context::default_profile
int default_profile
Definition: libaribb24.c:44
AVCodecContext::flags
int flags
AV_CODEC_FLAG_*.
Definition: avcodec.h:521
SD
#define SD
Definition: libaribb24.c:375
AVRational::num
int num
Numerator.
Definition: rational.h:59
ass.h
ff_libaribb24_decoder
const FFCodec ff_libaribb24_decoder
Definition: libaribb24.c:395
pkt
AVPacket * pkt
Definition: movenc.c:59
AV_LOG_ERROR
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
Definition: log.h:180
ASS_DEFAULT_FONT
#define ASS_DEFAULT_FONT
Definition: ass.h:35
get_profile_font_size
static unsigned int get_profile_font_size(AVCodecContext *avctx)
Definition: libaribb24.c:47
AV_PROFILE_UNKNOWN
#define AV_PROFILE_UNKNOWN
Definition: defs.h:65
init
int(* init)(AVBSFContext *ctx)
Definition: dts2pts_bsf.c:365
AV_LOG_DEBUG
#define AV_LOG_DEBUG
Stuff which is only useful for libav* developers.
Definition: log.h:201
av_rescale_q
int64_t av_rescale_q(int64_t a, AVRational bq, AVRational cq)
Rescale a 64-bit integer by 2 rational numbers.
Definition: mathematics.c:142
AVSubtitle::pts
int64_t pts
Same as packet pts, in AV_TIME_BASE.
Definition: avcodec.h:2275
CODEC_LONG_NAME
#define CODEC_LONG_NAME(str)
Definition: codec_internal.h:272
AV_CODEC_ID_ARIB_CAPTION
@ AV_CODEC_ID_ARIB_CAPTION
Definition: codec_id.h:575
ASS_DEFAULT_BACK_COLOR
#define ASS_DEFAULT_BACK_COLOR
Definition: ass.h:38
libaribb24_handle_regions
static int libaribb24_handle_regions(AVCodecContext *avctx, AVSubtitle *sub)
Definition: libaribb24.c:214
LIBAVUTIL_VERSION_INT
#define LIBAVUTIL_VERSION_INT
Definition: version.h:85
AVClass
Describe the class of an AVClass context structure.
Definition: log.h:66
NULL
#define NULL
Definition: coverity.c:32
options
static const AVOption options[]
Definition: libaribb24.c:376
AVRational
Rational number (pair of numerator and denominator).
Definition: rational.h:58
av_default_item_name
const char * av_default_item_name(void *ptr)
Return the context name.
Definition: log.c:237
AVCodecContext::subtitle_header_size
int subtitle_header_size
Definition: avcodec.h:1777
AVCodecContext::time_base
AVRational time_base
This is the fundamental unit of time (in seconds) in terms of which frame timestamps are represented.
Definition: avcodec.h:563
AVCodecContext::flags2
int flags2
AV_CODEC_FLAG2_*.
Definition: avcodec.h:528
ASS_DEFAULT_BOLD
#define ASS_DEFAULT_BOLD
Definition: ass.h:39
AVPacket::size
int size
Definition: packet.h:492
av_bprint_finalize
int av_bprint_finalize(AVBPrint *buf, char **ret_str)
Finalize a print buffer.
Definition: bprint.c:240
codec_internal.h
Libaribb24Context
Definition: libaribb24.c:32
libaribb24_flush
static void libaribb24_flush(AVCodecContext *avctx)
Definition: libaribb24.c:367
Libaribb24Context::aribb24_base_path
char * aribb24_base_path
Definition: libaribb24.c:41
AVCodecContext::pkt_timebase
AVRational pkt_timebase
Timebase in which pkt_dts/pts and AVPacket.dts/pts are expressed.
Definition: avcodec.h:1817
OFFSET
#define OFFSET(x)
Definition: libaribb24.c:374
AV_NOPTS_VALUE
#define AV_NOPTS_VALUE
Undefined timestamp value.
Definition: avutil.h:248
Libaribb24Context::parser
arib_parser_t * parser
Definition: libaribb24.c:36
AVSubtitle::end_display_time
uint32_t end_display_time
Definition: avcodec.h:2272
AVPacket::dts
int64_t dts
Decompression timestamp in AVStream->time_base units; the time at which the packet is decompressed.
Definition: packet.h:490
AVERROR_EXTERNAL
#define AVERROR_EXTERNAL
Generic error in an external library.
Definition: error.h:59
AV_LOG_INFO
#define AV_LOG_INFO
Standard information.
Definition: log.h:191
ASS_DEFAULT_UNDERLINE
#define ASS_DEFAULT_UNDERLINE
Definition: ass.h:41
AVSubtitle::format
uint16_t format
Definition: avcodec.h:2270
log.h
AVPacket::pts
int64_t pts
Presentation timestamp in AVStream->time_base units; the time at which the decompressed packet will b...
Definition: packet.h:484
AV_STRINGIFY
#define AV_STRINGIFY(s)
Definition: macros.h:66
av_mallocz
void * av_mallocz(size_t size)
Allocate a memory block with alignment suitable for all memory accesses (including vectors if availab...
Definition: mem.c:254
AVCodec::name
const char * name
Name of the codec implementation.
Definition: codec.h:194
ASS_DEFAULT_ITALIC
#define ASS_DEFAULT_ITALIC
Definition: ass.h:40
ASS_DEFAULT_COLOR
#define ASS_DEFAULT_COLOR
Definition: ass.h:37
profile
int profile
Definition: mxfenc.c:2115
av_rescale
int64_t av_rescale(int64_t a, int64_t b, int64_t c)
Rescale a 64-bit integer with rounding to nearest.
Definition: mathematics.c:129
avcodec.h
ret
ret
Definition: filter_design.txt:187
AVClass::class_name
const char * class_name
The name of the class; usually it is the same name as the context structure type to which the AVClass...
Definition: log.h:71
av_bprintf
void av_bprintf(AVBPrint *buf, const char *fmt,...)
Definition: bprint.c:99
libaribb24_close
static int libaribb24_close(AVCodecContext *avctx)
Definition: libaribb24.c:199
Libaribb24Context::aribb24_skip_ruby
unsigned int aribb24_skip_ruby
Definition: libaribb24.c:42
AVCodecContext
main external API structure.
Definition: avcodec.h:441
AVRational::den
int den
Denominator.
Definition: rational.h:60
AV_OPT_TYPE_INT
@ AV_OPT_TYPE_INT
Definition: opt.h:225
AVCodecContext::profile
int profile
profile
Definition: avcodec.h:1596
FF_CODEC_DECODE_SUB_CB
#define FF_CODEC_DECODE_SUB_CB(func)
Definition: codec_internal.h:309
libaribb24_log
static void libaribb24_log(void *p, const char *msg)
Definition: libaribb24.c:65
Libaribb24Context::read_order
int read_order
Definition: libaribb24.c:39
AV_CODEC_FLAG_BITEXACT
#define AV_CODEC_FLAG_BITEXACT
Use only bitexact stuff (except (I)DCT).
Definition: avcodec.h:338
av_free
#define av_free(p)
Definition: tableprint_vlc.h:33
AVPacket
This structure stores compressed data.
Definition: packet.h:468
AVCodecContext::priv_data
void * priv_data
Definition: avcodec.h:468
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:293
aribb24_class
static const AVClass aribb24_class
Definition: libaribb24.c:388
av_log
#define av_log(a,...)
Definition: tableprint_vlc.h:27
AVERROR_INVALIDDATA
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
Definition: error.h:61
AV_OPT_TYPE_STRING
@ AV_OPT_TYPE_STRING
Definition: opt.h:229
AV_CODEC_FLAG2_RO_FLUSH_NOOP
#define AV_CODEC_FLAG2_RO_FLUSH_NOOP
Do not reset ASS ReadOrder field on flush (subtitles decoding)
Definition: avcodec.h:388
av_bprint_append_data
void av_bprint_append_data(AVBPrint *buf, const char *data, unsigned size)
Append data to a print buffer.
Definition: bprint.c:163
AV_OPT_TYPE_CONST
@ AV_OPT_TYPE_CONST
Definition: opt.h:234
libaribb24_init
static int libaribb24_init(AVCodecContext *avctx)
Definition: libaribb24.c:146