~ubuntu-branches/ubuntu/saucy/gst-libav1.0/saucy-proposed

« back to all changes in this revision

Viewing changes to gst-libs/ext/libav/libavdevice/jack_audio.c

  • Committer: Package Import Robot
  • Author(s): Sebastian Dröge
  • Date: 2013-07-30 09:00:15 UTC
  • mfrom: (1.1.16) (7.1.7 experimental)
  • Revision ID: package-import@ubuntu.com-20130730090015-sc1ou2yssu7q5w4e
Tags: 1.1.3-1
* New upstream development snapshot:
  + debian/control:
    - Build depend on GStreamer and gst-plugins-base >= 1.1.3.

Show diffs side-by-side

added added

removed removed

Lines of Context:
27
27
#include "libavutil/log.h"
28
28
#include "libavutil/fifo.h"
29
29
#include "libavutil/opt.h"
 
30
#include "libavutil/time.h"
30
31
#include "libavcodec/avcodec.h"
31
32
#include "libavformat/avformat.h"
32
33
#include "libavformat/internal.h"
91
92
 
92
93
    /* Copy and interleave audio data from the JACK buffer into the packet */
93
94
    for (i = 0; i < self->nports; i++) {
 
95
    #if HAVE_JACK_PORT_GET_LATENCY_RANGE
 
96
        jack_latency_range_t range;
 
97
        jack_port_get_latency_range(self->ports[i], JackCaptureLatency, &range);
 
98
        latency += range.max;
 
99
    #else
94
100
        latency += jack_port_get_total_latency(self->client, self->ports[i]);
 
101
    #endif
95
102
        buffer = jack_port_get_buffer(self->ports[i], self->buffer_size);
96
103
        for (j = 0; j < self->buffer_size; j++)
97
104
            pkt_data[j * self->nports + i] = buffer[j];
221
228
    ff_timefilter_destroy(self->timefilter);
222
229
}
223
230
 
224
 
static int audio_read_header(AVFormatContext *context, AVFormatParameters *params)
 
231
static int audio_read_header(AVFormatContext *context)
225
232
{
226
233
    JackData *self = context->priv_data;
227
234
    AVStream *stream;
238
245
 
239
246
    stream->codec->codec_type   = AVMEDIA_TYPE_AUDIO;
240
247
#if HAVE_BIGENDIAN
241
 
    stream->codec->codec_id     = CODEC_ID_PCM_F32BE;
 
248
    stream->codec->codec_id     = AV_CODEC_ID_PCM_F32BE;
242
249
#else
243
 
    stream->codec->codec_id     = CODEC_ID_PCM_F32LE;
 
250
    stream->codec->codec_id     = AV_CODEC_ID_PCM_F32LE;
244
251
#endif
245
252
    stream->codec->sample_rate  = self->sample_rate;
246
253
    stream->codec->channels     = self->nports;
315
322
 
316
323
#define OFFSET(x) offsetof(JackData, x)
317
324
static const AVOption options[] = {
318
 
    { "channels", "Number of audio channels.", OFFSET(nports), AV_OPT_TYPE_INT, { 2 }, 1, INT_MAX, AV_OPT_FLAG_DECODING_PARAM },
 
325
    { "channels", "Number of audio channels.", OFFSET(nports), AV_OPT_TYPE_INT, { .i64 = 2 }, 1, INT_MAX, AV_OPT_FLAG_DECODING_PARAM },
319
326
    { NULL },
320
327
};
321
328