~ubuntu-branches/ubuntu/saucy/mpd/saucy

« back to all changes in this revision

Viewing changes to src/decoder/ffmpeg_plugin.c

  • Committer: Bazaar Package Importer
  • Author(s): Angel Abad
  • Date: 2011-02-02 12:26:30 UTC
  • mfrom: (1.5.11 upstream)
  • Revision ID: james.westby@ubuntu.com-20110202122630-bdyx8w4k94doz4fs
Tags: 0.16.1-1ubuntu1
* Merge from debian unstable. Remaining changes:
  - debian/control:
    + Don't build-depend on libmikmod2-dev (Debian bug #510675).
    + Move avahi-daemon from Suggests field to Recommends field.
  - debian/mpd.init.d:
    + Read mpd user from mpd.conf.
  - debian/control, debian/rules:
    + Add libmp3lame-dev to the build dependencies and enable lame.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
 * Copyright (C) 2003-2009 The Music Player Daemon Project
3
 
 * http://www.musicpd.org
4
 
 *
5
 
 * This program is free software; you can redistribute it and/or modify
6
 
 * it under the terms of the GNU General Public License as published by
7
 
 * the Free Software Foundation; either version 2 of the License, or
8
 
 * (at your option) any later version.
9
 
 *
10
 
 * This program is distributed in the hope that it will be useful,
11
 
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
 
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
 
 * GNU General Public License for more details.
14
 
 *
15
 
 * You should have received a copy of the GNU General Public License along
16
 
 * with this program; if not, write to the Free Software Foundation, Inc.,
17
 
 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18
 
 */
19
 
 
20
 
#include "../decoder_api.h"
21
 
#include "config.h"
22
 
 
23
 
#include <glib.h>
24
 
 
25
 
#include <assert.h>
26
 
#include <stdio.h>
27
 
#include <unistd.h>
28
 
#include <stdlib.h>
29
 
#include <string.h>
30
 
#include <sys/types.h>
31
 
#include <sys/stat.h>
32
 
#include <unistd.h>
33
 
 
34
 
#ifdef OLD_FFMPEG_INCLUDES
35
 
#include <avcodec.h>
36
 
#include <avformat.h>
37
 
#include <avio.h>
38
 
#else
39
 
#include <libavcodec/avcodec.h>
40
 
#include <libavformat/avformat.h>
41
 
#include <libavformat/avio.h>
42
 
#endif
43
 
 
44
 
#undef G_LOG_DOMAIN
45
 
#define G_LOG_DOMAIN "ffmpeg"
46
 
 
47
 
struct ffmpeg_context {
48
 
        int audio_stream;
49
 
        AVFormatContext *format_context;
50
 
        AVCodecContext *codec_context;
51
 
        struct decoder *decoder;
52
 
        struct input_stream *input;
53
 
        struct tag *tag;
54
 
};
55
 
 
56
 
struct mpd_ffmpeg_stream {
57
 
        struct decoder *decoder;
58
 
        struct input_stream *input;
59
 
 
60
 
        ByteIOContext *io;
61
 
        unsigned char buffer[8192];
62
 
};
63
 
 
64
 
static int
65
 
mpd_ffmpeg_stream_read(void *opaque, uint8_t *buf, int size)
66
 
{
67
 
        struct mpd_ffmpeg_stream *stream = opaque;
68
 
 
69
 
        return decoder_read(stream->decoder, stream->input,
70
 
                            (void *)buf, size);
71
 
}
72
 
 
73
 
static int64_t
74
 
mpd_ffmpeg_stream_seek(void *opaque, int64_t pos, int whence)
75
 
{
76
 
        struct mpd_ffmpeg_stream *stream = opaque;
77
 
        bool ret;
78
 
 
79
 
        if (whence == AVSEEK_SIZE)
80
 
                return stream->input->size;
81
 
 
82
 
        ret = input_stream_seek(stream->input, pos, whence);
83
 
        if (!ret)
84
 
                return -1;
85
 
 
86
 
        return stream->input->offset;
87
 
}
88
 
 
89
 
