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)
 
static int read_header_gme (AVFormatContext *s)
 
static int read_packet_gme (AVFormatContext *s, AVPacket *pkt)
 
static int read_close_gme (AVFormatContext *s)
 
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
 
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 42 of file libgme.c.

◆ A

#define A   AV_OPT_FLAG_AUDIO_PARAM

Definition at line 43 of file libgme.c.

◆ D

Definition at line 44 of file libgme.c.

◆ AUDIO_PKT_SIZE

#define AUDIO_PKT_SIZE   512

Definition at line 78 of file libgme.c.

Function Documentation

◆ add_meta()

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

Definition at line 52 of file libgme.c.

Referenced by load_metadata().

◆ load_metadata()

static int load_metadata ( AVFormatContext s)
static

Definition at line 58 of file libgme.c.

Referenced by read_header_gme().

◆ read_header_gme()

static int read_header_gme ( AVFormatContext s)
static

Definition at line 80 of file libgme.c.

◆ read_packet_gme()

static int read_packet_gme ( AVFormatContext s,
AVPacket pkt 
)
static

Definition at line 137 of file libgme.c.

◆ read_close_gme()

static int read_close_gme ( AVFormatContext s)
static

Definition at line 156 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 164 of file libgme.c.

◆ probe_gme()

static int probe_gme ( const AVProbeData p)
static

Definition at line 172 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 45 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 184 of file libgme.c.

◆ ff_libgme_demuxer

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

Definition at line 191 of file libgme.c.

read_packet_gme
static int read_packet_gme(AVFormatContext *s, AVPacket *pkt)
Definition: libgme.c:137
track_index
static int track_index(VividasDemuxContext *viv, AVFormatContext *s, uint8_t *buf, unsigned size)
Definition: vividas.c:432
read_header_gme
static int read_header_gme(AVFormatContext *s)
Definition: libgme.c:80
sample_rate
sample_rate
Definition: ffmpeg_filter.c:191
read_seek
static int read_seek(AVFormatContext *ctx, int stream_index, int64_t timestamp, int flags)
Definition: libcdio.c:153
GMEContext
Definition: libgme.c:31
read_close
static av_cold int read_close(AVFormatContext *ctx)
Definition: libcdio.c:145
D
#define D
Definition: libgme.c:44
OFFSET
#define OFFSET(x)
Definition: libgme.c:42
AV_OPT_TYPE_INT64
@ AV_OPT_TYPE_INT64
Definition: opt.h:224
LIBAVUTIL_VERSION_INT
#define LIBAVUTIL_VERSION_INT
Definition: version.h:85
read_header
static int read_header(FFV1Context *f)
Definition: ffv1dec.c:530
options
static const AVOption options[]
Definition: libgme.c:45
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:191
class_gme
static const AVClass class_gme
Definition: libgme.c:184
read_close_gme
static int read_close_gme(AVFormatContext *s)
Definition: libgme.c:156
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:188
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:223
probe_gme
static int probe_gme(const AVProbeData *p)
Definition: libgme.c:172
read_seek_gme
static int read_seek_gme(AVFormatContext *s, int stream_idx, int64_t ts, int flags)
Definition: libgme.c:164
A
#define A
Definition: libgme.c:43