1818#include " bluray.h"
1919#include " tv.h" // for actions
2020
21- #define LOC QString (" BDRingBuf(%1) : " ).arg(filename )
22- #define LOC_WARN QString (" BDRingBuf(%1) Warning: " ).arg(filename )
23- #define LOC_ERR QString (" BDRingBuf(%1) Error: " ).arg(filename )
21+ #define LOC QString (" BDRingBuf: " )
22+ #define LOC_WARN QString (" BDRingBuf Warning: " )
23+ #define LOC_ERR QString (" BDRingBuf Error: " )
2424
2525static void HandleOverlayCallback(void *data, const bd_overlay_s *const overlay)
2626{
@@ -146,8 +146,7 @@ long long BDRingBuffer::Seek(long long pos, int whence, bool has_lock)
146146
147147uint64_t BDRingBuffer::Seek (uint64_t pos)
148148{
149- VERBOSE (VB_PLAYBACK, LOC + QString (" Seeking to %1." )
150- .arg (pos));
149+ VERBOSE (VB_PLAYBACK, LOC + QString (" Seeking to %1." ).arg (pos));
151150 if (bdnav)
152151 return bd_seek_time (bdnav, pos);
153152 return 0 ;
@@ -291,29 +290,28 @@ bool BDRingBuffer::OpenFile(const QString &lfilename, uint retry_ms)
291290 const BLURAY_DISC_INFO *discinfo = bd_get_disc_info (bdnav);
292291 if (discinfo)
293292 {
294- VERBOSE (VB_PLAYBACK, QString (
295- " *** Blu-ray Disc Information ***\n "
296- " First Play Supported: %1\n "
297- " Top Menu Supported: %2\n "
298- " Number of HDMV Titles: %3\n "
299- " Number of BD-J Titles: %4\n "
300- " Number of Unsupported Titles: %5\n "
301- " AACS present on disc: %6\n "
302- " libaacs used: %7\n "
303- " AACS handled: %8\n "
304- " BD+ present on disc: %9\n "
305- " libbdplus used: %10\n "
306- " BD+ handled: %11" )
307- .arg (discinfo->first_play_supported ? " yes" : " no" )
308- .arg (discinfo->top_menu_supported ? " yes" : " no" )
309- .arg (discinfo->num_hdmv_titles )
310- .arg (discinfo->num_bdj_titles )
311- .arg (discinfo->num_unsupported_titles )
312- .arg (discinfo->aacs_detected ? " yes" : " no" )
313- .arg (discinfo->libaacs_detected ? " yes" : " no" )
314- .arg (discinfo->aacs_handled ? " yes" : " no" )
315- .arg (discinfo->bdplus_detected ? " yes" : " no" )
316- .arg (discinfo->libbdplus_detected ? " yes" : " no" )
293+ VERBOSE (VB_PLAYBACK, LOC + QString (" *** Blu-ray Disc Information ***" ));
294+ VERBOSE (VB_PLAYBACK, LOC + QString (" First Play Supported: %1" )
295+ .arg (discinfo->first_play_supported ? " yes" : " no" ));
296+ VERBOSE (VB_PLAYBACK, LOC + QString (" Top Menu Supported: %1" )
297+ .arg (discinfo->top_menu_supported ? " yes" : " no" ));
298+ VERBOSE (VB_PLAYBACK, LOC + QString (" Number of HDMV Titles: %1" )
299+ .arg (discinfo->num_hdmv_titles ));
300+ VERBOSE (VB_PLAYBACK, LOC + QString (" Number of BD-J Titles: %1" )
301+ .arg (discinfo->num_bdj_titles ));
302+ VERBOSE (VB_PLAYBACK, LOC + QString (" Number of Unsupported Titles: %1" )
303+ .arg (discinfo->num_unsupported_titles ));
304+ VERBOSE (VB_PLAYBACK, LOC + QString (" AACS present on disc: %1" )
305+ .arg (discinfo->aacs_detected ? " yes" : " no" ));
306+ VERBOSE (VB_PLAYBACK, LOC + QString (" libaacs used: %1" )
307+ .arg (discinfo->libaacs_detected ? " yes" : " no" ));
308+ VERBOSE (VB_PLAYBACK, LOC + QString (" AACS handled: %1" )
309+ .arg (discinfo->aacs_handled ? " yes" : " no" ));
310+ VERBOSE (VB_PLAYBACK, LOC + QString (" BD+ present on disc: %1" )
311+ .arg (discinfo->bdplus_detected ? " yes" : " no" ));
312+ VERBOSE (VB_PLAYBACK, LOC + QString (" libbdplus used: %1" )
313+ .arg (discinfo->libbdplus_detected ? " yes" : " no" ));
314+ VERBOSE (VB_PLAYBACK, LOC + QString (" BD+ handled: %1" )
317315 .arg (discinfo->bdplus_handled ? " yes" : " no" ));
318316 }
319317
@@ -351,7 +349,9 @@ bool BDRingBuffer::OpenFile(const QString &lfilename, uint retry_ms)
351349 .arg (QString (keyfilepath)));
352350
353351 // Return an index of relevant titles (excludes dupe clips + titles)
352+ VERBOSE (VB_GENERAL, LOC + QString (" Retrieving title list (please wait)." ));
354353 m_numTitles = bd_get_titles (bdnav, TITLES_RELEVANT);
354+ VERBOSE (VB_GENERAL, LOC + QString (" Found %1 titles." ).arg (m_numTitles));
355355 m_mainTitle = 0 ;
356356 m_currentTitleLength = 0 ;
357357 m_titlesize = 0 ;
@@ -396,9 +396,7 @@ bool BDRingBuffer::OpenFile(const QString &lfilename, uint retry_ms)
396396 }
397397 else
398398 {
399- VERBOSE (VB_IMPORTANT, LOC + QString (" Using title navigation mode - "
400- " Found %1 relevant titles." )
401- .arg (m_numTitles));
399+ VERBOSE (VB_IMPORTANT, LOC + QString (" Using title navigation mode." ));
402400
403401 // Loop through the relevant titles and find the longest
404402 uint64_t titleLength = 0 ;
@@ -539,7 +537,7 @@ BLURAY_TITLE_INFO* BDRingBuffer::GetTitleInfo(uint32_t index)
539537 BLURAY_TITLE_INFO* result = bd_get_title_info (bdnav, index);
540538 if (result)
541539 {
542- VERBOSE (VB_PLAYBACK, QString (" Found title %1 info" ).arg (index));
540+ VERBOSE (VB_PLAYBACK, LOC + QString (" Found title %1 info" ).arg (index));
543541 m_cachedTitleInfo.insert (index,result);
544542 return result;
545543 }
@@ -558,7 +556,7 @@ BLURAY_TITLE_INFO* BDRingBuffer::GetPlaylistInfo(uint32_t index)
558556 BLURAY_TITLE_INFO* result = bd_get_playlist_info (bdnav, index);
559557 if (result)
560558 {
561- VERBOSE (VB_PLAYBACK, QString (" Found playlist %1 info" ).arg (index));
559+ VERBOSE (VB_PLAYBACK, LOC + QString (" Found playlist %1 info" ).arg (index));
562560 m_cachedPlaylistInfo.insert (index,result);
563561 return result;
564562 }
@@ -739,7 +737,7 @@ int BDRingBuffer::GetAudioLanguage(uint streamID)
739737 memcpy (lang, m_currentTitleInfo->clips ->audio_streams [streamID].lang , 4 );
740738 int code = iso639_key_to_canonical_key ((lang[0 ]<<16 )|(lang[1 ]<<8 )|lang[2 ]);
741739
742- VERBOSE (VB_IMPORTANT, QString (" Audio Lang: %1 Code: %2" ).arg (code).arg (iso639_key_to_str3 (code)));
740+ VERBOSE (VB_IMPORTANT, LOC + QString (" Audio Lang: %1 Code: %2" ).arg (code).arg (iso639_key_to_str3 (code)));
743741
744742 return code;
745743}
@@ -762,7 +760,9 @@ int BDRingBuffer::GetSubtitleLanguage(uint streamID)
762760 uint8_t lang[4 ] = { 0 , 0 , 0 , 0 };
763761 memcpy (lang, m_currentTitleInfo->clips ->pg_streams [streamID].lang , 4 );
764762 int code = iso639_key_to_canonical_key ((lang[0 ]<<16 )|(lang[1 ]<<8 )|lang[2 ]);
765- VERBOSE (VB_IMPORTANT, QString (" Subtitle Lang: %1 Code: %2" ).arg (code).arg (iso639_key_to_str3 (code)));
763+ VERBOSE (VB_IMPORTANT, LOC +
764+ QString (" Subtitle Lang: %1 Code: %2" )
765+ .arg (code).arg (iso639_key_to_str3 (code)));
766766 return code;
767767 }
768768 subCount++;
@@ -801,14 +801,14 @@ bool BDRingBuffer::GoToMenu(const QString str, int64_t pts)
801801 if (!m_is_hdmv_navigation || pts <= 0 )
802802 return false ;
803803
804- VERBOSE (VB_PLAYBACK, QString (" BDRingBuf: GoToMenu %1" ).arg (str));
804+ VERBOSE (VB_PLAYBACK, LOC + QString (" GoToMenu %1" ).arg (str));
805805
806806 if (str.compare (" root" ) == 0 )
807807 {
808808 if (bd_menu_call (bdnav, pts))
809809 {
810- VERBOSE (VB_PLAYBACK,
811- QString ( " BDRingBuf: Invoked Top Menu (pts %1) " ) .arg (pts));
810+ VERBOSE (VB_PLAYBACK, LOC + QString ( " Invoked Top Menu (pts %1) " )
811+ .arg (pts));
812812 return true ;
813813 }
814814 }
@@ -844,115 +844,111 @@ void BDRingBuffer::HandleBDEvent(BD_EVENT &ev)
844844 case BD_EVENT_NONE:
845845 break ;
846846 case BD_EVENT_ERROR:
847- VERBOSE (VB_PLAYBACK,
848- QString (" BDRingBuf: EVENT_ERROR %1" ).arg (ev.param ));
847+ VERBOSE (VB_PLAYBACK, LOC + QString (" EVENT_ERROR %1" ).arg (ev.param ));
849848 break ;
850849 case BD_EVENT_ENCRYPTED:
851- VERBOSE (VB_IMPORTANT,
852- QString (" BDRingBuf: EVENT_ENCRYPTED, playback will fail." ));
850+ VERBOSE (VB_IMPORTANT, LOC +
851+ QString (" EVENT_ENCRYPTED, playback will fail." ));
853852 break ;
854853
855854 /* current playback position */
856855
857856 case BD_EVENT_ANGLE:
858- VERBOSE (VB_PLAYBACK,
859- QString (" BDRingBuf: EVENT_ANGLE %1" ).arg (ev.param ));
857+ VERBOSE (VB_PLAYBACK, LOC + QString (" EVENT_ANGLE %1" ).arg (ev.param ));
860858 m_currentAngle = ev.param ;
861859 break ;
862860 case BD_EVENT_TITLE:
863- VERBOSE (VB_PLAYBACK, QString (" BDRingBuf: EVENT_TITLE %1 (old %2)" )
864- .arg (ev.param ).arg (m_currentTitle));
861+ VERBOSE (VB_PLAYBACK, LOC + QString (" EVENT_TITLE %1 (old %2)" )
862+ .arg (ev.param ).arg (m_currentTitle));
865863 m_currentTitle = ev.param ;
866864 break ;
867865 case BD_EVENT_END_OF_TITLE:
868- VERBOSE (VB_PLAYBACK, QString (" BDRingBuf: EVENT_END_OF_TITLE %1" )
869- .arg (m_currentTitle));
866+ VERBOSE (VB_PLAYBACK, LOC + QString (" EVENT_END_OF_TITLE %1" )
867+ .arg (m_currentTitle));
870868 WaitForPlayer ();
871869 break ;
872870 case BD_EVENT_PLAYLIST:
873- VERBOSE (VB_PLAYBACK, QString (" BDRingBuf: EVENT_PLAYLIST %1 (old %2)" )
874- .arg (ev.param ).arg (m_currentPlaylist));
871+ VERBOSE (VB_PLAYBACK, LOC + QString (" EVENT_PLAYLIST %1 (old %2)" )
872+ .arg (ev.param ).arg (m_currentPlaylist));
875873 m_currentPlaylist = ev.param ;
876874 m_currentTitle = bd_get_current_title (bdnav);
877875 SwitchPlaylist (m_currentPlaylist);
878876 break ;
879877 case BD_EVENT_PLAYITEM:
880- VERBOSE (VB_PLAYBACK,
881- QString ( " BDRingBuf: EVENT_PLAYITEM %1 " ) .arg (ev.param ));
878+ VERBOSE (VB_PLAYBACK, LOC + QString ( " EVENT_PLAYITEM %1 " )
879+ .arg (ev.param ));
882880 m_currentPlayitem = ev.param ;
883881 break ;
884882 case BD_EVENT_CHAPTER:
885883 // N.B. event chapter numbering 1...N, chapter seeks etc 0...
886- VERBOSE (VB_PLAYBACK,
887- QString ( " BDRingBuf: EVENT_CHAPTER %1 " ) .arg (ev.param ));
884+ VERBOSE (VB_PLAYBACK, LOC + QString ( " EVENT_CHAPTER %1 " )
885+ .arg (ev.param ));
888886 m_currentChapter = ev.param ;
889887 break ;
890888 case BD_EVENT_STILL:
891- VERBOSE (VB_PLAYBACK,
892- QString (" BDRingBuf: EVENT_STILL %1" ).arg (ev.param ));
889+ VERBOSE (VB_PLAYBACK, LOC + QString (" EVENT_STILL %1" ).arg (ev.param ));
893890 break ;
894891 case BD_EVENT_STILL_TIME:
895892 // we use the clip information to determine the still frame status
896893 // sleep a little
897894 usleep (10000 );
898895 break ;
899896 case BD_EVENT_SEEK:
900- VERBOSE (VB_PLAYBACK,
901- QString (" BDRingBuf: EVENT_SEEK" ));
897+ VERBOSE (VB_PLAYBACK, LOC + QString (" EVENT_SEEK" ));
902898 break ;
903899
904900 /* stream selection */
905901
906902 case BD_EVENT_AUDIO_STREAM:
907- VERBOSE (VB_PLAYBACK,
908- QString ( " BDRingBuf: EVENT_AUDIO_STREAM %1 " ) .arg (ev.param ));
903+ VERBOSE (VB_PLAYBACK, LOC + QString ( " EVENT_AUDIO_STREAM %1 " )
904+ .arg (ev.param ));
909905 m_currentAudioStream = ev.param ;
910906 break ;
911907 case BD_EVENT_IG_STREAM:
912- VERBOSE (VB_PLAYBACK,
913- QString ( " BDRingBuf: EVENT_IG_STREAM %1 " ) .arg (ev.param ));
908+ VERBOSE (VB_PLAYBACK, LOC + QString ( " EVENT_IG_STREAM %1 " )
909+ .arg (ev.param ));
914910 m_currentIGStream = ev.param ;
915911 break ;
916912 case BD_EVENT_PG_TEXTST_STREAM:
917- VERBOSE (VB_PLAYBACK,
918- QString ( " BDRingBuf: EVENT_PG_TEXTST_STREAM %1 " ) .arg (ev.param ));
913+ VERBOSE (VB_PLAYBACK, LOC + QString ( " EVENT_PG_TEXTST_STREAM %1 " )
914+ .arg (ev.param ));
919915 m_currentPGTextSTStream = ev.param ;
920916 break ;
921917 case BD_EVENT_SECONDARY_AUDIO_STREAM:
922- VERBOSE (VB_PLAYBACK,
923- QString ( " BDRingBuf: EVENT_SECONDARY_AUDIO_STREAM %1 " ) .arg (ev.param ));
918+ VERBOSE (VB_PLAYBACK, LOC + QString ( " EVENT_SECONDARY_AUDIO_STREAM %1 " )
919+ .arg (ev.param ));
924920 m_currentSecondaryAudioStream = ev.param ;
925921 break ;
926922 case BD_EVENT_SECONDARY_VIDEO_STREAM:
927- VERBOSE (VB_PLAYBACK,
928- QString ( " BDRingBuf: EVENT_SECONDARY_VIDEO_STREAM %1 " ) .arg (ev.param ));
923+ VERBOSE (VB_PLAYBACK, LOC + QString ( " EVENT_SECONDARY_VIDEO_STREAM %1 " )
924+ .arg (ev.param ));
929925 m_currentSecondaryVideoStream = ev.param ;
930926 break ;
931927
932928 case BD_EVENT_PG_TEXTST:
933- VERBOSE (VB_PLAYBACK,
934- QString ( " BDRingBuf: EVENT_PG_TEXTST %1 " ) .arg (ev.param ? " enable" : " disable" ));
929+ VERBOSE (VB_PLAYBACK, LOC + QString ( " EVENT_PG_TEXTST %1 " )
930+ .arg (ev.param ? " enable" : " disable" ));
935931 m_PGTextSTEnabled = ev.param ;
936932 break ;
937933 case BD_EVENT_SECONDARY_AUDIO:
938- VERBOSE (VB_PLAYBACK,
939- QString ( " BDRingBuf: EVENT_SECONDARY_AUDIO %1 " ) .arg (ev.param ? " enable" : " disable" ));
934+ VERBOSE (VB_PLAYBACK, LOC + QString ( " EVENT_SECONDARY_AUDIO %1 " )
935+ .arg (ev.param ? " enable" : " disable" ));
940936 m_secondaryAudioEnabled = ev.param ;
941937 break ;
942938 case BD_EVENT_SECONDARY_VIDEO:
943- VERBOSE (VB_PLAYBACK,
944- QString ( " BDRingBuf: EVENT_SECONDARY_VIDEO %1 " ) .arg (ev.param ? " enable" : " disable" ));
939+ VERBOSE (VB_PLAYBACK, LOC + QString ( " EVENT_SECONDARY_VIDEO %1 " )
940+ .arg (ev.param ? " enable" : " disable" ));
945941 m_secondaryVideoEnabled = ev.param ;
946942 break ;
947943 case BD_EVENT_SECONDARY_VIDEO_SIZE:
948- VERBOSE (VB_PLAYBACK,
949- QString ( " BDRingBuf: EVENT_SECONDARY_VIDEO_SIZE %1 " ) .arg (ev.param ==0 ? " PIP" : " fullscreen" ));
944+ VERBOSE (VB_PLAYBACK, LOC + QString ( " EVENT_SECONDARY_VIDEO_SIZE %1 " )
945+ .arg (ev.param ==0 ? " PIP" : " fullscreen" ));
950946 m_secondaryVideoIsFullscreen = ev.param ;
951947 break ;
952948
953949 default :
954- VERBOSE (VB_PLAYBACK,
955- QString ( " BDRingBuf: Unknown Event! %1 %2 " ) .arg (ev.event ).arg (ev.param ));
950+ VERBOSE (VB_PLAYBACK, LOC_ERR + QString ( " Unknown Event! %1 %2 " )
951+ .arg (ev.event ).arg (ev.param ));
956952 break ;
957953 }
958954}
0 commit comments