4 * Copyright (C) 2005-2013 Team XBMC
7 * This Program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2, or (at your option)
12 * This Program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with XBMC; see the file COPYING. If not, see
19 * <http://www.gnu.org/licenses/>.
23 #include "DVDInputStream.h"
25 #include <boost/shared_ptr.hpp>
29 #include <libbluray/bluray.h>
30 #include <libbluray/keys.h>
31 #include <libbluray/overlay.h>
34 class CDVDOverlayImage;
38 class CDVDInputStreamBluray
39 : public CDVDInputStream
40 , public CDVDInputStream::IDisplayTime
41 , public CDVDInputStream::IChapter
42 , public CDVDInputStream::ISeekTime
43 , public CDVDInputStream::IMenus
46 CDVDInputStreamBluray(IDVDPlayer* player);
47 virtual ~CDVDInputStreamBluray();
48 virtual bool Open(const char* strFile, const std::string &content);
50 virtual int Read(BYTE* buf, int buf_size);
51 virtual int64_t Seek(int64_t offset, int whence);
52 virtual bool Pause(double dTime) { return false; };
54 virtual int64_t GetLength();
55 virtual int GetBlockSize() { return 6144; }
56 virtual ENextStream NextStream();
60 virtual void ActivateButton() { UserInput(BD_VK_ENTER); }
61 virtual void SelectButton(int iButton)
64 UserInput((bd_vk_key_e)(BD_VK_0 + iButton));
66 virtual int GetCurrentButton() { return 0; }
67 virtual int GetTotalButtons() { return 0; }
68 virtual void OnUp() { UserInput(BD_VK_UP); }
69 virtual void OnDown() { UserInput(BD_VK_DOWN); }
70 virtual void OnLeft() { UserInput(BD_VK_LEFT); }
71 virtual void OnRight() { UserInput(BD_VK_RIGHT); }
72 virtual void OnMenu();
78 virtual void OnNext() {}
79 virtual void OnPrevious() {}
80 virtual bool IsInMenu();
81 virtual bool OnMouseMove(const CPoint &point) { return false; }
82 virtual bool OnMouseClick(const CPoint &point) { return false; }
83 virtual double GetTimeStampCorrection() { return 0.0; }
85 void UserInput(bd_vk_key_e vk);
88 int GetChapterCount();
89 void GetChapterName(std::string& name) {};
90 bool SeekChapter(int ch);
94 bool SeekTime(int ms);
96 void GetStreamInfo(int pid, char* language);
98 void OverlayCallback(const BD_OVERLAY * const);
100 BLURAY_TITLE_INFO* GetTitleLongest();
101 BLURAY_TITLE_INFO* GetTitleFile(const std::string& name);
104 IDVDPlayer* m_player;
107 BLURAY_TITLE_INFO* m_title;
108 bool m_title_playing;
112 typedef boost::shared_ptr<CDVDOverlayImage> SOverlay;
113 typedef std::list<SOverlay> SOverlays;