From 982dbe6dcd3e119227e453f368e6b5ecaac35f20 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Diego=20=27Flameeyes=27=20Petten=C3=B2?= Date: Tue, 11 Dec 2007 13:20:42 +0100 Subject: Update all video decoder plugins to the new identifier/description interface. Add _() where missing, for i18n. --- src/libxinevdec/bitplane.c | 12 ++---------- src/libxinevdec/foovideo.c | 20 ++------------------ src/libxinevdec/gdkpixbuf.c | 12 ++---------- src/libxinevdec/image.c | 12 ++---------- src/libxinevdec/rgb.c | 12 ++---------- src/libxinevdec/yuv.c | 12 ++---------- 6 files changed, 12 insertions(+), 68 deletions(-) (limited to 'src/libxinevdec') diff --git a/src/libxinevdec/bitplane.c b/src/libxinevdec/bitplane.c index b6940813f..1c7f387c6 100644 --- a/src/libxinevdec/bitplane.c +++ b/src/libxinevdec/bitplane.c @@ -1544,14 +1544,6 @@ static video_decoder_t *open_plugin (video_decoder_class_t *class_gen, xine_stre return &this->video_decoder; } -static char *get_identifier (video_decoder_class_t *this) { - return "bitplane"; -} - -static char *get_description (video_decoder_class_t *this) { - return "Raw bitplane video decoder plugin"; -} - static void dispose_class (video_decoder_class_t *this) { free (this); } @@ -1561,8 +1553,8 @@ static void *init_plugin (xine_t *xine, void *data) { bitplane_class_t *this = (bitplane_class_t *) xine_xmalloc (sizeof (bitplane_class_t)); this->decoder_class.open_plugin = open_plugin; - this->decoder_class.get_identifier = get_identifier; - this->decoder_class.get_description = get_description; + this->decoder_class.identifier = "bitplane"; + this->decoder_class.description = _("Raw bitplane video decoder plugin"); this->decoder_class.dispose = dispose_class; return this; diff --git a/src/libxinevdec/foovideo.c b/src/libxinevdec/foovideo.c index 98e0ebc0b..dfcb8630d 100644 --- a/src/libxinevdec/foovideo.c +++ b/src/libxinevdec/foovideo.c @@ -224,22 +224,6 @@ static video_decoder_t *open_plugin (video_decoder_class_t *class_gen, xine_stre return &this->video_decoder; } -/* - * This function returns a brief string that describes (usually with the - * decoder's most basic name) the video decoder plugin. - */ -static char *get_identifier (video_decoder_class_t *this) { - return "foovideo"; -} - -/* - * This function returns a slightly longer string describing the video - * decoder plugin. - */ -static char *get_description (video_decoder_class_t *this) { - return "foovideo: reference xine video decoder plugin"; -} - /* * This function frees the video decoder class and any other memory that was * allocated. @@ -259,8 +243,8 @@ static void *init_plugin (xine_t *xine, void *data) { this = (foovideo_class_t *) xine_xmalloc (sizeof (foovideo_class_t)); this->decoder_class.open_plugin = open_plugin; - this->decoder_class.get_identifier = get_identifier; - this->decoder_class.get_description = get_description; + this->decoder_class.identifier = "foovideo"; + this->decoder_class.description = _("foovideo: reference xine video decoder plugin"); this->decoder_class.dispose = dispose_class; return this; diff --git a/src/libxinevdec/gdkpixbuf.c b/src/libxinevdec/gdkpixbuf.c index b5acdfa42..bbd66f42f 100644 --- a/src/libxinevdec/gdkpixbuf.c +++ b/src/libxinevdec/gdkpixbuf.c @@ -257,14 +257,6 @@ static video_decoder_t *open_plugin (video_decoder_class_t *class_gen, * image plugin class */ -static char *get_identifier (video_decoder_class_t *this) { - return "gdkpixbuf"; -} - -static char *get_description (video_decoder_class_t *this) { - return "gdk-pixbuf image video decoder plugin"; -} - static void dispose_class (video_decoder_class_t *this_gen) { image_class_t *this = (image_class_t *) this_gen; @@ -280,8 +272,8 @@ static void *init_class (xine_t *xine, void *data) { this = (image_class_t *) xine_xmalloc (sizeof (image_class_t)); this->decoder_class.open_plugin = open_plugin; - this->decoder_class.get_identifier = get_identifier; - this->decoder_class.get_description = get_description; + this->decoder_class.identifier = "gdkpixbuf"; + this->decoder_class.description = _("gdk-pixbuf image video decoder plugin"); this->decoder_class.dispose = dispose_class; /* diff --git a/src/libxinevdec/image.c b/src/libxinevdec/image.c index a338e3cab..2807fc5d6 100644 --- a/src/libxinevdec/image.c +++ b/src/libxinevdec/image.c @@ -235,14 +235,6 @@ static video_decoder_t *open_plugin (video_decoder_class_t *class_gen, * image plugin class */ -static char *get_identifier (video_decoder_class_t *this) { - return "imagevdec"; -} - -static char *get_description (video_decoder_class_t *this) { - return "image video decoder plugin"; -} - static void dispose_class (video_decoder_class_t *this_gen) { image_class_t *this = (image_class_t *) this_gen; @@ -258,8 +250,8 @@ static void *init_class (xine_t *xine, void *data) { this = (image_class_t *) xine_xmalloc (sizeof (image_class_t)); this->decoder_class.open_plugin = open_plugin; - this->decoder_class.get_identifier = get_identifier; - this->decoder_class.get_description = get_description; + this->decoder_class.identifier = "imagevdec"; + this->decoder_class.description = _("image video decoder plugin"); this->decoder_class.dispose = dispose_class; /* diff --git a/src/libxinevdec/rgb.c b/src/libxinevdec/rgb.c index 0e7be4c18..54adeeec1 100644 --- a/src/libxinevdec/rgb.c +++ b/src/libxinevdec/rgb.c @@ -416,14 +416,6 @@ static video_decoder_t *open_plugin (video_decoder_class_t *class_gen, xine_stre return &this->video_decoder; } -static char *get_identifier (video_decoder_class_t *this) { - return "RGB"; -} - -static char *get_description (video_decoder_class_t *this) { - return "Raw RGB video decoder plugin"; -} - static void dispose_class (video_decoder_class_t *this) { free (this); } @@ -435,8 +427,8 @@ static void *init_plugin (xine_t *xine, void *data) { this = (rgb_class_t *) xine_xmalloc (sizeof (rgb_class_t)); this->decoder_class.open_plugin = open_plugin; - this->decoder_class.get_identifier = get_identifier; - this->decoder_class.get_description = get_description; + this->decoder_class.identifier = "RGB"; + this->decoder_class.description = _("Raw RGB video decoder plugin"); this->decoder_class.dispose = dispose_class; return this; diff --git a/src/libxinevdec/yuv.c b/src/libxinevdec/yuv.c index 2b8657685..bcbb4bbe7 100644 --- a/src/libxinevdec/yuv.c +++ b/src/libxinevdec/yuv.c @@ -339,14 +339,6 @@ static video_decoder_t *open_plugin (video_decoder_class_t *class_gen, xine_stre return &this->video_decoder; } -static char *get_identifier (video_decoder_class_t *this) { - return "YUV"; -} - -static char *get_description (video_decoder_class_t *this) { - return "Raw YUV video decoder plugin"; -} - static void dispose_class (video_decoder_class_t *this) { free (this); } @@ -358,8 +350,8 @@ static void *init_plugin (xine_t *xine, void *data) { this = (yuv_class_t *) xine_xmalloc (sizeof (yuv_class_t)); this->decoder_class.open_plugin = open_plugin; - this->decoder_class.get_identifier = get_identifier; - this->decoder_class.get_description = get_description; + this->decoder_class.identifier = "YUV"; + this->decoder_class.description = _("Raw YUV video decoder plugin"); this->decoder_class.dispose = dispose_class; return this; -- 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/libxinevdec/bitplane.c | 2 +- src/libxinevdec/foovideo.c | 2 +- src/libxinevdec/gdkpixbuf.c | 2 +- src/libxinevdec/image.c | 2 +- src/libxinevdec/rgb.c | 2 +- src/libxinevdec/yuv.c | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) (limited to 'src/libxinevdec') diff --git a/src/libxinevdec/bitplane.c b/src/libxinevdec/bitplane.c index 1c7f387c6..a3c314b0b 100644 --- a/src/libxinevdec/bitplane.c +++ b/src/libxinevdec/bitplane.c @@ -1554,7 +1554,7 @@ static void *init_plugin (xine_t *xine, void *data) { this->decoder_class.open_plugin = open_plugin; this->decoder_class.identifier = "bitplane"; - this->decoder_class.description = _("Raw bitplane video decoder plugin"); + this->decoder_class.description = N_("Raw bitplane video decoder plugin"); this->decoder_class.dispose = dispose_class; return this; diff --git a/src/libxinevdec/foovideo.c b/src/libxinevdec/foovideo.c index dfcb8630d..29ad2e11e 100644 --- a/src/libxinevdec/foovideo.c +++ b/src/libxinevdec/foovideo.c @@ -244,7 +244,7 @@ static void *init_plugin (xine_t *xine, void *data) { this->decoder_class.open_plugin = open_plugin; this->decoder_class.identifier = "foovideo"; - this->decoder_class.description = _("foovideo: reference xine video decoder plugin"); + this->decoder_class.description = N_("foovideo: reference xine video decoder plugin"); this->decoder_class.dispose = dispose_class; return this; diff --git a/src/libxinevdec/gdkpixbuf.c b/src/libxinevdec/gdkpixbuf.c index bbd66f42f..1b30489f5 100644 --- a/src/libxinevdec/gdkpixbuf.c +++ b/src/libxinevdec/gdkpixbuf.c @@ -273,7 +273,7 @@ static void *init_class (xine_t *xine, void *data) { this->decoder_class.open_plugin = open_plugin; this->decoder_class.identifier = "gdkpixbuf"; - this->decoder_class.description = _("gdk-pixbuf image video decoder plugin"); + this->decoder_class.description = N_("gdk-pixbuf image video decoder plugin"); this->decoder_class.dispose = dispose_class; /* diff --git a/src/libxinevdec/image.c b/src/libxinevdec/image.c index 2807fc5d6..7fbafe70e 100644 --- a/src/libxinevdec/image.c +++ b/src/libxinevdec/image.c @@ -251,7 +251,7 @@ static void *init_class (xine_t *xine, void *data) { this->decoder_class.open_plugin = open_plugin; this->decoder_class.identifier = "imagevdec"; - this->decoder_class.description = _("image video decoder plugin"); + this->decoder_class.description = N_("image video decoder plugin"); this->decoder_class.dispose = dispose_class; /* diff --git a/src/libxinevdec/rgb.c b/src/libxinevdec/rgb.c index 54adeeec1..490069643 100644 --- a/src/libxinevdec/rgb.c +++ b/src/libxinevdec/rgb.c @@ -428,7 +428,7 @@ static void *init_plugin (xine_t *xine, void *data) { this->decoder_class.open_plugin = open_plugin; this->decoder_class.identifier = "RGB"; - this->decoder_class.description = _("Raw RGB video decoder plugin"); + this->decoder_class.description = N_("Raw RGB video decoder plugin"); this->decoder_class.dispose = dispose_class; return this; diff --git a/src/libxinevdec/yuv.c b/src/libxinevdec/yuv.c index bcbb4bbe7..56f97be5d 100644 --- a/src/libxinevdec/yuv.c +++ b/src/libxinevdec/yuv.c @@ -351,7 +351,7 @@ static void *init_plugin (xine_t *xine, void *data) { this->decoder_class.open_plugin = open_plugin; this->decoder_class.identifier = "YUV"; - this->decoder_class.description = _("Raw YUV video decoder plugin"); + this->decoder_class.description = N_("Raw YUV video decoder plugin"); this->decoder_class.dispose = dispose_class; return this; -- 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/libxinevdec/bitplane.c | 6 +----- src/libxinevdec/gdkpixbuf.c | 11 +---------- src/libxinevdec/image.c | 11 +---------- src/libxinevdec/rgb.c | 6 +----- src/libxinevdec/yuv.c | 6 +----- 5 files changed, 5 insertions(+), 35 deletions(-) (limited to 'src/libxinevdec') diff --git a/src/libxinevdec/bitplane.c b/src/libxinevdec/bitplane.c index a3c314b0b..77cd47db3 100644 --- a/src/libxinevdec/bitplane.c +++ b/src/libxinevdec/bitplane.c @@ -1544,10 +1544,6 @@ static video_decoder_t *open_plugin (video_decoder_class_t *class_gen, xine_stre return &this->video_decoder; } -static void dispose_class (video_decoder_class_t *this) { - free (this); -} - static void *init_plugin (xine_t *xine, void *data) { bitplane_class_t *this = (bitplane_class_t *) xine_xmalloc (sizeof (bitplane_class_t)); @@ -1555,7 +1551,7 @@ static void *init_plugin (xine_t *xine, void *data) { this->decoder_class.open_plugin = open_plugin; this->decoder_class.identifier = "bitplane"; this->decoder_class.description = N_("Raw bitplane video decoder plugin"); - this->decoder_class.dispose = dispose_class; + this->decoder_class.dispose = default_video_decoder_class_dispose; return this; } diff --git a/src/libxinevdec/gdkpixbuf.c b/src/libxinevdec/gdkpixbuf.c index 1b30489f5..1ae0920bd 100644 --- a/src/libxinevdec/gdkpixbuf.c +++ b/src/libxinevdec/gdkpixbuf.c @@ -256,15 +256,6 @@ static video_decoder_t *open_plugin (video_decoder_class_t *class_gen, /* * image plugin class */ - -static void dispose_class (video_decoder_class_t *this_gen) { - image_class_t *this = (image_class_t *) this_gen; - - lprintf("class closed\n"); - - free (this); -} - static void *init_class (xine_t *xine, void *data) { image_class_t *this; @@ -274,7 +265,7 @@ static void *init_class (xine_t *xine, void *data) { this->decoder_class.open_plugin = open_plugin; this->decoder_class.identifier = "gdkpixbuf"; this->decoder_class.description = N_("gdk-pixbuf image video decoder plugin"); - this->decoder_class.dispose = dispose_class; + this->decoder_class.dispose = default_video_decoder_class_dispose; /* * initialisation of privates diff --git a/src/libxinevdec/image.c b/src/libxinevdec/image.c index 7fbafe70e..a73440f9c 100644 --- a/src/libxinevdec/image.c +++ b/src/libxinevdec/image.c @@ -234,15 +234,6 @@ static video_decoder_t *open_plugin (video_decoder_class_t *class_gen, /* * image plugin class */ - -static void dispose_class (video_decoder_class_t *this_gen) { - image_class_t *this = (image_class_t *) this_gen; - - lprintf("class closed\n"); - - free (this); -} - static void *init_class (xine_t *xine, void *data) { image_class_t *this; @@ -252,7 +243,7 @@ static void *init_class (xine_t *xine, void *data) { this->decoder_class.open_plugin = open_plugin; this->decoder_class.identifier = "imagevdec"; this->decoder_class.description = N_("image video decoder plugin"); - this->decoder_class.dispose = dispose_class; + this->decoder_class.dispose = default_video_decoder_class_dispose; /* * initialisation of privates diff --git a/src/libxinevdec/rgb.c b/src/libxinevdec/rgb.c index 490069643..85307b155 100644 --- a/src/libxinevdec/rgb.c +++ b/src/libxinevdec/rgb.c @@ -416,10 +416,6 @@ static video_decoder_t *open_plugin (video_decoder_class_t *class_gen, xine_stre return &this->video_decoder; } -static void dispose_class (video_decoder_class_t *this) { - free (this); -} - static void *init_plugin (xine_t *xine, void *data) { rgb_class_t *this; @@ -429,7 +425,7 @@ static void *init_plugin (xine_t *xine, void *data) { this->decoder_class.open_plugin = open_plugin; this->decoder_class.identifier = "RGB"; this->decoder_class.description = N_("Raw RGB video decoder plugin"); - this->decoder_class.dispose = dispose_class; + this->decoder_class.dispose = default_video_decoder_class_dispose; return this; } diff --git a/src/libxinevdec/yuv.c b/src/libxinevdec/yuv.c index 56f97be5d..fea2ca4af 100644 --- a/src/libxinevdec/yuv.c +++ b/src/libxinevdec/yuv.c @@ -339,10 +339,6 @@ static video_decoder_t *open_plugin (video_decoder_class_t *class_gen, xine_stre return &this->video_decoder; } -static void dispose_class (video_decoder_class_t *this) { - free (this); -} - static void *init_plugin (xine_t *xine, void *data) { yuv_class_t *this; @@ -352,7 +348,7 @@ static void *init_plugin (xine_t *xine, void *data) { this->decoder_class.open_plugin = open_plugin; this->decoder_class.identifier = "YUV"; this->decoder_class.description = N_("Raw YUV video decoder plugin"); - this->decoder_class.dispose = dispose_class; + this->decoder_class.dispose = default_video_decoder_class_dispose; return this; } -- cgit v1.2.3 From 86af045eabd1e30e41a9750a6d48fa3ed8767df6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Diego=20=27Flameeyes=27=20Petten=C3=B2?= Date: Tue, 11 Dec 2007 18:21:13 +0100 Subject: Bump the interface version for video decoder plugins. --- src/libxinevdec/bitplane.c | 2 +- src/libxinevdec/foovideo.c | 2 +- src/libxinevdec/gdkpixbuf.c | 2 +- src/libxinevdec/image.c | 2 +- src/libxinevdec/rgb.c | 2 +- src/libxinevdec/yuv.c | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) (limited to 'src/libxinevdec') diff --git a/src/libxinevdec/bitplane.c b/src/libxinevdec/bitplane.c index 08bdb4c22..c8400f464 100644 --- a/src/libxinevdec/bitplane.c +++ b/src/libxinevdec/bitplane.c @@ -1549,6 +1549,6 @@ static const decoder_info_t dec_info_video = { const plugin_info_t xine_plugin_info[] EXPORTED = { /* type, API, "name", version, special_info, init_function */ - { PLUGIN_VIDEO_DECODER, 18, "bitplane", XINE_VERSION_CODE, &dec_info_video, init_plugin }, + { PLUGIN_VIDEO_DECODER, 19, "bitplane", XINE_VERSION_CODE, &dec_info_video, init_plugin }, { PLUGIN_NONE, 0, "", 0, NULL, NULL } }; diff --git a/src/libxinevdec/foovideo.c b/src/libxinevdec/foovideo.c index 1dc6fa137..b33705a3f 100644 --- a/src/libxinevdec/foovideo.c +++ b/src/libxinevdec/foovideo.c @@ -276,6 +276,6 @@ static const decoder_info_t dec_info_video = { */ const plugin_info_t xine_plugin_info[] EXPORTED = { /* { type, API, "name", version, special_info, init_function } */ - { PLUGIN_VIDEO_DECODER, 18, "foovideo", XINE_VERSION_CODE, &dec_info_video, init_plugin }, + { PLUGIN_VIDEO_DECODER, 19, "foovideo", XINE_VERSION_CODE, &dec_info_video, init_plugin }, { PLUGIN_NONE, 0, "", 0, NULL, NULL } }; diff --git a/src/libxinevdec/gdkpixbuf.c b/src/libxinevdec/gdkpixbuf.c index 1ae0920bd..7fd4a6a0e 100644 --- a/src/libxinevdec/gdkpixbuf.c +++ b/src/libxinevdec/gdkpixbuf.c @@ -289,6 +289,6 @@ static const decoder_info_t dec_info_image = { const plugin_info_t xine_plugin_info[] EXPORTED = { /* type, API, "name", version, special_info, init_function */ - { PLUGIN_VIDEO_DECODER, 18, "gdkpixbuf", XINE_VERSION_CODE, &dec_info_image, init_class }, + { PLUGIN_VIDEO_DECODER, 19, "gdkpixbuf", XINE_VERSION_CODE, &dec_info_image, init_class }, { PLUGIN_NONE, 0, "", 0, NULL, NULL } }; diff --git a/src/libxinevdec/image.c b/src/libxinevdec/image.c index a73440f9c..7a97972c7 100644 --- a/src/libxinevdec/image.c +++ b/src/libxinevdec/image.c @@ -268,6 +268,6 @@ static const decoder_info_t dec_info_image = { const plugin_info_t xine_plugin_info[] EXPORTED = { /* type, API, "name", version, special_info, init_function */ - { PLUGIN_VIDEO_DECODER, 18, "image", XINE_VERSION_CODE, &dec_info_image, init_class }, + { PLUGIN_VIDEO_DECODER, 19, "image", XINE_VERSION_CODE, &dec_info_image, init_class }, { PLUGIN_NONE, 0, "", 0, NULL, NULL } }; diff --git a/src/libxinevdec/rgb.c b/src/libxinevdec/rgb.c index 1cf61febe..5360fd8b2 100644 --- a/src/libxinevdec/rgb.c +++ b/src/libxinevdec/rgb.c @@ -442,6 +442,6 @@ static const decoder_info_t dec_info_video = { const plugin_info_t xine_plugin_info[] EXPORTED = { /* type, API, "name", version, special_info, init_function */ - { PLUGIN_VIDEO_DECODER, 18, "rgb", XINE_VERSION_CODE, &dec_info_video, init_plugin }, + { PLUGIN_VIDEO_DECODER, 19, "rgb", XINE_VERSION_CODE, &dec_info_video, init_plugin }, { PLUGIN_NONE, 0, "", 0, NULL, NULL } }; diff --git a/src/libxinevdec/yuv.c b/src/libxinevdec/yuv.c index b9856379a..352f59e9a 100644 --- a/src/libxinevdec/yuv.c +++ b/src/libxinevdec/yuv.c @@ -368,6 +368,6 @@ static const decoder_info_t dec_info_video = { const plugin_info_t xine_plugin_info[] EXPORTED = { /* type, API, "name", version, special_info, init_function */ - { PLUGIN_VIDEO_DECODER, 18, "yuv", XINE_VERSION_CODE, &dec_info_video, init_plugin }, + { PLUGIN_VIDEO_DECODER, 19, "yuv", XINE_VERSION_CODE, &dec_info_video, init_plugin }, { PLUGIN_NONE, 0, "", 0, NULL, NULL } }; -- cgit v1.2.3