FFmpeg
Loading...
Searching...
No Matches
libgme.c File Reference

libgme demuxer More...

#include <gme/gme.h>
#include "libavutil/mem.h"
#include "libavutil/opt.h"
#include "avformat.h"
#include "demux.h"
#include "internal.h"

Go to the source code of this file.

Data Structures

struct  GMEContext
 

Macros

#define OFFSET(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 FFInputFormat ff_libgme_demuxer
 

Detailed Description

libgme demuxer

Definition in file libgme.c.

Macro Definition Documentation

◆ OFFSET

#define OFFSET ( x)
Value:
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

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.

◆ 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}
}
#define A(x)
Definition vpx_arith.h:28
#define D
Definition avdct.c:35
#define NULL
Definition coverity.c:32
#define OFFSET(x)
@ AV_OPT_TYPE_INT64
Underlying C type is int64_t.
Definition opt.h:262
@ AV_OPT_TYPE_INT
Underlying C type is int.
Definition opt.h:258
static int track_index(VividasDemuxContext *viv, AVFormatContext *s, const uint8_t *buf, unsigned size)
Definition vividas.c:438

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,
}
const char * av_default_item_name(void *ptr)
Return the context name.
Definition log.c:241
#define LIBAVUTIL_VERSION_INT
Definition version.h:85

Definition at line 189 of file libgme.c.

◆ ff_libgme_demuxer

const FFInputFormat ff_libgme_demuxer
Initial value:
= {
.p.name = "libgme",
.p.long_name = NULL_IF_CONFIG_SMALL("Game Music Emu demuxer"),
.p.priv_class = &class_gme,
.priv_data_size = sizeof(GMEContext),
.flags_internal = FF_INFMT_FLAG_INIT_CLEANUP,
}
static int read_packet(void *opaque, uint8_t *buf, int buf_size)
static int read_probe(const AVProbeData *p)
Definition cdg.c:30
#define FF_INFMT_FLAG_INIT_CLEANUP
For an FFInputFormat with this flag set read_close() needs to be called by the caller upon read_heade...
Definition demux.h:35
static int read_header(FFV1Context *f, RangeCoder *c)
Definition ffv1dec.c:578
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
Definition internal.h:88
static av_cold int read_close(AVFormatContext *ctx)
Definition libcdio.c:143
static int read_seek(AVFormatContext *ctx, int stream_index, int64_t timestamp, int flags)
Definition libcdio.c:151
static int read_seek_gme(AVFormatContext *s, int stream_idx, int64_t ts, int flags)
Definition libgme.c:169
static int read_header_gme(AVFormatContext *s)
Definition libgme.c:92
static int probe_gme(const AVProbeData *p)
Definition libgme.c:177
static int read_close_gme(AVFormatContext *s)
Definition libgme.c:84
static int read_packet_gme(AVFormatContext *s, AVPacket *pkt)
Definition libgme.c:151
static const AVClass class_gme
Definition libgme.c:189

Definition at line 196 of file libgme.c.