Skip to content

Commit

Permalink
[bluray] Initial support for menu's, no BD-J supported
Browse files Browse the repository at this point in the history
Code will fall back to longest item if there is not first play
hdmv item. However it will still try menu's if there is only
some unnsupported BD-J titles. This could possible fail to
play if it switches into BD-J mode later in menu's.

Starting index.bdmv will still only play longest title,
to attempt playback with menu's, start the MovieObject.bdmv
  • Loading branch information
elupus committed Apr 10, 2012
1 parent 9b1dd39 commit 226c850
Show file tree
Hide file tree
Showing 5 changed files with 546 additions and 41 deletions.
32 changes: 32 additions & 0 deletions lib/DllLibbluray.h
Expand Up @@ -30,6 +30,8 @@ extern "C"
#include <libbluray/bluray.h> #include <libbluray/bluray.h>
#include <libbluray/filesystem.h> #include <libbluray/filesystem.h>
#include <libbluray/log_control.h> #include <libbluray/log_control.h>
#include <libbluray/keys.h>
#include <libbluray/overlay.h>
} }


class DllLibblurayInterface class DllLibblurayInterface
Expand Down Expand Up @@ -65,6 +67,16 @@ class DllLibblurayInterface
virtual void bd_set_debug_mask(uint32_t mask)=0; virtual void bd_set_debug_mask(uint32_t mask)=0;
virtual uint32_t bd_get_debug_mask(void)=0; virtual uint32_t bd_get_debug_mask(void)=0;
virtual const BLURAY_DISC_INFO *bd_get_disc_info(BLURAY *bd)=0; virtual const BLURAY_DISC_INFO *bd_get_disc_info(BLURAY *bd)=0;

virtual int bd_get_event (BLURAY *bd, BD_EVENT *event)=0;
virtual int bd_play (BLURAY *bd)=0;
virtual int bd_read_ext (BLURAY *bd, unsigned char *buf, int len, BD_EVENT *event)=0;
virtual int bd_read_skip_still (BLURAY *bd)=0;
virtual int bd_user_input (BLURAY *bd, int64_t pts, uint32_t key)=0;
virtual int bd_set_player_setting (BLURAY *bd, uint32_t idx, uint32_t value)=0;
virtual int bd_set_player_setting_str (BLURAY *bd, uint32_t idx, const char *s)=0;
virtual void bd_register_overlay_proc (BLURAY *bd, void *handle, bd_overlay_proc_f func)=0;
virtual int bd_menu_call (BLURAY *bd, int64_t pts)=0;
}; };


class DllLibbluray : public DllDynamic, DllLibblurayInterface class DllLibbluray : public DllDynamic, DllLibblurayInterface
Expand Down Expand Up @@ -100,6 +112,16 @@ class DllLibbluray : public DllDynamic, DllLibblurayInterface
DEFINE_METHOD0(uint32_t, bd_get_debug_mask) DEFINE_METHOD0(uint32_t, bd_get_debug_mask)
DEFINE_METHOD1(const BLURAY_DISC_INFO*, bd_get_disc_info, (BLURAY *p1)) DEFINE_METHOD1(const BLURAY_DISC_INFO*, bd_get_disc_info, (BLURAY *p1))


DEFINE_METHOD2(int, bd_get_event, (BLURAY *p1, BD_EVENT *p2))
DEFINE_METHOD1(int, bd_play, (BLURAY *p1))
DEFINE_METHOD4(int, bd_read_ext, (BLURAY *p1, unsigned char *p2, int p3, BD_EVENT *p4))
DEFINE_METHOD1(int, bd_read_skip_still, (BLURAY *p1))
DEFINE_METHOD3(int, bd_user_input, (BLURAY *p1, int64_t p2, uint32_t p3))
DEFINE_METHOD3(int, bd_set_player_setting, (BLURAY *p1, uint32_t p2, uint32_t p3))
DEFINE_METHOD3(int, bd_set_player_setting_str, (BLURAY *p1, uint32_t p2, const char *p3))
DEFINE_METHOD3(void, bd_register_overlay_proc, (BLURAY *p1, void *p2, bd_overlay_proc_f p3))
DEFINE_METHOD2(int, bd_menu_call, (BLURAY *p1, int64_t p2))

BEGIN_METHOD_RESOLVE() BEGIN_METHOD_RESOLVE()
RESOLVE_METHOD(bd_get_titles) RESOLVE_METHOD(bd_get_titles)
RESOLVE_METHOD(bd_get_title_info) RESOLVE_METHOD(bd_get_title_info)
Expand Down Expand Up @@ -129,6 +151,16 @@ class DllLibbluray : public DllDynamic, DllLibblurayInterface
RESOLVE_METHOD(bd_set_debug_mask) RESOLVE_METHOD(bd_set_debug_mask)
RESOLVE_METHOD(bd_get_debug_mask) RESOLVE_METHOD(bd_get_debug_mask)
RESOLVE_METHOD(bd_get_disc_info) RESOLVE_METHOD(bd_get_disc_info)

RESOLVE_METHOD(bd_get_event)
RESOLVE_METHOD(bd_play)
RESOLVE_METHOD(bd_read_ext)
RESOLVE_METHOD(bd_read_skip_still)
RESOLVE_METHOD(bd_user_input)
RESOLVE_METHOD(bd_set_player_setting)
RESOLVE_METHOD(bd_set_player_setting_str)
RESOLVE_METHOD(bd_register_overlay_proc)
RESOLVE_METHOD(bd_menu_call)
END_METHOD_RESOLVE() END_METHOD_RESOLVE()


public: public:
Expand Down
Expand Up @@ -54,7 +54,7 @@ CDVDInputStream* CDVDFactoryInputStream::CreateInputStream(IDVDPlayer* pPlayer,
} }
#ifdef HAVE_LIBBLURAY #ifdef HAVE_LIBBLURAY
else if (item.IsType(".bdmv") || item.IsType(".mpls") || content == "bluray/iso") else if (item.IsType(".bdmv") || item.IsType(".mpls") || content == "bluray/iso")
return new CDVDInputStreamBluray(); return new CDVDInputStreamBluray(pPlayer);
#endif #endif
else if(file.substr(0, 6) == "rtp://" else if(file.substr(0, 6) == "rtp://"
|| file.substr(0, 7) == "rtsp://" || file.substr(0, 7) == "rtsp://"
Expand Down

3 comments on commit 226c850

@arnova
Copy link
Member

@arnova arnova commented on 226c850 Apr 11, 2012

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This fails to compile on Linux systems which don't have libbluray installed

@elupus
Copy link
Contributor

@elupus elupus commented on 226c850 Apr 11, 2012 via email

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@arnova
Copy link
Member

@arnova arnova commented on 226c850 Apr 11, 2012

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed compile error in 8d0d0b3

Please sign in to comment.