37
37
* @short_description: audio transcoder interface
39
39
* The RBEncoder interface provides transcoding between audio formats based on
40
* media types. Media types are conceptually similar to MIME types, and overlap
41
* in many cases, but the media type for an encoding is not always the same as the
42
* MIME type for files using that encoding.
44
* The encoder picks the output format from a list provided by the caller,
45
* limited by the available codecs. It operatees asynchronously and provides
46
* status updates in the form of signals.
48
* A new encoder instance should be created for each file that is transcoded.
40
* encoding profiles. The encoder implementation operates asynchronously and
41
* provides status updates in the form of signals emitted on the main thread.
42
* A new encoder instance should be created for each file that is transcoded
51
46
static void rb_encoder_factory_class_init (RBEncoderFactoryClass *klass);
226
221
* @encoder: the #RBEncoder
227
222
* @entry: the #RhythmDBEntry to transcode
228
223
* @dest: destination file URI
229
* @dest_media_type: destination media type, or NULL to just copy it
231
* Initiates encoding, transcoding to the specified media type if it doesn't match
232
* the current media type of the entry. The caller should use rb_encoder_get_media_type
233
* to select a destination media type.
235
* Encoding and error reporting takes places asynchronously. The caller should wait
224
* @profile: encoding profile to use, or NULL to just copy
226
* Initiates encoding, transcoding to the specified profile if specified.
228
* Encoding and error reporting takes place asynchronously. The caller should wait
236
229
* for the 'completed' signal which indicates it has either completed or failed.
239
232
rb_encoder_encode (RBEncoder *encoder,
240
233
RhythmDBEntry *entry,
241
234
const char *dest,
242
const char *dest_media_type)
235
GstEncodingProfile *profile)
244
237
RBEncoderIface *iface = RB_ENCODER_GET_IFACE (encoder);
246
iface->encode (encoder, entry, dest, dest_media_type);
239
iface->encode (encoder, entry, dest, profile);
266
* rb_encoder_get_media_type:
267
* @encoder: a #RBEncoder
268
* @entry: the source #RhythmDBEntry
269
* @dest_media_types: (element-type utf8): media type strings in order of preference
270
* @media_type: (out callee-allocates) (allow-none): returns the selected media type, if any
271
* @extension: (out callee-allocates) (allow-none): returns the file extension associated with the selected media type, if any
273
* Identifies the first media type in the list that the encoder can actually encode to.
274
* The file extension (eg. '.mp3' for audio/mpeg) associated with the selected type is
277
* Return value: TRUE if a format was identified
280
rb_encoder_get_media_type (RBEncoder *encoder,
281
RhythmDBEntry *entry,
282
GList *dest_media_types,
286
RBEncoderIface *iface = RB_ENCODER_GET_IFACE (encoder);
288
return iface->get_media_type (encoder, entry, dest_media_types, media_type, extension);
292
259
* rb_encoder_get_missing_plugins:
293
260
* @encoder: a #RBEncoder
294
* @media_type: the media type required
261
* @profile: an encoding profile
295
262
* @details: (out callee-allocates): returns plugin installer detail strings
263
* @descriptions: (out callee-allocates): returns plugin descriptions
297
* Retrieves the plugin installer detail strings for any missing plugins
298
* required to encode the specified media type.
265
* Retrieves the plugin installer detail strings and descriptions
266
* for any missing plugins required to use the specified encoding profile.
300
268
* Return value: %TRUE if some detail strings are returned, %FALSE otherwise
303
271
rb_encoder_get_missing_plugins (RBEncoder *encoder,
304
const char *media_type,
272
GstEncodingProfile *profile,
274
char ***descriptions)
307
276
RBEncoderIface *iface = RB_ENCODER_GET_IFACE (encoder);
308
return iface->get_missing_plugins (encoder, media_type, details);
277
return iface->get_missing_plugins (encoder, profile, details, descriptions);