summaryrefslogtreecommitdiff
path: root/src/video_out/video_out_xcbshm.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/video_out/video_out_xcbshm.c')
-rw-r--r--src/video_out/video_out_xcbshm.c66
1 files changed, 27 insertions, 39 deletions
diff --git a/src/video_out/video_out_xcbshm.c b/src/video_out/video_out_xcbshm.c
index 2ac579555..bb19058f5 100644
--- a/src/video_out/video_out_xcbshm.c
+++ b/src/video_out/video_out_xcbshm.c
@@ -37,7 +37,7 @@
#include <math.h>
#include "xine.h"
-#include "video_out.h"
+#include <xine/video_out.h>
#include <errno.h>
@@ -56,10 +56,10 @@
#define LOG
*/
-#include "xine_internal.h"
+#include <xine/xine_internal.h>
#include "yuv2rgb.h"
-#include "xineutils.h"
-#include "vo_scale.h"
+#include <xine/xineutils.h>
+#include <xine/vo_scale.h>
#include "xcbosd.h"
typedef struct {
@@ -147,8 +147,9 @@ static void create_ximage(xshm_driver_t *this, xshm_frame_t *frame, int width, i
if (shmid < 0) {
xprintf(this->xine, XINE_VERBOSITY_LOG,
- _("video_out_xcbshm: %s: allocating image\n"
- "video_out_xcbshm: => not using MIT Shared Memory extension.\n"), strerror(errno));
+ _("%s: %s: allocating image\n"), LOG_MODULE, strerror(errno));
+ xprintf(this->xine, XINE_VERBOSITY_LOG,
+ _("%s: => not using MIT Shared Memory extension.\n"), LOG_MODULE);
goto shm_fail1;
}
@@ -156,8 +157,9 @@ static void create_ximage(xshm_driver_t *this, xshm_frame_t *frame, int width, i
if (frame->image == ((void *) -1)) {
xprintf(this->xine, XINE_VERBOSITY_LOG,
- _("video_out_xcbshm: shared memory error (address error) when allocating image \n"
- "video_out_xcbshm: => not using MIT Shared Memory extension.\n"));
+ _("%s: shared memory error (address error) when allocating image \n"), LOG_MODULE);
+ xprintf(this->xine, XINE_VERBOSITY_LOG,
+ _("%s: => not using MIT Shared Memory extension.\n"), LOG_MODULE);
goto shm_fail2;
}
@@ -167,8 +169,9 @@ static void create_ximage(xshm_driver_t *this, xshm_frame_t *frame, int width, i
if (generic_error != NULL) {
xprintf(this->xine, XINE_VERBOSITY_LOG,
- _("video_out_xcbshm: x11 error during shared memory XImage creation\n"
- "video_out_xcbshm: => not using MIT Shared Memory extension.\n"));
+ _("%s: x11 error during shared memory XImage creation\n"), LOG_MODULE);
+ xprintf(this->xine, XINE_VERBOSITY_LOG,
+ _("%s: => not using MIT Shared Memory extension.\n"), LOG_MODULE);
free(generic_error);
goto shm_fail3;
}
@@ -737,7 +740,7 @@ static int xshm_get_property (vo_driver_t *this_gen, int property) {
return this->cur_frame->sc.output_yoffset;
default:
xprintf(this->xine, XINE_VERBOSITY_DEBUG,
- "video_out_xcbshm: tried to get unsupported property %d\n", property);
+ LOG_MODULE ": tried to get unsupported property %d\n", property);
}
return 0;
@@ -753,7 +756,7 @@ static int xshm_set_property (vo_driver_t *this_gen,
value = XINE_VO_ASPECT_AUTO;
this->sc.user_ratio = value;
xprintf(this->xine, XINE_VERBOSITY_DEBUG,
- "video_out_xcbshm: aspect ratio changed to %s\n", _x_vo_scale_aspect_ratio_name(value));
+ LOG_MODULE ": aspect ratio changed to %s\n", _x_vo_scale_aspect_ratio_name_table[value]);
} else if (property == VO_PROP_BRIGHTNESS) {
@@ -787,7 +790,7 @@ static int xshm_set_property (vo_driver_t *this_gen,
} else {
xprintf (this->xine, XINE_VERBOSITY_DEBUG,
- "video_out_xcbshm: tried to set unsupported property %d\n", property);
+ LOG_MODULE ": tried to set unsupported property %d\n", property);
}
return value;
@@ -963,7 +966,7 @@ static int ImlibPaletteLUTGet(xshm_driver_t *this) {
char *retval = xcb_get_property_value(prop_reply);
j = 1 + retval[0]*4;
- this->yuv2rgb_cmap = malloc(sizeof(uint8_t) * 32 * 32 * 32);
+ this->yuv2rgb_cmap = xine_xcalloc(sizeof(uint8_t), 32 * 32 * 32);
for (i = 0; i < 32 * 32 * 32 && j < num_ret; i++)
this->yuv2rgb_cmap[i] = retval[1+4*retval[j++]+3];
@@ -975,8 +978,8 @@ static int ImlibPaletteLUTGet(xshm_driver_t *this) {
return 0;
}
-
-static char *visual_class_name(xcb_visualtype_t *visual) {
+/* TODO replace this with a string table. */
+static const char *visual_class_name(xcb_visualtype_t *visual) {
switch (visual->_class) {
case XCB_VISUAL_CLASS_STATIC_GRAY:
@@ -1111,7 +1114,7 @@ static vo_driver_t *xshm_open_plugin(video_driver_class_t *class_gen, const void
}
else {
xprintf(this->xine, XINE_VERBOSITY_LOG,
- _("video_out_xcbshm: MIT shared memory extension not present on display.\n"));
+ _("%s: MIT shared memory extension not present on display.\n"), LOG_MODULE);
this->use_shm = 0;
}
@@ -1149,8 +1152,8 @@ static vo_driver_t *xshm_open_plugin(video_driver_class_t *class_gen, const void
swapped = cpu_byte_order != image_byte_order;
xprintf(this->xine, XINE_VERBOSITY_DEBUG,
- "video_out_xcbshm: video mode depth is %d (%d bpp), %s, %sswapped,\n"
- "\tred: %08x, green: %08x, blue: %08x\n",
+ LOG_MODULE ": video mode depth is %d (%d bpp), %s, %sswapped,\n"
+ LOG_MODULE ": red: %08x, green: %08x, blue: %08x\n",
this->depth, this->bpp,
visual_class_name(visualtype),
swapped ? "" : "not ",
@@ -1210,7 +1213,7 @@ static vo_driver_t *xshm_open_plugin(video_driver_class_t *class_gen, const void
if (!mode) {
xprintf (this->xine, XINE_VERBOSITY_LOG,
- _("video_out_xcbshm: your video mode was not recognized, sorry :-(\n"));
+ _("%s: your video mode was not recognized, sorry :-(\n"), LOG_MODULE);
return NULL;
}
@@ -1234,28 +1237,13 @@ static vo_driver_t *xshm_open_plugin(video_driver_class_t *class_gen, const void
/*
* class functions
*/
-
-static char* xshm_get_identifier (video_driver_class_t *this_gen) {
- return "XShm";
-}
-
-static char* xshm_get_description (video_driver_class_t *this_gen) {
- return _("xine video output plugin using the MIT X shared memory extension");
-}
-
-static void xshm_dispose_class (video_driver_class_t *this_gen) {
- xshm_class_t *this = (xshm_class_t *) this_gen;
-
- free (this);
-}
-
static void *xshm_init_class (xine_t *xine, void *visual_gen) {
xshm_class_t *this = (xshm_class_t *) xine_xmalloc (sizeof (xshm_class_t));
this->driver_class.open_plugin = xshm_open_plugin;
- this->driver_class.get_identifier = xshm_get_identifier;
- this->driver_class.get_description = xshm_get_description;
- this->driver_class.dispose = xshm_dispose_class;
+ this->driver_class.identifier = "XShm";
+ this->driver_class.description = N_("xine video output plugin using the MIT X shared memory extension");
+ this->driver_class.dispose = default_video_driver_class_dispose;
this->config = xine->config;
this->xine = xine;
@@ -1275,6 +1263,6 @@ static const vo_info_t vo_info_xshm = {
const plugin_info_t xine_plugin_info[] EXPORTED = {
/* type, API, "name", version, special_info, init_function */
- { PLUGIN_VIDEO_OUT, 21, "xshm", XINE_VERSION_CODE, &vo_info_xshm, xshm_init_class },
+ { PLUGIN_VIDEO_OUT, 22, "xshm", XINE_VERSION_CODE, &vo_info_xshm, xshm_init_class },
{ PLUGIN_NONE, 0, "", 0, NULL, NULL }
};