static struct mpd_ffmpeg_stream *
90
 
mpd_ffmpeg_stream_open(struct decoder *decoder, struct input_stream *input)
91
 
{
92
 
        struct mpd_ffmpeg_stream *stream = g_new(struct mpd_ffmpeg_stream, 1);
93
 
        stream->decoder = decoder;
94
 
        stream->input = input;
95
 
        stream->io = av_alloc_put_byte(stream->buffer, sizeof(stream->buffer),
96
 
                                       false, stream,
97
 
                                       mpd_ffmpeg_stream_read, NULL,
98
 
                                       input->seekable
99
 
                                       ? mpd_ffmpeg_stream_seek : NULL);
100
 
        if (stream->io == NULL) {
101
 
                g_free(stream);
102
 
                return NULL;
103
 
        }
104
 
 
105
 
        return stream;
106
 
}
107
 
 
108
 
static void
109
 
mpd_ffmpeg_stream_close(struct mpd_ffmpeg_stream *stream)
110
 
{
111
 
        av_free(stream->io);
112
 
        g_free(stream);
113
 
}
114
 
 
115
 
static bool
116
 
ffmpeg_init(G_GNUC_UNUSED const struct config_param *param)
117
 
{
118
 
        av_register_all();
119
 
        return true;
120
 
}
121
 
 
122
 
static int
123
 
ffmpeg_find_audio_stream(const AVFormatContext *format_context)
124
 
{
125
 
        for (unsigned i = 0; i < format_context->nb_streams; ++i)
126
 
                if (format_context->streams[i]->codec->codec_type ==
127
 
                    CODEC_TYPE_AUDIO)
128
 
                        return i;
129
 
 
130
 
        return -1;
131
 
}
132
 
 
133
 
static AVInputFormat *
134
 
ffmpeg_probe(struct decoder *decoder, struct input_stream *is,
135
 
             const char *uri)
136
 
{
137
 
        enum {
138
 
                BUFFER_SIZE = 16384,
139
 
                PADDING = 16,
140
 
        };
141
 
 
142
 
        unsigned char *buffer = g_malloc(BUFFER_SIZE);
143
 
        size_t nbytes = decoder_read(decoder, is, buffer, BUFFER_SIZE);
144
 
        if (nbytes <= PADDING || !input_stream_seek(is, 0, SEEK_SET)) {
145
 
                g_free(buffer);
146
 
                return NULL;
147
 
        }
148
 
 
149
 
        /* some ffmpeg parsers (e.g. ac3_parser.c) read a few bytes
150
 
           beyond the declared buffer limit, which makes valgrind
151
 
           angry; this workaround removes some padding from the buffer
152
 
           size */
153
 
        nbytes -= PADDING;
154
 
 
155
 
        AVProbeData avpd = {
156
 
                .buf = buffer,
157
 
                .buf_size = nbytes,
158
 
                .filename = uri,
159
 
        };
160
 
 
161
 
        AVInputFormat *format = av_probe_input_format(&avpd, true);
162
 
        g_free(buffer);
163
 
 
164
 
        return format;
165
 
}
166
 
 
167
 
static bool
168
 
ffmpeg_helper(const char *uri,
169
 
              struct decoder *decoder, struct input_stream *input,
170
 
              bool (*callback)(struct ffmpeg_context *ctx),
171
 
              struct ffmpeg_context *ctx)
172
 
