当前位置: 首页>>代码示例>>C++>>正文


C++ PLT_Service::InitURLs方法代码示例

本文整理汇总了C++中PLT_Service::InitURLs方法的典型用法代码示例。如果您正苦于以下问题:C++ PLT_Service::InitURLs方法的具体用法?C++ PLT_Service::InitURLs怎么用?C++ PLT_Service::InitURLs使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在PLT_Service的用法示例。


在下文中一共展示了PLT_Service::InitURLs方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1:

/*----------------------------------------------------------------------
|   PLT_LightSampleDevice::SetupServices
+---------------------------------------------------------------------*/
NPT_Result
PLT_LightSampleDevice::SetupServices(PLT_DeviceData& data)
{
    PLT_Service* service = new PLT_Service(
        this,
        "urn:schemas-upnp-org:service:SwitchPower:1", 
        "urn:upnp-org:serviceId:SwitchPower.001");
    NPT_CHECK_FATAL(service->SetSCPDXML((const char*)SCPDXML));
    NPT_CHECK_FATAL(service->InitURLs("SwitchPower", m_UUID));
    NPT_CHECK_FATAL(data.AddService(service));

    service->SetStateVariable("Status", "True");

    return NPT_SUCCESS;
}
开发者ID:AWilco,项目名称:xbmc,代码行数:18,代码来源:PltLightSample.cpp

示例2: AddService

/*----------------------------------------------------------------------
|   PLT_LightSampleDevice::PLT_LightSampleDevice
+---------------------------------------------------------------------*/
PLT_LightSampleDevice::PLT_LightSampleDevice(char* FriendlyName, char* UUID) :	
    PLT_DeviceHost("/", UUID, "urn:schemas-upnp-org:device:SwitchPower:1", FriendlyName)
{
    PLT_Service* service = new PLT_Service(
        this,
        "urn:schemas-upnp-org:service:SwitchPower:1", 
        "urn:upnp-org:serviceId:SwitchPower.001");

    if (SCPDXML &&
        NPT_SUCCEEDED(service->SetSCPDXML((const char*)SCPDXML))) {
        service->InitURLs("SwitchPower", m_UUID);
        AddService(service);
    } else {
        delete service;
    }

    service->SetStateVariable("Status", "True");
}
开发者ID:Avoidnf8,项目名称:xbmc-fork,代码行数:21,代码来源:PltLightSample.cpp

示例3: AddService

