From 8837a03dc8f5127d71c2a5640bb4cd7c9fe4242c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Diego=20=27Flameeyes=27=20Petten=C3=B2?= Date: Tue, 11 Dec 2007 12:26:40 +0100 Subject: Update all input plugins to the new identifier/description interface. --- src/input/input_v4l.c | 20 ++++---------------- 1 file changed, 4 insertions(+), 16 deletions(-) (limited to 'src/input/input_v4l.c') diff --git a/src/input/input_v4l.c b/src/input/input_v4l.c index b9ac7296a..f698f8772 100644 --- a/src/input/input_v4l.c +++ b/src/input/input_v4l.c @@ -1901,18 +1901,6 @@ static input_plugin_t *v4l_class_get_radio_instance (input_class_t *cls_gen, * v4l input plugin class stuff */ -static char *v4l_class_get_video_description (input_class_t *this_gen) { - return _("v4l tv input plugin"); -} - -static char *v4l_class_get_radio_description (input_class_t *this_gen) { - return _("v4l radio input plugin"); -} - -static const char *v4l_class_get_identifier (input_class_t *this_gen) { - return "v4l"; -} - static void v4l_class_dispose (input_class_t *this_gen) { v4l_input_class_t *this = (v4l_input_class_t *) this_gen; @@ -1929,8 +1917,8 @@ static void *init_video_class (xine_t *xine, void *data) this->xine = xine; this->input_class.get_instance = v4l_class_get_video_instance; - this->input_class.get_identifier = v4l_class_get_identifier; - this->input_class.get_description = v4l_class_get_video_description; + this->input_class.identifier = "v4l"; + this->input_class.description = _("v4l tv input plugin"); this->input_class.get_dir = NULL; this->input_class.get_autoplay_list = NULL; this->input_class.dispose = v4l_class_dispose; @@ -1961,8 +1949,8 @@ static void *init_radio_class (xine_t *xine, void *data) this->xine = xine; this->input_class.get_instance = v4l_class_get_radio_instance; - this->input_class.get_identifier = v4l_class_get_identifier; - this->input_class.get_description = v4l_class_get_radio_description; + this->input_class.identifier = "v4l"; + this->input_class.description = _("v4l radio input plugin"); this->input_class.get_dir = NULL; this->input_class.get_autoplay_list = NULL; this->input_class.dispose = v4l_class_dispose; -- 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/input/input_v4l.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/input/input_v4l.c') diff --git a/src/input/input_v4l.c b/src/input/input_v4l.c index f698f8772..7ed5c172b 100644 --- a/src/input/input_v4l.c +++ b/src/input/input_v4l.c @@ -1918,7 +1918,7 @@ static void *init_video_class (xine_t *xine, void *data) this->input_class.get_instance = v4l_class_get_video_instance; this->input_class.identifier = "v4l"; - this->input_class.description = _("v4l tv input plugin"); + this->input_class.description = N_("v4l tv input plugin"); this->input_class.get_dir = NULL; this->input_class.get_autoplay_list = NULL; this->input_class.dispose = v4l_class_dispose; @@ -1950,7 +1950,7 @@ static void *init_radio_class (xine_t *xine, void *data) this->input_class.get_instance = v4l_class_get_radio_instance; this->input_class.identifier = "v4l"; - this->input_class.description = _("v4l radio input plugin"); + this->input_class.description = N_("v4l radio input plugin"); this->input_class.get_dir = NULL; this->input_class.get_autoplay_list = NULL; this->input_class.dispose = v4l_class_dispose; -- 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/input/input_v4l.c | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) (limited to 'src/input/input_v4l.c') diff --git a/src/input/input_v4l.c b/src/input/input_v4l.c index 7ed5c172b..6b2349dd2 100644 --- a/src/input/input_v4l.c +++ b/src/input/input_v4l.c @@ -1900,13 +1900,6 @@ static input_plugin_t *v4l_class_get_radio_instance (input_class_t *cls_gen, /* * v4l input plugin class stuff */ - -static void v4l_class_dispose (input_class_t *this_gen) { - v4l_input_class_t *this = (v4l_input_class_t *) this_gen; - - free (this); -} - static void *init_video_class (xine_t *xine, void *data) { v4l_input_class_t *this; @@ -1921,7 +1914,7 @@ static void *init_video_class (xine_t *xine, void *data) this->input_class.description = N_("v4l tv input plugin"); this->input_class.get_dir = NULL; this->input_class.get_autoplay_list = NULL; - this->input_class.dispose = v4l_class_dispose; + this->input_class.dispose = default_input_class_dispose; this->input_class.eject_media = NULL; config->register_filename (config, "media.video4linux.video_device", @@ -1953,7 +1946,7 @@ static void *init_radio_class (xine_t *xine, void *data) this->input_class.description = N_("v4l radio input plugin"); this->input_class.get_dir = NULL; this->input_class.get_autoplay_list = NULL; - this->input_class.dispose = v4l_class_dispose; + this->input_class.dispose = default_input_class_dispose; this->input_class.eject_media = NULL; config->register_filename (config, "media.video4linux.radio_device", -- 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/input/input_v4l.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/input/input_v4l.c') diff --git a/src/input/input_v4l.c b/src/input/input_v4l.c index 6b2349dd2..ff9ea87d0 100644 --- a/src/input/input_v4l.c +++ b/src/input/input_v4l.c @@ -1964,8 +1964,8 @@ static void *init_radio_class (xine_t *xine, void *data) const plugin_info_t xine_plugin_info[] EXPORTED = { /* type, API, "name", version, special_info, init_function */ - { PLUGIN_INPUT | PLUGIN_MUST_PRELOAD, 17, "v4l_radio", XINE_VERSION_CODE, NULL, init_radio_class }, - { PLUGIN_INPUT | PLUGIN_MUST_PRELOAD, 17, "v4l_tv", XINE_VERSION_CODE, NULL, init_video_class }, + { PLUGIN_INPUT | PLUGIN_MUST_PRELOAD, 18, "v4l_radio", XINE_VERSION_CODE, NULL, init_radio_class }, + { PLUGIN_INPUT | PLUGIN_MUST_PRELOAD, 18, "v4l_tv", XINE_VERSION_CODE, NULL, init_video_class }, { PLUGIN_NONE, 0, "", 0, NULL, NULL } }; -- cgit v1.2.3