diff options
-rw-r--r-- | frontend_svr.c | 6 | ||||
-rw-r--r-- | osd.c | 15 | ||||
-rw-r--r-- | xine_input_vdr.c | 11 | ||||
-rw-r--r-- | xine_osd_command.h | 17 |
4 files changed, 40 insertions, 9 deletions
diff --git a/frontend_svr.c b/frontend_svr.c index 1b0295c2..d4e5fe67 100644 --- a/frontend_svr.c +++ b/frontend_svr.c @@ -4,7 +4,7 @@ * See the main source file 'xineliboutput.c' for copyright information and * how to reach the author. * - * $Id: frontend_svr.c,v 1.50 2008-02-19 02:59:46 phintuka Exp $ + * $Id: frontend_svr.c,v 1.51 2008-03-11 15:57:57 phintuka Exp $ * */ @@ -352,6 +352,10 @@ void cXinelibServer::OsdCmd(void *cmd_gen) cmdnet.datalen = htonl(cmd->datalen); cmdnet.num_rle = htonl(cmd->num_rle); cmdnet.colors = htonl(cmd->colors); + cmdnet.dirty_area.x1 = htons(cmd->dirty_area.x1); + cmdnet.dirty_area.y1 = htons(cmd->dirty_area.y1); + cmdnet.dirty_area.x2 = htons(cmd->dirty_area.x2); + cmdnet.dirty_area.y2 = htons(cmd->dirty_area.y2); if(cmd->data) { cmdnet.raw_data = (uint8_t*)malloc(cmd->datalen); cmdnet.datalen = htonl( recompress_osd_net(cmdnet.raw_data, cmd->data, cmd->num_rle)); @@ -4,7 +4,7 @@ * See the main source file 'xineliboutput.c' for copyright information and * how to reach the author. * - * $Id: osd.c,v 1.15 2008-02-27 00:27:48 phintuka Exp $ + * $Id: osd.c,v 1.16 2008-03-11 15:57:57 phintuka Exp $ * */ @@ -134,7 +134,9 @@ class cXinelibOsd : public cOsd, public cListObject void CmdSize(int Width, int Height); void CmdRle(int Wnd, int X0, int Y0, int W, int H, unsigned char *Data, - int Colors, unsigned int *Palette, int Top); + int Colors, unsigned int *Palette, + osd_rect_t *DirtyArea, + bool Top); void CmdClose(int Wnd); protected: @@ -199,7 +201,9 @@ void cXinelibOsd::CmdClose(int Wnd) void cXinelibOsd::CmdRle(int Wnd, int X0, int Y0, int W, int H, unsigned char *Data, - int Colors, unsigned int *Palette, int Top) + int Colors, unsigned int *Palette, + osd_rect_t *DirtyArea, + bool Top) { TRACEF("cXinelibOsd::CmdRle"); @@ -215,6 +219,8 @@ void cXinelibOsd::CmdRle(int Wnd, int X0, int Y0, osdcmd.y = Y0; osdcmd.w = W; osdcmd.h = H; + if(DirtyArea) + memcpy(&osdcmd.dirty_area, DirtyArea, sizeof(osd_rect_t)); prepare_palette(&clut[0], Palette, Colors, Top, true); osdcmd.colors = Colors; @@ -320,12 +326,13 @@ void cXinelibOsd::Flush(void) /* XXX what if only palette has been changed ? */ int NumColors; const tColor *Colors = Bitmap->Colors(NumColors); + osd_rect_t DirtyArea = {x1:x1, y1:y1, x2:x2, y2:y2}; CmdRle(i, Left() + Bitmap->X0(), Top() + Bitmap->Y0(), Bitmap->Width(), Bitmap->Height(), (unsigned char *)Bitmap->Data(0,0), NumColors, (unsigned int *)Colors, - top); + &DirtyArea, top); SendDone++; } Bitmap->Clean(); diff --git a/xine_input_vdr.c b/xine_input_vdr.c index 4f09204c..3b84539c 100644 --- a/xine_input_vdr.c +++ b/xine_input_vdr.c @@ -4,7 +4,7 @@ * See the main source file 'xineliboutput.c' for copyright information and * how to reach the author. * - * $Id: xine_input_vdr.c,v 1.120 2008-02-27 00:30:43 phintuka Exp $ + * $Id: xine_input_vdr.c,v 1.121 2008-03-11 15:57:57 phintuka Exp $ * */ @@ -2318,7 +2318,10 @@ static int vdr_plugin_exec_osd_command(input_plugin_t *this_gen, } if(!pthread_mutex_lock (&this->osd_lock)) { - palette_rgb_to_yuy(cmd->palette, cmd->colors); + if(!(cmd->flags & OSDFLAG_YUV_CLUT)) + palette_rgb_to_yuy(cmd->palette, cmd->colors); + cmd->flags &= ~OSDFLAG_YUV_CLUT; + video_changed = update_video_size(this); this->class->xine->port_ticket->acquire(this->class->xine->port_ticket, 1); result = exec_osd_command(this, cmd); @@ -3129,6 +3132,10 @@ static int handle_control_osdcmd(vdr_input_plugin_t *this) osdcmd.datalen = ntohl(osdcmd.datalen); osdcmd.num_rle = ntohl(osdcmd.num_rle); osdcmd.colors = ntohl(osdcmd.colors); + osdcmd.dirty_area.x1 = ntohs(osdcmd.dirty_area.x1); + osdcmd.dirty_area.y1 = ntohs(osdcmd.dirty_area.y1); + osdcmd.dirty_area.x2 = ntohs(osdcmd.dirty_area.x2); + osdcmd.dirty_area.y2 = ntohs(osdcmd.dirty_area.y2); #elif __BYTE_ORDER == __BIG_ENDIAN #else # error __BYTE_ORDER undefined ! diff --git a/xine_osd_command.h b/xine_osd_command.h index af05aecb..f36c387a 100644 --- a/xine_osd_command.h +++ b/xine_osd_command.h @@ -4,7 +4,7 @@ * See the main source file 'xineliboutput.c' for copyright information and * how to reach the author. * - * $Id: xine_osd_command.h,v 1.7 2008-02-27 00:27:48 phintuka Exp $ + * $Id: xine_osd_command.h,v 1.8 2008-03-11 15:57:57 phintuka Exp $ * */ @@ -29,9 +29,12 @@ typedef enum { OSD_SetPalette = 3, /* Modify palette of already created OSD window */ OSD_Move = 4, /* Change x/y position of already created OSD window */ OSD_Close = 5, /* Close OSD window */ - OSD_Set_YUV = 6 /* Create/update OSD window. Data is in YUV420 format. */ + OSD_Set_YUV = 6, /* Create/update OSD window. Data is in YUV420 format. */ + OSD_Commit = 7 /* All OSD areas have been updated, commit changes to display */ } osd_command_id_t; +#define OSDFLAG_YUV_CLUT 0x01 + typedef struct xine_clut_s { union { uint8_t cb /*: 8*/; @@ -53,6 +56,13 @@ typedef struct xine_rle_elem_s { uint16_t color; } PACKED xine_rle_elem_t; /* from xine */ +typedef struct osd_rect_s { + uint16_t x1; + uint16_t y1; + uint16_t x2; + uint16_t y2; +} osd_rect_t; + typedef struct osd_command_s { uint32_t cmd; /* osd_command_id_t */ @@ -79,6 +89,9 @@ typedef struct osd_command_s { uint64_t dummy02; }; + osd_rect_t dirty_area; + uint8_t flags; + } PACKED osd_command_t; |