/*----------------------------------------------------------------------
|   PLT_MediaRenderer::PLT_MediaRenderer
+---------------------------------------------------------------------*/
PLT_MediaRenderer::PLT_MediaRenderer(PlaybackCmdListener* listener, 
                                     const char*          friendly_name, 
                                     bool                 show_ip, 
                                     const char*          uuid, 
                                     unsigned int         port) :	
    PLT_DeviceHost("/", uuid, "urn:schemas-upnp-org:device:MediaRenderer:1", friendly_name, show_ip, port)
{
    NPT_COMPILER_UNUSED(listener);

    PLT_Service* service;

    /* AVTransport */
    service = new PLT_Service(
        this,
        "urn:schemas-upnp-org:service:AVTransport:1", 
        "urn:upnp-org:serviceId:AVT_1-0");
    if (NPT_SUCCEEDED(service->SetSCPDXML((const char*) RDR_AVTransportSCPD))) {
        service->InitURLs("AVTransport", m_UUID);
        AddService(service);
        service->SetStateVariableRate("LastChange", NPT_TimeInterval(0.2f));

        // GetCurrentTransportActions
        service->SetStateVariable("CurrentTransportActions", "", false);
        
        // GetDeviceCapabilities
        service->SetStateVariable("PossiblePlaybackStorageMedia", "vendor-defined ,NOT_IMPLEMENTED,NONE,NETWORK,MICRO-MV,HDD,LD,DAT,DVD-AUDIO,DVD-RAM,DVD-RW,DVD+RW,DVD-R,DVD-VIDEO,DVD-ROM,MD-PICTURE,MD-AUDIO,SACD,VIDEO-CD,CD-RW,CD-R,CD-DA,CD-ROM,HI8,VIDEO8,VHSC,D-VHS,S-VHS,W-VHS,VHS,MINI-DV,DV,UNKNOWN", false);
        service->SetStateVariable("PossibleRecordStorageMedia", "vendor-defined ,NOT_IMPLEMENTED,NONE,NETWORK,MICRO-MV,HDD,LD,DAT,DVD-AUDIO,DVD-RAM,DVD-RW,DVD+RW,DVD-R,DVD-VIDEO,DVD-ROM,MD-PICTURE,MD-AUDIO,SACD,VIDEO-CD,CD-RW,CD-R,CD-DA,CD-ROM,HI8,VIDEO8,VHSC,D-VHS,S-VHS,W-VHS,VHS,MINI-DV,DV,UNKNOWN", false);
        service->SetStateVariable("PossibleRecordQualityModes", "vendor-defined ,NOT_IMPLEMENTED,2:HIGH,1:MEDIUM,0:BASIC,2:SP,1:LP,0:EP", false);
        
        // GetMediaInfo
        service->SetStateVariable("PlaybackStorageMedium", "UNKNOWN", false);
        service->SetStateVariable("RecordStorageMedium", "UNKNOWN", false);
        service->SetStateVariable("RecordMediumWriteStatus", "UNKNOWN", false);
        service->SetStateVariable("NumberOfTracks", "0", false);
        service->SetStateVariable("CurrentTrackDuration", "00:00:00", false);
        service->SetStateVariable("CurrentMediaDuration", "00:00:00", false);
        service->SetStateVariable("NextAVTransportURI", "NOT_IMPLEMENTED", false);
        service->SetStateVariable("NextAVTransportURIMetadata", "NOT_IMPLEMENTED", false);
        
        // GetPositionInfo
        service->SetStateVariable("AbsTime", "NOT_IMPLEMENTED", false);
        service->SetStateVariable("CurrentTrack", "0", false);
        service->SetStateVariable("RelativeTimePosition", "00:00:00", false); //??
        service->SetStateVariable("AbsoluteTimePosition", "NOT_IMPLEMENTED", false); //??
        service->SetStateVariable("RelativeCounterPosition", "0", false); //??
        service->SetStateVariable("AbsoluteCounterPosition", "0", false); //??

        // GetTransportInfo
        service->SetStateVariable("TransportState", "NO_MEDIA_PRESENT", false);
        service->SetStateVariable("TransportStatus", "OK", false);
        service->SetStateVariable("TransportPlaySpeed", "1", false);
        
        // GetTransportSettings
        service->SetStateVariable("CurrentPlayMode", "NORMAL", false);
        service->SetStateVariable("CurrentRecordQualityMode", "NOT_IMPLEMENTED", false);
    }

    /* ConnectionManager */
    service = new PLT_Service(
        this,
        "urn:schemas-upnp-org:service:ConnectionManager:1", 
        "urn:upnp-org:serviceId:CMGR_1-0");
    if (NPT_SUCCEEDED(service->SetSCPDXML((const char*) RDR_ConnectionManagerSCPD))) {
        service->InitURLs("ConnectionManager", m_UUID);
        AddService(service);
        service->SetStateVariable("CurrentConnectionIDs", "0", false);
        // put all supported mime types here instead
        service->SetStateVariable("SinkProtocolInfo", "http-get:*:*:*", false);
        service->SetStateVariable("SourceProtocolInfo", "", false);
    }

    /* RenderingControl */
    service = new PLT_Service(
        this,
        "urn:schemas-upnp-org:service:RenderingControl:1", 
        "urn:upnp-org:serviceId:RCS_1-0");
    if (NPT_SUCCEEDED(service->SetSCPDXML((const char*) RDR_RenderingControlSCPD))) {
        service->InitURLs("RenderingControl", m_UUID);
        AddService(service);
        service->SetStateVariableRate("LastChange", NPT_TimeInterval(0.2f));
    }
}
开发者ID:Avoidnf8,项目名称:xbmc-fork,代码行数:85,代码来源:PltMediaRenderer.cpp

示例4:

