From 78fc25b90a9659048ba3a9a178a45a3e536765f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Diego=20=27Flameeyes=27=20Petten=C3=B2?= Date: Tue, 11 Dec 2007 13:26:26 +0100 Subject: Update all misc plugins to the new identifier/description interface. Add _() where missing, for i18n. --- src/vdr/input_vdr.c | 14 ++------------ src/vdr/post_vdr.h | 16 +++------------- src/vdr/post_vdr_audio.c | 16 ++-------------- src/vdr/post_vdr_video.c | 16 ++-------------- 4 files changed, 9 insertions(+), 53 deletions(-) (limited to 'src/vdr') diff --git a/src/vdr/input_vdr.c b/src/vdr/input_vdr.c index 069eb734a..9a1ec0f8e 100644 --- a/src/vdr/input_vdr.c +++ b/src/vdr/input_vdr.c @@ -2628,16 +2628,6 @@ static input_plugin_t *vdr_class_get_instance(input_class_t *cls_gen, xine_strea * vdr input plugin class stuff */ -static const char *vdr_class_get_description(input_class_t *this_gen) -{ - return _("VDR display device plugin"); -} - -static const char *vdr_class_get_identifier (input_class_t *this_gen) -{ - return "VDR"; -} - static void vdr_class_dispose (input_class_t *this_gen) { vdr_input_class_t *this = (vdr_input_class_t *)this_gen; @@ -2668,8 +2658,8 @@ static void *init_class(xine_t *xine, void *data) this->mrls[ 1 ] = 0; this->input_class.get_instance = vdr_class_get_instance; - this->input_class.get_identifier = vdr_class_get_identifier; - this->input_class.get_description = vdr_class_get_description; + this->input_class.identifier = "VDR"; + this->input_class.description = _("VDR display device plugin"); this->input_class.get_dir = NULL; this->input_class.get_autoplay_list = vdr_class_get_autoplay_list; this->input_class.dispose = vdr_class_dispose; diff --git a/src/vdr/post_vdr.h b/src/vdr/post_vdr.h index b16a2d2df..46aa8dcb3 100644 --- a/src/vdr/post_vdr.h +++ b/src/vdr/post_vdr.h @@ -62,19 +62,9 @@ inline static int vdr_is_vdr_stream(xine_stream_t *stream) return 0; } - { - input_class_t *input_class = stream->input_plugin->input_class; - - if (input_class->get_identifier) - { - const char *identifier = input_class->get_identifier(input_class); - if (identifier - && 0 == strcmp(identifier, "VDR")) - { - return 1; - } - } - } + if (stream->input_plugin->input_class->identifier && + strcmp(stream->input_plugin->input_class->identifier, "VDR")) + return 1; return 0; } diff --git a/src/vdr/post_vdr_audio.c b/src/vdr/post_vdr_audio.c index 9248e9c45..6ebefd70e 100644 --- a/src/vdr/post_vdr_audio.c +++ b/src/vdr/post_vdr_audio.c @@ -58,8 +58,6 @@ static void vdr_audio_select_audio(vdr_audio_post_plugin_t *this, uint8_t channe static post_plugin_t *vdr_audio_open_plugin(post_class_t *class_gen, int inputs, xine_audio_port_t **audio_target, xine_video_port_t **video_target); -static char *vdr_audio_get_identifier(post_class_t *class_gen); -static char *vdr_audio_get_description(post_class_t *class_gen); static void vdr_audio_class_dispose(post_class_t *class_gen); /* plugin instance functions */ @@ -80,8 +78,8 @@ void *vdr_audio_init_plugin(xine_t *xine, void *data) return NULL; class->open_plugin = vdr_audio_open_plugin; - class->get_identifier = vdr_audio_get_identifier; - class->get_description = vdr_audio_get_description; + class->identifier = "vdr_audio"; + class->description = _("modifies every audio frame as requested by VDR"); class->dispose = vdr_audio_class_dispose; return class; @@ -120,16 +118,6 @@ fprintf(stderr, "~~~~~~~~~~ vdr open plugin\n"); return &this->post_plugin; } -static char *vdr_audio_get_identifier(post_class_t *class_gen) -{ - return "vdr_audio"; -} - -static char *vdr_audio_get_description(post_class_t *class_gen) -{ - return "modifies every audio frame as requested by VDR"; -} - static void vdr_audio_class_dispose(post_class_t *class_gen) { free(class_gen); diff --git a/src/vdr/post_vdr_video.c b/src/vdr/post_vdr_video.c index 85536819a..ae02c31e0 100644 --- a/src/vdr/post_vdr_video.c +++ b/src/vdr/post_vdr_video.c @@ -81,8 +81,6 @@ static void vdr_video_set_video_window(vdr_video_post_plugin_t *this, int32_t x, static post_plugin_t *vdr_video_open_plugin(post_class_t *class_gen, int inputs, xine_audio_port_t **audio_target, xine_video_port_t **video_target); -static char *vdr_video_get_identifier(post_class_t *class_gen); -static char *vdr_video_get_description(post_class_t *class_gen); static void vdr_video_class_dispose(post_class_t *class_gen); /* plugin instance functions */ @@ -103,8 +101,8 @@ void *vdr_video_init_plugin(xine_t *xine, void *data) return NULL; class->open_plugin = vdr_video_open_plugin; - class->get_identifier = vdr_video_get_identifier; - class->get_description = vdr_video_get_description; + class->identifier = "vdr"; + class->description = _("modifies every video frame as requested by VDR"); class->dispose = vdr_video_class_dispose; return class; @@ -146,16 +144,6 @@ static post_plugin_t *vdr_video_open_plugin(post_class_t *class_gen, int inputs, return &this->post_plugin; } -static char *vdr_video_get_identifier(post_class_t *class_gen) -{ - return "vdr"; -} - -static char *vdr_video_get_description(post_class_t *class_gen) -{ - return "modifies every video frame as requested by VDR"; -} - static void vdr_video_class_dispose(post_class_t *class_gen) { free(class_gen); -- cgit v1.2.3 From e2a10c5fdaed1f45040fb3d737ab79f0e5d774d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Diego=20=27Flameeyes=27=20Petten=C3=B2?= Date: Tue, 11 Dec 2007 14:12:35 +0100 Subject: Use N_() rather than _(), passing the string just once to gettext(). This way the gettext code for description does not need to be repeated by every plugin. --- src/vdr/input_vdr.c | 2 +- src/vdr/post_vdr_audio.c | 2 +- src/vdr/post_vdr_video.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'src/vdr') diff --git a/src/vdr/input_vdr.c b/src/vdr/input_vdr.c index 9a1ec0f8e..6a49eafce 100644 --- a/src/vdr/input_vdr.c +++ b/src/vdr/input_vdr.c @@ -2659,7 +2659,7 @@ static void *init_class(xine_t *xine, void *data) this->input_class.get_instance = vdr_class_get_instance; this->input_class.identifier = "VDR"; - this->input_class.description = _("VDR display device plugin"); + this->input_class.description = N_("VDR display device plugin"); this->input_class.get_dir = NULL; this->input_class.get_autoplay_list = vdr_class_get_autoplay_list; this->input_class.dispose = vdr_class_dispose; diff --git a/src/vdr/post_vdr_audio.c b/src/vdr/post_vdr_audio.c index 6ebefd70e..398f86f46 100644 --- a/src/vdr/post_vdr_audio.c +++ b/src/vdr/post_vdr_audio.c @@ -79,7 +79,7 @@ void *vdr_audio_init_plugin(xine_t *xine, void *data) class->open_plugin = vdr_audio_open_plugin; class->identifier = "vdr_audio"; - class->description = _("modifies every audio frame as requested by VDR"); + class->description = N_("modifies every audio frame as requested by VDR"); class->dispose = vdr_audio_class_dispose; return class; diff --git a/src/vdr/post_vdr_video.c b/src/vdr/post_vdr_video.c index ae02c31e0..0b1544ae4 100644 --- a/src/vdr/post_vdr_video.c +++ b/src/vdr/post_vdr_video.c @@ -102,7 +102,7 @@ void *vdr_video_init_plugin(xine_t *xine, void *data) class->open_plugin = vdr_video_open_plugin; class->identifier = "vdr"; - class->description = _("modifies every video frame as requested by VDR"); + class->description = N_("modifies every video frame as requested by VDR"); class->dispose = vdr_video_class_dispose; return class; -- cgit v1.2.3 From 32a70cef7fdce1648d6850dafbe78bee04830429 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Diego=20=27Flameeyes=27=20Petten=C3=B2?= Date: Tue, 11 Dec 2007 15:40:37 +0100 Subject: Use default_*_class_dispose macro whenever the class dispose function only called free(). --- src/vdr/input_vdr.c | 10 +--------- src/vdr/post_vdr_audio.c | 9 +-------- src/vdr/post_vdr_video.c | 9 +-------- 3 files changed, 3 insertions(+), 25 deletions(-) (limited to 'src/vdr') diff --git a/src/vdr/input_vdr.c b/src/vdr/input_vdr.c index 6a49eafce..c07ae2d18 100644 --- a/src/vdr/input_vdr.c +++ b/src/vdr/input_vdr.c @@ -2627,14 +2627,6 @@ static input_plugin_t *vdr_class_get_instance(input_class_t *cls_gen, xine_strea /* * vdr input plugin class stuff */ - -static void vdr_class_dispose (input_class_t *this_gen) -{ - vdr_input_class_t *this = (vdr_input_class_t *)this_gen; - - free(this); -} - static char **vdr_class_get_autoplay_list(input_class_t *this_gen, int *num_files) { @@ -2662,7 +2654,7 @@ static void *init_class(xine_t *xine, void *data) this->input_class.description = N_("VDR display device plugin"); this->input_class.get_dir = NULL; this->input_class.get_autoplay_list = vdr_class_get_autoplay_list; - this->input_class.dispose = vdr_class_dispose; + this->input_class.dispose = default_input_class_dispose; this->input_class.eject_media = NULL; return this; diff --git a/src/vdr/post_vdr_audio.c b/src/vdr/post_vdr_audio.c index 398f86f46..96fa84fb5 100644 --- a/src/vdr/post_vdr_audio.c +++ b/src/vdr/post_vdr_audio.c @@ -58,7 +58,6 @@ static void vdr_audio_select_audio(vdr_audio_post_plugin_t *this, uint8_t channe static post_plugin_t *vdr_audio_open_plugin(post_class_t *class_gen, int inputs, xine_audio_port_t **audio_target, xine_video_port_t **video_target); -static void vdr_audio_class_dispose(post_class_t *class_gen); /* plugin instance functions */ static void vdr_audio_dispose(post_plugin_t *this_gen); @@ -80,7 +79,7 @@ void *vdr_audio_init_plugin(xine_t *xine, void *data) class->open_plugin = vdr_audio_open_plugin; class->identifier = "vdr_audio"; class->description = N_("modifies every audio frame as requested by VDR"); - class->dispose = vdr_audio_class_dispose; + class->dispose = default_post_class_dispose; return class; } @@ -118,12 +117,6 @@ fprintf(stderr, "~~~~~~~~~~ vdr open plugin\n"); return &this->post_plugin; } -static void vdr_audio_class_dispose(post_class_t *class_gen) -{ - free(class_gen); -} - - static void vdr_audio_dispose(post_plugin_t *this_gen) { /* diff --git a/src/vdr/post_vdr_video.c b/src/vdr/post_vdr_video.c index 0b1544ae4..ed0eafc35 100644 --- a/src/vdr/post_vdr_video.c +++ b/src/vdr/post_vdr_video.c @@ -81,7 +81,6 @@ static void vdr_video_set_video_window(vdr_video_post_plugin_t *this, int32_t x, static post_plugin_t *vdr_video_open_plugin(post_class_t *class_gen, int inputs, xine_audio_port_t **audio_target, xine_video_port_t **video_target); -static void vdr_video_class_dispose(post_class_t *class_gen); /* plugin instance functions */ static void vdr_video_dispose(post_plugin_t *this_gen); @@ -103,7 +102,7 @@ void *vdr_video_init_plugin(xine_t *xine, void *data) class->open_plugin = vdr_video_open_plugin; class->identifier = "vdr"; class->description = N_("modifies every video frame as requested by VDR"); - class->dispose = vdr_video_class_dispose; + class->dispose = default_post_class_dispose; return class; } @@ -144,12 +143,6 @@ static post_plugin_t *vdr_video_open_plugin(post_class_t *class_gen, int inputs, return &this->post_plugin; } -static void vdr_video_class_dispose(post_class_t *class_gen) -{ - free(class_gen); -} - - static void vdr_video_dispose(post_plugin_t *this_gen) { if (_x_post_dispose(this_gen)) -- cgit v1.2.3 From b803c2268c144475f4037677b2eea20f364e35b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Diego=20=27Flameeyes=27=20Petten=C3=B2?= Date: Tue, 11 Dec 2007 18:07:02 +0100 Subject: Bump the input plugins interface version to 18 as they got updated. --- src/vdr/input_vdr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/vdr') diff --git a/src/vdr/input_vdr.c b/src/vdr/input_vdr.c index c07ae2d18..946e963a3 100644 --- a/src/vdr/input_vdr.c +++ b/src/vdr/input_vdr.c @@ -2667,7 +2667,7 @@ static void *init_class(xine_t *xine, void *data) const plugin_info_t xine_plugin_info[] EXPORTED = { /* type, API, "name", version, special_info, init_function */ - { PLUGIN_INPUT, 17, "VDR", XINE_VERSION_CODE, NULL, init_class }, + { PLUGIN_INPUT, 18, "VDR", XINE_VERSION_CODE, NULL, init_class }, { PLUGIN_NONE, 0, "", 0, NULL, NULL } }; -- cgit v1.2.3