~ubuntu-branches/ubuntu/wily/gmerlin-encoders/wily-proposed

« back to all changes in this revision

Viewing changes to plugins/ffmpeg/e_ffmpeg_audio.c

  • Committer: Bazaar Package Importer
  • Author(s): IOhannes m zmoelnig (gpg-key at iem)
  • Date: 2011-01-15 20:19:05 UTC
  • Revision ID: james.westby@ubuntu.com-20110115201905-qign5pihv1b977ct
Tags: upstream-1.0.0
ImportĀ upstreamĀ versionĀ 1.0.0

Show diffs side-by-side

added added

removed removed

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