7#include <QCoreApplication>
10#include "libmythbase/mythconfig.h"
20#ifndef __cpp_size_t_suffix
27#include "libbluray/bluray.h"
35#include <libbluray/log_control.h>
36#include <libbluray/meta_data.h>
37#include <libbluray/overlay.h>
38#include <libbluray/keys.h>
40#include "util/log_control.h"
41#include "libbluray/bdnav/meta_data.h"
42#include "libbluray/decoders/overlay.h"
43#include "libbluray/keys.h"
46#define LOC QString("BDBuffer: ")
71 LOG(VB_PLAYBACK, LOG_DEBUG,
LOC + QString(Message).trimmed());
74static int BDRead(
void *Handle,
void *
Buf,
int LBA,
int NumBlocks)
76 if (
MythFileSeek(*(
static_cast<int*
>(Handle)), LBA * 2048LL, SEEK_SET) != -1)
78 static_cast<size_t>(NumBlocks) * 2048) / 2048);
84 m_tryHDMVNavigation(qEnvironmentVariableIsSet(
"MYTHTV_HDMV")),
85 m_overlayPlanes(2, nullptr),
86 m_mainThread(QThread::currentThread())
103 bd_free_title_info(it.value());
106 bd_free_title_info(it.value());
130 ((Whence == SEEK_SET && Position ==
m_readPos) || (Whence == SEEK_CUR && Position == 0)))
138 long long newposition = (SEEK_SET == Whence) ? Position :
m_readPos + Position;
143 if ((SEEK_END == Whence) || ((SEEK_CUR == Whence) && newposition != 0))
165 QString cmd = QString(
"Seek(%1, %2)").arg(Position)
167 LOG(VB_GENERAL, LOG_ERR,
LOC + cmd +
" Failed" +
ENO);
177 LOG(VB_PLAYBACK, LOG_INFO,
LOC + QString(
"Seeking to '%1'").arg(Position));
180 return static_cast<uint64_t
>(bd_seek_time(
m_bdnav, Position));
215 else if (Actions.contains(
ACTION_0))
217 else if (Actions.contains(
ACTION_1))
219 else if (Actions.contains(
ACTION_2))
221 else if (Actions.contains(
ACTION_3))
223 else if (Actions.contains(
ACTION_4))
225 else if (Actions.contains(
ACTION_5))
227 else if (Actions.contains(
ACTION_6))
229 else if (Actions.contains(
ACTION_7))
231 else if (Actions.contains(
ACTION_8))
233 else if (Actions.contains(
ACTION_9))
252 qApp->processEvents(QEventLoop::ExcludeUserInputEvents);
279 QString
filename = QDir(QDir::cleanPath(Filename)).canonicalPath();
282 LOG(VB_GENERAL, LOG_ERR,
LOC + QString(
"%1 nonexistent").arg(Filename));
287 LOG(VB_GENERAL, LOG_INFO,
LOC + QString(
"Opened MythBDBuffer device at %1")
292 bd_set_debug_mask(DBG_CRIT | DBG_NAV | DBG_BLURAY);
310 QString keyfile = QString(
"%1/KEYDB.cfg").arg(
GetConfDir());
341 const meta_dl *metaDiscLibrary = bd_get_meta(
m_bdnav);
345 LOG(VB_GENERAL, LOG_INFO,
LOC + QString(
"Disc Title: %1 (%2)")
346 .arg(metaDiscLibrary->di_name, metaDiscLibrary->language_code));
347 LOG(VB_GENERAL, LOG_INFO,
LOC + QString(
"Alternative Title: %1")
348 .arg(metaDiscLibrary->di_alternative));
349 LOG(VB_GENERAL, LOG_INFO,
LOC + QString(
"Disc Number: %1 of %2")
350 .arg(metaDiscLibrary->di_set_number).arg(metaDiscLibrary->di_num_sets));
358 const BLURAY_DISC_INFO *discinfo = bd_get_disc_info(
m_bdnav);
361 LOG(VB_GENERAL, LOG_ERR,
LOC +
"Failed to retrieve disc info");
370 if ((discinfo->aacs_detected && !discinfo->aacs_handled) ||
371 (discinfo->bdplus_detected && !discinfo->bdplus_handled))
387 bd_set_player_setting(
m_bdnav, BLURAY_PLAYER_SETTING_PARENTAL, 99);
392 std::string country = QScountry.toLatin1().data();
393 bd_set_player_setting_str(
m_bdnav, BLURAY_PLAYER_SETTING_AUDIO_LANG, langpref.c_str());
395 bd_set_player_setting_str(
m_bdnav, BLURAY_PLAYER_SETTING_PG_LANG, langpref.c_str());
397 bd_set_player_setting_str(
m_bdnav, BLURAY_PLAYER_SETTING_MENU_LANG, langpref.c_str());
399 bd_set_player_setting_str(
m_bdnav, BLURAY_PLAYER_SETTING_COUNTRY_CODE, country.c_str());
403 bd_set_player_setting(
m_bdnav, BLURAY_PLAYER_SETTING_REGION_CODE, regioncode);
405 LOG(VB_GENERAL, LOG_INFO,
LOC + QString(
"Using %1 as keyfile...").arg(keyfile));
408 LOG(VB_GENERAL, LOG_INFO,
LOC +
"Retrieving title list (please wait).");
416 m_lastError = tr(
"Unable to find any Blu-ray compatible titles");
425 LOG(VB_PLAYBACK, LOG_INFO,
LOC +
"*** Blu-ray Disc Information ***");
426 LOG(VB_PLAYBACK, LOG_INFO,
LOC + QString(
"First Play Supported: %1")
427 .arg(discinfo->first_play_supported ?
"yes" :
"no"));
428 LOG(VB_PLAYBACK, LOG_INFO,
LOC + QString(
"Top Menu Supported: %1")
429 .arg(discinfo->top_menu_supported ?
"yes" :
"no"));
430 LOG(VB_PLAYBACK, LOG_INFO,
LOC + QString(
"Number of HDMV Titles: %1")
431 .arg(discinfo->num_hdmv_titles));
432 LOG(VB_PLAYBACK, LOG_INFO,
LOC + QString(
"Number of BD-J Titles: %1")
433 .arg(discinfo->num_bdj_titles));
434 if (discinfo->num_bdj_titles && discinfo->bdj_detected)
436 LOG(VB_PLAYBACK, LOG_INFO,
LOC + QString(
"BD-J Supported: %1")
437 .arg(discinfo->bdj_handled ?
"yes" :
"no"));
439 LOG(VB_PLAYBACK, LOG_INFO,
LOC + QString(
"Number of Unsupported Titles: %1")
440 .arg(discinfo->num_unsupported_titles));
441 LOG(VB_PLAYBACK, LOG_INFO,
LOC + QString(
"AACS present on disc: %1")
442 .arg(discinfo->aacs_detected ?
"yes" :
"no"));
443 LOG(VB_PLAYBACK, LOG_INFO,
LOC + QString(
"libaacs used: %1")
444 .arg(discinfo->libaacs_detected ?
"yes" :
"no"));
445 LOG(VB_PLAYBACK, LOG_INFO,
LOC + QString(
"AACS handled: %1")
446 .arg(discinfo->aacs_handled ?
"yes" :
"no"));
447 LOG(VB_PLAYBACK, LOG_INFO,
LOC + QString(
"BD+ present on disc: %1")
448 .arg(discinfo->bdplus_detected ?
"yes" :
"no"));
449 LOG(VB_PLAYBACK, LOG_INFO,
LOC + QString(
"libbdplus used: %1")
450 .arg(discinfo->libbdplus_detected ?
"yes" :
"no"));
451 LOG(VB_PLAYBACK, LOG_INFO,
LOC + QString(
"BD+ handled: %1")
452 .arg(discinfo->bdplus_handled ?
"yes" :
"no"));
489 LOG(VB_GENERAL, LOG_INFO,
LOC +
"Using HDMV navigation mode.");
498 LOG(VB_GENERAL, LOG_INFO,
LOC +
"Using title navigation mode.");
501 uint64_t titleLength = 0;
502 BLURAY_TITLE_INFO *titleInfo =
nullptr;
509 if (titleLength == 0 || (titleInfo->duration > titleLength))
512 titleLength = titleInfo->duration;
522 m_lastError = tr(
"Unable to find any usable Blu-ray titles");
545 return static_cast<long long>(bd_tell(
m_bdnav));
565 return bd_get_current_chapter(
m_bdnav);
575 return duration_cast<std::chrono::milliseconds>(
start);
584 return duration_cast<std::chrono::seconds>(
start);
615 if (numTitles <= 0 || Title < 0 || Title >=
static_cast<int>(numTitles))
648 bd_select_title(
m_bdnav, Index);
658 LOG(VB_PLAYBACK, LOG_INFO,
LOC +
"SwitchPlaylist - start");
666 LOG(VB_PLAYBACK, LOG_INFO,
LOC +
"SwitchPlaylist - end");
682 BLURAY_TITLE_INFO* result = bd_get_title_info(
m_bdnav, Index, 0);
685 LOG(VB_PLAYBACK, LOG_INFO,
LOC + QString(
"Found title %1 info").arg(Index));
701 BLURAY_TITLE_INFO* result = bd_get_playlist_info(
m_bdnav, Index, 0);
704 LOG(VB_PLAYBACK, LOG_INFO,
LOC + QString(
"Found playlist %1 info").arg(Index));
727 LOG(VB_GENERAL, LOG_INFO,
LOC + QString(
"New title info: Index %1 Playlist: %2 Duration: %3 ""Chapters: %5")
729 LOG(VB_GENERAL, LOG_INFO,
LOC + QString(
"New title info: Clips: %1 Angles: %2 Title Size: %3 Frame Rate %4")
733 for (
uint i = 0; i < chapter_count; i++)
736 LOG(VB_PLAYBACK, LOG_INFO,
LOC + QString(
"Chapter %1 found @ [%2]->%3")
739 QString::number(framenum)));
742 int still = BLURAY_STILL_NONE;
743 std::chrono::seconds time = 0s;
748 LOG(VB_PLAYBACK, LOG_INFO,
LOC +
749 QString(
"Clip %1 stillmode %2 stilltime %3 videostreams %4 audiostreams %5 igstreams %6")
762 LOG(VB_GENERAL, LOG_WARNING,
LOC +
"Warning: more than 1 clip, following still "
763 "frame analysis may be wrong");
766 if (still == BLURAY_STILL_TIME)
768 LOG(VB_PLAYBACK, LOG_INFO,
LOC + QString(
"Entering still frame (%1 seconds) UNSUPPORTED").arg(time.count()));
771 else if (still == BLURAY_STILL_INFINITE)
773 LOG(VB_PLAYBACK, LOG_INFO,
LOC +
"Entering infinite still frame.");
793 LOG(VB_GENERAL, LOG_INFO,
LOC + QString(
"Switching to Angle '%1'").arg(Angle));
794 bd_seamless_angle_change(
m_bdnav, Angle);
807 return bd_get_title_size(
m_bdnav);
813 int64_t newTimestamp = Timestamp;
814 if ((newTimestamp != AV_NOPTS_VALUE) && (newTimestamp >=
m_timeDiff))
828 result = bd_read_ext(
m_bdnav,
static_cast<unsigned char*
>(
Buffer),
829 static_cast<int>(Size), &event);
844 result = bd_read(
m_bdnav,
static_cast<unsigned char*
>(
Buffer),
static_cast<int>(Size));
881 case BLURAY_VIDEO_RATE_24000_1001:
return 23.97;
882 case BLURAY_VIDEO_RATE_24:
return 24.00;
883 case BLURAY_VIDEO_RATE_25:
return 25.00;
884 case BLURAY_VIDEO_RATE_30000_1001:
return 29.97;
885 case BLURAY_VIDEO_RATE_50:
return 50.00;
886 case BLURAY_VIDEO_RATE_60000_1001:
return 59.94;
902 const BLURAY_STREAM_INFO* stream =
FindStream(
StreamID, clip.audio_streams, clip.audio_stream_count);
905 const uint8_t* lang = stream->lang;
910 LOG(VB_GENERAL, LOG_INFO,
LOC + QString(
"Audio Lang: 0x%1 Code: %2")
922 const BLURAY_STREAM_INFO* stream =
FindStream(
StreamID, clip.pg_streams, clip.pg_stream_count);
925 const uint8_t* lang = stream->lang;
930 LOG(VB_GENERAL, LOG_INFO,
LOC + QString(
"Subtitle Lang: 0x%1 Code: %2")
937 LOG(VB_PLAYBACK, LOG_INFO,
LOC + QString(
"Key %1 (pts %2)").arg(Key).arg(Pts.count()));
942 bd_user_input(
m_bdnav, Pts.count(),
static_cast<uint32_t
>(Key));
949 if (Pts <= 0 || X == 0 || Y == 0)
951 bd_mouse_select(
m_bdnav, Pts, X, Y);
963 LOG(VB_PLAYBACK, LOG_INFO,
LOC +
"Top Menu not supported");
967 LOG(VB_PLAYBACK, LOG_INFO,
LOC + QString(
"GoToMenu %1").arg(Menu));
969 if (Menu.compare(
"root") == 0)
971 if (bd_menu_call(
m_bdnav, Pts.count()))
973 LOG(VB_PLAYBACK, LOG_INFO,
LOC +QString(
"Invoked Top Menu (pts %1)").arg(Pts.count()));
977 else if (Menu.compare(
"popup") == 0)
1009 switch (
Event.event) {
1012 case BD_EVENT_ERROR:
1013 LOG(VB_PLAYBACK, LOG_INFO,
LOC + QString(
"EVENT_ERROR %1").arg(
Event.param));
1015 case BD_EVENT_ENCRYPTED:
1016 LOG(VB_GENERAL, LOG_ERR,
LOC +
"EVENT_ENCRYPTED, playback will fail.");
1021 case BD_EVENT_ANGLE:
1022 LOG(VB_PLAYBACK, LOG_INFO,
LOC + QString(
"EVENT_ANGLE %1").arg(
Event.param));
1025 case BD_EVENT_TITLE:
1026 LOG(VB_PLAYBACK, LOG_INFO,
LOC + QString(
"EVENT_TITLE %1 (old %2)")
1030 case BD_EVENT_END_OF_TITLE:
1034 case BD_EVENT_PLAYLIST:
1035 LOG(VB_PLAYBACK, LOG_INFO,
LOC + QString(
"EVENT_PLAYLIST %1 (old %2)")
1042 case BD_EVENT_PLAYITEM:
1043 LOG(VB_PLAYBACK, LOG_INFO,
LOC + QString(
"EVENT_PLAYITEM %1").arg(
Event.param));
1049 int64_t diff = in - out;
1052 LOG(VB_PLAYBACK, LOG_DEBUG,
LOC + QString(
"PTS discontinuity - waiting for decoder: this %1, last %2, diff %3")
1053 .arg(in).arg(out).arg(diff));
1064 case BD_EVENT_CHAPTER:
1066 LOG(VB_PLAYBACK, LOG_INFO,
LOC + QString(
"EVENT_CHAPTER %1").arg(
Event.param));
1069 case BD_EVENT_PLAYMARK:
1071 LOG(VB_PLAYBACK, LOG_INFO,
LOC + QString(
"EVENT_PLAYMARK"));
1075 case BD_EVENT_PLAYLIST_STOP:
1077 LOG(VB_PLAYBACK, LOG_INFO,
LOC + QString(
"ToDo EVENT_PLAYLIST_STOP %1")
1081 case BD_EVENT_STILL:
1082 LOG(VB_PLAYBACK, LOG_INFO,
LOC + QString(
"EVENT_STILL %1").arg(
Event.param));
1084 case BD_EVENT_STILL_TIME:
1087 std::this_thread::sleep_for(10ms);
1090 LOG(VB_PLAYBACK, LOG_INFO,
LOC + QString(
"EVENT_SEEK"));
1095 case BD_EVENT_AUDIO_STREAM:
1096 LOG(VB_PLAYBACK, LOG_INFO,
LOC + QString(
"EVENT_AUDIO_STREAM %1").arg(
Event.param));
1099 case BD_EVENT_IG_STREAM:
1100 LOG(VB_PLAYBACK, LOG_INFO,
LOC + QString(
"EVENT_IG_STREAM %1").arg(
Event.param));
1103 case BD_EVENT_PG_TEXTST_STREAM:
1104 LOG(VB_PLAYBACK, LOG_INFO,
LOC + QString(
"EVENT_PG_TEXTST_STREAM %1").arg(
Event.param));
1107 case BD_EVENT_SECONDARY_AUDIO_STREAM:
1108 LOG(VB_PLAYBACK, LOG_INFO,
LOC + QString(
"EVENT_SECONDARY_AUDIO_STREAM %1").arg(
Event.param));
1111 case BD_EVENT_SECONDARY_VIDEO_STREAM:
1112 LOG(VB_PLAYBACK, LOG_INFO,
LOC + QString(
"EVENT_SECONDARY_VIDEO_STREAM %1").arg(
Event.param));
1116 case BD_EVENT_PG_TEXTST:
1117 LOG(VB_PLAYBACK, LOG_INFO,
LOC + QString(
"EVENT_PG_TEXTST %1")
1118 .arg(
Event.param ?
"enable" :
"disable"));
1121 case BD_EVENT_SECONDARY_AUDIO:
1122 LOG(VB_PLAYBACK, LOG_INFO,
LOC + QString(
"EVENT_SECONDARY_AUDIO %1")
1123 .arg(
Event.param ?
"enable" :
"disable"));
1126 case BD_EVENT_SECONDARY_VIDEO:
1127 LOG(VB_PLAYBACK, LOG_INFO,
LOC + QString(
"EVENT_SECONDARY_VIDEO %1")
1128 .arg(
Event.param ?
"enable" :
"disable"));
1131 case BD_EVENT_SECONDARY_VIDEO_SIZE:
1132 LOG(VB_PLAYBACK, LOG_INFO,
LOC + QString(
"EVENT_SECONDARY_VIDEO_SIZE %1")
1133 .arg(
Event.param==0 ?
"PIP" :
"fullscreen"));
1141 std::this_thread::sleep_for(40ms);
1146 LOG(VB_PLAYBACK, LOG_INFO,
LOC + QString(
"EVENT_MENU %1")
1147 .arg(
Event.param==0 ?
"no" :
"yes"));
1151 case BD_EVENT_KEY_INTEREST_TABLE:
1153 LOG(VB_PLAYBACK, LOG_INFO,
LOC + QString(
"ToDo EVENT_KEY_INTEREST_TABLE %1")
1157 case BD_EVENT_UO_MASK_CHANGED:
1159 LOG(VB_PLAYBACK, LOG_INFO,
LOC + QString(
"ToDo EVENT_UO_MASK_CHANGED %1")
1164 LOG(VB_PLAYBACK, LOG_ERR,
LOC + QString(
"Unknown Event! %1 %2")
1183 BLURAY_STREAM_INFO* Streams,
1186 const BLURAY_STREAM_INFO* stream =
nullptr;
1187 for (
int i = 0; i < StreamCount && !stream; i++)
1189 stream = &Streams[i];
1198 if (
FindStream(StreamId, clip.audio_streams, clip.audio_stream_count) ||
1199 FindStream(StreamId, clip.video_streams, clip.video_stream_count) ||
1200 FindStream(StreamId, clip.ig_streams, clip.ig_stream_count) ||
1201 FindStream(StreamId, clip.pg_streams, clip.pg_stream_count) ||
1202 FindStream(StreamId, clip.sec_audio_streams, clip.sec_audio_stream_count) ||
1203 FindStream(StreamId, clip.sec_video_streams, clip.sec_video_stream_count))
1232 LOG(VB_PLAYBACK, LOG_INFO,
LOC +
"Waiting for player's buffers to drain");
1236 std::this_thread::sleep_for(10ms);
1239 LOG(VB_GENERAL, LOG_ERR,
LOC +
"Player wait state was not cleared");
1253 LOG(VB_PLAYBACK, LOG_INFO,
LOC +
"Starting from beginning...");
1265 return !SerialNum.isEmpty();
1276 State = QString(
"title:%1,time:%2,angle:%3").arg(title).arg(time.count()).arg(angle);
1279 return !
State.isEmpty();
1286 QStringList states =
State.split(
",", Qt::SkipEmptyParts);
1287 QHash<QString, uint64_t> settings;
1289 for (
const QString& state : std::as_const(states))
1291 QStringList keyvalue = state.split(
":", Qt::SkipEmptyParts);
1292 if (keyvalue.length() != 2)
1294 LOG(VB_PLAYBACK, LOG_ERR,
LOC + QString(
"Invalid BD state: %1 (%2)")
1295 .arg(state,
State));
1299 settings[keyvalue[0]] = keyvalue[1].toULongLong();
1304 if (settings.contains(
"title") && settings.contains(
"time"))
1306 uint32_t title =
static_cast<uint32_t
>(settings[
"title"]);
1307 uint64_t time = settings[
"time"];
1310 if (settings.contains(
"angle"))
1311 angle = settings[
"angle"];
1362 LOG(VB_PLAYBACK, LOG_DEBUG, QString(
"--------------------"));
1363 LOG(VB_PLAYBACK, LOG_DEBUG, QString(
"overlay->cmd = %1, %2")
1364 .arg(Overlay->cmd).arg(Overlay->plane));
1365 LOG(VB_PLAYBACK, LOG_DEBUG, QString(
"overlay rect = (%1,%2,%3,%4)")
1366 .arg(Overlay->x).arg(Overlay->y).arg(Overlay->w).arg(Overlay->h));
1367 LOG(VB_PLAYBACK, LOG_DEBUG, QString(
"overlay->pts = %1")
1368 .arg(Overlay->pts));
1369 LOG(VB_PLAYBACK, LOG_DEBUG, QString(
"update palette = %1")
1370 .arg(Overlay->palette_update_flag ?
"yes":
"no"));
1374 switch(Overlay->cmd)
1376 case BD_OVERLAY_INIT:
1382 case BD_OVERLAY_CLOSE:
1397 case BD_OVERLAY_HIDE:
1398 case BD_OVERLAY_CLEAR:
1402 case BD_OVERLAY_WIPE:
1404 osd->
Wipe(Overlay->x, Overlay->y, Overlay->w, Overlay->h);
1406 case BD_OVERLAY_DRAW:
1409 const BD_PG_RLE_ELEM *rlep = Overlay->img;
1410 int actual = Overlay->w * Overlay->h;
1411 uint8_t *data = osd->
m_image.bits();
1412 data = &data[(Overlay->y * osd->
m_image.bytesPerLine()) + Overlay->x];
1413 for (
int i = 0; i < actual; i += rlep->len, rlep++)
1415 int dst_y = (i / Overlay->w) * osd->
m_image.bytesPerLine();
1416 int dst_x = (i % Overlay->w);
1417 memset(data + dst_y + dst_x, rlep->color, rlep->len);
1423 case BD_OVERLAY_FLUSH:
1427 newOverlay->m_image = osd->
m_image.convertToFormat(QImage::Format_ARGB32);
1428 newOverlay->m_pts = Overlay->pts;
1442 LOG(VB_PLAYBACK, LOG_DEBUG, QString(
"--------------------"));
1443 LOG(VB_PLAYBACK, LOG_DEBUG, QString(
"overlay->cmd,plane = %1, %2")
1444 .arg(Overlay->cmd).arg(Overlay->plane));
1445 LOG(VB_PLAYBACK, LOG_DEBUG, QString(
"overlay->(x,y,w,h) = %1,%2,%3x%4 - %5")
1446 .arg(Overlay->x).arg(Overlay->y).arg(Overlay->w).arg(Overlay->h).arg(Overlay->stride));
1447 LOG(VB_PLAYBACK, LOG_DEBUG, QString(
"overlay->pts = %1").arg(Overlay->pts));
1450 switch(Overlay->cmd)
1452 case BD_ARGB_OVERLAY_INIT:
1457 case BD_ARGB_OVERLAY_CLOSE:
1472 case BD_ARGB_OVERLAY_DRAW:
1476 uint8_t* data = osd->
m_image.bits();
1477 int32_t srcOffset = 0;
1478 int32_t dstOffset = (Overlay->y * osd->
m_image.bytesPerLine()) + (Overlay->x * 4);
1479 for (
uint16_t y = 0; y < Overlay->h; y++)
1481#ifdef __cpp_size_t_suffix
1482 memcpy(&data[dstOffset], &Overlay->argb[srcOffset], Overlay->w * 4UZ);
1484 memcpy(&data[dstOffset], &Overlay->argb[srcOffset], Overlay->w * 4_UZ);
1486 dstOffset += osd->
m_image.bytesPerLine();
1487 srcOffset += Overlay->stride;
1491 case BD_ARGB_OVERLAY_FLUSH:
1497 newOverlay->m_pts = Overlay->pts;
1502 LOG(VB_PLAYBACK, LOG_ERR, QString(
"Unknown ARGB overlay - %1").arg(Overlay->cmd));
void start(QThread::Priority p=QThread::InheritPriority)
Tell MThread to start running the thread in the near future.
A class to allow a MythMediaBuffer to read from BDs.
uint64_t GetTotalReadPosition(void)
QRecursiveMutex m_infoLock
void ClickButton(int64_t Pts, uint16_t X, uint16_t Y)
QHash< uint32_t, BLURAY_TITLE_INFO * > m_cachedTitleInfo
std::chrono::seconds GetTotalTimeOfTitle(void) const
std::chrono::seconds GetCurrentTime(void) const
int m_currentPGTextSTStream
void IgnoreWaitStates(bool Ignore) override
bool HandleAction(const QStringList &Actions, mpeg::chrono::pts Pts) override
bool GetNameAndSerialNum(QString &Name, QString &SerialNum) override
bool HandleBDEvents(void)
bool m_secondaryVideoIsFullscreen
std::chrono::milliseconds GetChapterStartTimeMs(uint32_t Chapter)
void HandleBDEvent(BD_EVENT &Event)
bool RestoreBDStateSnapshot(const QString &State)
Restore a BD snapshot.
void GetDescForPos(QString &Desc)
BLURAY_TITLE_INFO * GetPlaylistInfo(uint32_t Index)
void SkipBDWaitingForPlayer(void)
int SafeRead(void *Buffer, uint Size) override
void ProgressUpdate(void)
bool IsOpen(void) const override
QHash< uint32_t, BLURAY_TITLE_INFO * > m_cachedPlaylistInfo
long long GetReadPosition(void) const override
int GetCurrentTitle(void)
MythBDOverlay * GetOverlay(void)
bool IsReadingBlocked(void)
bool m_secondaryAudioEnabled
int64_t AdjustTimestamp(int64_t Timestamp) const
void UnblockReading(void)
uint32_t GetNumTitles(void) const
bool StartFromBeginning(void) override
int m_currentSecondaryVideoStream
uint32_t GetCurrentChapter(void)
bool IsValidStream(uint StreamId)
uint64_t GetCurrentAngle(void) const
QList< MythBDOverlay * > m_overlayImages
double GetFrameRate(void)
std::chrono::seconds GetTitleDuration(int Title)
BLURAY_TITLE_INFO * m_currentTitleInfo
bool SwitchAngle(uint Angle)
MythBDBuffer(const QString &Filename)
uint64_t GetNumAngles(void) const
bool GetBDStateSnapshot(QString &State)
Get a snapshot of the current BD state.
bool OpenFile(const QString &Filename, std::chrono::milliseconds Retry=kDefaultOpenTimeout) override
Opens a bluray device for reading.
QVector< MythBDOverlay * > m_overlayPlanes
mpeg::chrono::pts m_currentTitleLength
void SubmitOverlay(const bd_overlay_s *Overlay)
int GetAudioLanguage(uint StreamID)
std::chrono::seconds m_stillTime
mpeg::chrono::pts m_currentTime
bool SwitchTitle(uint32_t Index)
static const BLURAY_STREAM_INFO * FindStream(uint StreamID, BLURAY_STREAM_INFO *Streams, int StreamCount)
Find the stream with the given ID from an array of streams.
long long SeekInternal(long long Position, int Whence) override
uint64_t m_currentTitleAngleCount
int GetSubtitleLanguage(uint StreamID)
bool IsHDMVNavigation(void) const
void SubmitARGBOverlay(const bd_argb_overlay_s *Overlay)
int m_currentSecondaryAudioStream
uint32_t GetNumChapters(void)
bool UpdateTitleInfo(void)
BLURAY_TITLE_INFO * GetTitleInfo(uint32_t Index)
bool m_secondaryVideoEnabled
void PressButton(int32_t Key, mpeg::chrono::pts Pts)
bool m_firstPlaySupported
bool BDWaitingForPlayer(void) const
bool GoToMenu(const QString &Menu, mpeg::chrono::pts Pts)
jump to a Blu-ray root or popup menu
uint64_t GetChapterStartFrame(uint32_t Chapter)
uint64_t GetTitleSize(void) const
std::chrono::seconds GetChapterStartTime(uint32_t Chapter)
bool SwitchPlaylist(uint32_t Index)
bool IsInStillFrame(void) const override
bool GetNameAndSerialNum(QString &Name, QString &SerialNum)
void SetPalette(const BD_PG_PALETTE_ENTRY *Palette)
static ImageType inspectImage(const QString &path)
QString GetSetting(const QString &key, const QString &defaultval="")
int GetNumSetting(const QString &key, int defaultval=0)
MythLocale * GetLocale(void) const
This class is used as a container for messages.
static const Type kUpdateTvProgressEventType
QString GetCountryCode() const
bool IsInMenu(void) const override
QString m_discSerialNumber
MythOpticalState m_processState
Contains listing of PMT Stream ID's for various A/V Stream types.
int iso639_key_to_canonical_key(int iso639_2)
ISO 639-1 and ISO 639-2 support functions.
static QString iso639_key_to_str3(int code)
static int iso639_str3_to_key(const unsigned char *iso639_2)
bool is_current_thread(MThread *thread)
Use this to determine if you are in the named thread.
static void BDLogger(const char *Message)
static void FileOpenedCallback(void *Data)
static int BDRead(void *Handle, void *Buf, int LBA, int NumBlocks)
static void HandleOverlayCallback(void *Data, const bd_overlay_s *const Overlay)
static void HandleARGBOverlayCallback(void *Data, const bd_argb_overlay_s *const Overlay)
static constexpr int32_t BD_BLOCK_SIZE
void MythBDIORedirect(void)
MythCoreContext * gCoreContext
This global variable contains the MythCoreContext instance for the app.
ssize_t MythFileRead(int FileID, void *Buffer, size_t Count)
off_t MythFileSeek(int FileID, off_t Offset, int Whence)
int MythfileClose(int FileID)
void MythFileOpenRegisterCallback(const char *Pathname, void *Object, callback_t Func)
int MythFileOpen(const char *Pathname, int Flags)
#define ENO
This can be appended to the LOG args with "+".
#define LOG(_MASK_, _LEVEL_, _QSTRING_)
MythMainWindow * GetMythMainWindow(void)
static constexpr const char * ACTION_7
static constexpr const char * ACTION_5
static constexpr const char * ACTION_0
static constexpr const char * ACTION_LEFT
static constexpr const char * ACTION_DOWN
static constexpr const char * ACTION_3
static constexpr const char * ACTION_1
static constexpr const char * ACTION_4
static constexpr const char * ACTION_RIGHT
static constexpr const char * ACTION_SELECT
static constexpr const char * ACTION_UP
static constexpr const char * ACTION_6
static constexpr const char * ACTION_8
static constexpr const char * ACTION_2
static constexpr const char * ACTION_9
QString formatTime(std::chrono::milliseconds msecs, QString fmt)
Format a milliseconds time value.
QString intToPaddedString(int n, int width=2)
Creates a zero padded string representation of an integer.
std::chrono::duration< CHRONO_TYPE, std::ratio< 1, 90000 > > pts
#define ACTION_CHANNELDOWN