本文整理汇总了C++中CFileItem::IsDVDFile方法的典型用法代码示例。如果您正苦于以下问题:C++ CFileItem::IsDVDFile方法的具体用法?C++ CFileItem::IsDVDFile怎么用?C++ CFileItem::IsDVDFile使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CFileItem
的用法示例。
在下文中一共展示了CFileItem::IsDVDFile方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetPlayers
void CPlayerCoreFactory::GetPlayers( const CFileItem& item, VECPLAYERCORES &vecCores)
{
CURL url(item.m_strPath);
CLog::Log(LOGDEBUG, "CPlayerCoreFactory::GetPlayers(%s)", item.m_strPath.c_str());
// ugly hack for ReplayTV. our filesystem is broken against real ReplayTV's (not the psuedo DVArchive)
// it breaks down for small requests. As we can't allow truncated reads for all emulated dll file functions
// we are often forced to do small reads to fill up the full buffer size wich seems gives garbage back
if (url.GetProtocol().Equals("rtv"))
{
vecCores.push_back(EPC_MPLAYER); // vecCores.push_back(EPC_DVDPLAYER);
}
if (url.GetProtocol().Equals("hdhomerun")
|| url.GetProtocol().Equals("myth")
|| url.GetProtocol().Equals("cmyth")
|| url.GetProtocol().Equals("rtmp"))
{
vecCores.push_back(EPC_DVDPLAYER);
}
if (url.GetProtocol().Equals("lastfm") ||
url.GetProtocol().Equals("shout"))
{
vecCores.push_back(EPC_PAPLAYER);
}
if (url.GetProtocol().Equals("mms"))
{
vecCores.push_back(EPC_DVDPLAYER);
}
// dvdplayer can play standard rtsp streams
if (url.GetProtocol().Equals("rtsp")
&& !url.GetFileType().Equals("rm")
&& !url.GetFileType().Equals("ra"))
{
vecCores.push_back(EPC_DVDPLAYER);
}
// Special care in case it's an internet stream
if (item.IsInternetStream())
{
CStdString content = item.GetContentType();
CLog::Log(LOGDEBUG, "%s - Item is an internet stream, content-type=%s", __FUNCTION__, content.c_str());
if (content == "video/x-flv"
|| content == "video/flv")
{
vecCores.push_back(EPC_DVDPLAYER);
}
else if (content == "audio/aacp")
{
vecCores.push_back(EPC_DVDPLAYER);
}
else if (content == "application/sdp")
{
vecCores.push_back(EPC_DVDPLAYER);
}
else if (content == "application/octet-stream")
{
//unknown contenttype, send mp2 to pap
if( url.GetFileType() == "mp2")
vecCores.push_back(EPC_PAPLAYER);
}
}
if (item.IsDVD() || item.IsDVDFile() || item.IsDVDImage())
{
if ( g_advancedSettings.m_videoDefaultDVDPlayer == "externalplayer" )
{
vecCores.push_back(EPC_EXTPLAYER);
vecCores.push_back(EPC_DVDPLAYER);
}
else
{
vecCores.push_back(EPC_DVDPLAYER);
vecCores.push_back(EPC_EXTPLAYER);
}
}
// only dvdplayer can handle these normally
if (url.GetFileType().Equals("sdp")
|| url.GetFileType().Equals("asf"))
{
vecCores.push_back(EPC_DVDPLAYER);
}
// Set video default player. Check whether it's video first (overrule audio check)
// Also push these players in case it is NOT audio either
if (item.IsVideo() || !item.IsAudio())
{
if ( g_advancedSettings.m_videoDefaultPlayer == "externalplayer" )
{
vecCores.push_back(EPC_EXTPLAYER);
vecCores.push_back(EPC_DVDPLAYER);
}
else
//.........这里部分代码省略.........
示例2: GetPlayers
void CPlayerSelectionRule::GetPlayers(const CFileItem& item, std::vector<std::string>&validPlayers, std::vector<std::string>&players)
{
CLog::Log(LOGDEBUG, "CPlayerSelectionRule::GetPlayers: considering rule: %s", m_name.c_str());
if (m_bStreamDetails && !item.HasVideoInfoTag())
return;
if (m_tAudio >= 0 && (m_tAudio > 0) != item.IsAudio())
return;
if (m_tVideo >= 0 && (m_tVideo > 0) != item.IsVideo())
return;
if (m_tInternetStream >= 0 && (m_tInternetStream > 0) != item.IsInternetStream())
return;
if (m_tRemote >= 0 && (m_tRemote > 0) != item.IsRemote())
return;
if (m_tBD >= 0 && (m_tBD > 0) != (item.IsBDFile() && item.IsOnDVD()))
return;
if (m_tDVD >= 0 && (m_tDVD > 0) != item.IsDVD())
return;
if (m_tDVDFile >= 0 && (m_tDVDFile > 0) != item.IsDVDFile())
return;
if (m_tDVDImage >= 0 && (m_tDVDImage > 0) != item.IsDiscImage())
return;
CRegExp regExp(false, CRegExp::autoUtf8);
if (m_bStreamDetails)
{
if (!item.GetVideoInfoTag()->HasStreamDetails())
{
CLog::Log(LOGDEBUG, "CPlayerSelectionRule::GetPlayers: cannot check rule: %s, no StreamDetails", m_name.c_str());
return;
}
CStreamDetails streamDetails = item.GetVideoInfoTag()->m_streamDetails;
if (CompileRegExp(m_audioCodec, regExp) && !MatchesRegExp(streamDetails.GetAudioCodec(), regExp))
return;
std::stringstream itoa;
itoa << streamDetails.GetAudioChannels();
std::string audioChannelsstr = itoa.str();
if (CompileRegExp(m_audioChannels, regExp) && !MatchesRegExp(audioChannelsstr, regExp))
return;
if (CompileRegExp(m_videoCodec, regExp) && !MatchesRegExp(streamDetails.GetVideoCodec(), regExp))
return;
if (CompileRegExp(m_videoResolution, regExp) &&
!MatchesRegExp(CStreamDetails::VideoDimsToResolutionDescription(streamDetails.GetVideoWidth(), streamDetails.GetVideoHeight()), regExp))
return;
if (CompileRegExp(m_videoAspect, regExp) &&
!MatchesRegExp(CStreamDetails::VideoAspectToAspectDescription(streamDetails.GetVideoAspect()), regExp))
return;
}
CURL url(item.GetPath());
if (CompileRegExp(m_fileTypes, regExp) && !MatchesRegExp(url.GetFileType(), regExp))
return;
if (CompileRegExp(m_protocols, regExp) && !MatchesRegExp(url.GetProtocol(), regExp))
return;
if (CompileRegExp(m_mimeTypes, regExp) && !MatchesRegExp(item.GetMimeType(), regExp))
return;
if (CompileRegExp(m_fileName, regExp) && !MatchesRegExp(item.GetPath(), regExp))
return;
CLog::Log(LOGDEBUG, "CPlayerSelectionRule::GetPlayers: matches rule: %s", m_name.c_str());
for (unsigned int i = 0; i < vecSubRules.size(); i++)
vecSubRules[i]->GetPlayers(item, validPlayers, players);
if (std::find(validPlayers.begin(), validPlayers.end(), m_playerName) != validPlayers.end())
{
CLog::Log(LOGDEBUG, "CPlayerSelectionRule::GetPlayers: adding player: %s for rule: %s", m_playerName.c_str(), m_name.c_str());
players.push_back(m_playerName);
}
}
示例3: OpenFile
bool CApplicationPlayer::OpenFile(const CFileItem& item, const CPlayerOptions& options,
const CPlayerCoreFactory &factory,
const std::string &playerName, IPlayerCallback& callback)
{
// get player type
std::string newPlayer;
if (!playerName.empty())
newPlayer = playerName;
else
newPlayer = factory.GetDefaultPlayer(item);
// check if we need to close current player
// VideoPlayer can open a new file while playing
std::shared_ptr<IPlayer> player = GetInternal();
if (player && player->IsPlaying())
{
bool needToClose = false;
if (item.IsDiscImage() || item.IsDVDFile())
needToClose = true;
if (player->m_name != newPlayer)
needToClose = true;
if (player->m_type != "video")
needToClose = true;
if (needToClose)
{
m_nextItem.pItem = std::make_shared<CFileItem>(item);
m_nextItem.options = options;
m_nextItem.playerName = newPlayer;
m_nextItem.callback = &callback;
CloseFile();
if (player->m_name != newPlayer)
{
CSingleLock lock(m_playerLock);
m_pPlayer.reset();
}
return true;
}
}
if (!player)
{
CreatePlayer(factory, newPlayer, callback);
player = GetInternal();
if (!player)
return false;
}
bool ret = player->OpenFile(item, options);
m_nextItem.pItem.reset();
// reset caching timers
m_audioStreamUpdate.SetExpired();
m_videoStreamUpdate.SetExpired();
m_subtitleStreamUpdate.SetExpired();
return ret;
}
示例4: GetPlayers
void CPlayerCoreFactory::GetPlayers( const CFileItem& item, VECPLAYERCORES &vecCores)
{
CURL url(item.m_strPath);
CLog::Log(LOGDEBUG,"CPlayerCoreFactor::GetPlayers(%s)",item.m_strPath.c_str());
// Plex media server streams.
if (url.GetProtocol().Equals("plex", false))
vecCores.push_back(EPC_PMSPLAYER);
// Play audio files with iTunes DRM using QuickTime
if (url.GetFileType().Equals("m4p") || url.GetFileType().Equals("m4b"))
{
vecCores.push_back(EPC_QTPLAYER);
CLog::Log(LOGDEBUG,"CPlayerCoreFactor::GetPlayers(%s) - matched M4P file",item.m_strPath.c_str());
}
// ugly hack for ReplayTV. our filesystem is broken against real ReplayTV's (not the psuevdo DVArchive)
// it breaks down for small requests. As we can't allow truncated reads for all emulated dll file functions
// we are often forced to do small reads to fill up the full buffer size wich seems gives garbage back
if (url.GetProtocol().Equals("rtv"))
vecCores.push_back(EPC_MPLAYER); // vecCores.push_back(EPC_DVDPLAYER);
if (url.GetProtocol().Equals("hdhomerun")
|| url.GetProtocol().Equals("myth")
|| url.GetProtocol().Equals("cmyth")
|| url.GetProtocol().Equals("rtmp"))
vecCores.push_back(EPC_DVDPLAYER);
if (url.GetProtocol().Equals("lastfm") ||
url.GetProtocol().Equals("shout"))
{
vecCores.push_back(EPC_PAPLAYER);
}
if (url.GetProtocol().Equals("mms"))
{
vecCores.push_back(EPC_DVDPLAYER);
}
// dvdplayer can play standard rtsp streams
if (url.GetProtocol().Equals("rtsp")
&& !url.GetFileType().Equals("rm")
&& !url.GetFileType().Equals("ra"))
vecCores.push_back(EPC_DVDPLAYER);
// only dvdplayer can handle these normally
if (url.GetFileType().Equals("sdp") ||
url.GetFileType().Equals("asf"))
vecCores.push_back(EPC_DVDPLAYER);
if ( item.IsInternetStream() )
{
CStdString content = item.GetContentType();
if (content == "video/x-flv"
|| content == "video/flv")
vecCores.push_back(EPC_DVDPLAYER);
else if (content == "audio/aacp")
vecCores.push_back(EPC_DVDPLAYER);
else if (content == "application/sdp")
vecCores.push_back(EPC_DVDPLAYER);
else if (content == "application/octet-stream")
{
//unknown contenttype, send mp2 to pap
if( url.GetFileType() == "mp2")
vecCores.push_back(EPC_PAPLAYER);
}
}
if (((item.IsDVD()) || item.IsDVDFile() || item.IsDVDImage()))
{
vecCores.push_back(EPC_DVDPLAYER);
}
if( PAPlayer::HandlesType(url.GetFileType()) )
{
bool bAdd = true;
if (url.GetProtocol().Equals("mms"))
{
bAdd = false;
}
else if (item.IsType(".wma"))
{
DVDPlayerCodec codec;
if (!codec.Init(item.m_strPath,2048))
bAdd = false;
codec.DeInit();
}
if (bAdd)
{
if(!g_audioConfig.UseDigitalOutput())
{
vecCores.push_back(EPC_PAPLAYER);
}
//else if( ( url.GetFileType().Equals("ac3") && g_audioConfig.GetAC3Enabled() )
// || ( url.GetFileType().Equals("dts") && g_audioConfig.GetDTSEnabled() ) )
//{
// vecCores.push_back(EPC_DVDPLAYER);
//.........这里部分代码省略.........