diff options
| author | phintuka <phintuka> | 2011-07-03 12:45:34 +0000 |
|---|---|---|
| committer | phintuka <phintuka> | 2011-07-03 12:45:34 +0000 |
| commit | aa649bacd8eadc739ff692aa1a1cca285c1ddac1 (patch) | |
| tree | 60ed167d012627e0de0b98876c3b4ca64532f027 | |
| parent | 2a7a2a5fa01ad9483df21624409d21e160273ac3 (diff) | |
| download | xineliboutput-aa649bacd8eadc739ff692aa1a1cca285c1ddac1.tar.gz xineliboutput-aa649bacd8eadc739ff692aa1a1cca285c1ddac1.tar.bz2 | |
Splitted overlay_proc()
| -rw-r--r-- | xine/BluRay/input_bluray.c | 58 |
1 files changed, 33 insertions, 25 deletions
diff --git a/xine/BluRay/input_bluray.c b/xine/BluRay/input_bluray.c index 62d68416..226895b4 100644 --- a/xine/BluRay/input_bluray.c +++ b/xine/BluRay/input_bluray.c @@ -173,10 +173,41 @@ static void close_overlay(bluray_input_plugin_t *this, int plane) } } +static void draw_bitmap(xine_osd_t *osd, const BD_OVERLAY * const ov) +{ + unsigned i; + + /* convert and set palette */ + if (ov->palette) { + uint32_t color[256]; + uint8_t trans[256]; + for(i = 0; i < 256; i++) { + trans[i] = ov->palette[i].T; + color[i] = (ov->palette[i].Y << 16) | (ov->palette[i].Cr << 8) | ov->palette[i].Cb; + } + + xine_osd_set_palette(osd, color, trans); + } + + /* uncompress and draw bitmap */ + if (ov->img) { + const BD_PG_RLE_ELEM *rlep = ov->img; + uint8_t *img = malloc(ov->w * ov->h); + unsigned pixels = ov->w * ov->h; + + for (i = 0; i < pixels; i += rlep->len, rlep++) { + memset(img + i, rlep->color, rlep->len); + } + + xine_osd_draw_bitmap(osd, img, ov->x, ov->y, ov->w, ov->h, NULL); + + free(img); + } +} + static void overlay_proc(void *this_gen, const BD_OVERLAY * const ov) { bluray_input_plugin_t *this = (bluray_input_plugin_t *) this_gen; - unsigned i; if (!this) { return; @@ -202,31 +233,8 @@ static void overlay_proc(void *this_gen, const BD_OVERLAY * const ov) _x_select_spu_channel(this->stream, -1); } - /* convert and set palette */ - if (ov->palette) { - uint32_t color[256]; - uint8_t trans[256]; - for(i = 0; i < 256; i++) { - trans[i] = ov->palette[i].T; - color[i] = (ov->palette[i].Y << 16) | (ov->palette[i].Cr << 8) | ov->palette[i].Cb; - } - - xine_osd_set_palette(osd, color, trans); - } - - /* uncompress and draw bitmap */ if (ov->img) { - const BD_PG_RLE_ELEM *rlep = ov->img; - uint8_t *img = malloc(ov->w * ov->h); - unsigned pixels = ov->w * ov->h; - - for (i = 0; i < pixels; i += rlep->len, rlep++) { - memset(img + i, rlep->color, rlep->len); - } - - xine_osd_draw_bitmap(osd, img, ov->x, ov->y, ov->w, ov->h, NULL); - - free(img); + draw_bitmap(osd, ov); } else { |