{
173
 
        AVInputFormat *input_format = ffmpeg_probe(decoder, input, uri);
174
 
        if (input_format == NULL)
175
 
                return false;
176
 
 
177
 
        g_debug("detected input format '%s' (%s)",
178
 
                input_format->name, input_format->long_name);
179
 
 
180
 
        struct mpd_ffmpeg_stream *stream =
181
 
                mpd_ffmpeg_stream_open(decoder, input);
182
 
        if (stream == NULL) {
183
 
                g_warning("Failed to open stream");
184
 
                return false;
185
 
        }
186
 
 
187
 
        AVFormatContext *format_context;
188
 
        AVCodecContext *codec_context;
189
 
        AVCodec *codec;
190
 
        int audio_stream;
191
 
        bool ret;
192
 
 
193
 
        //ffmpeg works with ours "fileops" helper
194
 
        if (av_open_input_stream(&format_context, stream->io, uri,
195
 
                                 input_format, NULL) != 0) {
196
 
                g_warning("Open failed\n");
197
 
                mpd_ffmpeg_stream_close(stream);
198
 
                return false;
199
 
        }
200
 
 
201
 
        if (av_find_stream_info(format_context)<0) {
202
 
                g_warning("Couldn't find stream info\n");
203
 
                av_close_input_stream(format_context);
204
 
                mpd_ffmpeg_stream_close(stream);
205
 
                return false;
206
 
        }
207
 
 
208
 
        audio_stream = ffmpeg_find_audio_stream(format_context);
209
 
        if (audio_stream == -1) {
210
 
                g_warning("No audio stream inside\n");
211
 
                av_close_input_stream(format_context);
212
 
                mpd_ffmpeg_stream_close(stream);
213
 
                return false;
214
 
        }
215
 
 
216
 
        codec_context = format_context->streams[audio_stream]->codec;
217
 
        if (codec_context->codec_name[0] != 0)
218
 
                g_debug("codec '%s'", codec_context->codec_name);
219
 
 
220
 
        codec = avcodec_find_decoder(codec_context->codec_id);
221
 
 
222
 
        if (!codec) {
223
 
                g_warning("Unsupported audio codec\n");
224
 
                av_close_input_stream(format_context);
225
 
                mpd_ffmpeg_stream_close(stream);
226
 
                return false;
227
 
        }
228
 
 
229
 
        if (avcodec_open(codec_context, codec)<0) {
230
 
                g_warning("Could not open codec\n");
231
 
                av_close_input_stream(format_context);
232
 
                mpd_ffmpeg_stream_close(stream);
233
 
                return false;
234
 
        }
235
 
 
236
 
        if (callback) {
237
 
                ctx->audio_stream = audio_stream;
238
 
                ctx->format_context = format_context;
239
 
                ctx->codec_context = codec_context;
240
 
 
241
 
                ret = callback(ctx);
242
 
        } else
243
 
                ret = true;
244
 
 
245
 
        avcodec_close(codec_context);
246
 
        av_close_input_stream(format_context);
247
 
        mpd_ffmpeg_stream_close(stream);
248
 
 
249
 
        return ret;
250
 
}
251
 
 
252
 
/**
253
 
 * On some platforms, libavcodec wants the output buffer aligned to 16
254
 
 * bytes (because it uses SSE/Altivec internally).  This function
255
 
 * returns the aligned version of the specified buffer, and corrects
256
 
 * the buffer size.
257
 
 */
258
 
static void *
259
 
align16(void *p, size_t *length_p)
260
 
{
261
 
        unsigned add = 16 - (size_t)p % 16;
262
 
 
263
 
        *length_p -= add;
264
 
        return (char *)p + add;
265
 
}
266
 
 
267
 
static enum decoder_command
268
 
ffmpeg_send_packet(struct decoder *decoder, struct input_stream *is,
269
 
                   const AVPacket *packet,
270
 
                   AVCodecContext *codec_context,
271
 
                   const AVRational *time_base)
272
 
