summaryrefslogtreecommitdiffstats
path: root/libvo
diff options
context:
space:
mode:
authorreimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>2006-12-12 19:13:48 +0000
committerreimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>2006-12-12 19:13:48 +0000
commitb333ae1922b83208bd6cd88d15a4517ee7ef441b (patch)
treedbe52a97f358dd00ac3f03c17991caea4a166921 /libvo
parentba288eb9b0db20c58681d36d85f805de455688da (diff)
downloadmpv-b333ae1922b83208bd6cd88d15a4517ee7ef441b.tar.bz2
mpv-b333ae1922b83208bd6cd88d15a4517ee7ef441b.tar.xz
Support for different endianness on client and server with -vo x11
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@21602 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libvo')
-rw-r--r--libvo/vo_x11.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/libvo/vo_x11.c b/libvo/vo_x11.c
index b53751e0fc..c17f1562ae 100644
--- a/libvo/vo_x11.c
+++ b/libvo/vo_x11.c
@@ -85,6 +85,7 @@ static uint32_t image_width;
static uint32_t image_height;
static uint32_t in_format;
static uint32_t out_format = 0;
+static int out_offset;
static int srcW = -1;
static int srcH = -1;
static int aspect; // 1<<16 based fixed point aspect, so that the aspect stays correct during resizing
@@ -552,6 +553,17 @@ static int config(uint32_t width, uint32_t height, uint32_t d_width,
default:
draw_alpha_fnc = draw_alpha_null;
}
+ out_offset = 0;
+ // for these formats conversion is currently not support and
+ // we can easily "emulate" them.
+ if (out_format & 64 && IMGFMT_IS_RGB(out_format) || IMGFMT_IS_BGR(out_format)) {
+ out_format &= ~64;
+#ifdef WORDS_BIGENDIAN
+ out_offset = 1;
+#else
+ out_offset = -1;
+#endif
+ }
/* always allocate swsContext as size could change between frames */
swsContext =
@@ -571,6 +583,7 @@ static int config(uint32_t width, uint32_t height, uint32_t d_width,
static void Display_Image(XImage * myximage, uint8_t * ImageData)
{
+ myximage->data += out_offset;
#ifdef HAVE_SHM
if (Shmem_Flag)
{
@@ -588,6 +601,7 @@ static void Display_Image(XImage * myximage, uint8_t * ImageData)
(vo_dheight - myximage->height) / 2, dst_width,
myximage->height);
}
+ myximage->data -= out_offset;
}
static void draw_osd(void)