diff options
| author | phintuka <phintuka> | 2011-03-19 21:38:20 +0000 |
|---|---|---|
| committer | phintuka <phintuka> | 2011-03-19 21:38:20 +0000 |
| commit | 80d6a514f16676c7aaefc8c92980742df8beff36 (patch) | |
| tree | 48b2b6f4fceaad52acf19a27ceddce41843576e9 | |
| parent | e2b91f4a5f35dc52437ffd8e580b5e5d590b107a (diff) | |
| download | xineliboutput-80d6a514f16676c7aaefc8c92980742df8beff36.tar.gz xineliboutput-80d6a514f16676c7aaefc8c92980742df8beff36.tar.bz2 | |
Check OSD data type before trying to compress it.
Use HDMV compression with LUT8 data, it has better compress ratio with complex images.
| -rw-r--r-- | frontend_svr.c | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/frontend_svr.c b/frontend_svr.c index 28479252..a37bbe06 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.101 2011-02-28 13:15:07 phintuka Exp $ + * $Id: frontend_svr.c,v 1.102 2011-03-19 21:38:20 phintuka Exp $ * */ @@ -300,13 +300,27 @@ void cXinelibServer::OsdCmd(void *cmd_gen) return; if(cmd_gen) { + void *compressed_data = NULL; osd_command_t *cmd = (osd_command_t*)cmd_gen; osd_command_t cmdnet; memcpy(&cmdnet, cmd, sizeof(osd_command_t)); + if (cmd->data) { - cmdnet.raw_data = (uint8_t *)malloc(cmd->datalen); - cmdnet.datalen = rle_recompress_net(cmdnet.raw_data, cmd->data, cmd->num_rle); + // compress data + if (cmd->cmd == OSD_Set_LUT8) { + int num_rle = 0; + cmdnet.datalen = rle_compress_hdmv(&cmdnet.raw_data, cmd->raw_data, cmd->w, cmd->h, &num_rle); + cmdnet.num_rle = num_rle; + cmdnet.cmd = OSD_Set_HDMV; + compressed_data = cmdnet.raw_data; // free it later + + } else if (cmd->cmd == OSD_Set_RLE) { + cmdnet.raw_data = (uint8_t *)malloc(cmd->datalen); + cmdnet.datalen = rle_recompress_net(cmdnet.raw_data, cmd->data, cmd->num_rle); + compressed_data = cmdnet.raw_data; // free it later + } } + // -> network byte order hton_osdcmd(cmdnet); @@ -327,7 +341,7 @@ void cXinelibServer::OsdCmd(void *cmd_gen) } } - free(cmdnet.data); + free(compressed_data); #ifdef LOG_OSD_BANDWIDTH { |