/*----------------------------------------------------------------------
|   PLT_MediaRenderer::SetupServices
+---------------------------------------------------------------------*/
NPT_Result
PLT_MediaRenderer::SetupServices(PLT_DeviceData& data)
{
    PLT_Service* service;

    {
        /* AVTransport */
        service = new PLT_Service(
            &data,
            "urn:schemas-upnp-org:service:AVTransport:1", 
            "urn:upnp-org:serviceId:AVT_1-0",
            "urn:schemas-upnp-org:metadata-1-0/AVT/");
        NPT_CHECK_FATAL(service->SetSCPDXML((const char*) RDR_AVTransportSCPD));
        NPT_CHECK_FATAL(service->InitURLs("AVTransport", data.GetUUID()));
        NPT_CHECK_FATAL(data.AddService(service));

        service->SetStateVariableRate("LastChange", NPT_TimeInterval(0.2f));
        service->SetStateVariable("A_ARG_TYPE_InstanceID", "0"); 

        // GetCurrentTransportActions
        service->SetStateVariable("CurrentTransportActions", "Play,Pause,Stop,Seek,Next,Previous");

        // GetDeviceCapabilities
        service->SetStateVariable("PossiblePlaybackStorageMedia", "NONE,NETWORK");
        service->SetStateVariable("PossibleRecordStorageMedia", "NOT_IMPLEMENTED");
        service->SetStateVariable("PossibleRecordQualityModes", "NOT_IMPLEMENTED");

        // GetMediaInfo
        service->SetStateVariable("NumberOfTracks", "0");
        service->SetStateVariable("CurrentMediaDuration", "00:00:00");;
        service->SetStateVariable("AVTransportURI", "");
        service->SetStateVariable("AVTransportURIMetadata", "");;
        service->SetStateVariable("NextAVTransportURI", "NOT_IMPLEMENTED");
        service->SetStateVariable("NextAVTransportURIMetadata", "NOT_IMPLEMENTED");
        service->SetStateVariable("PlaybackStorageMedium", "NONE");
        service->SetStateVariable("RecordStorageMedium", "NOT_IMPLEMENTED");
        service->SetStateVariable("RecordMediumWriteStatus", "NOT_IMPLEMENTED");

        // GetPositionInfo
        service->SetStateVariable("CurrentTrack", "0");
        service->SetStateVariable("CurrentTrackDuration", "00:00:00");
        service->SetStateVariable("CurrentTrackMetadata", "");
        service->SetStateVariable("CurrentTrackURI", "");
        service->SetStateVariable("RelativeTimePosition", "00:00:00"); 
        service->SetStateVariable("AbsoluteTimePosition", "00:00:00");
        service->SetStateVariable("RelativeCounterPosition", "2147483647"); // means NOT_IMPLEMENTED
        service->SetStateVariable("AbsoluteCounterPosition", "2147483647"); // means NOT_IMPLEMENTED

        // disable indirect eventing for certain state variables
        PLT_StateVariable* var;
        var = service->FindStateVariable("RelativeTimePosition");
        if (var) var->DisableIndirectEventing();
        var = service->FindStateVariable("AbsoluteTimePosition");
        if (var) var->DisableIndirectEventing();
        var = service->FindStateVariable("RelativeCounterPosition");
        if (var) var->DisableIndirectEventing();
        var = service->FindStateVariable("AbsoluteCounterPosition");
        if (var) var->DisableIndirectEventing();

        // GetTransportInfo
        service->SetStateVariable("TransportState", "NO_MEDIA_PRESENT");
        service->SetStateVariable("TransportStatus", "OK");
        service->SetStateVariable("TransportPlaySpeed", "1");

        // GetTransportSettings
        service->SetStateVariable("CurrentPlayMode", "NORMAL");
        service->SetStateVariable("CurrentRecordQualityMode", "NOT_IMPLEMENTED");
    }

    {
        /* ConnectionManager */
        service = new PLT_Service(
            &data,
            "urn:schemas-upnp-org:service:ConnectionManager:1", 
            "urn:upnp-org:serviceId:CMGR_1-0");
        NPT_CHECK_FATAL(service->SetSCPDXML((const char*) RDR_ConnectionManagerSCPD));
        NPT_CHECK_FATAL(service->InitURLs("ConnectionManager", data.GetUUID()));
        NPT_CHECK_FATAL(data.AddService(service));

        service->SetStateVariable("CurrentConnectionIDs", "0");

        // put all supported mime types here instead
        service->SetStateVariable("SinkProtocolInfo", "http-get:*:*:*");
        service->SetStateVariable("SourceProtocolInfo", "");
    }

    {
        /* RenderingControl */
        service = new PLT_Service(
            &data,
            "urn:schemas-upnp-org:service:RenderingControl:1", 
            "urn:upnp-org:serviceId:RCS_1-0",
            "urn:schemas-upnp-org:metadata-1-0/RCS/");
        NPT_CHECK_FATAL(service->SetSCPDXML((const char*) RDR_RenderingControlSCPD));
        NPT_CHECK_FATAL(service->InitURLs("RenderingControl", data.GetUUID()));
        NPT_CHECK_FATAL(data.AddService(service));

//.........这里部分代码省略.........
开发者ID:Castlecard,项目名称:plex,代码行数:101,代码来源:PltMediaRenderer.cpp

示例5:

NPT_Result
GPAC_MediaRenderer::SetupServices(PLT_DeviceData& data)
{
    PLT_Service* service;

    {
        /* AVTransport */
        m_pAVService = new PLT_Service(
            &data,
            "urn:schemas-upnp-org:service:AVTransport:1",
            "urn:upnp-org:serviceId:AVT_1-0",
            "urn:schemas-upnp-org:metadata-1-0/AVT/");
        NPT_CHECK_FATAL(m_pAVService->SetSCPDXML((const char*) RDR_AVTransportSCPD));
        NPT_CHECK_FATAL(m_pAVService->InitURLs("AVTransport", data.GetUUID()));
        NPT_CHECK_FATAL(data.AddService(m_pAVService));

        m_pAVService->SetStateVariableRate("LastChange", NPT_TimeInterval(0.2f));
        m_pAVService->SetStateVariable("A_ARG_TYPE_InstanceID", "0");

        // GetCurrentTransportActions
        m_pAVService->SetStateVariable("CurrentTransportActions", "Play,Pause,Stop,Seek,Next,Previous");

        // GetDeviceCapabilities
        m_pAVService->SetStateVariable("PossiblePlaybackStorageMedia", "NONE,NETWORK");
        m_pAVService->SetStateVariable("PossibleRecordStorageMedia", "NOT_IMPLEMENTED");
        m_pAVService->SetStateVariable("PossibleRecordQualityModes", "NOT_IMPLEMENTED");

        // GetMediaInfo
        m_pAVService->SetStateVariable("NumberOfTracks", "0");
        m_pAVService->SetStateVariable("CurrentMediaDuration", "00:00:00");;
        m_pAVService->SetStateVariable("AVTransportURI", "");
        m_pAVService->SetStateVariable("AVTransportURIMetadata", "");;
        m_pAVService->SetStateVariable("NextAVTransportURI", "NOT_IMPLEMENTED");
        m_pAVService->SetStateVariable("NextAVTransportURIMetadata", "NOT_IMPLEMENTED");
        m_pAVService->SetStateVariable("PlaybackStorageMedium", "NONE");
        m_pAVService->SetStateVariable("RecordStorageMedium", "NOT_IMPLEMENTED");
        m_pAVService->SetStateVariable("RecordMediumWriteStatus", "NOT_IMPLEMENTED");

        // GetPositionInfo
        m_pAVService->SetStateVariable("CurrentTrack", "0");
        m_pAVService->SetStateVariable("CurrentTrackDuration", "00:00:00");
        m_pAVService->SetStateVariable("CurrentTrackMetadata", "");
        m_pAVService->SetStateVariable("CurrentTrackURI", "");
        m_pAVService->SetStateVariable("RelativeTimePosition", "00:00:00");
        m_pAVService->SetStateVariable("AbsoluteTimePosition", "00:00:00");
        m_pAVService->SetStateVariable("RelativeCounterPosition", "2147483647"); // means NOT_IMPLEMENTED
        m_pAVService->SetStateVariable("AbsoluteCounterPosition", "2147483647"); // means NOT_IMPLEMENTED

        // disable indirect eventing for certain state variables
        //PLT_StateVariable* var;
        //var =
			m_pAVService->FindStateVariable("RelativeTimePosition");
        //if (var) var->DisableIndirectEventing();
        //var =
			m_pAVService->FindStateVariable("AbsoluteTimePosition");
        //if (var) var->DisableIndirectEventing();
        //var =
			m_pAVService->FindStateVariable("RelativeCounterPosition");
        //if (var) var->DisableIndirectEventing();
        //var =
			m_pAVService->FindStateVariable("AbsoluteCounterPosition");
        //if (var) var->DisableIndirectEventing();

        // GetTransportInfo
        m_pAVService->SetStateVariable("TransportState", "NO_MEDIA_PRESENT");
        m_pAVService->SetStateVariable("TransportStatus", "OK");
        m_pAVService->SetStateVariable("TransportPlaySpeed", "1");

        // GetTransportSettings
        m_pAVService->SetStateVariable("CurrentPlayMode", "NORMAL");
        m_pAVService->SetStateVariable("CurrentRecordQualityMode", "NOT_IMPLEMENTED");
    }

    {
        /* ConnectionManager */
        service = new PLT_Service(
            &data,
            "urn:schemas-upnp-org:service:ConnectionManager:1",
            "urn:upnp-org:serviceId:CMGR_1-0");
        NPT_CHECK_FATAL(service->SetSCPDXML((const char*) RDR_ConnectionManagerSCPD));
        NPT_CHECK_FATAL(service->InitURLs("ConnectionManager", data.GetUUID()));
        NPT_CHECK_FATAL(data.AddService(service));

        service->SetStateVariable("CurrentConnectionIDs", "0");

        // put all supported mime types here instead
        service->SetStateVariable("SinkProtocolInfo", "http-get:*:*:*, rtsp-rtp-udp:*:*:*");
        service->SetStateVariable("SourceProtocolInfo", "");
    }

    {
        /* RenderingControl */
        service = new PLT_Service(
            &data,
            "urn:schemas-upnp-org:service:RenderingControl:1",
            "urn:upnp-org:serviceId:RCS_1-0",
            "urn:schemas-upnp-org:metadata-1-0/RCS/");
        NPT_CHECK_FATAL(service->SetSCPDXML((const char*) RDR_RenderingControlSCPD));
        NPT_CHECK_FATAL(service->InitURLs("RenderingControl", data.GetUUID()));
        NPT_CHECK_FATAL(data.AddService(service));
//.........这里部分代码省略.........
开发者ID:erelh,项目名称:gpac,代码行数:101,代码来源:GPACMediaRenderer.cpp


注:本文中的PLT_Service::InitURLs方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。