|
@@ -56,24 +56,134 @@ void mediaManage::GetPlayList(vector<ResourceParse> &resourceList)
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-void mediaManage::GetPlayListByLocal(vector<ResourceParse>& resourceList)
|
|
|
+size_t mediaManage::GetPlayListByLocal(vector<ResourceParse>& resourceList)
|
|
|
{
|
|
|
+ size_t uNum = 0;
|
|
|
resourceList.clear();
|
|
|
|
|
|
#ifdef RVC_OS_WIN
|
|
|
for each (auto i in m_localList)
|
|
|
{
|
|
|
- if (checkInVaildTime(i.vaildTime, true) && checkInPlayTime(i.playTime, true))
|
|
|
+ if (checkInVaildTime(i.vaildTime, true) && checkInPlayTime(i.playTime, true)) {
|
|
|
resourceList.push_back(i);
|
|
|
+ uNum++;
|
|
|
+ }
|
|
|
}
|
|
|
#else
|
|
|
- for (vector<ResourceParse>::iterator it = m_localList.begin(); it < m_localList.end(); it++)
|
|
|
+ for (vector<ResourceParse>::iterator it = m_localList.begin(); it != m_localList.end(); it++)
|
|
|
{
|
|
|
- resourceList.push_back(*it);
|
|
|
+ Dbg("play extend %c:%s, %s, %s, %s", it->type, it->resourcePath.c_str(), it->videoNames.c_str(), it->vaildTime.c_str(), it->playTime.c_str());
|
|
|
+ if (checkInVaildTime(it->vaildTime, true) && checkInPlayTime(it->playTime, true)) {
|
|
|
+ resourceList.push_back(*it);
|
|
|
+ uNum++;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ Dbg("uNum is %d, m_localList size is %d, resourceList size is %d", uNum, m_localList.size(), resourceList.size());
|
|
|
+
|
|
|
+ for (vector<ResourceParse>::iterator i = resourceList.begin(); i != resourceList.end(); i++)
|
|
|
+ {
|
|
|
+ Dbg("begin play extend %c:%s, %s", i->type, i->resourcePath.c_str(), i->videoNames.c_str());
|
|
|
}
|
|
|
#endif // _WIN32
|
|
|
+
|
|
|
+ return uNum;
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+size_t mediaManage::GetPlayListByLocal(CResourceParse** ResourceArr, size_t uSize)
|
|
|
+{
|
|
|
+ size_t uNum = 0;
|
|
|
+
|
|
|
+ Dbg("%s:%d", __FUNCTION__, __LINE__);
|
|
|
+
|
|
|
+ for (vector<ResourceParse>::iterator it = m_localList.begin(); it != m_localList.end() && uNum < uSize; it++)
|
|
|
+ {
|
|
|
+ Dbg("new deep copy play extend %c:%s, %s, %s, %s", it->type, it->resourcePath.c_str(), it->videoNames.c_str(), it->vaildTime.c_str(), it->playTime.c_str());
|
|
|
+ if (checkInVaildTime(it->vaildTime, true) && checkInPlayTime(it->playTime, true)) {
|
|
|
+ CResourceParse* pNode = new CResourceParse();
|
|
|
+ pNode->type = it->type;
|
|
|
+ pNode->fullScreen = it->fullScreen;
|
|
|
+ pNode->primMonitor = it->primMonitor;
|
|
|
+ pNode->simpleMode = it->simpleMode;
|
|
|
+ pNode->playInterval = it->playInterval;
|
|
|
+ pNode->priority = it->priority;
|
|
|
+
|
|
|
+ if (it->videoNames.length() > 0) {
|
|
|
+ pNode->pvideoNames = new char[it->videoNames.length() + 1];
|
|
|
+ memset(pNode->pvideoNames, 0, it->videoNames.length() + 1);
|
|
|
+ memcpy(pNode->pvideoNames, it->videoNames.c_str(), it->videoNames.length());
|
|
|
+ }
|
|
|
+
|
|
|
+ if (it->vaildTime.length() > 0) {
|
|
|
+ pNode->pvaildTime = new char[it->vaildTime.length() + 1];
|
|
|
+ memset(pNode->pvaildTime, 0, it->vaildTime.length() + 1);
|
|
|
+ memcpy(pNode->pvaildTime, it->vaildTime.c_str(), it->vaildTime.length());
|
|
|
+ }
|
|
|
+
|
|
|
+ if (it->resourcePath.length() > 0) {
|
|
|
+ pNode->presourcePath = new char[it->resourcePath.length() + 1];
|
|
|
+ memset(pNode->presourcePath, 0, it->resourcePath.length() + 1);
|
|
|
+ memcpy(pNode->presourcePath, it->resourcePath.c_str(), it->resourcePath.length());
|
|
|
+ }
|
|
|
+
|
|
|
+ if (it->playTime.length() > 0) {
|
|
|
+ pNode->playTime = new char[it->playTime.length() + 1];
|
|
|
+ memset(pNode->playTime, 0, it->playTime.length() + 1);
|
|
|
+ memcpy(pNode->playTime, it->playTime.c_str(), it->playTime.length());
|
|
|
+ }
|
|
|
+ ResourceArr[uNum++] = pNode;
|
|
|
+ Dbg("aftercopy play extend pNode->type=0x%0x:pNode->presourcePath=0x%0x, pNode->pvideoNames=0x%0x, pNode->pvaildTime=0x%0x, pNode->playTime=0x%0x", pNode->type, pNode->presourcePath, pNode->pvideoNames, pNode->pvaildTime, pNode->playTime);
|
|
|
+ Dbg("aftercopy play extend %c:%s, %s, %s, %s", pNode->type, pNode->presourcePath, pNode->pvideoNames, pNode->pvaildTime, pNode->playTime);
|
|
|
+ Dbg("%s:%d ResourceList[%d] address is 0x%0x, pNode address is 0x%0x.", __FUNCTION__, __LINE__, uNum-1, ResourceArr[uNum-1], pNode);
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ return uNum;
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+size_t mediaManage::GetPlayListByLocal(rvcResourceParse_t* ResourceArr, size_t uSize)
|
|
|
+{
|
|
|
+ size_t uNum = 0;
|
|
|
+
|
|
|
+ Dbg("%s:%d", __FUNCTION__, __LINE__);
|
|
|
+
|
|
|
+ for (vector<ResourceParse>::iterator it = m_localList.begin(); it != m_localList.end() && uNum < uSize; it++)
|
|
|
+ {
|
|
|
+ Dbg("new deep copy play extend %c:%s, %s, %s, %s", it->type, it->resourcePath.c_str(), it->videoNames.c_str(), it->vaildTime.c_str(), it->playTime.c_str());
|
|
|
+ if (checkInVaildTime(it->vaildTime, true) && checkInPlayTime(it->playTime, true)) {
|
|
|
+ rvcResourceParse_t* pNode = ResourceArr+uNum;
|
|
|
+ pNode->type = it->type;
|
|
|
+ pNode->fullScreen = it->fullScreen;
|
|
|
+ pNode->primMonitor = it->primMonitor;
|
|
|
+ pNode->simpleMode = it->simpleMode;
|
|
|
+ pNode->playInterval = it->playInterval;
|
|
|
+ pNode->priority = it->priority;
|
|
|
+
|
|
|
+ if (it->videoNames.length() > 0) {
|
|
|
+ memcpy(pNode->strvideoNames, it->videoNames.c_str(), it->videoNames.length());
|
|
|
+ }
|
|
|
+
|
|
|
+ if (it->vaildTime.length() > 0) {
|
|
|
+ memcpy(pNode->strvaildTime, it->vaildTime.c_str(), it->vaildTime.length());
|
|
|
+ }
|
|
|
+
|
|
|
+ if (it->resourcePath.length() > 0) {
|
|
|
+ memcpy(pNode->strResourcePath, it->resourcePath.c_str(), it->resourcePath.length());
|
|
|
+ }
|
|
|
+
|
|
|
+ if (it->playTime.length() > 0) {
|
|
|
+ memcpy(pNode->strplayTime, it->playTime.c_str(), it->playTime.length());
|
|
|
+ }
|
|
|
+ uNum++;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ return uNum;
|
|
|
}
|
|
|
|
|
|
+
|
|
|
bool mediaManage::InitResourseList(vector<string> resourceList)
|
|
|
{
|
|
|
/*
|
|
@@ -216,22 +326,27 @@ void mediaManage::InitResourceListByLocal()
|
|
|
for each (auto i in networkList)
|
|
|
m_localList.push_back(i);
|
|
|
#else
|
|
|
- for (vector<ResourceParse>::iterator it = headList.begin(); it < headList.end(); ++it)
|
|
|
- {
|
|
|
+ size_t uheadList = 0;
|
|
|
+ size_t ubranchList = 0;
|
|
|
+ size_t unetworkList = 0;
|
|
|
+ for (vector<ResourceParse>::iterator it = headList.begin(); it < headList.end(); ++it){
|
|
|
m_localList.push_back(*it);
|
|
|
+ uheadList++;
|
|
|
}
|
|
|
|
|
|
- for (vector<ResourceParse>::iterator it = branchList.begin(); it < branchList.end(); ++it)
|
|
|
- {
|
|
|
+ for (vector<ResourceParse>::iterator it = branchList.begin(); it < branchList.end(); ++it){
|
|
|
m_localList.push_back(*it);
|
|
|
+ ubranchList++;
|
|
|
}
|
|
|
|
|
|
- for (vector<ResourceParse>::iterator it = networkList.begin(); it < networkList.end(); ++it)
|
|
|
- {
|
|
|
+ for (vector<ResourceParse>::iterator it = networkList.begin(); it < networkList.end(); ++it){
|
|
|
m_localList.push_back(*it);
|
|
|
+ unetworkList++;
|
|
|
}
|
|
|
-#endif // RVC_OS_WIN
|
|
|
+ Dbg("headList size is %d, branchList size is %d, networkList size is %d, and m_localList size is %u.", uheadList, ubranchList, unetworkList, m_localList.size());
|
|
|
|
|
|
+#endif // RVC_OS_WIN
|
|
|
+
|
|
|
std::stable_sort(m_localList.begin(), m_localList.end(), [](const ResourceParse& a, const ResourceParse& b) {
|
|
|
return a.priority > b.priority;
|
|
|
});//��priority����
|
|
@@ -240,15 +355,14 @@ void mediaManage::InitResourceListByLocal()
|
|
|
for (auto i = m_localList.begin(); i != m_localList.end(); i++)
|
|
|
{
|
|
|
auto pos = i->videoNames.find(SPLIT_SLASH_STR);
|
|
|
- if (pos > 0)
|
|
|
- {
|
|
|
+ if (pos > 0){
|
|
|
i->resourcePath = m_addvertPath + SPLIT_SLASH_STR + i->videoNames.substr(0, pos + 1);
|
|
|
i->videoNames = i->videoNames.substr(pos + 1, i->videoNames.length() - pos - 1);
|
|
|
}
|
|
|
- else
|
|
|
+ else {
|
|
|
i->resourcePath = m_addvertPath + SPLIT_SLASH_STR;
|
|
|
+ }
|
|
|
}
|
|
|
-
|
|
|
}
|
|
|
|
|
|
void mediaManage::DeleteResourceList(vector<string> resourceList)
|