{
273
 
        enum decoder_command cmd = DECODE_COMMAND_NONE;
274
 
        int position;
275
 
        uint8_t audio_buf[(AVCODEC_MAX_AUDIO_FRAME_SIZE * 3) / 2 + 16];
276
 
        int16_t *aligned_buffer;
277
 
        size_t buffer_size;
278
 
        int len, audio_size;
279
 
        uint8_t *packet_data;
280
 
        int packet_size;
281
 
 
282
 
        packet_data = packet->data;
283
 
        packet_size = packet->size;
284
 
 
285
 
        buffer_size = sizeof(audio_buf);
286
 
        aligned_buffer = align16(audio_buf, &buffer_size);
287
 
 
288
 
        while ((packet_size > 0) && (cmd == DECODE_COMMAND_NONE)) {
289
 
                audio_size = buffer_size;
290
 
                len = avcodec_decode_audio2(codec_context,
291
 
                                            aligned_buffer, &audio_size,
292
 
                                            packet_data, packet_size);
293
 
 
294
 
                if (len < 0) {
295
 
                        /* if error, we skip the frame */
296
 
                        g_message("decoding failed\n");
297
 
                        break;
298
 
                }
299
 
 
300
 
                packet_data += len;
301
 
                packet_size -= len;
302
 
 
303
 
                if (audio_size <= 0)
304
 
                        continue;
305
 
 
306
 
                position = packet->pts != (int64_t)AV_NOPTS_VALUE
307
 
                        ? av_rescale_q(packet->pts, *time_base,
308
 
                                       (AVRational){1, 1})
309
 
                        : 0;
310
 
 
311
 
                cmd = decoder_data(decoder, is,
312
 
                                   aligned_buffer, audio_size,
313
 
                                   position,
314
 
                                   codec_context->bit_rate / 1000, NULL);
315
 
        }
316
 
        return cmd;
317
 
}
318
 
 
319
 
static bool
320
 
ffmpeg_decode_internal(struct ffmpeg_context *ctx)
321
 
{
322
 
        struct decoder *decoder = ctx->decoder;
323
 
        AVCodecContext *codec_context = ctx->codec_context;
324
 
        AVFormatContext *format_context = ctx->format_context;
325
 
        AVPacket packet;
326
 
        struct audio_format audio_format;
327
 
        enum decoder_command cmd;
328
 
        int total_time;
329
 
 
330
 
        total_time = 0;
331
 
 
332
 
#if LIBAVCODEC_VERSION_INT >= ((51<<16)+(41<<8)+0)
333
 
        audio_format.bits = (uint8_t) av_get_bits_per_sample_format(codec_context->sample_fmt);
334
 
#else
335
 
        /* XXX fixme 16-bit for older ffmpeg (13 Aug 2007) */
336
 
        audio_format.bits = (uint8_t) 16;
337
 
#endif
338
 
        audio_format.sample_rate = (unsigned int)codec_context->sample_rate;
339
 
        audio_format.channels = codec_context->channels;
340
 
 
341
 
        if (!audio_format_valid(&audio_format)) {
342
 
                g_warning("Invalid audio format: %u:%u:%u\n",
343
 
                          audio_format.sample_rate, audio_format.bits,
344
 
                          audio_format.channels);
345
 
                return false;
346
 
        }
347
 
 
348
 
        //there is some problem with this on some demux (mp3 at least)
349
 
        if (format_context->duration != (int64_t)AV_NOPTS_VALUE) {
350
 
                total_time = format_context->duration / AV_TIME_BASE;
351
 
        }
352
 
 
353
 
        decoder_initialized(decoder, &audio_format,
354
 
                            ctx->input->seekable, total_time);
355
 
 
356
 
        do {
357
 
                if (av_read_frame(format_context, &packet) < 0)
358
 
                        /* end of file */
359
 
                        break;
360
 
 
361
 
                if (packet.stream_index == ctx->audio_stream)
362
 
                        cmd = ffmpeg_send_packet(decoder, ctx->input,
363
 
                                                 &packet, codec_context,
364
 
                                                 &format_context->streams[ctx->audio_stream]->time_base);
365
 
                else
366
 
                        cmd = decoder_get_command(decoder);
367
 
 
368
 
                av_free_packet(&packet);
369
 
 
370
 
                if (cmd == DECODE_COMMAND_SEEK) {
371
 
                        int64_t where =
372
 
                                decoder_seek_where(decoder) * AV_TIME_BASE;
373
 
 
374
 
                        if (av_seek_frame(format_context, -1, where, 0) < 0)
375
 
                                decoder_seek_error(decoder);
376
 
                        else
377
 
                                decoder_command_finished(decoder);
378
 
                }
379
 
        } while (cmd != DECODE_COMMAND_STOP);
380
 
 
381
 
        return true;
382
 
}
383
 
 
384
 
