![]() |
![]() |
![]() |
Rhythmbox Development Reference Manual | ![]() |
---|---|---|---|---|
Top | Description |
enum RBEncoderError; GQuark rb_encoder_error_quark (void
); struct RBEncoderIface; struct RBEncoderFactoryClass; RBEncoderFactory * rb_encoder_factory_get (void
); RBEncoder * rb_encoder_new (void
); void rb_encoder_encode (RBEncoder *encoder
,RhythmDBEntry *entry
,const char *dest
,gboolean overwrite
,GstEncodingProfile *profile
); void rb_encoder_cancel (RBEncoder *encoder
); gboolean rb_encoder_get_missing_plugins (RBEncoder *encoder
,GstEncodingProfile *profile
,char ***details
,char ***descriptions
);
The RBEncoder interface provides transcoding between audio formats based on encoding profiles. The encoder implementation operates asynchronously and provides status updates in the form of signals emitted on the main thread. A new encoder instance should be created for each file that is transcoded or copied.
typedef enum { RB_ENCODER_ERROR_FORMAT_UNSUPPORTED, RB_ENCODER_ERROR_INTERNAL, RB_ENCODER_ERROR_FILE_ACCESS, RB_ENCODER_ERROR_OUT_OF_SPACE, RB_ENCODER_ERROR_DEST_READ_ONLY, RB_ENCODER_ERROR_DEST_EXISTS } RBEncoderError;
struct RBEncoderIface { GTypeInterface g_iface; /* vtable */ void (*encode) (RBEncoder *encoder, RhythmDBEntry *entry, const char *dest, gboolean overwrite, GstEncodingProfile *profile); void (*cancel) (RBEncoder *encoder); gboolean (*get_missing_plugins) (RBEncoder *encoder, GstEncodingProfile *profile, char ***details, char ***descriptions); /* signals */ void (*progress) (RBEncoder *encoder, double fraction); void (*completed) (RBEncoder *encoder, guint64 dest_size, const char *mediatype, GError *error); };
struct RBEncoderFactoryClass { GObjectClass obj_class; /* signals */ void (*prepare_source) (RBEncoderFactory *factory, const char *uri, GObject *source); void (*prepare_sink) (RBEncoderFactory *factory, const char *uri, GObject *sink); };
RBEncoderFactory * rb_encoder_factory_get (void
);
Returns the RBEncoderFactory instance.
Returns : |
the RBEncoderFactory. [transfer none] |
RBEncoder * rb_encoder_new (void
);
Creates a new RBEncoder instance.
Returns : |
the new RBEncoder. [transfer full] |
void rb_encoder_encode (RBEncoder *encoder
,RhythmDBEntry *entry
,const char *dest
,gboolean overwrite
,GstEncodingProfile *profile
);
Initiates encoding, transcoding to the specified profile if specified.
Encoding and error reporting takes place asynchronously. The caller should wait for the 'completed' signal which indicates it has either completed or failed.
|
the RBEncoder |
|
the RhythmDBEntry to transcode |
|
destination file URI |
|
if TRUE , overwrite dest if it already exists |
|
encoding profile to use, or NULL to just copy |
void rb_encoder_cancel (RBEncoder *encoder
);
Attempts to cancel any in progress encoding. The encoder should delete the destination file, if it created one, and emit the 'completed' signal.
|
a RBEncoder |
gboolean rb_encoder_get_missing_plugins (RBEncoder *encoder
,GstEncodingProfile *profile
,char ***details
,char ***descriptions
);
Retrieves the plugin installer detail strings and descriptions for any missing plugins required to use the specified encoding profile.
|
a RBEncoder |
|
an encoding profile |
|
returns plugin installer detail strings. [out callee-allocates] |
|
returns plugin descriptions. [out callee-allocates] |
Returns : |
TRUE if some detail strings are returned, FALSE otherwise |