FFmpeg
Data Structures | Macros | Functions | Variables
openal-dec.c File Reference
#include <AL/al.h>
#include <AL/alc.h>
#include "libavutil/opt.h"
#include "libavutil/time.h"
#include "libavformat/demux.h"
#include "libavformat/internal.h"
#include "avdevice.h"

Go to the source code of this file.

Data Structures

struct  al_data
 
struct  al_format_info
 

Macros

#define LOWEST_AL_FORMAT   FFMIN(FFMIN(AL_FORMAT_MONO8,AL_FORMAT_MONO16),FFMIN(AL_FORMAT_STEREO8,AL_FORMAT_STEREO16))
 
#define OFFSET(x)   offsetof(al_data, x)
 

Functions

static const al_format_infoget_al_format_info (ALCenum al_fmt)
 Get information about an AL_FORMAT value. More...
 
static int al_get_error (ALCdevice *device, const char **error_msg_ret)
 Get the OpenAL error code, translated into an av/errno error code. More...
 
static void print_al_capture_devices (void *log_ctx)
 Print out a list of OpenAL capture devices on this system. More...
 
static int read_header (AVFormatContext *ctx)
 
static int read_packet (AVFormatContext *ctx, AVPacket *pkt)
 
static int read_close (AVFormatContext *ctx)
 

Variables

static const AVOption options []
 
class {
      class_name = "openal indev"
 
      item_name = av_default_item_name
 
      option = options
 
      version = LIBAVUTIL_VERSION_INT
 
      category = AV_CLASS_CATEGORY_DEVICE_AUDIO_INPUT
 
}; 
 
const FFInputFormat ff_openal_demuxer
 

Detailed Description

OpenAL 1.1 capture device for libavdevice

Definition in file openal-dec.c.

Macro Definition Documentation

◆ LOWEST_AL_FORMAT

#define LOWEST_AL_FORMAT   FFMIN(FFMIN(AL_FORMAT_MONO8,AL_FORMAT_MONO16),FFMIN(AL_FORMAT_STEREO8,AL_FORMAT_STEREO16))

Definition at line 57 of file openal-dec.c.

◆ OFFSET

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

Definition at line 232 of file openal-dec.c.

Function Documentation

◆ get_al_format_info()

static const al_format_info* get_al_format_info ( ALCenum  al_fmt)
inlinestatic

Get information about an AL_FORMAT value.

Parameters
al_fmtthe AL_FORMAT value to find information about.
Returns
A pointer to a structure containing information about the AL_FORMAT value.

Definition at line 64 of file openal-dec.c.

Referenced by read_header().

◆ al_get_error()

static int al_get_error ( ALCdevice *  device,
const char **  error_msg_ret 
)
inlinestatic

Get the OpenAL error code, translated into an av/errno error code.

Parameters
deviceThe ALC device to check for errors.
error_msg_retA pointer to a char* in which to return the error message, or NULL if desired.
Returns
The error code, or 0 if there is no error.

Definition at line 82 of file openal-dec.c.

Referenced by read_header(), and read_packet().

◆ print_al_capture_devices()

static void print_al_capture_devices ( void *  log_ctx)
inlinestatic

Print out a list of OpenAL capture devices on this system.

Definition at line 109 of file openal-dec.c.

Referenced by read_header().

◆ read_header()

static int read_header ( AVFormatContext ctx)
static

Definition at line 122 of file openal-dec.c.

◆ read_packet()

static int read_packet ( AVFormatContext ctx,
AVPacket pkt 
)
static

Definition at line 184 of file openal-dec.c.

◆ read_close()

static int read_close ( AVFormatContext ctx)
static

Definition at line 221 of file openal-dec.c.

Variable Documentation

◆ options

const AVOption options[]
static
Initial value:
= {
{"channels", "set number of channels", OFFSET(channels), AV_OPT_TYPE_INT, {.i64=2}, 1, 2, AV_OPT_FLAG_DECODING_PARAM },
{"sample_rate", "set sample rate", OFFSET(sample_rate), AV_OPT_TYPE_INT, {.i64=44100}, 1, 192000, AV_OPT_FLAG_DECODING_PARAM },
{"sample_size", "set sample size", OFFSET(sample_size), AV_OPT_TYPE_INT, {.i64=16}, 8, 16, AV_OPT_FLAG_DECODING_PARAM },
{"list_devices", "list available devices", OFFSET(list_devices), AV_OPT_TYPE_INT, {.i64=0}, 0, 1, AV_OPT_FLAG_DECODING_PARAM, .unit = "list_devices" },
{"true", "", 0, AV_OPT_TYPE_CONST, {.i64=1}, 0, 0, AV_OPT_FLAG_DECODING_PARAM, .unit = "list_devices" },
{"false", "", 0, AV_OPT_TYPE_CONST, {.i64=0}, 0, 0, AV_OPT_FLAG_DECODING_PARAM, .unit = "list_devices" },
{NULL},
}

Definition at line 234 of file openal-dec.c.

◆ class_name

class_name = "openal indev"
private

Definition at line 245 of file openal-dec.c.

◆ item_name

item_name = av_default_item_name
private

Definition at line 246 of file openal-dec.c.

◆ option

option = options
private

Definition at line 247 of file openal-dec.c.

◆ version

version = LIBAVUTIL_VERSION_INT
private

Definition at line 248 of file openal-dec.c.

◆ category

◆ @301

const { ... }

◆ ff_openal_demuxer

const FFInputFormat ff_openal_demuxer
Initial value:
= {
.p.name = "openal",
.p.long_name = NULL_IF_CONFIG_SMALL("OpenAL audio capture device"),
.p.flags = AVFMT_NOFILE,
.p.priv_class = &class,
.priv_data_size = sizeof(al_data),
}

Definition at line 252 of file openal-dec.c.

read_header
static int read_header(AVFormatContext *ctx)
Definition: openal-dec.c:122
read_close
static int read_close(AVFormatContext *ctx)
Definition: openal-dec.c:221
channels
channels
Definition: aptx.h:31
NULL
#define NULL
Definition: coverity.c:32
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
AVFMT_NOFILE
#define AVFMT_NOFILE
Demuxer will use avio_open, no opened file should be provided by the caller.
Definition: avformat.h:468
OFFSET
#define OFFSET(x)
Definition: openal-dec.c:232
read_packet
static int read_packet(AVFormatContext *ctx, AVPacket *pkt)
Definition: openal-dec.c:184
AV_OPT_TYPE_INT
@ AV_OPT_TYPE_INT
Underlying C type is int.
Definition: opt.h:259
AV_OPT_FLAG_DECODING_PARAM
#define AV_OPT_FLAG_DECODING_PARAM
A generic parameter which can be set by the user for demuxing or decoding.
Definition: opt.h:356
read_probe
static int read_probe(const AVProbeData *p)
Definition: cdg.c:30
AV_OPT_TYPE_CONST
@ AV_OPT_TYPE_CONST
Special option type for declaring named constants.
Definition: opt.h:299
al_data
Definition: openal-dec.c:33