static void
385
 
ffmpeg_decode(struct decoder *decoder, struct input_stream *input)
386
 
{
387
 
        struct ffmpeg_context ctx;
388
 
 
389
 
        ctx.input = input;
390
 
        ctx.decoder = decoder;
391
 
 
392
 
        char *uri = decoder_get_uri(decoder);
393
 
        ffmpeg_helper(uri, decoder, input,
394
 
                      ffmpeg_decode_internal, &ctx);
395
 
        g_free(uri);
396
 
}
397
 
 
398
 
#if LIBAVFORMAT_VERSION_INT >= ((52<<16)+(31<<8)+0)
399
 
static bool
400
 
ffmpeg_copy_metadata(struct tag *tag, AVMetadata *m,
401
 
                     enum tag_type type, const char *name)
402
 
{
403
 
        AVMetadataTag *mt = av_metadata_get(m, name, NULL, 0);
404
 
        if (mt != NULL)
405
 
                tag_add_item(tag, type, mt->value);
406
 
        return mt != NULL;
407
 
}
408
 
#endif
409
 
 
410
 
static bool ffmpeg_tag_internal(struct ffmpeg_context *ctx)
411
 
{
412
 
        struct tag *tag = (struct tag *) ctx->tag;
413
 
        AVFormatContext *f = ctx->format_context;
414
 
 
415
 
        tag->time = 0;
416
 
        if (f->duration != (int64_t)AV_NOPTS_VALUE)
417
 
                tag->time = f->duration / AV_TIME_BASE;
418
 
 
419
 
#if LIBAVFORMAT_VERSION_INT >= ((52<<16)+(31<<8)+0)
420
 
        av_metadata_conv(f, NULL, f->iformat->metadata_conv);
421
 
 
422
 
        ffmpeg_copy_metadata(tag, f->metadata, TAG_ITEM_TITLE, "title");
423
 
#if LIBAVFORMAT_VERSION_INT >= ((52<<16)+(50<<8))
424
 
        ffmpeg_copy_metadata(tag, f->metadata, TAG_ITEM_ARTIST, "artist");
425
 
        ffmpeg_copy_metadata(tag, f->metadata, TAG_ITEM_DATE, "date");
426
 
#else
427
 
        ffmpeg_copy_metadata(tag, f->metadata, TAG_ITEM_ARTIST, "author");
428
 
        ffmpeg_copy_metadata(tag, f->metadata, TAG_ITEM_DATE, "year");
429
 
#endif
430
 
        ffmpeg_copy_metadata(tag, f->metadata, TAG_ITEM_ALBUM, "album");
431
 
        ffmpeg_copy_metadata(tag, f->metadata, TAG_ITEM_COMMENT, "comment");
432
 
        ffmpeg_copy_metadata(tag, f->metadata, TAG_ITEM_GENRE, "genre");
433
 
        ffmpeg_copy_metadata(tag, f->metadata, TAG_ITEM_TRACK, "track");
434
 
        ffmpeg_copy_metadata(tag, f->metadata, TAG_ITEM_ALBUM_ARTIST, "album_artist");
435
 
        ffmpeg_copy_metadata(tag, f->metadata, TAG_ITEM_COMPOSER, "composer");
436
 
        ffmpeg_copy_metadata(tag, f->metadata, TAG_ITEM_PERFORMER, "performer");
437
 
        ffmpeg_copy_metadata(tag, f->metadata, TAG_ITEM_DISC, "disc");
438
 
#else
439
 
        if (f->author[0])
440
 
                tag_add_item(tag, TAG_ITEM_ARTIST, f->author);
441
 
        if (f->title[0])
442
 
                tag_add_item(tag, TAG_ITEM_TITLE, f->title);
443
 
        if (f->album[0])
444
 
                tag_add_item(tag, TAG_ITEM_ALBUM, f->album);
445
 
 
446
 
        if (f->track > 0) {
447
 
                char buffer[16];
448
 
                snprintf(buffer, sizeof(buffer), "%d", f->track);
449
 
                tag_add_item(tag, TAG_ITEM_TRACK, buffer);
450
 
        }
451
 
 
452
 
        if (f->comment[0])
453
 
                tag_add_item(tag, TAG_ITEM_COMMENT, f->comment);
454
 
        if (f->genre[0])
455
 
                tag_add_item(tag, TAG_ITEM_GENRE, f->genre);
456
 
        if (f->year > 0) {
457
 
                char buffer[16];
458
 
                snprintf(buffer, sizeof(buffer), "%d", f->year);
459
 
                tag_add_item(tag, TAG_ITEM_DATE, buffer);
460
 
        }
461
 
 
462
 
#endif
463
 
        return true;
464
 
}
465
 
 
466
 
