diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2011-08-15 23:35:53 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2011-08-15 23:35:53 +0200 |
commit | 1a34478b7183b1a08caab7eac56b452609725736 (patch) | |
tree | 4ddae5c3407716d83b592694cdabbdb3dff3041f /libavdevice/jack_audio.c | |
parent | 6ae356c9a0987d56f60137f9784afcb3a9303037 (diff) | |
parent | cc73511e8e81b2e1454f406acb71da9fd1c60d32 (diff) | |
download | ffmpeg-streaming-1a34478b7183b1a08caab7eac56b452609725736.zip ffmpeg-streaming-1a34478b7183b1a08caab7eac56b452609725736.tar.gz |
Merge remote-tracking branch 'qatar/master'
* qatar/master:
Fix NASM include directive
dsputil_mmx: Honor HAVE_AMD3DNOW
lavf,lavd: remove all usage of AVFormatParameters from demuxers.
jack: add 'channels' private option.
VC-1: fix reading of custom PAR.
Remove redundant and dubious video codec detection by its extradata
mpeg12: remove repeat-field code disabled since May 2002
patch checklist: suggest fate instead of regression tests
Turn on resampling on sudden size change instead of bailing out during recode.
avtools: reinitialise filter chain when input video stream changes dimensions
Conflicts:
Makefile
avconv.c
doc/developer.texi
ffplay.c
libavcodec/x86/dsputil_mmx.c
libavdevice/libdc1394.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavdevice/jack_audio.c')
-rw-r--r-- | libavdevice/jack_audio.c | 24 |
1 files changed, 18 insertions, 6 deletions
diff --git a/libavdevice/jack_audio.c b/libavdevice/jack_audio.c index f78a2c9..bdf5eb8 100644 --- a/libavdevice/jack_audio.c +++ b/libavdevice/jack_audio.c @@ -26,6 +26,7 @@ #include "libavutil/log.h" #include "libavutil/fifo.h" +#include "libavutil/opt.h" #include "libavcodec/avcodec.h" #include "libavformat/timefilter.h" #include "avdevice.h" @@ -36,6 +37,7 @@ #define FIFO_PACKETS_NUM 16 typedef struct { + AVClass *class; jack_client_t * client; int activated; sem_t packet_count; @@ -136,7 +138,7 @@ static int supply_new_packets(JackData *self, AVFormatContext *context) return 0; } -static int start_jack(AVFormatContext *context, AVFormatParameters *params) +static int start_jack(AVFormatContext *context) { JackData *self = context->priv_data; jack_status_t status; @@ -153,7 +155,6 @@ static int start_jack(AVFormatContext *context, AVFormatParameters *params) sem_init(&self->packet_count, 0, 0); self->sample_rate = jack_get_sample_rate(self->client); - self->nports = params->channels; self->ports = av_malloc(self->nports * sizeof(*self->ports)); self->buffer_size = jack_get_buffer_size(self->client); @@ -225,10 +226,7 @@ static int audio_read_header(AVFormatContext *context, AVFormatParameters *param AVStream *stream; int test; - if (params->sample_rate <= 0 || params->channels <= 0) - return -1; - - if ((test = start_jack(context, params))) + if ((test = start_jack(context))) return test; stream = av_new_stream(context, 0); @@ -314,6 +312,19 @@ static int audio_read_close(AVFormatContext *context) return 0; } +#define OFFSET(x) offsetof(JackData, x) +static const AVOption options[] = { + { "channels", "Number of audio channels.", OFFSET(nports), FF_OPT_TYPE_INT, { 2 }, 1, INT_MAX, AV_OPT_FLAG_DECODING_PARAM }, + { NULL }, +}; + +static const AVClass jack_indev_class = { + .class_name = "JACK indev", + .item_name = av_default_item_name, + .option = options, + .version = LIBAVUTIL_VERSION_INT, +}; + AVInputFormat ff_jack_demuxer = { "jack", NULL_IF_CONFIG_SMALL("JACK Audio Connection Kit"), @@ -323,4 +334,5 @@ AVInputFormat ff_jack_demuxer = { audio_read_packet, audio_read_close, .flags = AVFMT_NOFILE, + .priv_class = &jack_indev_class, }; |