[libbluray-devel] [Git][videolan/libbluray][master] 6 commits: BD-J: Split CodingType from StreamInfo

Petri Hintukainen (@hpi) gitlab at videolan.org
Tue Jan 27 23:08:17 UTC 2026



Petri Hintukainen pushed to branch master at VideoLAN / libbluray


Commits:
bfa0624c by Petri Hintukainen at 2026-01-28T01:06:46+02:00
BD-J: Split CodingType from StreamInfo

- - - - -
64947ad6 by Petri Hintukainen at 2026-01-28T01:06:46+02:00
Trim trailing space

- - - - -
0dacae6f by Petri Hintukainen at 2026-01-28T01:06:46+02:00
Rename index_parse.h -> index_data.h

- - - - -
4089ba70 by Petri Hintukainen at 2026-01-28T01:06:46+02:00
Split index_data.h

- - - - -
76f44f2b by Petri Hintukainen at 2026-01-28T01:06:46+02:00
Silence pointer conversion warning

- - - - -
15dd24fe by Petri Hintukainen at 2026-01-28T01:06:46+02:00
BD-J: Add some type safety to Xlet default look store

- - - - -


7 changed files:

- src/file/dl_posix.c
- src/libbluray/bdj/java/org/bluray/ti/TitleImpl.java
- src/libbluray/bdj/java/org/videolan/BDJXletContext.java
- src/libbluray/bdj/java/org/videolan/StreamInfo.java
- + src/libbluray/bdj/java/org/videolan/ti/CodingTypeHelper.java
- + src/libbluray/bdnav/index_data.h
- src/libbluray/bdnav/index_parse.h


Changes:

=====================================
src/file/dl_posix.c
=====================================
@@ -137,7 +137,7 @@ const char *dl_get_path(void)
 
 #if defined(__APPLE__) || defined(HAVE_DLADDR)
         Dl_info dl_info;
