[libbluray-devel] Added disc application info to BLURAY_DISC_INFO

hpi1 git at videolan.org
Sun Mar 23 12:55:19 CET 2014


libbluray | branch: master | hpi1 <hpi1 at anonymous.org> | Sun Mar 23 13:40:14 2014 +0200| [daea81460846e3ef50fe489457d64622577005d9] | committer: hpi1

Added disc application info to BLURAY_DISC_INFO

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

 ChangeLog              |    2 ++
 src/examples/bd_info.c |   27 +++++++++++++++++++++++++++
 src/libbluray/bluray.c |    7 +++++++
 src/libbluray/bluray.h |    8 ++++++++
 4 files changed, 44 insertions(+)

diff --git a/ChangeLog b/ChangeLog
index c1caa97..62113b5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,5 @@
+- Added disc application info to BLURAY_DISC_INFO
+
 2013-12-21: Version 0.5.0
 - Portability fixes.
 - Build system updates.
diff --git a/src/examples/bd_info.c b/src/examples/bd_info.c
index fbf8f31..cbd94d8 100644
--- a/src/examples/bd_info.c
+++ b/src/examples/bd_info.c
@@ -120,6 +120,31 @@ static void _print_meta(const META_DL *meta)
     }
 }
 
+static void _print_app_info(const BLURAY_DISC_INFO *info)
+{
+    static const char video_format_str[16][8] = {
+        "ignored", "480i", "576i", "480p", "1080i", "720p", "1080p", "576p"
+    };
+
+    static const char frame_rate_str[16][16] = {
+        "ignored",
+        "23.976 Hz",
+        "24 Hz",
+        "25 Hz",
+        "29.97 Hz",
+        "reserved",
+        "50 Hz",
+        "59.94 Hz"
+    };
+
+    printf("Application info:\n");
+    printf("  initial mode preference : %s\n",        info->initial_output_mode_preference ? "3D"  : "2D");
+    printf("  3D content exists       : %s\n",        info->content_exist_3D               ? "Yes" : "No");
+    printf("  video format            : %s (0x%x)\n", video_format_str[info->video_format & 0xf], info->video_format);
+    printf("  frame rate              : %s (0x%x)\n", frame_rate_str[info->frame_rate & 0xf],     info->frame_rate);
+    printf("  provider data           : \'%32s\'\n",  info->provider_data);
+}
+
 int main(int argc, char *argv[])
 {
     const char *disc_root = (argc > 1) ? argv[1] : NULL;
@@ -192,6 +217,8 @@ int main(int argc, char *argv[])
         }
     }
 
+    _print_app_info(info);
+
     _print_meta(bd_get_meta(bd));
 
     bd_close(bd);
diff --git a/src/libbluray/bluray.c b/src/libbluray/bluray.c
index 277b46c..a0974e1 100644
--- a/src/libbluray/bluray.c
+++ b/src/libbluray/bluray.c
@@ -953,6 +953,13 @@ static void _fill_disc_info(BLURAY *bd)
 
         bd->disc_info.bluray_detected = 1;
 
+        /* application info */
+        bd->disc_info.video_format     = bd->index->app_info.video_format;
+        bd->disc_info.frame_rate       = bd->index->app_info.frame_rate;
+        bd->disc_info.content_exist_3D = bd->index->app_info.content_exist_flag;
+        bd->disc_info.initial_output_mode_preference = bd->index->app_info.initial_output_mode_preference;
+        memcpy(bd->disc_info.provider_data, bd->index->app_info.user_data, sizeof(bd->disc_info.provider_data));
+
         /* count titles */
 
         for (ii = 0; ii < bd->index->num_titles; ii++) {
diff --git a/src/libbluray/bluray.h b/src/libbluray/bluray.h
index 10c8a09..4e8efc4 100644
--- a/src/libbluray/bluray.h
+++ b/src/libbluray/bluray.h
@@ -505,6 +505,14 @@ typedef struct {
     uint8_t  bdplus_gen;
     /* BD+ content code relese date */
     uint32_t bdplus_date;      /* (year << 16) | (month << 8) | day */
+
+    /* disc application info */
+    uint8_t video_format;             /* bd_video_format_e */
+    uint8_t frame_rate;               /* bd_frame_rate_e */
+    uint8_t content_exist_3D;
+    uint8_t initial_output_mode_preference;   /* 0 - 2D, 1 - 3D */
+    uint8_t provider_data[32];
+
 } BLURAY_DISC_INFO;
 
 /**



More information about the libbluray-devel mailing list