summaryrefslogtreecommitdiff
path: root/src/xine-engine
diff options
context:
space:
mode:
Diffstat (limited to 'src/xine-engine')
-rw-r--r--src/xine-engine/audio_decoder.h21
-rw-r--r--src/xine-engine/audio_out.h22
-rw-r--r--src/xine-engine/load_plugins.c2
-rw-r--r--src/xine-engine/post.h22
-rw-r--r--src/xine-engine/spu_decoder.h23
-rw-r--r--src/xine-engine/video_decoder.h23
-rw-r--r--src/xine-engine/video_out.h21
-rw-r--r--src/xine-engine/xine.c14
8 files changed, 97 insertions, 51 deletions
diff --git a/src/xine-engine/audio_decoder.h b/src/xine-engine/audio_decoder.h
index 8f75ba242..f5a9f506e 100644
--- a/src/xine-engine/audio_decoder.h
+++ b/src/xine-engine/audio_decoder.h
@@ -47,17 +47,23 @@ struct audio_decoder_class_s {
*/
audio_decoder_t* (*open_plugin) (audio_decoder_class_t *this, xine_stream_t *stream);
- /*
- * return short, human readable identifier for this plugin class
+ /**
+ * @brief short human readable identifier for this plugin class
*/
- char* (*get_identifier) (audio_decoder_class_t *this);
+ const char *identifier;
- /*
- * return human readable (verbose = 1 line) description for
- * this plugin class
+ /**
+ * @brief human readable (verbose = 1 line) description for this plugin class
+ *
+ * The description is passed to gettext() to internationalise.
*/
- char* (*get_description) (audio_decoder_class_t *this);
+ const char *description;
+ /**
+ * @brief Optional non-standard catalog to use with dgettext() for description.
+ */
+ const char *textdomain;
+
/*
* free all class-related resources
*/
@@ -65,6 +71,7 @@ struct audio_decoder_class_s {
void (*dispose) (audio_decoder_class_t *this);
};
+#define default_audio_decoder_class_dispose (void (*) (audio_decoder_class_t *this))free
struct audio_decoder_s {
diff --git a/src/xine-engine/audio_out.h b/src/xine-engine/audio_out.h
index 6ead6505e..0dffa6620 100644
--- a/src/xine-engine/audio_out.h
+++ b/src/xine-engine/audio_out.h
@@ -237,17 +237,23 @@ struct audio_driver_class_s {
*/
ao_driver_t* (*open_plugin) (audio_driver_class_t *, const void *data);
- /*
- * return short, human readable identifier for this plugin class
+ /**
+ * @brief short human readable identifier for this plugin class
*/
- char* (*get_identifier) (audio_driver_class_t *);
+ const char *identifier;
- /*
- * return human readable (verbose = 1 line) description for
- * this plugin class
+ /**
+ * @brief human readable (verbose = 1 line) description for this plugin class
+ *
+ * The description is passed to gettext() to internationalise.
*/
- char* (*get_description) (audio_driver_class_t *);
+ const char *description;
+ /**
+ * @brief Optional non-standard catalog to use with dgettext() for description.
+ */
+ const char *textdomain;
+
/*
* free all class-related resources
*/
@@ -255,6 +261,8 @@ struct audio_driver_class_s {
void (*dispose) (audio_driver_class_t *);
};
+#define default_audio_driver_class_dispose (void (*) (audio_driver_class_t *this))free
+
/**
* @brief Initialise the audio_out sync routines
*
diff --git a/src/xine-engine/load_plugins.c b/src/xine-engine/load_plugins.c
index 19a8b4e05..3e6708e65 100644
--- a/src/xine-engine/load_plugins.c
+++ b/src/xine-engine/load_plugins.c
@@ -2299,7 +2299,7 @@ const char *const *xine_list_post_plugins_typed(xine_t *xine, uint32_t type) {
else \
return NULL; \
} \
- return ic->get_description(ic); \
+ return dgettext(ic->textdomain ? : XINE_TEXTDOMAIN, ic->description); \
} \
} \
return NULL; \
diff --git a/src/xine-engine/post.h b/src/xine-engine/post.h
index 6186f31e0..1995ca82f 100644
--- a/src/xine-engine/post.h
+++ b/src/xine-engine/post.h
@@ -54,17 +54,23 @@ struct post_class_s {
xine_audio_port_t **audio_target,
xine_video_port_t **video_target);
- /*
- * return short, human readable identifier for this plugin class
+ /**
+ * @brief short human readable identifier for this plugin class
*/
- char* (*get_identifier) (post_class_t *this);
+ const char *identifier;
- /*
- * return human readable (verbose = 1 line) description for
- * this plugin class
+ /**
+ * @brief human readable (verbose = 1 line) description for this plugin class
+ *
+ * The description is passed to gettext() to internationalise.
*/
- char* (*get_description) (post_class_t *this);
+ const char *description;
+ /**
+ * @brief Optional non-standard catalog to use with dgettext() for description.
+ */
+ const char *textdomain;
+
/*
* free all class-related resources
*/
@@ -72,6 +78,8 @@ struct post_class_s {
void (*dispose) (post_class_t *this);
};
+#define default_post_class_dispose (void (*) (post_class_t *this))free
+
struct post_plugin_s {
/* public part of the plugin */
diff --git a/src/xine-engine/spu_decoder.h b/src/xine-engine/spu_decoder.h
index 66ab5e54a..2a7337c71 100644
--- a/src/xine-engine/spu_decoder.h
+++ b/src/xine-engine/spu_decoder.h
@@ -48,23 +48,30 @@ struct spu_decoder_class_s {
*/
spu_decoder_t* (*open_plugin) (spu_decoder_class_t *this, xine_stream_t *stream);
- /*
- * return short, human readable identifier for this plugin class
+ /**
+ * @brief short human readable identifier for this plugin class
*/
- char* (*get_identifier) (spu_decoder_class_t *this);
+ const char *identifier;
- /*
- * return human readable (verbose = 1 line) description for
- * this plugin class
+ /**
+ * @brief human readable (verbose = 1 line) description for this plugin class
+ *
+ * The description is passed to gettext() to internationalise.
+ */
+ const char *description;
+
+ /**
+ * @brief Optional non-standard catalog to use with dgettext() for description.
*/
- char* (*get_description) (spu_decoder_class_t *this);
+ const char *textdomain;
/*
* free all class-related resources
*/
void (*dispose) (spu_decoder_class_t *this);
};
-
+
+#define default_spu_decoder_class_dispose (void (*) (spu_decoder_class_t *this))free
struct spu_decoder_s {
diff --git a/src/xine-engine/video_decoder.h b/src/xine-engine/video_decoder.h
index 7b13159a3..ed3386717 100644
--- a/src/xine-engine/video_decoder.h
+++ b/src/xine-engine/video_decoder.h
@@ -47,24 +47,31 @@ struct video_decoder_class_s {
* open a new instance of this plugin class
*/
video_decoder_t* (*open_plugin) (video_decoder_class_t *this, xine_stream_t *stream);
-
- /*
- * return short, human readable identifier for this plugin class
+
+ /**
+ * @brief short human readable identifier for this plugin class
*/
- char* (*get_identifier) (video_decoder_class_t *this);
+ const char *identifier;
- /*
- * return human readable (verbose = 1 line) description for
- * this plugin class
+ /**
+ * @brief human readable (verbose = 1 line) description for this plugin class
+ *
+ * The description is passed to gettext() to internationalise.
*/
- char* (*get_description) (video_decoder_class_t *this);
+ const char *description;
+ /**
+ * @brief Optional non-standard catalog to use with dgettext() for description.
+ */
+ const char *textdomain;
+
/*
* free all class-related resources
*/
void (*dispose) (video_decoder_class_t *this);
};
+#define default_video_decoder_class_dispose (void (*) (video_decoder_class_t *this))free
struct video_decoder_s {
diff --git a/src/xine-engine/video_out.h b/src/xine-engine/video_out.h
index db99334eb..39dbe0caa 100644
--- a/src/xine-engine/video_out.h
+++ b/src/xine-engine/video_out.h
@@ -369,23 +369,30 @@ struct video_driver_class_s {
*/
vo_driver_t* (*open_plugin) (video_driver_class_t *self, const void *visual);
- /*
- * return short, human readable identifier for this plugin class
+ /**
+ * @brief short human readable identifier for this plugin class
*/
- char* (*get_identifier) (video_driver_class_t *self);
+ const char *identifier;
- /*
- * return human readable (verbose = 1 line) description for
- * this plugin class
+ /**
+ * @brief human readable (verbose = 1 line) description for this plugin class
+ *
+ * The description is passed to gettext() to internationalise.
*/
- char* (*get_description) (video_driver_class_t *self);
+ const char *description;
+ /**
+ * @brief Optional non-standard catalog to use with dgettext() for description.
+ */
+ const char *textdomain;
+
/*
* free all class-related resources
*/
void (*dispose) (video_driver_class_t *self);
};
+#define default_video_driver_class_dispose (void (*) (video_driver_class_t *this))free
typedef struct rle_elem_s {
uint16_t len;
diff --git a/src/xine-engine/xine.c b/src/xine-engine/xine.c
index 77430a053..17ea5d679 100644
--- a/src/xine-engine/xine.c
+++ b/src/xine-engine/xine.c
@@ -862,11 +862,12 @@ static int open_internal (xine_stream_t *stream, const char *mrl) {
int res;
xine_log (stream->xine, XINE_LOG_MSG, _("xine: found input plugin : %s\n"),
- stream->input_plugin->input_class->get_description(stream->input_plugin->input_class));
+ dgettext(stream->input_plugin->input_class->textdomain ? : XINE_TEXTDOMAIN,
+ stream->input_plugin->input_class->description));
if (stream->input_plugin->input_class->eject_media)
stream->eject_class = stream->input_plugin->input_class;
_x_meta_info_set_utf8(stream, XINE_META_INFO_INPUT_PLUGIN,
- (stream->input_plugin->input_class->get_identifier (stream->input_plugin->input_class)));
+ stream->input_plugin->input_class->identifier);
res = (stream->input_plugin->open) (stream->input_plugin);
switch(res) {
@@ -929,7 +930,7 @@ static int open_internal (xine_stream_t *stream, const char *mrl) {
}
_x_meta_info_set_utf8(stream, XINE_META_INFO_SYSTEMLAYER,
- (stream->demux_plugin->demux_class->get_identifier(stream->demux_plugin->demux_class)));
+ stream->demux_plugin->demux_class->identifier);
free(demux_name);
} else {
xprintf(stream->xine, XINE_VERBOSITY_LOG, _("xine: error while parsing mrl\n"));
@@ -1004,7 +1005,7 @@ static int open_internal (xine_stream_t *stream, const char *mrl) {
lprintf ("demux and input plugin found\n");
_x_meta_info_set_utf8(stream, XINE_META_INFO_SYSTEMLAYER,
- (stream->demux_plugin->demux_class->get_identifier(stream->demux_plugin->demux_class)));
+ stream->demux_plugin->demux_class->identifier);
free(demux_name);
} else {
xprintf(stream->xine, XINE_VERBOSITY_LOG, _("xine: error while parsing mrl\n"));
@@ -1210,11 +1211,12 @@ static int open_internal (xine_stream_t *stream, const char *mrl) {
lprintf ("demux and input plugin found\n");
_x_meta_info_set_utf8(stream, XINE_META_INFO_SYSTEMLAYER,
- (stream->demux_plugin->demux_class->get_identifier(stream->demux_plugin->demux_class)));
+ stream->demux_plugin->demux_class->identifier);
}
xine_log (stream->xine, XINE_LOG_MSG, _("xine: found demuxer plugin: %s\n"),
- stream->demux_plugin->demux_class->get_description(stream->demux_plugin->demux_class));
+ dgettext(stream->demux_plugin->demux_class->textdomain ? : XINE_TEXTDOMAIN,
+ stream->demux_plugin->demux_class->description));
_x_extra_info_reset( stream->current_extra_info );
_x_extra_info_reset( stream->video_decoder_extra_info );