FFmpeg  4.0
Data Structures | Macros | Functions | Variables
libgme.c File Reference

libgme demuxer More...

#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 (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.

Referenced by read_packet_gme().

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 ( 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}
}
#define NULL
Definition: coverity.c:32
#define OFFSET(x)
Definition: libgme.c:42
#define A
Definition: libgme.c:43
#define D
Definition: libgme.c:44
sample_rate

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,
}
#define LIBAVUTIL_VERSION_INT
Definition: version.h:85
static const AVOption options[]
Definition: libgme.c:45
const char * av_default_item_name(void *ptr)
Return the context name.
Definition: log.c:191

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,
}
static int read_seek(AVFormatContext *ctx, int stream_index, int64_t timestamp, int flags)
Definition: libcdio.c:153
static int read_packet_gme(AVFormatContext *s, AVPacket *pkt)
Definition: libgme.c:137
static int probe_gme(AVProbeData *p)
Definition: libgme.c:172
static int read_header_gme(AVFormatContext *s)
Definition: libgme.c:80
static av_cold int read_close(AVFormatContext *ctx)
Definition: libcdio.c:145
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
Definition: internal.h:186
static int read_probe(AVProbeData *pd)
Definition: jvdec.c:55
static int read_header(FFV1Context *f)
Definition: ffv1dec.c:530
static int read_packet(void *opaque, uint8_t *buf, int buf_size)
Definition: avio_reading.c:42
static const AVClass class_gme
Definition: libgme.c:184
static int read_seek_gme(AVFormatContext *s, int stream_idx, int64_t ts, int flags)
Definition: libgme.c:164
static int read_close_gme(AVFormatContext *s)
Definition: libgme.c:156

Definition at line 191 of file libgme.c.