本文整理汇总了C++中PLT_DeviceDataReference::GetUUID方法的典型用法代码示例。如果您正苦于以下问题:C++ PLT_DeviceDataReference::GetUUID方法的具体用法?C++ PLT_DeviceDataReference::GetUUID怎么用?C++ PLT_DeviceDataReference::GetUUID使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PLT_DeviceDataReference
的用法示例。
在下文中一共展示了PLT_DeviceDataReference::GetUUID方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnMRRemoved
virtual void OnMRRemoved(PLT_DeviceDataReference& device )
{
if (device->GetUUID().IsEmpty() || device->GetUUID().GetChars() == NULL)
return;
std::string uuid(device->GetUUID().GetChars());
unregisterRenderer(uuid);
m_registeredRenderers.erase(uuid);
}
示例2: OnMRAdded
virtual bool OnMRAdded(PLT_DeviceDataReference& device )
{
if (device->GetUUID().IsEmpty() || device->GetUUID().GetChars() == NULL)
return false;
CPlayerCoreFactory::GetInstance().OnPlayerDiscovered((const char*)device->GetUUID()
,(const char*)device->GetFriendlyName()
, EPC_UPNPPLAYER);
m_registeredRenderers.insert(std::string(device->GetUUID().GetChars()));
return true;
}
示例3:
/*----------------------------------------------------------------------
| PLT_MediaBrowser::Search
+---------------------------------------------------------------------*/
NPT_Result
PLT_MediaBrowser::Search(PLT_DeviceDataReference& device,
const char* container_id,
const char* search_criteria,
NPT_UInt32 start_index,
NPT_UInt32 count,
const char* filter,
void* userdata)
{
// verify device still in our list
PLT_DeviceDataReference device_data;
NPT_CHECK_WARNING(FindServer(device->GetUUID(), device_data));
// create action
PLT_ActionReference action;
NPT_CHECK_SEVERE(m_CtrlPoint->CreateAction(
device,
"urn:schemas-upnp-org:service:ContentDirectory:1",
"Search",
action));
// Set the container id
PLT_Arguments args;
if (NPT_FAILED(action->SetArgumentValue("ContainerID", container_id))) {
return NPT_ERROR_INVALID_PARAMETERS;
}
// set the Search Criteria
if (NPT_FAILED(action->SetArgumentValue("SearchCriteria", search_criteria))) {
return NPT_ERROR_INVALID_PARAMETERS;
}
// set the Filter
if (NPT_FAILED(action->SetArgumentValue("Filter", filter))) {
return NPT_ERROR_INVALID_PARAMETERS;
}
// set the Starting Index
if (NPT_FAILED(action->SetArgumentValue("StartingIndex", NPT_String::FromInteger(start_index)))) {
return NPT_ERROR_INVALID_PARAMETERS;
}
// set the Requested Count
if (NPT_FAILED(action->SetArgumentValue("RequestedCount", NPT_String::FromInteger(count)))) {
return NPT_ERROR_INVALID_PARAMETERS;
}
// set the Requested Count
if (NPT_FAILED(action->SetArgumentValue("SortCriteria", ""))) {
return NPT_ERROR_INVALID_PARAMETERS;
}
// invoke the action
if (NPT_FAILED(m_CtrlPoint->InvokeAction(action, userdata))) {
return NPT_ERROR_INVALID_PARAMETERS;
}
return NPT_SUCCESS;
}
示例4: lock
/*----------------------------------------------------------------------
| PLT_MediaBrowser::OnDeviceRemoved
+---------------------------------------------------------------------*/
NPT_Result
PLT_MediaBrowser::OnDeviceRemoved(PLT_DeviceDataReference& device)
{
if (!device->GetType().StartsWith("urn:schemas-upnp-org:device:MediaServer"))
return NPT_FAILURE;
{
NPT_AutoLock lock(m_MediaServers);
// only release if we have kept it around
PLT_DeviceDataReference data;
NPT_String uuid = device->GetUUID();
// Have we seen that device?
if (NPT_FAILED(NPT_ContainerFind(m_MediaServers, PLT_DeviceDataFinder(uuid), data))) {
NPT_LOG_WARNING_1("Device (%s) not found in our list!", (const char*)uuid);
return NPT_FAILURE;
}
NPT_LOG_FINE_1("Device Removed: %s", (const char*)*device);
m_MediaServers.Remove(device);
}
if (m_Delegate) {
m_Delegate->OnMSRemoved(device);
}
return NPT_SUCCESS;
}
示例5: lock
/*----------------------------------------------------------------------
| PLT_MediaBrowser::OnDeviceRemoved
+---------------------------------------------------------------------*/
NPT_Result
PLT_MediaBrowser::OnDeviceRemoved(PLT_DeviceDataReference& device)
{
PLT_DeviceDataReference data;
{
NPT_AutoLock lock(m_MediaServers);
// only release if we have kept it around
NPT_String uuid = device->GetUUID();
// is it a new device?
if (NPT_FAILED(NPT_ContainerFind(m_MediaServers, PLT_DeviceDataFinder(uuid), data))) {
NPT_LOG_WARNING_1("Device (%s) not found in our list!", (const char*)uuid);
return NPT_FAILURE;
}
NPT_LOG_FINE("Device Removed:");
device->ToLog(NPT_LOG_LEVEL_FINE);
m_MediaServers.Remove(device);
}
if (m_Listener) {
m_Listener->OnMSAddedRemoved(device, 0);
}
return NPT_SUCCESS;
}
示例6: OnMRAdded
virtual bool OnMRAdded(PLT_DeviceDataReference& device )
{
CPlayerCoreFactory::Get().OnPlayerDiscovered((const char*)device->GetUUID()
,(const char*)device->GetFriendlyName()
, EPC_UPNPPLAYER);
return true;
}
示例7: OnDeviceAdded
NPT_Result GPAC_GenericController::OnDeviceAdded(PLT_DeviceDataReference& device)
{
GPAC_DeviceItem *item;
NPT_String uuid = device->GetUUID();
gf_mx_p(m_ControlPointLock);
u32 i, count = gf_list_count(m_Devices);
for (i=0; i<count; i++) {
item = (GPAC_DeviceItem *) gf_list_get(m_Devices, i);
if (item->m_UUID == uuid ) {
gf_mx_v(m_ControlPointLock);
return NPT_SUCCESS;
}
}
item = new GPAC_DeviceItem(device, device->GetUUID() );
gf_list_add(m_Devices, item );
m_pUPnP->OnDeviceAdd(item, 1);
gf_mx_v(m_ControlPointLock);
return NPT_SUCCESS;
}
示例8: lock
/*----------------------------------------------------------------------
| PLT_SyncMediaBrowser::OnDeviceAdded
+---------------------------------------------------------------------*/
NPT_Result
PLT_SyncMediaBrowser::OnDeviceAdded(PLT_DeviceDataReference& device)
{
NPT_String uuid = device->GetUUID();
// test if it's a media server
PLT_Service* service;
if (NPT_SUCCEEDED(device->FindServiceByType("urn:schemas-upnp-org:service:ContentDirectory:*", service))) {
NPT_AutoLock lock(m_MediaServers);
m_MediaServers.Put(uuid, device);
}
return PLT_MediaBrowser::OnDeviceAdded(device);
}
示例9: lock
/*----------------------------------------------------------------------
| PLT_MicroMediaController::OnMRAdded
+---------------------------------------------------------------------*/
bool
PLT_MicroMediaController::OnMRAdded(PLT_DeviceDataReference& device)
{
NPT_String uuid = device->GetUUID();
// test if it's a media renderer
PLT_Service* service;
if (NPT_SUCCEEDED(device->FindServiceByType("urn:schemas-upnp-org:service:AVTransport:*", service))) {
NPT_AutoLock lock(m_MediaRenderers);
m_MediaRenderers.Put(uuid, device);
}
return true;
}
示例10:
bool
GPAC_MediaController::OnMSAdded(PLT_DeviceDataReference& device)
{
NPT_String uuid = device->GetUUID();
gf_mx_p(m_ControlPointLock);
// test if it's a media server
PLT_Service* service;
if (NPT_SUCCEEDED(device->FindServiceByType("urn:schemas-upnp-org:service:ContentDirectory:1", service))) {
gf_list_add(m_MediaServers, new GPAC_MediaServerItem(device, uuid) );
}
m_pUPnP->OnMediaServerAdd(device, 1);
gf_mx_v(m_ControlPointLock);
return true;
}
示例11: OnContainerChanged
// PLT_MediaContainerChangesListener methods
virtual void OnContainerChanged(PLT_DeviceDataReference& device,
const char* item_id,
const char* update_id)
{
NPT_String path = "upnp://"+device->GetUUID()+"/";
if (!NPT_StringsEqual(item_id, "0")) {
std::string id(CURL::Encode(item_id));
URIUtils::AddSlashAtEnd(id);
path += id.c_str();
}
CLog::Log(LOGDEBUG, "UPNP: notfified container update %s", (const char*)path);
CGUIMessage message(GUI_MSG_NOTIFY_ALL, 0, 0, GUI_MSG_UPDATE_PATH);
message.SetStringParam(path.GetChars());
g_windowManager.SendThreadMessage(message);
}
示例12:
/*----------------------------------------------------------------------
| PLT_MediaController::GetProtocolInfoSink
+---------------------------------------------------------------------*/
NPT_Result
PLT_MediaController::GetProtocolInfoSink(PLT_DeviceDataReference& device,
NPT_List<NPT_String>& sinks)
{
PLT_DeviceDataReference renderer;
NPT_CHECK_WARNING(FindRenderer(device->GetUUID(), renderer));
// look for ConnectionManager service
PLT_Service* serviceCMR;
NPT_CHECK_SEVERE(device->FindServiceByType(
"urn:schemas-upnp-org:service:ConnectionManager:*",
serviceCMR));
NPT_String value;
NPT_CHECK_SEVERE(serviceCMR->GetStateVariableValue(
"SinkProtocolInfo",
value));
sinks = value.Split(",");
return NPT_SUCCESS;
}
示例13: OnDeviceRemoved
NPT_Result GPAC_GenericController::OnDeviceRemoved(PLT_DeviceDataReference& device)
{
u32 i, count;
GPAC_DeviceItem *item = NULL;
NPT_String uuid = device->GetUUID();
gf_mx_p(m_ControlPointLock);
count = gf_list_count(m_Devices);
for (i=0; i<count; i++) {
item = (GPAC_DeviceItem *) gf_list_get(m_Devices, i);
if (item->m_UUID == uuid ) {
gf_list_rem(m_Devices, i);
break;
}
item = NULL;
}
if (item) {
m_pUPnP->OnDeviceAdd(item, 0);
delete item;
}
gf_mx_v(m_ControlPointLock);
return NPT_SUCCESS;
}
示例14:
/*----------------------------------------------------------------------
| PLT_SyncMediaBrowser::OnMSAddedRemoved
+---------------------------------------------------------------------*/
void
PLT_SyncMediaBrowser::OnMSAddedRemoved(PLT_DeviceDataReference& device, int added)
{
NPT_String uuid = device->GetUUID();
if (added) {
// test if it's a media server
m_MediaServers.Lock();
PLT_Service* service;
if (NPT_SUCCEEDED(device->FindServiceByType("urn:schemas-upnp-org:service:ContentDirectory:1", service))) {
m_MediaServers.Put(uuid, device);
}
m_MediaServers.Unlock();
} else { /* removed */
// Remove from our list of servers first if found
m_MediaServers.Lock();
m_MediaServers.Erase(uuid);
m_MediaServers.Unlock();
// clear cache for that device
if (m_UseCache) m_Cache.Clear(device.AsPointer()->GetUUID());
}
}
示例15: GetMediaServers
/*----------------------------------------------------------------------
| CMediaCrawler::OnBrowseRoot
+---------------------------------------------------------------------*/
NPT_Result
CMediaCrawler::OnBrowseRoot(PLT_ActionReference& action)
{
NPT_String browseFlagValue;
if (NPT_FAILED(action->GetArgumentValue("BrowseFlag", browseFlagValue))) {
NPT_LOG_WARNING("PLT_FileMediaServer::OnBrowse - invalid arguments.");
return NPT_FAILURE;
}
/* extract browseFlag */
BrowseFlags browseFlag;
if (NPT_FAILED(GetBrowseFlag(browseFlagValue, browseFlag))) {
/* error */
NPT_LOG_WARNING("PLT_FileMediaServer::OnBrowseRoot - BrowseFlag value not allowed.");
action->SetError(402,"Invalid BrowseFlag arg.");
return NPT_FAILURE;
}
if (browseFlag == BROWSEMETADATA) {
PLT_MediaContainer item;
item.m_Title = "Root";
item.m_ParentID = "-1";
item.m_ObjectID = "0";
item.m_ChildrenCount = GetMediaServers().GetItemCount();
item.m_ObjectClass.type = "object.container";
/* convert item to didl */
NPT_String filter;
action->GetArgumentValue("Filter", filter);
NPT_String tmp;
NPT_CHECK_SEVERE(PLT_Didl::ToDidl(item, filter, tmp));
/* add didl header and footer */
NPT_String didl = didl_header + tmp + didl_footer;
action->SetArgumentValue("Result", didl);
action->SetArgumentValue("NumberReturned", "1");
action->SetArgumentValue("TotalMatches", "1");
// update ID may be wrong here, it should be the one of the container?
action->SetArgumentValue("UpdateId", "1");
// TODO: We need to keep track of the overall updateID of the CDS
} else {
NPT_String startingInd;
NPT_String reqCount;
NPT_String filter;
NPT_CHECK_SEVERE(action->GetArgumentValue("StartingIndex", startingInd));
NPT_CHECK_SEVERE(action->GetArgumentValue("RequestedCount", reqCount));
NPT_CHECK_SEVERE(action->GetArgumentValue("Filter", filter));
unsigned long start_index, req_count;
if (NPT_FAILED(startingInd.ToInteger(start_index)) ||
NPT_FAILED(reqCount.ToInteger(req_count))) {
return NPT_FAILURE;
}
unsigned long cur_index = 0;
unsigned long num_returned = 0;
unsigned long total_matches = 0;
//unsigned long update_id = 0;
PLT_MediaContainer item;
NPT_String tmp;
NPT_String didl = didl_header;
// populate a list of containers (one container per known servers)
const NPT_Lock<PLT_DeviceDataReferenceList>& devices = GetMediaServers();
NPT_Lock<PLT_DeviceDataReferenceList>::Iterator entry = devices.GetFirstItem();
while (entry) {
PLT_DeviceDataReference device = (*entry);
item.m_Title = device->GetFriendlyName();
item.m_ObjectID = FormatObjectId(device->GetUUID(), "0");
item.m_ParentID = "0";
item.m_ObjectClass.type = "object.container";
if ((cur_index >= start_index) && ((num_returned < req_count) || (req_count == 0))) {
NPT_CHECK_SEVERE(PLT_Didl::ToDidl(item, filter, tmp));
didl += tmp;
num_returned++;
}
cur_index++;
total_matches++;
++entry;
}
didl += didl_footer;
action->SetArgumentValue("Result", didl);
action->SetArgumentValue("NumberReturned", NPT_String::FromInteger(num_returned));
action->SetArgumentValue("TotalMatches", NPT_String::FromInteger(total_matches));
action->SetArgumentValue("UpdateId", "1");
}
return NPT_SUCCESS;
}