[libbluray-devel] Parse CPI SS and ProgramInfo SS from .clpi file extension data

hpi1 git at videolan.org
Mon Sep 3 20:43:52 CEST 2012


libbluray | branch: master | hpi1 <hpi1 at anonymous.org> | Mon Sep  3 21:31:12 2012 +0300| [255672ff4c1eed25dd85d358fa89540868e8623c] | committer: hpi1

Parse CPI SS and ProgramInfo SS from .clpi file extension data

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

 src/examples/clpi_dump.c         |   17 +++++++++++++++++
 src/libbluray/bdnav/clpi_data.h  |    2 ++
 src/libbluray/bdnav/clpi_parse.c |    9 +++++++++
 3 files changed, 28 insertions(+)

diff --git a/src/examples/clpi_dump.c b/src/examples/clpi_dump.c
index f949aab..08faf1b 100644
--- a/src/examples/clpi_dump.c
+++ b/src/examples/clpi_dump.c
@@ -63,6 +63,7 @@ const VALUE_MAP codec_map[] = {
     {0xa2, "DTS-HD for secondary audio"},
     {0xea, "VC-1"},
     {0x1b, "H.264"},
+    {0x20, "H.264 MVC dep."},
     {0x90, "Presentation Graphics"},
     {0x91, "Presentation Graphics"},
     {0x92, "Interactive Graphics"},
@@ -136,6 +137,7 @@ _show_stream(CLPI_PROG_STREAM *ss, int level)
         case 0x02:
         case 0xea:
         case 0x1b:
+        case 0x20:
             indent_printf(level, "Format %02x: %s", ss->format,
                         _lookup_str(video_format_map, ss->format));
             indent_printf(level, "Rate %02x: %s", ss->rate,
@@ -435,6 +437,21 @@ main(int argc, char *argv[])
             // Show cpi
             _show_cpi_info(&cl->cpi, 1);
         }
+
+        if (opt_prog_info) {
+            if (cl->program_ss.num_prog) {
+                printf("\n");
+                indent_printf(1, "Extension: Program Info SS");
+                _show_prog_info(&cl->program_ss, 1);
+            }
+        }
+        if (opt_cpi_info) {
+            if (cl->program_ss.num_prog) {
+                printf("\n");
+                indent_printf(1, "Extension: CPI SS");
+                _show_cpi_info(&cl->cpi_ss, 1);
+            }
+        }
         if (opt_extent_start) {
             // Show extent start point
             if (cl->extent_start.num_point > 0) {
diff --git a/src/libbluray/bdnav/clpi_data.h b/src/libbluray/bdnav/clpi_data.h
index 6d36018..25f32b6 100644
--- a/src/libbluray/bdnav/clpi_data.h
+++ b/src/libbluray/bdnav/clpi_data.h
@@ -153,6 +153,8 @@ typedef struct clpi_cl {
     // extensions for 3D
 
     CLPI_EXTENT_START extent_start; /* extent start points (.ssif interleaving) */
+    CLPI_PROG_INFO    program_ss;
+    CLPI_CPI          cpi_ss;
 
 } CLPI_CL;
 
diff --git a/src/libbluray/bdnav/clpi_parse.c b/src/libbluray/bdnav/clpi_parse.c
index b92282f..e591af3 100644
--- a/src/libbluray/bdnav/clpi_parse.c
+++ b/src/libbluray/bdnav/clpi_parse.c
@@ -65,6 +65,7 @@ _parse_stream_attr(BITSTREAM *bits, CLPI_PROG_STREAM *ss)
         case 0x02:
         case 0xea:
         case 0x1b:
+        case 0x20:
             ss->format = bs_read(bits, 4);
             ss->rate   = bs_read(bits, 4);
             ss->aspect = bs_read(bits, 4);
@@ -573,6 +574,14 @@ static int _parse_clpi_extension(BITSTREAM *bits, int id1, int id2, void *handle
             // Extent start point
             return _parse_extent_start_points(bits, &cl->extent_start);
         }
+        if (id2 == 5) {
+            // ProgramInfo SS
+            return _parse_program(bits, &cl->program_ss);
+        }
+        if (id2 == 6) {
+            // CPI SS
+            return _parse_cpi(bits, &cl->cpi_ss);
+        }
     }
 
     return 0;



More information about the libbluray-devel mailing list