1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140
|
/*****************************************************************
* gmerlin-encoders - encoder plugins for gmerlin
*
* Copyright (c) 2001 - 2012 Members of the Gmerlin project
* gmerlin-general@lists.sourceforge.net
* http://gmerlin.sourceforge.net
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
* *****************************************************************/
#include <config.h>
#include <gmerlin/translation.h>
#include "ffmpeg_common.h"
static const ffmpeg_format_info_t formats[] =
{
{
.name = "SUN AU Format",
.short_name = "au",
.extension = "au",
.max_audio_streams = 1,
.audio_codecs = (enum AVCodecID[]){ AV_CODEC_ID_PCM_MULAW,
AV_CODEC_ID_PCM_S16BE,
AV_CODEC_ID_PCM_ALAW,
AV_CODEC_ID_NONE },
},
{
.name = "Raw AC3",
.short_name = "ac3",
.extension = "ac3",
.max_audio_streams = 1,
.audio_codecs = (enum AVCodecID[]){ AV_CODEC_ID_AC3,
AV_CODEC_ID_NONE },
.flags = FLAG_PIPE,
},
{
.name = "AIFF",
.short_name = "aiff",
.extension = "aif",
.max_audio_streams = 1,
.audio_codecs = (enum AVCodecID[]){ AV_CODEC_ID_PCM_S16BE,
AV_CODEC_ID_PCM_S8,
AV_CODEC_ID_PCM_ALAW,
AV_CODEC_ID_PCM_MULAW,
AV_CODEC_ID_NONE },
},
{
.name = "MP2",
.short_name = "mp2",
.extension = "mp2",
.max_audio_streams = 1,
.audio_codecs = (enum AVCodecID[]){ AV_CODEC_ID_MP2,
AV_CODEC_ID_NONE },
.flags = FLAG_PIPE,
},
#if LIBAVCODEC_BUILD >= ((51<<16)+(32<<8)+0)
{
.name = "WMA",
.short_name = "asf",
.extension = "wma",
.max_audio_streams = 1,
.audio_codecs = (enum AVCodecID[]){ AV_CODEC_ID_WMAV2,
AV_CODEC_ID_WMAV1,
AV_CODEC_ID_NONE },
},
#endif
#if 1
{
.name = "ADTS",
.short_name = "adts",
.extension = "aac",
.max_audio_streams = 1,
.audio_codecs = (enum AVCodecID[]){ AV_CODEC_ID_AAC,
AV_CODEC_ID_NONE },
.flags = FLAG_PIPE,
},
#endif
{ /* End of formats */ }
};
static void * create_ffmpeg()
{
return bg_ffmpeg_create(formats);
}
const bg_encoder_plugin_t the_plugin =
{
.common =
{
BG_LOCALE,
.name = "e_ffmpeg_audio", /* Unique short name */
.long_name = TRS("FFmpeg audio encoder"),
.description = TRS("Plugin for encoding various audio formats with ffmpeg \
(http://www.ffmpeg.org)."),
.type = BG_PLUGIN_ENCODER_AUDIO,
.flags = BG_PLUGIN_FILE | BG_PLUGIN_PIPE,
.priority = 5,
.create = create_ffmpeg,
.destroy = bg_ffmpeg_destroy,
.get_parameters = bg_ffmpeg_get_parameters,
.set_parameter = bg_ffmpeg_set_parameter,
},
.max_audio_streams = 1,
.get_audio_parameters = bg_ffmpeg_get_audio_parameters,
.set_callbacks = bg_ffmpeg_set_callbacks,
.open = bg_ffmpeg_open,
.open_io = bg_ffmpeg_open_io,
.writes_compressed_audio = bg_ffmpeg_writes_compressed_audio,
.add_audio_stream = bg_ffmpeg_add_audio_stream,
.add_audio_stream_compressed = bg_ffmpeg_add_audio_stream_compressed,
.set_audio_parameter = bg_ffmpeg_set_audio_parameter,
.get_audio_sink = bg_ffmpeg_get_audio_sink,
.get_audio_packet_sink = bg_ffmpeg_get_audio_packet_sink,
.start = bg_ffmpeg_start,
.close = bg_ffmpeg_close,
};
/* Include this into all plugin modules exactly once
to let the plugin loader obtain the API version */
BG_GET_PLUGIN_API_VERSION;
|