[libbluray-devel] [Git][videolan/libbluray][master] Parse and show initial dynamic range type

Petri Hintukainen gitlab at videolan.org
Mon Jul 6 19:21:39 CEST 2020



Petri Hintukainen pushed to branch master at VideoLAN / libbluray


Commits:
a235bbbe by rapperskull at 2020-07-06T20:18:37+03:00
Parse and show initial dynamic range type

- - - - -


5 changed files:

- src/examples/bd_info.c
- src/libbluray/bdnav/index_parse.c
- src/libbluray/bdnav/index_parse.h
- src/libbluray/bluray.c
- src/libbluray/bluray.h


Changes:

=====================================
src/examples/bd_info.c
=====================================
@@ -135,11 +135,18 @@ static void _print_app_info(const BLURAY_DISC_INFO *info)
         "59.94 Hz"
     };
 
+    static const char initial_dynamic_range_type_str[16][16] = {
+        "SDR",
+        "HDR10",
+        "Dolby Vision"
+    };
+
     printf("\nApplication 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("  initial dynamic range   : %s (0x%x)\n", initial_dynamic_range_type_str[info->initial_dynamic_range_type & 0xf],     info->initial_dynamic_range_type);
     printf("  provider data           : \'%32s\'\n",  info->provider_data);
 }
 


=====================================
src/libbluray/bdnav/index_parse.c
=====================================
@@ -169,10 +169,10 @@ static int _parse_app_info(BITSTREAM *bs, INDX_APP_INFO *app_info)
     bs_skip(bs, 1);
     app_info->initial_output_mode_preference = bs_read(bs, 1);
     app_info->content_exist_flag             = bs_read(bs, 1);
-    bs_skip(bs, 5);
-
-    app_info->video_format = bs_read(bs, 4);
-    app_info->frame_rate   = bs_read(bs, 4);
+    bs_skip(bs, 1);
+    app_info->initial_dynamic_range_type     = bs_read(bs, 4);
+    app_info->video_format                   = bs_read(bs, 4);
+    app_info->frame_rate                     = bs_read(bs, 4);
 
     bs_read_bytes(bs, app_info->user_data, 32);
 


=====================================
src/libbluray/bdnav/index_parse.h
=====================================
@@ -73,6 +73,7 @@ typedef enum {
 typedef struct {
     unsigned int       initial_output_mode_preference : 1; /* 0 - 2D, 1 - 3D */
     unsigned int       content_exist_flag : 1;
+    unsigned int       initial_dynamic_range_type : 4;
     unsigned int       video_format : 4;
     unsigned int       frame_rate : 4;
     uint8_t            user_data[32];


=====================================
src/libbluray/bluray.c
=====================================
@@ -987,10 +987,11 @@ static void _fill_disc_info(BLURAY *bd, BD_ENC_INFO *enc_info)
         bd->disc_info.bluray_detected = 1;
 
         /* application info */
-        bd->disc_info.video_format     = index->app_info.video_format;
-        bd->disc_info.frame_rate       = index->app_info.frame_rate;
-        bd->disc_info.content_exist_3D = index->app_info.content_exist_flag;
-        bd->disc_info.initial_output_mode_preference = index->app_info.initial_output_mode_preference;
+        bd->disc_info.video_format                      = index->app_info.video_format;
+        bd->disc_info.frame_rate                        = index->app_info.frame_rate;
+        bd->disc_info.initial_dynamic_range_type        = index->app_info.initial_dynamic_range_type;
+        bd->disc_info.content_exist_3D                  = index->app_info.content_exist_flag;
+        bd->disc_info.initial_output_mode_preference    = index->app_info.initial_output_mode_preference;
         memcpy(bd->disc_info.provider_data, index->app_info.user_data, sizeof(bd->disc_info.provider_data));
 
         /* allocate array for title info */


=====================================
src/libbluray/bluray.h
=====================================
@@ -120,6 +120,9 @@ typedef struct {
     uint8_t  bdplus_gen;          /* BD+ content code generation */
     uint32_t bdplus_date;         /* BD+ content code relese date ((year<<16)|(month<<8)|day) */
 
+    /* disc application info (libbluray > 1.2.0) */
+    uint8_t initial_dynamic_range_type; /* bd_dynamic_range_type_e */
+
 } BLURAY_DISC_INFO;
 
 /*
@@ -212,6 +215,12 @@ typedef enum {
     BLURAY_MARK_LINK      = 0x02,  /* link point */
 } bd_mark_type_e;
 
+typedef enum {
+    BLURAY_DYNAMIC_RANGE_SDR          = 0,
+    BLURAY_DYNAMIC_RANGE_HDR10        = 1,
+    BLURAY_DYNAMIC_RANGE_DOLBY_VISION = 2
+} bd_dynamic_range_type_e;
+
 typedef struct bd_stream_info {
     uint8_t     coding_type;
     uint8_t     format;



View it on GitLab: https://code.videolan.org/videolan/libbluray/-/commit/a235bbbe9ca7a055f7e00ee5d9b7deec303336d5

-- 
View it on GitLab: https://code.videolan.org/videolan/libbluray/-/commit/a235bbbe9ca7a055f7e00ee5d9b7deec303336d5
You're receiving this email because of your account on code.videolan.org.




More information about the libbluray-devel mailing list