FFmpeg
Data Structures | Macros | Functions | Variables
jack.c File Reference
#include "config.h"
#include <semaphore.h>
#include <jack/jack.h>
#include "libavutil/internal.h"
#include "libavutil/log.h"
#include "libavutil/fifo.h"
#include "libavutil/mem.h"
#include "libavutil/opt.h"
#include "libavutil/time.h"
#include "libavformat/avformat.h"
#include "libavformat/demux.h"
#include "libavformat/internal.h"
#include "timefilter.h"
#include "avdevice.h"

Go to the source code of this file.

Data Structures

struct  JackData
 

Macros

#define FIFO_PACKETS_NUM   16
 Size of the internal FIFO buffers as a number of audio packets. More...
 
#define OFFSET(x)   offsetof(JackData, x)
 

Functions

static int process_callback (jack_nframes_t nframes, void *arg)
 
static void shutdown_callback (void *arg)
 
static int xrun_callback (void *arg)
 
static int supply_new_packets (JackData *self, AVFormatContext *context)
 
static int start_jack (AVFormatContext *context)
 
static void free_pkt_fifo (AVFifo **fifop)
 
static void stop_jack (JackData *self)
 
static int audio_read_header (AVFormatContext *context)
 
static int audio_read_packet (AVFormatContext *context, AVPacket *pkt)
 
static int audio_read_close (AVFormatContext *context)
 

Variables

static const AVOption options []
 
static const AVClass jack_indev_class
 
const FFInputFormat ff_jack_demuxer
 

Macro Definition Documentation

◆ FIFO_PACKETS_NUM

#define FIFO_PACKETS_NUM   16

Size of the internal FIFO buffers as a number of audio packets.

Definition at line 42 of file jack.c.

◆ OFFSET

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

Definition at line 330 of file jack.c.

Function Documentation

◆ process_callback()

static int process_callback ( jack_nframes_t  nframes,
void *  arg 
)
static

Definition at line 60 of file jack.c.

Referenced by start_jack().

◆ shutdown_callback()

static void shutdown_callback ( void *  arg)
static

Definition at line 117 of file jack.c.

Referenced by start_jack().

◆ xrun_callback()

static int xrun_callback ( void *  arg)
static

Definition at line 123 of file jack.c.

Referenced by start_jack().

◆ supply_new_packets()

static int supply_new_packets ( JackData self,
AVFormatContext context 
)
static

Definition at line 131 of file jack.c.

Referenced by audio_read_packet(), and start_jack().

◆ start_jack()

static int start_jack ( AVFormatContext context)
static

Definition at line 149 of file jack.c.

Referenced by audio_read_header().

◆ free_pkt_fifo()

static void free_pkt_fifo ( AVFifo **  fifop)
static

Definition at line 214 of file jack.c.

Referenced by stop_jack().

◆ stop_jack()

static void stop_jack ( JackData self)
static

Definition at line 223 of file jack.c.

Referenced by audio_read_close(), and audio_read_header().

◆ audio_read_header()

static int audio_read_header ( AVFormatContext context)
static

Definition at line 237 of file jack.c.

◆ audio_read_packet()

static int audio_read_packet ( AVFormatContext context,
AVPacket pkt 
)
static

Definition at line 265 of file jack.c.

◆ audio_read_close()

static int audio_read_close ( AVFormatContext context)
static

Definition at line 323 of file jack.c.

Variable Documentation

◆ options

const AVOption options[]
static
Initial value:
= {
{ "channels", "Number of audio channels.", OFFSET(nports), AV_OPT_TYPE_INT, { .i64 = 2 }, 1, INT_MAX, AV_OPT_FLAG_DECODING_PARAM },
{ NULL },
}

Definition at line 331 of file jack.c.

◆ jack_indev_class

const AVClass jack_indev_class
static
Initial value:
= {
.class_name = "JACK indev",
.item_name = av_default_item_name,
.option = options,
}

Definition at line 336 of file jack.c.

◆ ff_jack_demuxer

const FFInputFormat ff_jack_demuxer
Initial value:
= {
.p.name = "jack",
.p.long_name = NULL_IF_CONFIG_SMALL("JACK Audio Connection Kit"),
.p.flags = AVFMT_NOFILE,
.p.priv_class = &jack_indev_class,
.priv_data_size = sizeof(JackData),
}

Definition at line 344 of file jack.c.

OFFSET
#define OFFSET(x)
Definition: jack.c:330
JackData
Definition: jack.c:44
jack_indev_class
static const AVClass jack_indev_class
Definition: jack.c:336
read_close
static av_cold int read_close(AVFormatContext *ctx)
Definition: libcdio.c:143
AV_CLASS_CATEGORY_DEVICE_AUDIO_INPUT
@ AV_CLASS_CATEGORY_DEVICE_AUDIO_INPUT
Definition: log.h:43
read_packet
static int read_packet(void *opaque, uint8_t *buf, int buf_size)
Definition: avio_read_callback.c:42
audio_read_packet
static int audio_read_packet(AVFormatContext *context, AVPacket *pkt)
Definition: jack.c:265
LIBAVUTIL_VERSION_INT
#define LIBAVUTIL_VERSION_INT
Definition: version.h:85
read_header
static int read_header(FFV1Context *f)
Definition: ffv1dec.c:540
NULL
#define NULL
Definition: coverity.c:32
av_default_item_name
const char * av_default_item_name(void *ptr)
Return the context name.
Definition: log.c:237
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
audio_read_close
static int audio_read_close(AVFormatContext *context)
Definition: jack.c:323
options
static const AVOption options[]
Definition: jack.c:331
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
audio_read_header
static int audio_read_header(AVFormatContext *context)
Definition: jack.c:237