Well the bludiscmenu.so is just a Wrapper for libbluray disc info, it shows only a list with all Titles in the Bluray. The "magic" is inside the MoviePlayer, cause the BluDiscMenu Calls the MoviePlayer with path to BluRay Disc and Title idx.
idx = self["menu"].getCurrent()[1]
newref = eServiceReference(0x04, 0, "%s:%03d" % (self.bd_mountpoint, idx))
newref.setData(1,1)
newref.setName("Bludisc title %d" % idx)
print "[Bludisc] play: ", name, newref.toString()
self.session.openWithCallback(self.moviefinished, BludiscPlayer, newref)
BludiscPlayer extends MoviePlayer:
class BludiscPlayer(MoviePlayer):
def __init__(self, session, service):
MoviePlayer.__init__(self, session, service)
self.skinName = "MoviePlayer"
def handleLeave(self, how):
self.is_closing = True
if how == "ask":
list = (
(_("Yes"), "quit"),
(_("No"), "continue")
)
from Screens.ChoiceBox import ChoiceBox
self.session.openWithCallback(self.leavePlayerConfirmed, ChoiceBox, title=_("Stop playing this movie?"), list = list)
else:
self.leavePlayerConfirmed([True, "quit"])
def showMovies(self):
pass
def movieSelected(self, service):
pass
The enigma2 binary of opendreambox has libbluray as direct dependency:
ldd -v enigma2
libfreetype.so.6 => /usr/lib/libfreetype.so.6 (0x77ac8000)
libfribidi.so.0 => /usr/lib/libfribidi.so.0 (0x77aa0000)
libgstpbutils-0.10.so.0 => /usr/lib/libgstpbutils-0.10.so.0 (0x77a6c000)
libgstreamer-0.10.so.0 => /usr/lib/libgstreamer-0.10.so.0 (0x7796c000)
libgobject-2.0.so.0 => /usr/lib/libgobject-2.0.so.0 (0x77908000)
librt.so.1 => /lib/librt.so.1 (0x778ec000)
libglib-2.0.so.0 => /usr/lib/libglib-2.0.so.0 (0x777a8000)
libdvbsi++.so.1 => /usr/lib/libdvbsi++.so.1 (0x77750000)
libpng12.so.0 => not found
libbluray.so.3 => /usr/lib/libbluray.so.3 (0x77720000)
libgif.so.4 => not found
libjpeg.so.8 => /usr/lib/libjpeg.so.8 (0x776d0000)
libxmlccwrap-0.0.12.so => /usr/lib/libxmlccwrap-0.0.12.so (0x776b4000)
libpython2.7.so.1.0 => /usr/lib/libpython2.7.so.1.0 (0x774fc000)
libsigc-2.0.so.0 => not found
libQtNetworkE.so.4 => not found
libQtGuiE.so.4 => not found
libQtCoreE.so.4 => /usr/lib/libQtCoreE.so.4 (0x77120000)
libaio.so.1 => not found
libcrypto.so.0.9.8 => /lib/libcrypto.so.0.9.8 (0x76fd4000)
libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0x76ec8000)
libm.so.6 => /lib/libm.so.6 (0x76e2c000)
libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x76df0000)
libpthread.so.0 => /lib/libpthread.so.0 (0x76dc4000)
libc.so.6 => /lib/libc.so.6 (0x76c30000)
libffi.so.6 => /usr/lib/libffi.so.6 (0x76c18000)
libgmodule-2.0.so.0 => /usr/lib/libgmodule-2.0.so.0 (0x76c04000)
libgthread-2.0.so.0 => /usr/lib/libgthread-2.0.so.0 (0x76bf0000)
libxml2.so.2 => /usr/lib/libxml2.so.2 (0x76a78000)
libdl.so.2 => /lib/libdl.so.2 (0x76a64000)
libz.so.1 => /lib/libz.so.1 (0x76a38000)
libutil.so.1 => /lib/libutil.so.1 (0x76a24000)
/lib/ld.so.1 (0x77b64000)
I have implemented a test.py with ctypes to use libbluray reading titles of a BDMV structure:
import sys
from ctypes import *
BLURAY_PLAYER_SETTING_PARENTAL = 13
BLURAY_PLAYER_SETTING_AUDIO_CAP = 15
BLURAY_PLAYER_SETTING_AUDIO_LANG = 16
BLURAY_PLAYER_SETTING_PG_LANG = 17
BLURAY_PLAYER_SETTING_MENU_LANG = 18
BLURAY_PLAYER_SETTING_COUNTRY_CODE = 19
BLURAY_PLAYER_SETTING_REGION_CODE = 20
BLURAY_PLAYER_SETTING_OUTPUT_PREFER = 21
BLURAY_PLAYER_SETTING_DISPLAY_CAP = 23
BLURAY_PLAYER_SETTING_3D_CAP = 24
BLURAY_PLAYER_SETTING_VIDEO_CAP = 29
BLURAY_PLAYER_SETTING_TEXT_CAP = 30
BLURAY_PLAYER_SETTING_PLAYER_PROFILE = 31
BLURAY_PLAYER_SETTING_DECODE_PG = 0x100
class BLURAY_DISC_INFO(Structure):
_fields_ = [("bluray_detected", c_ubyte),
("first_play_supported",c_ubyte),
("top_menu_supported",c_ubyte),
("num_hdmv_titles",c_uint),
("num_bdj_titles",c_uint),
("aacs_detected",c_uint),
("libaacs_detected",c_ubyte),
("aacs_handled",c_ubyte),
("bdplus_detected",c_ubyte),
("libbdplus_detected",c_ubyte),
("bdplus_handled",c_ubyte),
("aacs_error_code",c_int),
("aacs_mkbv",c_int),
("disc_id",c_ubyte * 20)]
class BLURAY_TITLE_INFO(Structure):
_fields_ = [("idx", c_uint),
("playlist",c_uint),
("duration",c_ulong),
("clip_count",c_uint),
("angle_count",c_ubyte),
("chapter_count",c_ulong),
("clips",POINTER( c_uint )),
("chapters",POINTER( c_uint )),
("mark_count",c_uint),
("marks",POINTER( c_uint ))]
class META_THUMBNAIL(Structure):
_fields_ = [("path",c_char_p),
("xres",c_uint),
("yres",c_uint)]
class META_TITLE(Structure):
_fields_ = [("title_number",c_uint),
("title_name",c_char_p)]
class META_DL(Structure):
_fields_ = [("language_code", c_uint),
("filename",c_char_p),
("di_name",c_char_p),
("di_alternative",c_char_p),
("di_num_sets",c_ubyte),
("di_set_number",c_ubyte),
("toc_count",c_uint),
("toc_entries",POINTER( META_TITLE )),
("thumb_count",c_ubyte),
("thumbnails",POINTER( META_THUMBNAIL ))]
lib = cdll.LoadLibrary('/usr/lib/libbluray.so.3')
lib.bd_get_title_info.restype = POINTER( BLURAY_TITLE_INFO )
lib.bd_get_meta.restype = POINTER( META_DL )
lib.bd_get_disc_info.restype = POINTER( BLURAY_DISC_INFO )
bd_mountpoint = sys.argv[1]
bd = lib.bd_open( bd_mountpoint, 0 )
disc_info = lib.bd_get_disc_info( bd )
di = disc_info[0]
print '%i %i %i %i %i %i %i %i %i %i %i %i %i' % (
di.bluray_detected,
di.first_play_supported,
di.top_menu_supported,
di.num_hdmv_titles,
di.num_bdj_titles,
di.aacs_detected,
di.libaacs_detected,
di.aacs_handled,
di.bdplus_detected,
di.libbdplus_detected,
di.bdplus_handled,
di.aacs_error_code,
di.aacs_mkbv )
bd_titles = lib.bd_get_titles( bd, 0, 0 )
for t in range( 0, bd_titles ):
title_info = lib.bd_get_title_info( bd, t, 0 )
ti = title_info[0]
print '%i %i %i %i %i %i %i' % ( ti.idx, ti.playlist, ti.duration, ti.clip_count, ti.angle_count, ti.chapter_count, ti.mark_count )
lib.bd_free_title_info( title_info )
if lib.bd_set_player_setting (bd, BLURAY_PLAYER_SETTING_REGION_CODE, 7) == 0:
print 'Failed to set BLURAY_PLAYER_SETTING_REGION_CODE'
if lib.bd_set_player_setting (bd, BLURAY_PLAYER_SETTING_PARENTAL, 99) == 0:
print 'Failed to set BLURAY_PLAYER_SETTING_PARENTAL'
if lib.bd_set_player_setting_str(bd, BLURAY_PLAYER_SETTING_AUDIO_LANG, "eng") == 0:
print 'Failed to set BLURAY_PLAYER_SETTING_AUDIO_LANG'
if lib.bd_set_player_setting_str(bd, BLURAY_PLAYER_SETTING_PG_LANG, "eng") == 0:
print 'Failed to set BLURAY_PLAYER_SETTING_PG_LANG'
if lib.bd_set_player_setting_str(bd, BLURAY_PLAYER_SETTING_MENU_LANG, "eng") == 0:
print 'Failed to set BLURAY_PLAYER_SETTING_MENU_LANG'
if lib.bd_set_player_setting_str(bd, BLURAY_PLAYER_SETTING_COUNTRY_CODE, "en") == 0:
print 'Failed to set BLURAY_PLAYER_SETTING_COUNTRY_CODE'
lib.bd_get_event( bd, 0 )
meta_data = lib.bd_get_meta( bd )
try:
md = meta_data[0]
print 'di_name %s' % ( md.di_name )
except ValueError:
print 'No Metadata'
lib.bd_close( bd );
Output:
1 1 0 1 0 0 0 0 0 0 0 0 0
0 0 525960000 0 11 1 4837888
No Metadata
So the bludiscmenu.so is not needed, but the OpenPLI MoviePlayer must use libbluray to play the BDMV structure ...
Is the MoviePlayer of OpenPLI closed source too?
Edited by pmneo, 1 October 2013 - 09:00.