[libbluray-devel] Added some data to title info (will be used in BD-J)

cb2000 git at videolan.org
Wed Sep 12 12:53:41 CEST 2012


libbluray | branch: master | cb2000 <cb2000 at anonymous.org> | Tue Sep 11 15:27:33 2012 +0300| [5feb83f40dafad73184146c0eee71a43502a2a46] | committer: hpi1

Added some data to title info (will be used in BD-J)

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

 src/libbluray/bluray.c |   19 +++++++++++++++++++
 src/libbluray/bluray.h |   18 ++++++++++++++++++
 2 files changed, 37 insertions(+)

diff --git a/src/libbluray/bluray.c b/src/libbluray/bluray.c
index 244abfb..34f5dcc 100644
--- a/src/libbluray/bluray.c
+++ b/src/libbluray/bluray.c
@@ -1741,6 +1741,10 @@ static void _copy_streams(NAV_CLIP *clip, BLURAY_STREAM_INFO *streams, MPLS_STRE
         memcpy(streams[ii].lang, si[ii].lang, 4);
         streams[ii].pid = si[ii].pid;
         streams[ii].aspect = nav_lookup_aspect(clip, si[ii].pid);
+        if ((si->stream_type == 2) || (si->stream_type == 3))
+            streams[ii].subpath_id = si->subpath_id;
+        else
+            streams[ii].subpath_id = -1;
     }
 }
 
@@ -1761,6 +1765,17 @@ static BLURAY_TITLE_INFO* _fill_title_info(NAV_TITLE* title, uint32_t title_idx,
         title_info->chapters[ii].start = (uint64_t)title->chap_list.mark[ii].title_time * 2;
         title_info->chapters[ii].duration = (uint64_t)title->chap_list.mark[ii].duration * 2;
         title_info->chapters[ii].offset = (uint64_t)title->chap_list.mark[ii].title_pkt * 192L;
+        title_info->chapters[ii].clip_ref = title->chap_list.mark[ii].clip_ref;
+    }
+    title_info->mark_count = title->mark_list.count;
+    title_info->marks = calloc(title_info->mark_count, sizeof(BLURAY_TITLE_MARK));
+    for (ii = 0; ii < title_info->mark_count; ii++) {
+        title_info->marks[ii].idx = ii;
+		title_info->marks[ii].type = title->mark_list.mark[ii].mark_type;
+        title_info->marks[ii].start = (uint64_t)title->mark_list.mark[ii].title_time * 2;
+        title_info->marks[ii].duration = (uint64_t)title->mark_list.mark[ii].duration * 2;
+        title_info->marks[ii].offset = (uint64_t)title->mark_list.mark[ii].title_pkt * 192L;
+		title_info->marks[ii].clip_ref = title->mark_list.mark[ii].clip_ref;
     }
     title_info->clip_count = title->clip_list.count;
     title_info->clips = calloc(title_info->clip_count, sizeof(BLURAY_CLIP_INFO));
@@ -1770,6 +1785,9 @@ static BLURAY_TITLE_INFO* _fill_title_info(NAV_TITLE* title, uint32_t title_idx,
         NAV_CLIP *nc = &title->clip_list.clip[ii];
 
         ci->pkt_count = nc->end_pkt - nc->start_pkt;
+        ci->start_time = (uint64_t)nc->start_time * 2;
+        ci->in_time = (uint64_t)pi->in_time * 2;
+        ci->out_time = (uint64_t)pi->out_time * 2;
         ci->still_mode = pi->still_mode;
         ci->still_time = pi->still_time;
         ci->video_stream_count = pi->stn.num_video;
@@ -1848,6 +1866,7 @@ void bd_free_title_info(BLURAY_TITLE_INFO *title_info)
     unsigned int ii;
 
     X_FREE(title_info->chapters);
+    X_FREE(title_info->marks);
     for (ii = 0; ii < title_info->clip_count; ii++) {
         X_FREE(title_info->clips[ii].video_streams);
         X_FREE(title_info->clips[ii].audio_streams);
diff --git a/src/libbluray/bluray.h b/src/libbluray/bluray.h
index 07b2831..08d3508 100644
--- a/src/libbluray/bluray.h
+++ b/src/libbluray/bluray.h
@@ -130,6 +130,7 @@ typedef struct bd_stream_info {
     uint8_t     lang[4];
     uint16_t    pid;
     uint8_t     aspect;
+    uint8_t     subpath_id;
 } BLURAY_STREAM_INFO;
 
 typedef struct bd_clip {
@@ -148,6 +149,10 @@ typedef struct bd_clip {
     BLURAY_STREAM_INFO *ig_streams;
     BLURAY_STREAM_INFO *sec_audio_streams;
     BLURAY_STREAM_INFO *sec_video_streams;
+
+    uint64_t           start_time;
+    uint64_t           in_time;
+    uint64_t           out_time;
 } BLURAY_CLIP_INFO;
 
 typedef struct bd_chapter {
@@ -155,8 +160,18 @@ typedef struct bd_chapter {
     uint64_t    start;
     uint64_t    duration;
     uint64_t    offset;
+    unsigned    clip_ref;
 } BLURAY_TITLE_CHAPTER;
 
+typedef struct bd_mark {
+    uint32_t    idx;
+    int         type;
+    uint64_t    start;
+    uint64_t    duration;
+    uint64_t    offset;
+    unsigned    clip_ref;
+} BLURAY_TITLE_MARK;
+
 typedef struct bd_title_info {
     uint32_t             idx;
     uint32_t             playlist;
@@ -166,6 +181,9 @@ typedef struct bd_title_info {
     uint32_t             chapter_count;
     BLURAY_CLIP_INFO     *clips;
     BLURAY_TITLE_CHAPTER *chapters;
+
+    uint32_t             mark_count;
+    BLURAY_TITLE_MARK    *marks;
 } BLURAY_TITLE_INFO;
 
 typedef struct bd_sound_effect {



More information about the libbluray-devel mailing list