本文整理汇总了C++中CFileItem::IsVideo方法的典型用法代码示例。如果您正苦于以下问题:C++ CFileItem::IsVideo方法的具体用法?C++ CFileItem::IsVideo怎么用?C++ CFileItem::IsVideo使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CFileItem
的用法示例。
在下文中一共展示了CFileItem::IsVideo方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: IsVisible
bool CPlay::IsVisible(const CFileItem& item) const
{
if (item.m_bIsFolder)
return false; //! @todo implement
if (item.IsPVR())
return false; // pvr has its own implementation for this
return item.IsVideo() || item.IsDVD() || item.IsCDDA();
}
示例2: GetPlayers
void CPlayerCoreFactory::GetPlayers(const CFileItem& item, std::vector<std::string>&players) const
{
CURL url(item.GetPath());
CLog::Log(LOGDEBUG, "CPlayerCoreFactory::GetPlayers(%s)", CURL::GetRedacted(item.GetPath()).c_str());
std::vector<std::string>validPlayers;
GetPlayers(validPlayers);
// Process rules
for (auto rule: m_vecCoreSelectionRules)
rule->GetPlayers(item, validPlayers, players);
CLog::Log(LOGDEBUG, "CPlayerCoreFactory::GetPlayers: matched {0} rules with players", players.size());
// Process defaults
// Set video default player. Check whether it's video first (overrule audio and
// game check). Also push these players in case it is NOT audio or game either.
if (item.IsVideo() || (!item.IsAudio() && !item.IsGame()))
{
int idx = GetPlayerIndex("videodefaultplayer");
if (idx > -1)
{
std::string eVideoDefault = GetPlayerName(idx);
CLog::Log(LOGDEBUG, "CPlayerCoreFactory::GetPlayers: adding videodefaultplayer (%s)", eVideoDefault.c_str());
players.push_back(eVideoDefault);
}
GetPlayers(players, false, true); // Video-only players
GetPlayers(players, true, true); // Audio & video players
}
// Set audio default player
// Pushback all audio players in case we don't know the type
if (item.IsAudio())
{
int idx = GetPlayerIndex("audiodefaultplayer");
if (idx > -1)
{
std::string eAudioDefault = GetPlayerName(idx);
CLog::Log(LOGDEBUG, "CPlayerCoreFactory::GetPlayers: adding audiodefaultplayer (%s)", eAudioDefault.c_str());
players.push_back(eAudioDefault);
}
GetPlayers(players, true, false); // Audio-only players
GetPlayers(players, true, true); // Audio & video players
}
if (item.IsGame())
{
CLog::Log(LOGDEBUG, "CPlayerCoreFactory::GetPlayers: adding retroplayer");
players.push_back("RetroPlayer");
}
CLog::Log(LOGDEBUG, "CPlayerCoreFactory::GetPlayers: added {0} players", players.size());
}
示例3: GetPlayers
void CPlayerCoreFactory::GetPlayers( const CFileItem& item, VECPLAYERCORES &vecCores)
{
CURL url(item.GetPath());
CLog::Log(LOGDEBUG, "CPlayerCoreFactory::GetPlayers(%s)", item.GetPath().c_str());
// Process rules
for(unsigned int i = 0; i < s_vecCoreSelectionRules.size(); i++)
s_vecCoreSelectionRules[i]->GetPlayers(item, vecCores);
CLog::Log(LOGDEBUG, "CPlayerCoreFactory::GetPlayers: matched %"PRIuS" rules with players", vecCores.size());
if( PAPlayer::HandlesType(url.GetFileType()) )
{
// We no longer force PAPlayer as our default audio player (used to be true):
bool bAdd = false;
if (url.GetProtocol().Equals("mms"))
{
bAdd = false;
}
else if (item.IsType(".wma"))
{
// bAdd = true;
// DVDPlayerCodec codec;
// if (!codec.Init(item.GetPath(),2048))
// bAdd = false;
// codec.DeInit();
}
if (bAdd)
{
if( g_guiSettings.GetInt("audiooutput.mode") == AUDIO_ANALOG && !AUDIO_IS_BITSTREAM(g_guiSettings.GetInt("audiooutput2.mode")) )
{
CLog::Log(LOGDEBUG, "CPlayerCoreFactory::GetPlayers: adding PAPlayer (%d)", EPC_PAPLAYER);
vecCores.push_back(EPC_PAPLAYER);
}
else if (url.GetFileType().Equals("ac3")
|| url.GetFileType().Equals("dts"))
{
CLog::Log(LOGDEBUG, "CPlayerCoreFactory::GetPlayers: adding DVDPlayer (%d)", EPC_DVDPLAYER);
vecCores.push_back(EPC_DVDPLAYER);
}
else
{
CLog::Log(LOGDEBUG, "CPlayerCoreFactory::GetPlayers: adding PAPlayer (%d)", EPC_PAPLAYER);
vecCores.push_back(EPC_PAPLAYER);
}
}
}
// Process defaults
// 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())
{
PLAYERCOREID eVideoDefault = GetPlayerCore("videodefaultplayer");
if (eVideoDefault != EPC_NONE)
{
CLog::Log(LOGDEBUG, "CPlayerCoreFactory::GetPlayers: adding videodefaultplayer (%d)", eVideoDefault);
vecCores.push_back(eVideoDefault);
}
GetPlayers(vecCores, false, true); // Video-only players
GetPlayers(vecCores, true, true); // Audio & video players
}
// Set audio default player
// Pushback all audio players in case we don't know the type
if (item.IsAudio())
{
PLAYERCOREID eAudioDefault = GetPlayerCore("audiodefaultplayer");
if (eAudioDefault != EPC_NONE)
{
CLog::Log(LOGDEBUG, "CPlayerCoreFactory::GetPlayers: adding audiodefaultplayer (%d)", eAudioDefault);
vecCores.push_back(eAudioDefault);
}
GetPlayers(vecCores, true, false); // Audio-only players
GetPlayers(vecCores, true, true); // Audio & video players
}
/* make our list unique, preserving first added players */
unique(vecCores);
CLog::Log(LOGDEBUG, "CPlayerCoreFactory::GetPlayers: added %"PRIuS" players", vecCores.size());
}
示例4: 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
//.........这里部分代码省略.........
示例5: 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);
}
}
示例6: RunDisc
bool CAutorun::RunDisc(IDirectory* pDir, const CStdString& strDrive, int& nAddedToPlaylist, bool bRoot, bool bypassSettings /* = false */)
{
bool bPlaying(false);
CFileItemList vecItems;
char szSlash = '\\';
if (strDrive.Find("iso9660") != -1) szSlash = '/';
if ( !pDir->GetDirectory( strDrive, vecItems ) )
{
return false;
}
bool bAllowVideo = true;
bool bAllowPictures = true;
bool bAllowMusic = true;
if (!g_passwordManager.IsMasterLockUnlocked(false))
{
bAllowVideo = !g_settings.m_vecProfiles[g_settings.m_iLastLoadedProfileIndex].videoLocked();
bAllowPictures = !g_settings.m_vecProfiles[g_settings.m_iLastLoadedProfileIndex].picturesLocked();
bAllowMusic = !g_settings.m_vecProfiles[g_settings.m_iLastLoadedProfileIndex].musicLocked();
}
if( bRoot )
{
// check root folders first, for normal structured dvd's
for (int i = 0; i < vecItems.Size(); i++)
{
CFileItem* pItem = vecItems[i];
if (pItem->m_bIsFolder && pItem->m_strPath != "." && pItem->m_strPath != "..")
{
if (pItem->m_strPath.Find( "VIDEO_TS" ) != -1 && bAllowVideo
&& (bypassSettings || g_guiSettings.GetBool("autorun.dvd")))
{
CUtil::PlayDVD();
bPlaying = true;
return true;
}
else if (pItem->m_strPath.Find("MPEGAV") != -1 && bAllowVideo
&& (bypassSettings || g_guiSettings.GetBool("autorun.vcd")))
{
CFileItemList items;
CDirectory::GetDirectory(pItem->m_strPath, items, ".dat");
if (items.Size())
{
items.Sort(SORT_METHOD_LABEL, SORT_ORDER_ASC);
g_playlistPlayer.ClearPlaylist(PLAYLIST_VIDEO);
g_playlistPlayer.Add(PLAYLIST_VIDEO, items);
g_playlistPlayer.SetCurrentPlaylist(PLAYLIST_VIDEO);
g_playlistPlayer.Play(0);
bPlaying = true;
return true;
}
}
else if (pItem->m_strPath.Find("MPEG2") != -1 && bAllowVideo
&& (bypassSettings || g_guiSettings.GetBool("autorun.vcd")))
{
CFileItemList items;
CDirectory::GetDirectory(pItem->m_strPath, items, ".mpg");
if (items.Size())
{
items.Sort(SORT_METHOD_LABEL, SORT_ORDER_ASC);
g_playlistPlayer.ClearPlaylist(PLAYLIST_VIDEO);
g_playlistPlayer.Add(PLAYLIST_VIDEO, items);
g_playlistPlayer.SetCurrentPlaylist(PLAYLIST_VIDEO);
g_playlistPlayer.Play(0);
bPlaying = true;
return true;
}
}
else if (pItem->m_strPath.Find("PICTURES") != -1 && bAllowPictures
&& (bypassSettings || g_guiSettings.GetBool("autorun.pictures")))
{
bPlaying = true;
CStdString strExec;
strExec.Format("XBMC.RecursiveSlideShow(%s)", pItem->m_strPath.c_str());
CUtil::ExecBuiltIn(strExec);
return true;
}
}
}
}
// check video first
if (!nAddedToPlaylist && !bPlaying && (bypassSettings || g_guiSettings.GetBool("autorun.video")))
{
// stack video files
CFileItemList tempItems;
tempItems.Append(vecItems);
tempItems.Stack();
CFileItemList itemlist;
for (int i = 0; i < tempItems.Size(); i++)
{
CFileItem *pItem = tempItems[i];
if (!pItem->m_bIsFolder && pItem->IsVideo())
{
bPlaying = true;
if (pItem->IsStack())
//.........这里部分代码省略.........