40 if (buf[2] !=
':' || buf[5] !=
':' || buf[8] !=
'.')
47 return ms - packet_time;
53 int buf_size = avpkt->
size;
55 const uint8_t *buf_end = buf + buf_size;
58 int64_t packet_time = 0;
63 if (buf_size < 27 + 7 * 2 + 4 * (3 + has_alpha)) {
69 if (buf[0] !=
'[' || buf[13] !=
'-' || buf[26] !=
']') {
80 w = bytestream_get_le16(&buf);
81 h = bytestream_get_le16(&buf);
84 x = bytestream_get_le16(&buf);
85 y = bytestream_get_le16(&buf);
87 bytestream_get_le16(&buf);
88 bytestream_get_le16(&buf);
93 bytestream_get_le16(&buf);
95 if (buf_end - buf < h + 3*4)
104 if (!sub->
rects[0]) {
126 ((uint32_t*)sub->
rects[0]->
data[1])[
i] = bytestream_get_be24(&buf);
131 ((uint32_t *)sub->
rects[0]->
data[1])[
i] |= 0xff000000;
134 ((uint32_t *)sub->
rects[0]->
data[1])[
i] |= (unsigned)*buf++ << 24;
142 rect = sub->
rects[0];
143 for (j = 0; j < 4; j++) {
155 for (y = 0; y <
h; y++) {
157 if (y == (h + 1) / 2) bitmap = sub->
rects[0]->
data[0] + w;
158 for (x = 0; x <
w; ) {
162 run =
FFMIN(run, w - x);
164 if (!run) run = w - x;
165 memset(bitmap, color, run);
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
int x
top left corner of pict, undefined when pict is not set
ptrdiff_t const GLvoid * data
static int decode_frame(AVCodecContext *avctx, void *data, int *got_sub_ptr, AVPacket *avpkt)
static unsigned int get_bits(GetBitContext *s, int n)
Read 1-25 bits.
int nb_colors
number of colors in pict, undefined when pict is not set
enum AVPixelFormat pix_fmt
Pixel format, see AV_PIX_FMT_xxx.
void * av_mallocz(size_t size)
Allocate a memory block with alignment suitable for all memory accesses (including vectors if availab...
attribute_deprecated AVPicture pict
int w
width of pict, undefined when pict is not set
#define FF_CODEC_CAP_INIT_THREADSAFE
The codec does not modify any global variables in the init function, allowing to call the init functi...
8 bits with AV_PIX_FMT_RGB32 palette
Undefined Behavior In the C some operations are like signed integer dereferencing freed accessing outside allocated Undefined Behavior must not occur in a C it is not safe even if the output of undefined operations is unused The unsafety may seem nit picking but Optimizing compilers have in fact optimized code on the assumption that no undefined Behavior occurs Optimizing code based on wrong assumptions can and has in some cases lead to effects beyond the output of computations The signed integer overflow problem in speed critical code Code which is highly optimized and works with signed integers sometimes has the problem that often the output of the computation does not c
attribute_deprecated int linesize[AV_NUM_DATA_POINTERS]
number of bytes per line
static const uint8_t tc_muls[9]
bitstream reader API header.
int h
height of pict, undefined when pict is not set
int64_t av_rescale_q(int64_t a, AVRational bq, AVRational cq)
Rescale a 64-bit integer by 2 rational numbers.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
static av_cold int decode_init(AVCodecContext *avctx)
int y
top left corner of pict, undefined when pict is not set
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
static int64_t parse_timecode(const uint8_t *buf, int64_t packet_time)
const char * name
Name of the codec implementation.
static const uint8_t tc_offsets[9]
uint32_t end_display_time
int av_image_check_size(unsigned int w, unsigned int h, int log_offset, void *log_ctx)
Check if the given dimension of an image is valid, meaning that all bytes of the image can be address...
A bitmap, pict will be set.
static unsigned int show_bits(GetBitContext *s, int n)
Show 1-25 bits.
attribute_deprecated uint8_t * data[AV_NUM_DATA_POINTERS]
pointers to the image data planes
uint8_t * data[4]
data+linesize for the bitmap of this subtitle.
const uint8_t ff_log2_tab[256]
Libavcodec external API header.
#define AV_TIME_BASE_Q
Internal time base represented as fractional value.
static int init_get_bits8(GetBitContext *s, const uint8_t *buffer, int byte_size)
Initialize GetBitContext.
main external API structure.
unsigned int codec_tag
fourcc (LSB first, so "ABCD" -> ('D'<<24) + ('C'<<16) + ('B'<<8) + 'A').
Rational number (pair of numerator and denominator).
#define FF_DISABLE_DEPRECATION_WARNINGS
common internal api header.
uint32_t start_display_time
#define FF_ENABLE_DEPRECATION_WARNINGS
static const uint8_t * align_get_bits(GetBitContext *s)
static float sub(float src0, float src1)
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
#define MKTAG(a, b, c, d)
This structure stores compressed data.
int64_t pts
Presentation timestamp in AVStream->time_base units; the time at which the decompressed packet will b...
#define AV_NOPTS_VALUE
Undefined timestamp value.