[libbluray-devel] mpls_dump: use public API

hpi1 git at videolan.org
Mon Apr 14 08:56:08 CEST 2014


libbluray | branch: master | hpi1 <hpi1 at anonymous.org> | Sun Apr 13 19:14:37 2014 +0300| [d81d4b15a7f012c3eb93b8160765a58e1e78af60] | committer: hpi1

mpls_dump: use public API

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

 src/Makefile.am          |   16 +---------------
 src/examples/mpls_dump.c |   11 ++++++-----
 src/libbluray/bluray.c   |   10 ++++++++++
 src/libbluray/bluray.h   |   12 ++++++++++++
 4 files changed, 29 insertions(+), 20 deletions(-)

diff --git a/src/Makefile.am b/src/Makefile.am
index 65a87ae..2953411 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -218,22 +218,8 @@ mpls_dump_SOURCES = \
 	examples/mpls_dump.c \
 	examples/util.c \
 	examples/util.h \
-	file/file.c \
-	libbluray/bdnav/clpi_parse.c \
-	libbluray/bdnav/extdata_parse.c \
-	libbluray/bdnav/mpls_parse.c \
-	util/bits.c \
-	util/logging.c \
 	util/strutl.c
-if HAVE_WIN32
-mpls_dump_SOURCES += \
-	file/file_win32.c \
-	file/dir_win32.c
-else
-mpls_dump_SOURCES += \
-	file/file_posix.c \
-	file/dir_posix.c
-endif
+mpls_dump_LDADD = libbluray.la
 
 clpi_dump_CFLAGS = $(AM_CFLAGS)
 clpi_dump_SOURCES = \
diff --git a/src/examples/mpls_dump.c b/src/examples/mpls_dump.c
index d4a2f76..5064830 100644
--- a/src/examples/mpls_dump.c
+++ b/src/examples/mpls_dump.c
@@ -28,6 +28,7 @@
 #include "util/strutl.h"
 
 #include "libbluray/bdnav/mpls_parse.h"
+#include "libbluray/bluray.h"
 
 #include "util.h"
 
@@ -543,26 +544,26 @@ _process_file(char *name, MPLS_PL *pl_list[], int pl_count)
 {
     MPLS_PL *pl;
 
-    pl = mpls_parse(name);
+    pl = bd_read_mpls(name);
     if (pl == NULL) {
         fprintf(stderr, "Parse failed: %s\n", name);
         return NULL;
     }
     if (seconds) {
         if (!_filter_short(pl, seconds)) {
-            mpls_free(pl);
+            bd_free_mpls(pl);
             return NULL;
         }
     }
     if (repeats) {
         if (!_filter_repeats(pl, repeats)) {
-            mpls_free(pl);
+            bd_free_mpls(pl);
             return NULL;
         }
     }
     if (dups) {
         if (!_filter_dup(pl_list, pl_count, pl)) {
-            mpls_free(pl);
+            bd_free_mpls(pl);
             return NULL;
         }
     }
@@ -761,7 +762,7 @@ main(int argc, char *argv[])
     }
     // Cleanup
     for (ii = 0; ii < pl_ii; ii++) {
-        mpls_free(pl_list[ii]);
+        bd_free_mpls(pl_list[ii]);
     }
     return 0;
 }
diff --git a/src/libbluray/bluray.c b/src/libbluray/bluray.c
index dcb9baa..eea8838 100644
--- a/src/libbluray/bluray.c
+++ b/src/libbluray/bluray.c
@@ -3354,3 +3354,13 @@ void bd_free_clpi(struct clpi_cl *cl)
 {
     clpi_free(cl);
 }
+
+struct mpls_pl *bd_read_mpls(const char *mpls_file)
+{
+    return mpls_parse(mpls_file);
+}
+
+void bd_free_mpls(struct mpls_pl *pl)
+{
+    mpls_free(pl);
+}
diff --git a/src/libbluray/bluray.h b/src/libbluray/bluray.h
index 0f4bdb0..4856c98 100644
--- a/src/libbluray/bluray.h
+++ b/src/libbluray/bluray.h
@@ -856,6 +856,12 @@ struct meta_dl;
 const struct meta_dl *bd_get_meta(BLURAY *bd);
 
 
+/*
+ * Testing and debugging
+ */
+
+/* access to internal information */
+
 struct clpi_cl;
 /**
  *
@@ -876,6 +882,12 @@ struct clpi_cl *bd_read_clpi(const char *clpi_file);
  */
 void bd_free_clpi(struct clpi_cl *cl);
 
+
+struct mpls_pl;
+struct mpls_pl *bd_read_mpls(const char *mpls_file);
+void bd_free_mpls(struct mpls_pl *);
+
+
 #ifdef __cplusplus
 };
 #endif



More information about the libbluray-devel mailing list