[libbluray-devel] commit: export mpls_parse_uo() from mpls_parse.c (hpi1 )

git at videolan.org git at videolan.org
Sat Aug 14 00:30:06 CEST 2010


libbluray | branch: master | hpi1 <hpi1 at anonymous.org> | Sat Aug 14 00:52:29 2010 +0300| [21a3b90ce5e194f7d40972593b42c8a2ce0d5c79] | committer: hpi1 

export mpls_parse_uo() from mpls_parse.c

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

 src/libbluray/bdnav/mpls_parse.c |   83 +++++++++++++++++++++----------------
 src/libbluray/bdnav/mpls_parse.h |    2 +
 2 files changed, 49 insertions(+), 36 deletions(-)

diff --git a/src/libbluray/bdnav/mpls_parse.c b/src/libbluray/bdnav/mpls_parse.c
index 9c04569..e9314a9 100644
--- a/src/libbluray/bdnav/mpls_parse.c
+++ b/src/libbluray/bdnav/mpls_parse.c
@@ -45,45 +45,56 @@ _human_readable_sig(char *sig, uint32_t s1, uint32_t s2)
     sig[8] = 0;
 }
 
+int
+mpls_parse_uo(uint8_t *buf, BD_UO_MASK *uo)
+{
+    BITBUFFER bb;
+    bb_init(&bb, buf, 8);
+
+    uo->menu_call                       = bb_read(&bb, 1);
+    uo->title_search                    = bb_read(&bb, 1);
+    uo->chapter_search                  = bb_read(&bb, 1);
+    uo->time_search                     = bb_read(&bb, 1);
+    uo->skip_to_next_point              = bb_read(&bb, 1);
+    uo->skip_to_prev_point              = bb_read(&bb, 1);
+    uo->play_firstplay                  = bb_read(&bb, 1);
+    uo->stop                            = bb_read(&bb, 1);
+    uo->pause_on                        = bb_read(&bb, 1);
+    uo->pause_off                       = bb_read(&bb, 1);
+    uo->still                           = bb_read(&bb, 1);
+    uo->forward                         = bb_read(&bb, 1);
+    uo->backward                        = bb_read(&bb, 1);
+    uo->resume                          = bb_read(&bb, 1);
+    uo->move_up                         = bb_read(&bb, 1);
+    uo->move_down                       = bb_read(&bb, 1);
+    uo->move_left                       = bb_read(&bb, 1);
+    uo->move_right                      = bb_read(&bb, 1);
+    uo->select                          = bb_read(&bb, 1);
+    uo->activate                        = bb_read(&bb, 1);
+    uo->select_and_activate             = bb_read(&bb, 1);
+    uo->primary_audio_change            = bb_read(&bb, 1);
+    bb_skip(&bb, 1);
+    uo->angle_change                    = bb_read(&bb, 1);
+    uo->popup_on                        = bb_read(&bb, 1);
+    uo->popup_off                       = bb_read(&bb, 1);
+    uo->pg_enable_disable               = bb_read(&bb, 1);
+    uo->pg_change                       = bb_read(&bb, 1);
+    uo->secondary_video_enable_disable  = bb_read(&bb, 1);
+    uo->secondary_video_change          = bb_read(&bb, 1);
+    uo->secondary_audio_enable_disable  = bb_read(&bb, 1);
+    uo->secondary_audio_change          = bb_read(&bb, 1);
+    bb_skip(&bb, 1);
+    uo->pip_pg_change                   = bb_read(&bb, 1);
+    bb_skip(&bb, 30);
+    return 1;
+}
+
 static int
 _parse_uo(BITSTREAM *bits, BD_UO_MASK *uo)
 {
-    uo->menu_call                       = bs_read(bits, 1);
-    uo->title_search                    = bs_read(bits, 1);
-    uo->chapter_search                  = bs_read(bits, 1);
-    uo->time_search                     = bs_read(bits, 1);
-    uo->skip_to_next_point              = bs_read(bits, 1);
-    uo->skip_to_prev_point              = bs_read(bits, 1);
-    uo->play_firstplay                  = bs_read(bits, 1);
-    uo->stop                            = bs_read(bits, 1);
-    uo->pause_on                        = bs_read(bits, 1);
-    uo->pause_off                       = bs_read(bits, 1);
-    uo->still                           = bs_read(bits, 1);
-    uo->forward                         = bs_read(bits, 1);
-    uo->backward                        = bs_read(bits, 1);
-    uo->resume                          = bs_read(bits, 1);
-    uo->move_up                         = bs_read(bits, 1);
-    uo->move_down                       = bs_read(bits, 1);
-    uo->move_left                       = bs_read(bits, 1);
-    uo->move_right                      = bs_read(bits, 1);
-    uo->select                          = bs_read(bits, 1);
-    uo->activate                        = bs_read(bits, 1);
-    uo->select_and_activate             = bs_read(bits, 1);
-    uo->primary_audio_change            = bs_read(bits, 1);
-    bs_skip(bits, 1);
-    uo->angle_change                    = bs_read(bits, 1);
-    uo->popup_on                        = bs_read(bits, 1);
-    uo->popup_off                       = bs_read(bits, 1);
-    uo->pg_enable_disable               = bs_read(bits, 1);
-    uo->pg_change                       = bs_read(bits, 1);
-    uo->secondary_video_enable_disable  = bs_read(bits, 1);
-    uo->secondary_video_change          = bs_read(bits, 1);
-    uo->secondary_audio_enable_disable  = bs_read(bits, 1);
-    uo->secondary_audio_change          = bs_read(bits, 1);
-    bs_skip(bits, 1);
-    uo->pip_pg_change                   = bs_read(bits, 1);
-    bs_skip(bits, 30);
-    return 1;
+    uint8_t buf[8];
+    bs_read_bytes(bits, buf, 8);
+    return mpls_parse_uo(buf, uo);
 }
 
 static int
diff --git a/src/libbluray/bdnav/mpls_parse.h b/src/libbluray/bdnav/mpls_parse.h
index fd1d231..27d7dca 100644
--- a/src/libbluray/bdnav/mpls_parse.h
+++ b/src/libbluray/bdnav/mpls_parse.h
@@ -151,4 +151,6 @@ typedef struct
 BD_PRIVATE MPLS_PL* mpls_parse(char *path, int verbose);
 BD_PRIVATE void mpls_free(MPLS_PL *pl);
 
+BD_PRIVATE int  mpls_parse_uo(uint8_t *buf, BD_UO_MASK *uo);
+
 #endif // _MPLS_PARSE_H_



More information about the libbluray-devel mailing list