-        int ret = dladdr((void *)dl_get_path, &dl_info);
+        int ret = dladdr((void *)(uintptr_t)dl_get_path, &dl_info);
         if (ret != 0) {
             lib_path = strdup(dl_info.dli_fname);
 


=====================================
src/libbluray/bdj/java/org/bluray/ti/TitleImpl.java
=====================================
@@ -28,16 +28,16 @@ public class TitleImpl implements Title {
     public PlayList[] getPlayLists() {
         if (bdjo == null)
             return new PlayList[0];
-       
+
         org.videolan.bdjo.PlayListTable plt = bdjo.getAccessiblePlaylists();
-        
+
         // If accessToAll flag is set, enumerate all playlists on the disc
         if (plt.isAccessToAll()) {
             String[] files = Libbluray.listBdFiles("BDMV" + java.io.File.separator + "PLAYLIST", false);
             if (files == null) {
                 return new PlayList[0];
             }
-            
+
             java.util.Vector allPlaylists = new java.util.Vector();
             for (int i = 0; i < files.length; i++) {
                 String file = files[i];
@@ -50,7 +50,7 @@ public class TitleImpl implements Title {
             allPlaylists.copyInto(playlists);
             return playlists;
         }
-        
+
         String[] playlistNames = plt.getPlayLists();
         PlayList[] playlists = new PlayList[playlistNames.length];
         for (int i = 0; i < playlistNames.length; i++)


=====================================
src/libbluray/bdj/java/org/videolan/BDJXletContext.java
=====================================
@@ -36,6 +36,7 @@ import org.bluray.ui.FrameAccurateAnimation;
 import org.dvb.application.AppID;
 import org.dvb.application.AppProxy;
 import org.dvb.application.AppsDatabase;
+import org.havi.ui.HLook;
 import org.havi.ui.HSceneFactory;
 import org.videolan.bdjo.AppCache;
 import org.videolan.bdjo.AppEntry;
@@ -292,7 +293,7 @@ public class BDJXletContext implements javax.tv.xlet.XletContext, javax.microedi
         return tvTimer;
     }
 
-    public static Object getXletDefaultLook(String key, Class defClass) {
+    public static HLook getXletDefaultLook(String key, Class defClass) {
         BDJXletContext ctx = BDJXletContext.getCurrentContext();
         if (ctx == null) {
             logger.error("getDefaultLook(): no context: " + Logger.dumpStack());
@@ -301,7 +302,7 @@ public class BDJXletContext implements javax.tv.xlet.XletContext, javax.microedi
         return ctx.getDefaultLook(key, defClass);
     }
 
-    public static void setXletDefaultLook(String key, Object look) {
+    public static void setXletDefaultLook(String key, HLook look) {
         BDJXletContext ctx = BDJXletContext.getCurrentContext();
         if (ctx == null) {
             logger.error("setDefaultLook(): no context: " + Logger.dumpStack());
@@ -310,13 +311,13 @@ public class BDJXletContext implements javax.tv.xlet.XletContext, javax.microedi
         ctx.setDefaultLook(key, look);
     }
 
-    private Object getDefaultLook(String key, Class defClass) {
-        Object look = null;
+    private HLook getDefaultLook(String key, Class defClass) {
+        HLook look = null;
         synchronized (defaultLooks) {
-            look = defaultLooks.get(key);
+            look = (HLook)defaultLooks.get(key);
             if (look == null) {
                 try {
-                    look = defClass.newInstance();
+                    look = (HLook)defClass.newInstance();
                     setDefaultLook(key, look);
                 } catch (Exception t) {
                     logger.error("Error creating default look " + defClass.getName() + " for " + key + ": " + t);
@@ -326,7 +327,7 @@ public class BDJXletContext implements javax.tv.xlet.XletContext, javax.microedi
         return look;
     }
 
-    private void setDefaultLook(String key, Object look) {
+    private void setDefaultLook(String key, HLook look) {
         synchronized (defaultLooks) {
             defaultLooks.remove(key);
             if (look != null) {


=====================================
src/libbluray/bdj/java/org/videolan/StreamInfo.java
=====================================
@@ -22,6 +22,7 @@ package org.videolan;
 import java.awt.Dimension;
 
 import org.bluray.ti.CodingType;
+import org.videolan.ti.CodingTypeHelper;
 
 public class StreamInfo {
     public StreamInfo(byte coding_type, byte format, byte rate,
@@ -36,43 +37,7 @@ public class StreamInfo {
     }
 
     public CodingType getCodingType() {
-        switch (coding_type) {
-        case (byte)0x02:
-            return CodingType.MPEG2_VIDEO;
-        case (byte)0x1b:
-            return CodingType.MPEG4_AVC_VIDEO;
-        case (byte)0xea:
-            return CodingType.SMPTE_VC1_VIDEO;
-        case (byte)0x80:
-            return CodingType.LPCM_AUDIO;
-        case (byte)0x81:
-            return CodingType.DOLBY_AC3_AUDIO;
-        case (byte)0x82:
-            return CodingType.DTS_AUDIO;
-        case (byte)0x83:
-            return CodingType.DOLBY_LOSSLESS_AUDIO;
-        case (byte)0x84:
-        case (byte)0xA1:
-            return CodingType.DOLBY_DIGITAL_PLUS_AUDIO;
-        case (byte)0x85:
-            return CodingType.DTS_HD_AUDIO_EXCEPT_XLL;
-        case (byte)0x86:
-            return CodingType.DTS_HD_AUDIO_XLL;
-        case (byte)0xA2:
-            return CodingType.DTS_HD_AUDIO_LBR;
-        //FIXME:case (byte)0x??:
-        //    return CodingType.DRA_AUDIO;
-        //FIXME:case (byte)0x??:
-        //    return CodingType.DRA_EXTENSION_AUDIO;
-        case (byte)0x90:
-            return CodingType.PRESENTATION_GRAPHICS;
-        case (byte)0x91:
-            return CodingType.INTERACTIVE_GRAPHICS;
-        case (byte)0x92:
-            return CodingType.TEXT_SUBTITLE;
-        default:
-            return null;
-        }
+        return CodingTypeHelper.getCodingType(coding_type);
     }
 
     public byte getFormat() {


=====================================
src/libbluray/bdj/java/org/videolan/ti/CodingTypeHelper.java
=====================================
@@ -0,0 +1,65 @@
+/*
+ * This file is part of libbluray
+ * Copyright (C) 2010  William Hahne
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library. If not, see
+ * <http://www.gnu.org/licenses/>.
+ */
+
+package org.videolan.ti;
+
+import javax.tv.service.navigation.StreamType;
+import org.bluray.ti.CodingType;
+
+public class CodingTypeHelper {
+    public static CodingType getCodingType(byte coding_type_byte) {
+        switch (coding_type_byte) {
+        case (byte)0x02:
+            return CodingType.MPEG2_VIDEO;
+        case (byte)0x1b:
+            return CodingType.MPEG4_AVC_VIDEO;
+        case (byte)0xea:
+            return CodingType.SMPTE_VC1_VIDEO;
+        case (byte)0x80:
+            return CodingType.LPCM_AUDIO;
+        case (byte)0x81:
+            return CodingType.DOLBY_AC3_AUDIO;
+        case (byte)0x82:
+            return CodingType.DTS_AUDIO;
+        case (byte)0x83:
+            return CodingType.DOLBY_LOSSLESS_AUDIO;
+        case (byte)0x84:
+        case (byte)0xA1:
+            return CodingType.DOLBY_DIGITAL_PLUS_AUDIO;
+        case (byte)0x85:
+            return CodingType.DTS_HD_AUDIO_EXCEPT_XLL;
+        case (byte)0x86:
+            return CodingType.DTS_HD_AUDIO_XLL;
+        case (byte)0xA2:
+            return CodingType.DTS_HD_AUDIO_LBR;
+        //FIXME:case (byte)0x??:
+        //    return CodingType.DRA_AUDIO;
+        //FIXME:case (byte)0x??:
+        //    return CodingType.DRA_EXTENSION_AUDIO;
+        case (byte)0x90:
+            return CodingType.PRESENTATION_GRAPHICS;
+        case (byte)0x91:
+            return CodingType.INTERACTIVE_GRAPHICS;
+        case (byte)0x92:
+            return CodingType.TEXT_SUBTITLE;
+        default:
+            return null;
+        }
+    }
+}


=====================================
src/libbluray/bdnav/index_data.h
=====================================
@@ -0,0 +1,126 @@
+/*
+ * This file is part of libbluray
+ * Copyright (C) 2010-2017  Petri Hintukainen <phintuka at users.sourceforge.net>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library. If not, see
+ * <http://www.gnu.org/licenses/>.
+ */
+
+#if !defined(_INDX_DATA_H_)
+#define _INDX_DATA_H_
+
+#include <stdint.h>
+
+typedef enum {
+    indx_video_format_ignored,
+    indx_video_480i,
+    indx_video_576i,
+    indx_video_480p,
+    indx_video_1080i,
+    indx_video_720p,
+    indx_video_1080p,
+    indx_video_576p,
+} indx_video_format;
+
+typedef enum {
+    indx_fps_reserved1,
+    indx_fps_23_976,
+    indx_fps_24,
+    indx_fps_25,
+    indx_fps_29_97,
+    indx_fps_reserved2,
+    indx_fps_50,
+    indx_fps_59_94,
+} indx_frame_rate;
+
+typedef enum {
+    indx_object_type_hdmv = 1,
+    indx_object_type_bdj  = 2,
+} indx_object_type;
+
+typedef enum {
+    indx_hdmv_playback_type_movie       = 0,
+    indx_hdmv_playback_type_interactive = 1,
+} indx_hdmv_playback_type;
+
+typedef enum {
+    indx_bdj_playback_type_movie       = 2,
+    indx_bdj_playback_type_interactive = 3,
+} indx_bdj_playback_type;
+
+typedef enum {
+    indx_access_permitted       = 0,  /* jump into this title is permitted.  title number may be shown on UI.  */
+    indx_access_prohibited      = 1,  /* jump into this title is prohibited. title number may be shown on UI. */
+    indx_access_hidden          = 3,  /* jump into this title is prohibited. title number shall not be shown on UI. */
+} indx_access_type;
+
+#define  INDX_ACCESS_PROHIBITED_MASK  0x01  /* if set, jump to this title is not allowed */
+#define  INDX_ACCESS_HIDDEN_MASK      0x02  /* if set, title number shall not be displayed on UI */
+
+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];
+} INDX_APP_INFO;
+
+typedef struct {
+    uint8_t            playback_type/* : 2*/;
+    char               name[6];
+} INDX_BDJ_OBJ;
+
+typedef struct {
+    uint8_t            playback_type/* : 2*/;
+    uint16_t           id_ref;
+} INDX_HDMV_OBJ;
+
+typedef struct {
+    uint8_t            object_type/* : 2*/;
+    /*union {*/
+        INDX_BDJ_OBJ   bdj;
+        INDX_HDMV_OBJ  hdmv;
+    /*};*/
+} INDX_PLAY_ITEM;
+
+typedef struct {
+    uint8_t            object_type/* : 2*/;
+    uint8_t            access_type/* : 2*/;
+    /*union {*/
+        INDX_BDJ_OBJ   bdj;
+        INDX_HDMV_OBJ  hdmv;
+    /*};*/
+} INDX_TITLE;
+
+typedef struct indx_root_s {
+    INDX_APP_INFO  app_info;
+    INDX_PLAY_ITEM first_play;
+    INDX_PLAY_ITEM top_menu;
+
+    uint16_t       num_titles;
+    INDX_TITLE    *titles;
+
+    uint32_t       indx_version;
+
+    /* UHD extension */
+    uint8_t        disc_type;
+    uint8_t        exist_4k_flag;
+    uint8_t        hdrplus_flag;
+    uint8_t        dv_flag;
+    uint8_t        hdr_flags;
+} INDX_ROOT;
+
+#endif // _INDX_DATA_H_
+


=====================================
src/libbluray/bdnav/index_parse.h
=====================================
@@ -1,6 +1,6 @@
 /*
  * This file is part of libbluray
- * Copyright (C) 2010-2017  Petri Hintukainen <phintuka at users.sourceforge.net>
+ * Copyright (C) 2010-2026  Petri Hintukainen <phintuka at users.sourceforge.net>
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
@@ -20,110 +20,9 @@
 #if !defined(_INDX_PARSE_H_)
 #define _INDX_PARSE_H_
 
-#include "util/attributes.h"
-
-#include <stdint.h>
-
-typedef enum {
-    indx_video_format_ignored,
-    indx_video_480i,
-    indx_video_576i,
-    indx_video_480p,
-    indx_video_1080i,
-    indx_video_720p,
-    indx_video_1080p,
-    indx_video_576p,
-} indx_video_format;
-
-typedef enum {
-    indx_fps_reserved1,
-    indx_fps_23_976,
-    indx_fps_24,
-    indx_fps_25,
-    indx_fps_29_97,
-    indx_fps_reserved2,
-    indx_fps_50,
-    indx_fps_59_94,
-} indx_frame_rate;
-
-typedef enum {
-    indx_object_type_hdmv = 1,
-    indx_object_type_bdj  = 2,
-} indx_object_type;
-
-typedef enum {
-    indx_hdmv_playback_type_movie       = 0,
-    indx_hdmv_playback_type_interactive = 1,
-} indx_hdmv_playback_type;
-
-typedef enum {
-    indx_bdj_playback_type_movie       = 2,
-    indx_bdj_playback_type_interactive = 3,
-} indx_bdj_playback_type;
-
-typedef enum {
-    indx_access_permitted       = 0,  /* jump into this title is permitted.  title number may be shown on UI.  */
-    indx_access_prohibited      = 1,  /* jump into this title is prohibited. title number may be shown on UI. */
-    indx_access_hidden          = 3,  /* jump into this title is prohibited. title number shall not be shown on UI. */
-} indx_access_type;
-
-#define  INDX_ACCESS_PROHIBITED_MASK  0x01  /* if set, jump to this title is not allowed */
-#define  INDX_ACCESS_HIDDEN_MASK      0x02  /* if set, title number shall not be displayed on UI */
-
-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];
-} INDX_APP_INFO;
-
-typedef struct {
-    uint8_t            playback_type/* : 2*/;
-    char               name[6];
-} INDX_BDJ_OBJ;
-
-typedef struct {
-    uint8_t            playback_type/* : 2*/;
-    uint16_t           id_ref;
-} INDX_HDMV_OBJ;
-
-typedef struct {
-    uint8_t            object_type/* : 2*/;
-    /*union {*/
-        INDX_BDJ_OBJ   bdj;
-        INDX_HDMV_OBJ  hdmv;
-    /*};*/
-} INDX_PLAY_ITEM;
-
-typedef struct {
-    uint8_t            object_type/* : 2*/;
-    uint8_t            access_type/* : 2*/;
-    /*union {*/
-        INDX_BDJ_OBJ   bdj;
-        INDX_HDMV_OBJ  hdmv;
-    /*};*/
-} INDX_TITLE;
-
-typedef struct indx_root_s {
-    INDX_APP_INFO  app_info;
-    INDX_PLAY_ITEM first_play;
-    INDX_PLAY_ITEM top_menu;
-
-    uint16_t       num_titles;
-    INDX_TITLE    *titles;
-
-    uint32_t       indx_version;
-
-    /* UHD extension */
-    uint8_t        disc_type;
-    uint8_t        exist_4k_flag;
-    uint8_t        hdrplus_flag;
-    uint8_t        dv_flag;
-    uint8_t        hdr_flags;
-} INDX_ROOT;
+#include "index_data.h"
 
+#include "util/attributes.h"
 
 struct bd_disc;
 



View it on GitLab: https://code.videolan.org/videolan/libbluray/-/compare/d4475bac019ae75b3515907e09ce1ec1561251a3...15dd24fe7dd684f4fba93870f69b4ce65ddd1ef4

-- 
View it on GitLab: https://code.videolan.org/videolan/libbluray/-/compare/d4475bac019ae75b3515907e09ce1ec1561251a3...15dd24fe7dd684f4fba93870f69b4ce65ddd1ef4
You're receiving this email because of your account on code.videolan.org.


VideoLAN code repository instance


More information about the libbluray-devel mailing list