FFmpeg
Data Structures | Macros | Functions | Variables
libgme.c File Reference
#include <gme/gme.h>
#include "libavutil/avstring.h"
#include "libavutil/eval.h"
#include "libavutil/opt.h"
#include "avformat.h"
#include "internal.h"

Go to the source code of this file.

Data Structures

struct  GMEContext
 

Macros

#define OFFSET(x)   offsetof(GMEContext, x)
 
#define A   AV_OPT_FLAG_AUDIO_PARAM
 
#define D   AV_OPT_FLAG_DECODING_PARAM
 
#define AUDIO_PKT_SIZE   512
 

Functions

static void add_meta (AVFormatContext *s, const char *name, const char *value)
 
static int load_metadata (AVFormatContext *s, int64_t *duration)
 
static int read_close_gme (AVFormatContext *s)
 
static int read_header_gme (AVFormatContext *s)
 
static int read_packet_gme (AVFormatContext *s, AVPacket *pkt)
 
static int read_seek_gme (AVFormatContext *s, int stream_idx, int64_t ts, int flags)
 
static int probe_gme (const AVProbeData *p)
 

Variables

static const AVOption options []
 
static const AVClass class_gme
 
const AVInputFormat ff_libgme_demuxer
 

Detailed Description

libgme demuxer

Definition in file libgme.c.

Macro Definition Documentation

◆ OFFSET

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

Definition at line 41 of file libgme.c.

◆ A

#define A   AV_OPT_FLAG_AUDIO_PARAM

Definition at line 42 of file libgme.c.

◆ D

Definition at line 43 of file libgme.c.

◆ AUDIO_PKT_SIZE

#define AUDIO_PKT_SIZE   512

Definition at line 82 of file libgme.c.

Function Documentation

◆ add_meta()

static void add_meta ( AVFormatContext s,
const char *  name,
const char *  value 
)
static

Definition at line 51 of file libgme.c.

Referenced by load_metadata().

◆ load_metadata()

static int load_metadata ( AVFormatContext s,
int64_t *  duration 
)
static

Definition at line 57 of file libgme.c.

Referenced by read_header_gme().

◆ read_close_gme()

static int read_close_gme ( AVFormatContext s)
static

Definition at line 84 of file libgme.c.

◆ read_header_gme()

static int read_header_gme ( AVFormatContext s)
static

Definition at line 92 of file libgme.c.

◆ read_packet_gme()

static int read_packet_gme ( AVFormatContext s,
AVPacket pkt 
)
static

Definition at line 151 of file libgme.c.

◆ read_seek_gme()

static int read_seek_gme ( AVFormatContext s,
int  stream_idx,
int64_t  ts,
int  flags 
)
static

Definition at line 169 of file libgme.c.

◆ probe_gme()

static int probe_gme ( const AVProbeData p)
static

Definition at line 177 of file libgme.c.

Variable Documentation

◆ options

const AVOption options[]
static
Initial value:
= {
{"track_index", "set track that should be played", OFFSET(track_index), AV_OPT_TYPE_INT, {.i64 = 0}, 0, INT_MAX, A|D},
{"sample_rate", "set sample rate", OFFSET(sample_rate), AV_OPT_TYPE_INT, {.i64 = 44100}, 1000, 999999, A|D},
{"max_size", "set max file size supported (in bytes)", OFFSET(max_size), AV_OPT_TYPE_INT64, {.i64 = 50 * 1024 * 1024}, 0, SIZE_MAX, A|D},
{NULL}
}

Definition at line 44 of file libgme.c.

◆ class_gme

const AVClass class_gme
static
Initial value:
= {
.class_name = "Game Music Emu demuxer",
.item_name = av_default_item_name,
.option = options,
}

Definition at line 189 of file libgme.c.

◆ ff_libgme_demuxer

const AVInputFormat ff_libgme_demuxer
Initial value:
= {
.name = "libgme",
.long_name = NULL_IF_CONFIG_SMALL("Game Music Emu demuxer"),
.priv_data_size = sizeof(GMEContext),
.flags_internal = FF_FMT_INIT_CLEANUP,
.priv_class = &class_gme,
}

Definition at line 196 of file libgme.c.

read_packet_gme
static int read_packet_gme(AVFormatContext *s, AVPacket *pkt)
Definition: libgme.c:151
FF_FMT_INIT_CLEANUP
#define FF_FMT_INIT_CLEANUP
For an AVInputFormat with this flag set read_close() needs to be called by the caller upon read_heade...
Definition: internal.h:49
track_index
static int track_index(VividasDemuxContext *viv, AVFormatContext *s, uint8_t *buf, unsigned size)
Definition: vividas.c:435
read_header_gme
static int read_header_gme(AVFormatContext *s)
Definition: libgme.c:92
sample_rate
sample_rate
Definition: ffmpeg_filter.c:153
read_seek
static int read_seek(AVFormatContext *ctx, int stream_index, int64_t timestamp, int flags)
Definition: libcdio.c:149
GMEContext
Definition: libgme.c:31
read_close
static av_cold int read_close(AVFormatContext *ctx)
Definition: libcdio.c:141
D
#define D
Definition: libgme.c:43
OFFSET
#define OFFSET(x)
Definition: libgme.c:41
AV_OPT_TYPE_INT64
@ AV_OPT_TYPE_INT64
Definition: opt.h:225
LIBAVUTIL_VERSION_INT
#define LIBAVUTIL_VERSION_INT
Definition: version.h:85
read_header
static int read_header(FFV1Context *f)
Definition: ffv1dec.c:527
options
static const AVOption options[]
Definition: libgme.c:44
NULL
#define NULL
Definition: coverity.c:32
read_probe
static int read_probe(const AVProbeData *pd)
Definition: jvdec.c:55
av_default_item_name
const char * av_default_item_name(void *ptr)
Return the context name.
Definition: log.c:235
class_gme
static const AVClass class_gme
Definition: libgme.c:189
read_close_gme
static int read_close_gme(AVFormatContext *s)
Definition: libgme.c:84
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
read_packet
static int read_packet(void *opaque, uint8_t *buf, int buf_size)
Definition: avio_reading.c:42
AV_OPT_TYPE_INT
@ AV_OPT_TYPE_INT
Definition: opt.h:224
probe_gme
static int probe_gme(const AVProbeData *p)
Definition: libgme.c:177
read_seek_gme
static int read_seek_gme(AVFormatContext *s, int stream_idx, int64_t ts, int flags)
Definition: libgme.c:169
A
#define A
Definition: libgme.c:42