FFmpeg
Data Structures | Macros | Functions | Variables
rl2.c File Reference

RL2 file demuxer. More...

#include <stdint.h>
#include "libavutil/intreadwrite.h"
#include "libavutil/mathematics.h"
#include "libavutil/mem.h"
#include "avformat.h"
#include "demux.h"
#include "internal.h"

Go to the source code of this file.

Data Structures

struct  Rl2DemuxContext
 

Macros

#define EXTRADATA1_SIZE   (6 + 256 * 3)
 video base, clr, palette More...
 
#define FORM_TAG   MKBETAG('F', 'O', 'R', 'M')
 
#define RLV2_TAG   MKBETAG('R', 'L', 'V', '2')
 
#define RLV3_TAG   MKBETAG('R', 'L', 'V', '3')
 

Functions

static int rl2_probe (const AVProbeData *p)
 check if the file is in rl2 format More...
 
static av_cold int rl2_read_header (AVFormatContext *s)
 read rl2 header data and setup the avstreams More...
 
static int rl2_read_packet (AVFormatContext *s, AVPacket *pkt)
 read a single audio or video packet More...
 
static int rl2_read_seek (AVFormatContext *s, int stream_index, int64_t timestamp, int flags)
 seek to a new timestamp More...
 

Variables

const FFInputFormat ff_rl2_demuxer
 

Detailed Description

RL2 file demuxer.

Author
Sascha Sommer (sasch.nosp@m.asom.nosp@m.mer@f.nosp@m.reen.nosp@m.et.de)
See also
http://wiki.multimedia.cx/index.php?title=RL2

extradata: 2 byte le initial drawing offset within 320x200 viewport 4 byte le number of used colors 256 * 3 bytes rgb palette optional background_frame

Definition in file rl2.c.

Macro Definition Documentation

◆ EXTRADATA1_SIZE

#define EXTRADATA1_SIZE   (6 + 256 * 3)

video base, clr, palette

Definition at line 44 of file rl2.c.

◆ FORM_TAG

#define FORM_TAG   MKBETAG('F', 'O', 'R', 'M')

Definition at line 46 of file rl2.c.

◆ RLV2_TAG

#define RLV2_TAG   MKBETAG('R', 'L', 'V', '2')

Definition at line 47 of file rl2.c.

◆ RLV3_TAG

#define RLV3_TAG   MKBETAG('R', 'L', 'V', '3')

Definition at line 48 of file rl2.c.

Function Documentation

◆ rl2_probe()

static int rl2_probe ( const AVProbeData p)
static

check if the file is in rl2 format

Parameters
pprobe buffer
Returns
0 when the probe buffer does not contain rl2 data, > 0 otherwise

Definition at line 60 of file rl2.c.

◆ rl2_read_header()

static av_cold int rl2_read_header ( AVFormatContext s)
static

read rl2 header data and setup the avstreams

Parameters
sdemuxer context
Returns
0 on success, AVERROR otherwise

< get size of the background frame

setup video stream

allocate and fill extradata

setup audio stream if present

read offset and size tables

build the sample index

Definition at line 78 of file rl2.c.

◆ rl2_read_packet()

static int rl2_read_packet ( AVFormatContext s,
AVPacket pkt 
)
static

read a single audio or video packet

Parameters
sdemuxer context
pktthe packet to be filled
Returns
0 on success, AVERROR otherwise

check if there is a valid video or audio entry that can be used

position the stream (will probably be there anyway)

fill the packet

Definition at line 229 of file rl2.c.

◆ rl2_read_seek()

static int rl2_read_seek ( AVFormatContext s,
int  stream_index,
int64_t  timestamp,
int  flags 
)
static

seek to a new timestamp

Parameters
sdemuxer context
stream_indexindex of the stream that should be seeked
timestampwanted timestamp
flagsdirection and seeking mode
Returns
0 on success, -1 otherwise

Definition at line 279 of file rl2.c.

Variable Documentation

◆ ff_rl2_demuxer

const FFInputFormat ff_rl2_demuxer
Initial value:
= {
.p.name = "rl2",
.p.long_name = NULL_IF_CONFIG_SMALL("RL2"),
.priv_data_size = sizeof(Rl2DemuxContext),
}

Definition at line 306 of file rl2.c.

rl2_read_header
static av_cold int rl2_read_header(AVFormatContext *s)
read rl2 header data and setup the avstreams
Definition: rl2.c:78
rl2_read_seek
static int rl2_read_seek(AVFormatContext *s, int stream_index, int64_t timestamp, int flags)
seek to a new timestamp
Definition: rl2.c:279
read_seek
static int read_seek(AVFormatContext *ctx, int stream_index, int64_t timestamp, int flags)
Definition: libcdio.c:151
rl2_probe
static int rl2_probe(const AVProbeData *p)
check if the file is in rl2 format
Definition: rl2.c:60
read_packet
static int read_packet(void *opaque, uint8_t *buf, int buf_size)
Definition: avio_read_callback.c:42
read_header
static int read_header(FFV1Context *f)
Definition: ffv1dec.c:540
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:94
Rl2DemuxContext
Definition: rl2.c:50
read_probe
static int read_probe(const AVProbeData *p)
Definition: cdg.c:30
rl2_read_packet
static int rl2_read_packet(AVFormatContext *s, AVPacket *pkt)
read a single audio or video packet
Definition: rl2.c:229