//no tag reading in ffmpeg, check if playable
467
 
static struct tag *ffmpeg_tag(const char *file)
468
 
{
469
 
        struct input_stream input;
470
 
        struct ffmpeg_context ctx;
471
 
        bool ret;
472
 
 
473
 
        if (!input_stream_open(&input, file)) {
474
 
                g_warning("failed to open %s\n", file);
475
 
                return NULL;
476
 
        }
477
 
 
478
 
        ctx.decoder = NULL;
479
 
        ctx.tag = tag_new();
480
 
 
481
 
        ret = ffmpeg_helper(file, NULL, &input, ffmpeg_tag_internal, &ctx);
482
 
        if (!ret) {
483
 
                tag_free(ctx.tag);
484
 
                ctx.tag = NULL;
485
 
        }
486
 
 
487
 
        input_stream_close(&input);
488
 
 
489
 
        return ctx.tag;
490
 
}
491
 
 
492
 
/**
493
 
 * A list of extensions found for the formats supported by ffmpeg.
494
 
 * This list is current as of 02-23-09; To find out if there are more
495
 
 * supported formats, check the ffmpeg changelog since this date for
496
 
 * more formats.
497
 
 */
498
 
static const char *const ffmpeg_suffixes[] = {
499
 
        "16sv", "3g2", "3gp", "4xm", "8svx", "aa3", "aac", "ac3", "afc", "aif",
500
 
        "aifc", "aiff", "al", "alaw", "amr", "anim", "apc", "ape", "asf",
501
 
        "atrac", "au", "aud", "avi", "avm2", "avs", "bap", "bfi", "c93", "cak",
502
 
        "cin", "cmv", "cpk", "daud", "dct", "divx", "dts", "dv", "dvd", "dxa",
503
 
        "eac3", "film", "flac", "flc", "fli", "fll", "flx", "flv", "g726",
504
 
        "gsm", "gxf", "iss", "m1v", "m2v", "m2t", "m2ts",
505
 
        "m4a", "m4b", "m4v",
506
 
        "mad",
507
 
        "mj2", "mjpeg", "mjpg", "mka", "mkv", "mlp", "mm", "mmf", "mov", "mp+",
508
 
        "mp1", "mp2", "mp3", "mp4", "mpc", "mpeg", "mpg", "mpga", "mpp", "mpu",
509
 
        "mve", "mvi", "mxf", "nc", "nsv", "nut", "nuv", "oga", "ogm", "ogv",
510
 
        "ogx", "oma", "ogg", "omg", "psp", "pva", "qcp", "qt", "r3d", "ra",
511
 
        "ram", "rl2", "rm", "rmvb", "roq", "rpl", "rvc", "shn", "smk", "snd",
512
 
        "sol", "son", "spx", "str", "swf", "tgi", "tgq", "tgv", "thp", "ts",
513
 
        "tsp", "tta", "xa", "xvid", "uv", "uv2", "vb", "vid", "vob", "voc",
514
 
        "vp6", "vmd", "wav", "wma", "wmv", "wsaud", "wsvga", "wv", "wve",
515
 
        NULL
516
 
};
517
 
 
518
 
