diff options
author | phintuka <phintuka> | 2014-06-23 12:20:28 +0000 |
---|---|---|
committer | phintuka <phintuka> | 2014-06-23 12:20:28 +0000 |
commit | a8401fb0472feb6e3de023290c8f286d4bc85486 (patch) | |
tree | ae8c2b570a3c6da72173462f114c5590e5e945c6 | |
parent | cfc9c5b1fc7caf6066404ce2366ec67f7d751114 (diff) | |
download | xineliboutput-a8401fb0472feb6e3de023290c8f286d4bc85486.tar.gz xineliboutput-a8401fb0472feb6e3de023290c8f286d4bc85486.tar.bz2 |
rename xine_osd_command.h -> tools/osd_command.h
-rw-r--r-- | frontend_svr.c | 4 | ||||
-rw-r--r-- | osd.c | 5 | ||||
-rw-r--r-- | tools/osd_command.h | 162 | ||||
-rw-r--r-- | tools/rle.c | 4 | ||||
-rw-r--r-- | xine/osd_manager.c | 4 | ||||
-rw-r--r-- | xine_input_vdr.c | 6 | ||||
-rw-r--r-- | xine_sxfe_frontend.c | 4 |
7 files changed, 176 insertions, 13 deletions
diff --git a/frontend_svr.c b/frontend_svr.c index 1173d994..519a3de9 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.108 2014-06-23 12:14:15 phintuka Exp $ + * $Id: frontend_svr.c,v 1.109 2014-06-23 12:20:28 phintuka Exp $ * */ @@ -34,8 +34,8 @@ #include "config.h" #include "xine_input_vdr_net.h" // stream header(s) -#include "xine_osd_command.h" // osd commands +#include "tools/osd_command.h" // osd commands #include "tools/cxsocket.h" #include "tools/future.h" #include "tools/backgroundwriter.h" @@ -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.51 2014-06-23 12:14:15 phintuka Exp $ + * $Id: osd.c,v 1.52 2014-06-23 12:20:28 phintuka Exp $ * */ @@ -15,7 +15,8 @@ #include "logdefs.h" #include "config.h" #include "device.h" -#include "xine_osd_command.h" + +#include "tools/osd_command.h" #include "osd.h" diff --git a/tools/osd_command.h b/tools/osd_command.h new file mode 100644 index 00000000..ea9eb8b3 --- /dev/null +++ b/tools/osd_command.h @@ -0,0 +1,162 @@ +/* + * xine_osd_command.h: + * + * See the main source file 'xineliboutput.c' for copyright information and + * how to reach the author. + * + * $Id: osd_command.h,v 1.1 2014-06-23 12:20:28 phintuka Exp $ + * + */ + +#ifndef __XINE_OSD_COMMAND_H_ +#define __XINE_OSD_COMMAND_H_ + +#ifndef PACKED +# define PACKED __attribute__((packed)) +#endif +#ifndef ALIGNED +# define ALIGNED __attribute__((aligned)) +#endif + +#define MAX_OSD_OBJECT 50 + +#if defined __cplusplus +extern "C" { +#endif + +typedef enum { + OSD_Nop = 0, /* Do nothing ; used to initialize delay_ms counter */ + OSD_Size = 1, /* Set size of VDR OSD area (usually 720x576) */ + OSD_Set_RLE = 2, /* Create/update OSD window. Data is rle-compressed. */ + 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_Commit = 7, /* All OSD areas have been updated, commit changes to display */ + OSD_Flush = 8, /* Flush all pending OSD operations immediately */ + OSD_VideoWindow = 9, /* Set video window inside OSD */ + OSD_Set_HDMV = 10, /* Create/update OSD window. Data is RLE compressed. */ + OSD_Set_LUT8 = 11, /* Create/update OSD window. Data is uncompressed. */ + OSD_Set_ARGB = 12, /* Create/update OSD window. Data is uncompressed. */ +} osd_command_id_t; + +#define OSDFLAG_YUV_CLUT 0x01 /* palette is in YUV format */ +#define OSDFLAG_REFRESH 0x02 /* OSD data refresh for new config, clients, etc. - no changes in bitmap */ +#define OSDFLAG_UNSCALED 0x04 /* xine-lib unscaled (hardware) blending */ +#define OSDFLAG_UNSCALED_LOWRES 0x08 /* unscaled blending when video resolution < .95 * 720x576 */ + +#define OSDFLAG_TOP_LAYER 0x10 /* window is part of top layer OSD */ + +typedef struct osd_clut_s { + union { + uint8_t cb /*: 8*/; + uint8_t g; + }; + union { + uint8_t cr /*: 8*/; + uint8_t b; + }; + union { + uint8_t y /*: 8*/; + uint8_t r; + }; + uint8_t alpha /*: 8*/; +} PACKED osd_clut_t; /* from xine, alphablend.h */ + +typedef struct osd_rle_elem_s { + uint16_t len; + uint16_t color; +} PACKED osd_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 { + uint8_t size; /* size of osd_command_t struct */ + + uint8_t cmd; /* osd_command_id_t */ + + uint8_t wnd; /* OSD window handle */ + uint8_t layer; /* OSD layer */ + + int64_t pts; /* execute at given pts */ + uint32_t delay_ms; /* execute 'delay_ms' ms after previous command (for same window). */ + + uint16_t x; /* window position, x */ + uint16_t y; /* window position, y */ + uint16_t w; /* window width */ + uint16_t h; /* window height */ + + uint32_t datalen; /* size of image data, in bytes */ + uint32_t num_rle; + union { + osd_rle_elem_t *data; /* RLE compressed image */ + uint8_t *raw_data; + uint64_t dummy01; + }; + uint32_t colors; /* palette size */ + union { + osd_clut_t *palette; /* palette (YCrCb) */ + uint64_t dummy02; + }; + + osd_rect_t dirty_area; + uint8_t flags; + uint8_t scaling; + +} PACKED osd_command_t ALIGNED; + + +#if __BYTE_ORDER == __LITTLE_ENDIAN +# define hton_osdcmd(cmdP) \ + do { \ + cmdP.pts = htonll(cmdP.pts); \ + cmdP.delay_ms = htonl (cmdP.delay_ms); \ + cmdP.x = htons (cmdP.x); \ + cmdP.y = htons (cmdP.y); \ + cmdP.w = htons (cmdP.w); \ + cmdP.h = htons (cmdP.h); \ + cmdP.datalen = htonl (cmdP.datalen); \ + cmdP.num_rle = htonl (cmdP.num_rle); \ + cmdP.colors = htonl (cmdP.colors); \ + cmdP.dirty_area.x1 = htons(cmdP.dirty_area.x1); \ + cmdP.dirty_area.y1 = htons(cmdP.dirty_area.y1); \ + cmdP.dirty_area.x2 = htons(cmdP.dirty_area.x2); \ + cmdP.dirty_area.y2 = htons(cmdP.dirty_area.y2); \ + } while(0) + +# define ntoh_osdcmd(cmdP) \ + do { \ + cmdP.pts = ntohll(cmdP.pts); \ + cmdP.delay_ms = ntohl (cmdP.delay_ms); \ + cmdP.x = ntohs (cmdP.x); \ + cmdP.y = ntohs (cmdP.y); \ + cmdP.w = ntohs (cmdP.w); \ + cmdP.h = ntohs (cmdP.h); \ + cmdP.datalen = ntohl (cmdP.datalen); \ + cmdP.num_rle = ntohl (cmdP.num_rle); \ + cmdP.colors = ntohl (cmdP.colors); \ + cmdP.dirty_area.x1 = ntohs(cmdP.dirty_area.x1); \ + cmdP.dirty_area.y1 = ntohs(cmdP.dirty_area.y1); \ + cmdP.dirty_area.x2 = ntohs(cmdP.dirty_area.x2); \ + cmdP.dirty_area.y2 = ntohs(cmdP.dirty_area.y2); \ + } while(0) + +#elif __BYTE_ORDER == __BIG_ENDIAN + +# define hton_osdcmd(cmd) do {} while(0) +# define ntoh_osdcmd(cmd) do {} while(0) + +#else +# error __BYTE_ORDER undefined ! +#endif + +#if defined __cplusplus +} +#endif + +#endif /*__XINE_OSD_COMMAND_H_*/ diff --git a/tools/rle.c b/tools/rle.c index 96b1d25e..8239f2ea 100644 --- a/tools/rle.c +++ b/tools/rle.c @@ -4,7 +4,7 @@ * See the main source file 'xineliboutput.c' for copyright information and * how to reach the author. * - * $Id: rle.c,v 1.11 2014-06-23 12:14:15 phintuka Exp $ + * $Id: rle.c,v 1.12 2014-06-23 12:20:28 phintuka Exp $ * */ @@ -14,7 +14,7 @@ #include <sys/types.h> #endif -#include "../xine_osd_command.h" +#include "osd_command.h" #include "rle.h" diff --git a/xine/osd_manager.c b/xine/osd_manager.c index cc6267e2..3840e26f 100644 --- a/xine/osd_manager.c +++ b/xine/osd_manager.c @@ -4,7 +4,7 @@ * See the main source file 'xineliboutput.c' for copyright information and * how to reach the author. * - * $Id: osd_manager.c,v 1.29 2014-06-23 12:14:15 phintuka Exp $ + * $Id: osd_manager.c,v 1.30 2014-06-23 12:20:28 phintuka Exp $ * */ @@ -15,9 +15,9 @@ #include <xine/xine_internal.h> #include <xine/video_out.h> -#include "../xine_osd_command.h" #include "../xine_input_vdr.h" +#include "../tools/osd_command.h" #include "../tools/rle.h" #include "vo_props.h" diff --git a/xine_input_vdr.c b/xine_input_vdr.c index fb8dfb1a..20cbae79 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.365 2014-06-23 12:14:15 phintuka Exp $ + * $Id: xine_input_vdr.c,v 1.366 2014-06-23 12:20:28 phintuka Exp $ * */ @@ -67,8 +67,8 @@ #include "xine_input_vdr.h" #include "xine_input_vdr_net.h" -#include "xine_osd_command.h" +#include "tools/osd_command.h" #include "tools/mpeg.h" #include "tools/pes.h" #include "tools/ts.h" @@ -136,7 +136,7 @@ typedef struct { # include <linux/unistd.h> /* syscall(__NR_gettid) */ #endif -static const char module_revision[] = "$Id: xine_input_vdr.c,v 1.365 2014-06-23 12:14:15 phintuka Exp $"; +static const char module_revision[] = "$Id: xine_input_vdr.c,v 1.366 2014-06-23 12:20:28 phintuka Exp $"; static const char log_module_input_vdr[] = "[input_vdr] "; #define LOG_MODULENAME log_module_input_vdr #define SysLogLevel iSysLogLevel diff --git a/xine_sxfe_frontend.c b/xine_sxfe_frontend.c index 7ff62eb9..1102ef13 100644 --- a/xine_sxfe_frontend.c +++ b/xine_sxfe_frontend.c @@ -4,7 +4,7 @@ * See the main source file 'xineliboutput.c' for copyright information and * how to reach the author. * - * $Id: xine_sxfe_frontend.c,v 1.207 2014-01-14 08:34:27 phintuka Exp $ + * $Id: xine_sxfe_frontend.c,v 1.208 2014-06-23 12:20:28 phintuka Exp $ * */ @@ -56,13 +56,13 @@ #define LOG_MODULENAME "[vdr-sxfe] " #include "logdefs.h" -#include "xine_osd_command.h" #include "xine_frontend_internal.h" #ifdef HAVE_DBUS_GLIB_1 # include "tools/gnome_screensaver.h" #endif +#include "tools/osd_command.h" #include "tools/rle.h" #include "tools/time_ms.h" |