[libbluray-devel] Added enum for overlay planes

hpi1 git at videolan.org
Mon Jul 11 08:54:00 CEST 2011


libbluray | branch: master | hpi1 <hpi1 at anonymous.org> | Wed Jul  6 13:05:18 2011 +0300| [1f068be84c92d56312819642173cd1005081704a] | committer: hpi1

Added enum for overlay planes

> http://git.videolan.org/gitweb.cgi/libbluray.git/?a=commit;h=1f068be84c92d56312819642173cd1005081704a
---

 src/libbluray/decoders/graphics_controller.c |   14 +++++++-------
 src/libbluray/decoders/overlay.h             |    7 ++++++-
 2 files changed, 13 insertions(+), 8 deletions(-)

diff --git a/src/libbluray/decoders/graphics_controller.c b/src/libbluray/decoders/graphics_controller.c
index ed3001a..bd62681 100644
--- a/src/libbluray/decoders/graphics_controller.c
+++ b/src/libbluray/decoders/graphics_controller.c
@@ -366,7 +366,7 @@ static void _clear_osd(GRAPHICS_CONTROLLER *gc, int plane)
 {
     _clear_osd_area(gc, plane, 0, 0, 1920, 1080);
 
-    if (plane) {
+    if (plane == BD_OVERLAY_IG) {
         gc->ig_drawn      = 0;
     } else {
         gc->pg_drawn      = 0;
@@ -377,7 +377,7 @@ static void _clear_bog_area(GRAPHICS_CONTROLLER *gc, BOG_DATA *bog_data)
 {
     if (gc->ig_drawn && bog_data->w && bog_data->h) {
 
-        _clear_osd_area(gc, 1, bog_data->x, bog_data->y, bog_data->w, bog_data->h);
+        _clear_osd_area(gc, BD_OVERLAY_IG, bog_data->x, bog_data->y, bog_data->w, bog_data->h);
 
         bog_data->x = bog_data->y = bog_data->w = bog_data->h = 0;
     }
@@ -386,7 +386,7 @@ static void _clear_bog_area(GRAPHICS_CONTROLLER *gc, BOG_DATA *bog_data)
 static void _select_page(GRAPHICS_CONTROLLER *gc, uint16_t page_id)
 {
     bd_psr_write(gc->regs, PSR_MENU_PAGE_ID, page_id);
-    _clear_osd(gc, 1);
+    _clear_osd(gc, BD_OVERLAY_IG);
     _reset_page_state(gc);
 
     uint16_t button_id = _find_selected_button_id(gc);
@@ -395,8 +395,8 @@ static void _select_page(GRAPHICS_CONTROLLER *gc, uint16_t page_id)
 
 static void _gc_reset(GRAPHICS_CONTROLLER *gc)
 {
-    _clear_osd(gc, 0);
-    _clear_osd(gc, 1);
+    _clear_osd(gc, BD_OVERLAY_PG);
+    _clear_osd(gc, BD_OVERLAY_IG);
 
     gc->popup_visible = 0;
 
@@ -568,7 +568,7 @@ static void _render_button(GRAPHICS_CONTROLLER *gc, BD_IG_BUTTON *button, BD_PG_
     }
 
     ov.pts   = -1;
-    ov.plane = 1; /* IG */
+    ov.plane = BD_OVERLAY_IG;
 
     ov.x = bog_data->x = button->x_pos;
     ov.y = bog_data->y = button->y_pos;
@@ -598,7 +598,7 @@ static void _render_page(GRAPHICS_CONTROLLER *gc,
     if (s->ics->interactive_composition.ui_model == IG_UI_MODEL_POPUP && !gc->popup_visible) {
         GC_TRACE("_render_page(): popup menu not visible\n");
 
-        _clear_osd(gc, 1);
+        _clear_osd(gc, BD_OVERLAY_IG);
 
         return;
     }
diff --git a/src/libbluray/decoders/overlay.h b/src/libbluray/decoders/overlay.h
index f7775c4..0269520 100644
--- a/src/libbluray/decoders/overlay.h
+++ b/src/libbluray/decoders/overlay.h
@@ -22,6 +22,11 @@
 
 #include <stdint.h>
 
+typedef enum {
+    BD_OVERLAY_PG = 0,  /* Presentation Graphics plane */
+    BD_OVERLAY_IG = 1,  /* Interactive Graphics plane (on top of PG plane) */
+} bd_overlay_plane_e;
+
 typedef struct bd_pg_palette_entry_s {
     uint8_t Y;
     uint8_t Cr;
@@ -36,7 +41,7 @@ typedef struct bd_pg_rle_elem_s {
 
 typedef struct bd_overlay_s {
     int64_t  pts;
-    uint8_t  plane; /* 0 - PG, 1 - IG */
+    uint8_t  plane; /* bd_overlay_plane_e */
 
     uint16_t x;
     uint16_t y;



More information about the libbluray-devel mailing list