static const char *const ffmpeg_mime_types[] = {
519
 
        "application/m4a",
520
 
        "application/mp4",
521
 
        "application/octet-stream",
522
 
        "application/ogg",
523
 
        "application/x-ms-wmz",
524
 
        "application/x-ms-wmd",
525
 
        "application/x-ogg",
526
 
        "application/x-shockwave-flash",
527
 
        "application/x-shorten",
528
 
        "audio/8svx",
529
 
        "audio/16sv",
530
 
        "audio/aac",
531
 
        "audio/ac3",
532
 
        "audio/aiff"
533
 
        "audio/amr",
534
 
        "audio/basic",
535
 
        "audio/flac",
536
 
        "audio/m4a",
537
 
        "audio/mp4",
538
 
        "audio/mpeg",
539
 
        "audio/musepack",
540
 
        "audio/ogg",
541
 
        "audio/qcelp",
542
 
        "audio/vorbis",
543
 
        "audio/vorbis+ogg",
544
 
        "audio/x-8svx",
545
 
        "audio/x-16sv",
546
 
        "audio/x-aac",
547
 
        "audio/x-ac3",
548
 
        "audio/x-aiff"
549
 
        "audio/x-alaw",
550
 
        "audio/x-au",
551
 
        "audio/x-dca",
552
 
        "audio/x-eac3",
553
 
        "audio/x-flac",
554
 
        "audio/x-gsm",
555
 
        "audio/x-mace",
556
 
        "audio/x-matroska",
557
 
        "audio/x-monkeys-audio",
558
 
        "audio/x-mpeg",
559
 
        "audio/x-ms-wma",
560
 
        "audio/x-ms-wax",
561
 
        "audio/x-musepack",
562
 
        "audio/x-ogg",
563
 
        "audio/x-vorbis",
564
 
        "audio/x-vorbis+ogg",
565
 
        "audio/x-pn-realaudio",
566
 
        "audio/x-pn-multirate-realaudio",
567
 
        "audio/x-speex",
568
 
        "audio/x-tta"
569
 
        "audio/x-voc",
570
 
        "audio/x-wav",
571
 
        "audio/x-wma",
572
 
        "audio/x-wv",
573
 
        "video/anim",
574
 
        "video/quicktime",
575
 
        "video/msvideo",
576
 
        "video/ogg",
577
 
        "video/theora",
578
 
        "video/x-dv",
579
 
        "video/x-flv",
580
 
        "video/x-matroska",
581
 
        "video/x-mjpeg",
582
 
        "video/x-mpeg",
583
 
        "video/x-ms-asf",
584
 
        "video/x-msvideo",
585
 
        "video/x-ms-wmv",
586
 
        "video/x-ms-wvx",
587
 
        "video/x-ms-wm",
588
 
        "video/x-ms-wmx",
589
 
        "video/x-nut",
590
 
        "video/x-pva",
591
 
        "video/x-theora",
592
 
        "video/x-vid",
593
 
        "video/x-wmv",
594
 
        "video/x-xvid",
595
 
        NULL
596
 
};
597
 
 
598
 
const struct decoder_plugin ffmpeg_decoder_plugin = {
599
 
        .name = "ffmpeg",
600
 
        .init = ffmpeg_init,
601
 
        .stream_decode = ffmpeg_decode,
602
 
        .tag_dup = ffmpeg_tag,
603
 
        .suffixes = ffmpeg_suffixes,
604
 
        .mime_types = ffmpeg_mime_types
605
 
};