sbITranscodeProfile.idl
Go to the documentation of this file.
1 /*
2  *=BEGIN SONGBIRD GPL
3  *
4  * This file is part of the Songbird web player.
5  *
6  * Copyright(c) 2005-2009 POTI, Inc.
7  * http://www.songbirdnest.com
8  *
9  * This file may be licensed under the terms of of the
10  * GNU General Public License Version 2 (the ``GPL'').
11  *
12  * Software distributed under the License is distributed
13  * on an ``AS IS'' basis, WITHOUT WARRANTY OF ANY KIND, either
14  * express or implied. See the GPL for the specific language
15  * governing rights and limitations.
16  *
17  * You should have received a copy of the GPL along with this
18  * program. If not, go to http://www.gnu.org/licenses/gpl.html
19  * or write to the Free Software Foundation, Inc.,
20  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
21  *
22  *=END SONGBIRD GPL
23  */
24 
29 #include "nsISupports.idl"
30 
31 interface nsIArray;
32 interface nsIVariant;
33 interface nsIFile;
34 
41 [scriptable, uuid(497ccd50-ebb4-11de-8a39-0800200c9a66)]
43 {
44  /*
45  * Types of transcode profile.
46  *
47  * Const: TRANSCODE_TYPE_UNKNOWN
48  *
49  * Const: TRANSCODE_TYPE_AUDIO
50  * Audio transcoding profile.
51  *
52  * Const: TRANSCODE_TYPE_IMAGE
53  * Image transcoding profile.
54  *
55  * Const: TRANSCODE_TYPE_AUDIO_VIDEO
56  * Video transcoding profile.
57  */
58  const unsigned long TRANSCODE_TYPE_UNKNOWN = 0;
59  const unsigned long TRANSCODE_TYPE_AUDIO = 1;
60  const unsigned long TRANSCODE_TYPE_IMAGE = 2;
61  const unsigned long TRANSCODE_TYPE_AUDIO_VIDEO = 3;
62 
63  const unsigned long TRANSCODE_PRIORITY_LOWEST = 0;
64  const unsigned long TRANSCODE_PRIORITY_LOW = 1000;
65  const unsigned long TRANSCODE_PRIORITY_MEDIUM = 2000;
66  const unsigned long TRANSCODE_PRIORITY_HIGH = 3000;
67  const unsigned long TRANSCODE_PRIORITY_HIGHEST = 4000;
68 
69  /*
70  * \brief An opaque string uniquely identifying this profile.
71  *
72  * Generally this would be stored in preferences, etc in order to fetch the
73  * same profile later.
74  */
75  attribute AString id;
76 
77  /*
78  * \brief A value representing how desirable using this profile is.
79  *
80  * When a user has not explicitly selected a profile to encode with,
81  * encoding will use the highest-priority profile available.
82  *
83  * The priority MAY be one of the constants defined here, but can also
84  * use intermediate values if desired.
85  */
86  attribute unsigned long priority;
87 
88  /* \brief A human-readable description of what this profile is for
89  *
90  * Example: "MP3 Audio"
91  */
92  attribute AString description;
93 
94  /* \brief Type of transcoding profile; should be one of the TRANSCODE_TYPE_*
95  constants
96  */
97  attribute unsigned long type;
98 
106  attribute ACString fileExtension;
107 
108  /* \brief The container format to put the transcoded media in (if any).
109 
110  Examples:
111  "appliction/ogg", "audio/mpeg", "video/mp4", "video/x-ms-asf",
112  "audio/x-wav"
113 
114  May be an empty string to indicate that no container is desired.
115 
116  Note that 'tag' formats such as id3 are considered as container formats
117  here for simplicity.
118  */
119  attribute AString containerFormat;
120 
121  /* \brief The audio codec to use (if any).
122 
123  Examples:
124  "audio/x-vorbis", "audio/aac", "audio/mpeg", "audio/x-ms-wma",
125 
126  May be an empty string to indicate that raw audio should be stored.
127  */
128  attribute AString audioCodec;
129 
130  /* \brief The video codec to use (if any). e.g "video/x-ms-wmv", "video/h264",
131  "video/theora"
132  */
133  attribute AString videoCodec;
134 
135  attribute nsIArray audioProperties;
136  attribute nsIArray videoProperties;
137 
138  attribute nsIArray containerProperties;
139 
140  /* Additional attributes on the format type (sbITranscodeProfileAttribute) */
141  attribute nsIArray containerAttributes;
142  /* Additional attributes on the video type (sbITranscodeProfileAttribute) */
143  attribute nsIArray videoAttributes;
144  /* Additional attributes on the audio type (sbITranscodeProfileAttribute) */
145  attribute nsIArray audioAttributes;
146 };
147 
151 [scriptable, uuid(43E0BD54-33F1-4C6F-9826-5E70BE6D6280)]
166  unsigned long getEncoderProfilePriority(in double aQuality);
167 
168 %{COMMENT
169  /* these live on sbITranscodeProfile for now */
181  attribute AString containerFormat;
182 
191  attribute AString audioCodec;
192 
201  attribute AString videoCodec;
202 %}COMMENT
203 
210  double getAudioBitrate(in double aQuality);
211 
218  double getVideoBitsPerPixel(in double aQuality);
219 };
220 
221 
222 %{C++
223 #define SONGBIRD_TRANSCODEPROFILE_DESCRIPTION \
224  "Songbird Transcode Profile Component"
225 #define SONGBIRD_TRANSCODEPROFILE_CONTRACTID \
226  "@songbirdnest.com/Songbird/Transcode/Profile;1"
227 #define SONGBIRD_TRANSCODEPROFILE_CLASSNAME \
228  "Songbird Transcode Profile"
229 #define SONGBIRD_TRANSCODEPROFILE_CID \
230  {0xdc50c9ab, 0x63ec, 0x4d6a, {0xa9, 0xd1, 0x79, 0x07, 0xbc, 0xe3, 0x33, 0x24}}
231 
232 %}
233 
234 [scriptable, uuid(2747feca-25af-4509-8ec5-800b10817d0b)]
236 {
237  /* \brief The attribute's name */
238  readonly attribute AString name;
239 
240  /* \brief The attribute's value */
241  readonly attribute nsIVariant value;
242 };
243 
244 [scriptable, uuid(22bd3898-1dd2-11b2-821f-9742fbc125a7)]
246 {
247  /* \brief The name of the property */
248  readonly attribute AString propertyName;
249 
250  /* \brief The minimum value this property may have, if any */
251  readonly attribute nsIVariant valueMin;
252  /* \brief The maximum value this property may have, if any */
253  readonly attribute nsIVariant valueMax;
254 
255  /* \brief The current value of this property (initially the default) */
256  attribute nsIVariant value;
257 
262  readonly attribute boolean hidden;
263 
269  readonly attribute ACString mapping;
270 
274  readonly attribute ACString scale;
275 };
276 
277 
282 [scriptable, uuid(8e37f4a4-3ced-427e-9aa3-c9fd8c7509f1)]
284 {
285  /* Initialise a profile for image encoding */
286  void Init(in AString mimetype, in unsigned long width, in unsigned long height);
287 
288  /* Mime type of the image (image/jpeg, image/png, etc.) */
289  readonly attribute AString mimetype;
290 
291  /* Width of the image in pixels */
292  readonly attribute unsigned long width;
293 
294  /* Height of the image in pixels */
295  readonly attribute unsigned long height;
296 };
297 
305 [scriptable, uuid(18950502-f9e6-49e6-be38-d454dfd6cb81)]
307 {
308  /* \brief Load a profile from the given XML profile description */
309  sbITranscodeProfile loadProfile(in nsIFile aFile);
310 };
311 
const unsigned long TRANSCODE_TYPE_IMAGE
void Init(in AString mimetype, in unsigned long width, in unsigned long height)
readonly attribute ACString mapping
readonly attribute nsIVariant value
attribute AString audioCodec
The audio codec to use (if any).
attribute AString containerFormat
The container format to put the transcoded media in (if any).
An object that can create an sbITranscodeProfile from an XML description file.
readonly attribute unsigned long width
An object defining the format to transcode a still image to.
sbITranscodeProfile loadProfile(in nsIFile aFile)
const unsigned long TRANSCODE_TYPE_AUDIO
attribute nsIArray audioProperties
const unsigned long TRANSCODE_TYPE_UNKNOWN
An object defining a transcoding profile.
attribute AString videoCodec
var uuid
attribute nsIArray audioAttributes
attribute unsigned long type
const unsigned long TRANSCODE_PRIORITY_HIGH
function C(H)
const unsigned long TRANSCODE_TYPE_AUDIO_VIDEO
COMMENT double getAudioBitrate(in double aQuality)
readonly attribute AString propertyName
const unsigned long TRANSCODE_PRIORITY_MEDIUM
const unsigned long TRANSCODE_PRIORITY_HIGHEST
readonly attribute ACString scale
readonly attribute AString mimetype
attribute AString audioCodec
unsigned long getEncoderProfilePriority(in double aQuality)
double getVideoBitsPerPixel(in double aQuality)
attribute ACString fileExtension
The file extension to use for this profile May be empty to indicate no extension is to be used...
const unsigned long TRANSCODE_PRIORITY_LOWEST
const unsigned long TRANSCODE_PRIORITY_LOW
attribute AString containerFormat
attribute nsIArray containerProperties
attribute AString videoCodec
The video codec to use (if any).
readonly attribute AString name
attribute unsigned long priority
readonly attribute nsIVariant valueMax
readonly attribute boolean hidden
If true, this property should not be output (instead it should be used for calcuating a different pro...
readonly attribute nsIVariant valueMin
readonly attribute unsigned long height
attribute AString description
attribute nsIArray videoAttributes
attribute nsIArray videoProperties
attribute nsIArray containerAttributes