DMR技术要点分析2

? HTTPMU 
在UDP上实现HTTP协议的多址传送。
? HTTPU 
在UDP上实现HTTP协议的单播传送。
? SOAP 
简单对象存取协议(Simple Object Access Protocol ),它是一种应用程序之间进行数据通讯的机制。它是一种在HTTP上使用XML发送命令并接收值的远程过程调用。
A remote-procedure call mechanism based on XML sends commands and receives values over HTTP.
? SSDP
A multicast discovery and search mechanism that use a multicast variant of HTTP over UDP.
? UPC 
通用产品编码的缩写(Universal Product Code),它由12个数字构成,由统一编码委员会(Uniform Code Council)管理。这个值可由UPnP制造商指定。 
? UDN
单一设备名(Unique Device Name)基于UUID,每个表示一个设备。在不同的时间,对于同一个设备此值应该是唯一的。 
? 设备 
设备是指其他服务或者是设备的容器。一个设备可以包含其他的逻辑设备。
Logical device. A container. May embed other logical devices. Embeds one or more services. Advertises its presence on network(s).
? 设备描述 
设备描述包含一个物理设备上所有设备一系列通用属性,它包括服务,设备结构和设备属性。

[原文]Formal definition of a logical device, expressed in the UPnP Template Language. Written in XML syntax. Specified by a UPnP vendor by filling in the placeholders in a UPnP Device Template, including, e.g., manufacturer name, model name, model number, serial number, and URLs for control, eventing, and presentation.
? 设备类型 
设备类型的一般格式为 urn:schemas-upnp-org:device:uuid-device,uuid-device 为UPnP工作委员会定义的标准设备类型。在UPnP设备模版和设备类型之间是一一对应的,设备制造商也可以指定其他的名字,一般格式为 urn:domain-name:device:uuid-device, uuid-device为制造商定义的标准设备类型,domain-name字段为设备制造商注册的域名。 
[原文]Standard device types are denoted by urn:schemas-upnp-org:device: followed by a unique name assigned by a UPnP Forum working committee. One-to-one relationship with UPnP Device Templates. UPnP vendors may specify additional device types; these are denoted by urn:domain-name:device: followed by a unique name assigned by the vendor, where domainname is a Vendor Domain Name. 
? 根设备 
根设备是指处于设备树最顶层的设备。 
A logical device that is not embedded in any other logical device. 
? 控制点 
控制点是一个控制器,它可以检索设备和服务描述,发送动作到服务,查询服务的状态变量和从服务接收事件。允许用户使用或运行一个设备,例如CD播放机,的程序可以认为是控制点。 
[原文]Retrieves device and service descriptions, sends actions to services, polls for service state variables, and receives events from services.
? 动作 
表示客户端发出的完成特定功能的命令。
[原文]Command exposed by a service. Takes one or more input or output arguments. May have a return value.
? 事件 
事件是指服务的状态变量的一个或多个改变的通知。 
[原文]Notification of one or more changes in state variables exposed by a service..
? 事件变量 
事件变量是指在改变一个服务的状态变量时触发事件的变量。任何订阅此变量的事件源的控制点将接收到改变通知。非事件变量与事件通知没有关系。 
? 服务 
服务是一个逻辑功能单位,服务代表动作和使用状态变量的物理设备的部分或所有状态。
[原文]Logical functional unit. Smallest units of control. Exposes actions and models the state of a physical device with state variables.
? 服务描述 
服务描述是指设备提供的一系列动作以及和动作相关的状态变量。 
[原文]Formal definition of a logical service, expressed in the UPnP Template language. Written in XML syntax. Specified by a UPnP vendor by filling in any placeholders in a UPnP Service Template. (Was SCPD.) 
? 服务类型 
服务类型是表示服务的统一资源名。服务类型和UPnP服务模版之间是一一对应的。UPnP任务组定义了几种标准的服务类型。服务类型的一般格式为: urn:schemas-upnp-org:service:serviceType:version。例如,扫描仪的服务类型应该为 urn:schemas-upnp-org:service:scanner:1。 UPnP设备制造商可以指定附加服务,这样的服务一般格式为: urn:domain-name:service:serviceType:version , domain-name字段为设备制造商注册的域名。 
[原文]Standard service types are denoted by urn:schemas-upnp-org:service: followed by a unique name assigned by a UPnP forum working committee, colon, and an integer version number. One-to-one relationship with UPnP Service Templates. UPnP vendors may specify additional services; these are denoted by urn:domain-name:service: followed by a unique name assigned by the vendor, colon, and a version number, where domain-name is a Vendor Domain Name. 
? 状态变量 
状态变量是用于描述服务状态的数据片断。
[原文]Single facet of a model of a physical service. Exposed by a service. Has a name, data type, optional default value, optional constraints values, and may trigger events when its value changes. For more information, see section 2, “Description” and section 3, “Control”. Subscriber Recipient of event messages. Typically a control point. 
? 通用事件通知架构
控制点对感兴趣的设备做预定操作,这样如果该设备状态有改变时,会通过GENA发出事件通知给控制点,保证控制点能够随时知道最新状态。
? UPnP Device Template
Template listing device type, required embedded devices (if any), and required services. Written in XML syntax and derived from the UPnP Device Schema. Defined by a UPnP Forum working committee. One-to-one relationship with standard device types.
? UPnP Service Template
Template listing action names, parameters for those actions, state variables, and properties of those state variables. Written in XML syntax and derived from the UPnP Service Schema. Defined by a UPnP Forum working committee. One-to-one relationship with standard service types. 
? UPnP Device Schema
Defines the elements and attributes used in UPnP Device and Service Templates. Written in XML syntax and derived from XML Schema (Part 1: Structures, Part 2: Datatypes). Defined by the UPnP Device Architecture herein.
? DIDL-Lite
DIDL-Lite是DIDL的子集,采用W3C XML schema构建。

DLNA应用类型可以分为DMS、DMP和DMR等子模块或子系统,本文目的是利用机顶盒原有的媒体播放功能,与DLNA和UPnP技术结合,实现DMR功能,即机顶盒作为展示器,能够在家庭网络中接受DMC的控制,播放DMS中的节目或者图片等。
机顶盒中将存在DMS、DMR、DMP的组件,默认情况机顶盒都有DMP功能,根据配置信息(或者硬盘检测功能)机顶盒使能DMS功能,根据配置信息使能DMR功能。
大致的实现方式可以参照下面流程:
1. 在机顶盒上,设计独立的DMR App应用。按照uPnP描述,一个物理设备可以是多个角色。为DMR App应用配置DMRini启动参数文件。
2. 在机顶盒运行后,各个应用程序被加载,这时再根据DMRini决定是否继续运行或终止DMRApp。
3. DMR App启动后首先启动DMR功能,即广播自己为DMR uPnP设备;
4. 一台DMC设备查看某一DMS设备上的媒体内容,选中一媒体节目。然后选择DMR设备进行播放。
5. 如果此DMR被选择,根据协议规定受到节目URI后,与DMS建立媒体连接。并接受DMC的播放控制命令进行播放。

动作 action UPnP网络中的远程过程调用;控制点将动作发送到设备服务,在动作完成(或失败)后,服务返回相应的结果或错误。
控制点 control point 客户端,获取设备提供的服务信息并使用服务。
设备 device 设备上提供的功能单元。
服务 service 服务端,用以在网络上提供各种服务,可能包含其它设备。
事件 event 事件是指服务的状态变量的一个或多个改变的通知。 
[原文]Notification of one or more changes in state variables exposed by a service.
DIDL-Lite DIDL-Lite DIDL-Lite是DIDL的子集,采用W3C XML schema构建。

本模块主要功能是作为媒体展示器,向DMC提供AVTranstport服务、ConnectionManager服务、RenderingControl服务.
DMR设备启动的时候,会向外广播自己的设备:消息如下:
<root xmlns="urn:schemas-upnp-org:device-1-0">    
<specVersion>       
<major>1</major>      
 <minor>0</minor>   
 </specVersion>  
 <device>       
 <deviceType>urn:schemas-upnp-org:device:MediaRenderer:1</deviceType>       
 <INMPR03>1.0</INMPR03>       
 <friendlyName>ZTE AV Renderer</friendlyName>       
 <manufacturer>ZTE Corporation</manufacturer>       
 <manufacturerURL> http://www.zte.com.cn</manufacturerURL>       
 <modelDescription>ZTE AV Media Renderer device</modelDescription>       
 <modelName>AV Renderer</modelName>       
 <modelURL> http://www.zte.com.cn</modelURL>       
 <UDN>uuid:31997c1e-c3dd-4010-9f4a-ca56f805faa7</UDN>       
 <serviceList>          
 <service>             
 <serviceType>urn:schemas-upnp-org:service:AVTransport:1</serviceType>             
 <serviceId>urn:schemas-upnp-org:service:AVTransport</serviceId>             
 <SCPDURL>_urn:schemas-upnp-org:service:AVTransport_scpd.xml</SCPDURL>             
 <controlURL>_urn:schemas-upnp-org:service:AVTransport_control</controlURL>             
 <eventSubURL>_urn:schemas-upnp-org:service:AVTransport_event</eventSubURL>          
 </service>          
 <service>             
 <serviceType>urn:schemas-upnp-org:service:ConnectionManager:1</serviceType>             
 <serviceId>urn:schemas-upnp-org:service:ConnectionManager</serviceId>             
 <SCPDURL>_urn:schemas-upnp-org:service:ConnectionManager_scpd.xml</SCPDURL>             
 <controlURL>_urn:schemas-upnp-org:service:ConnectionManager_control</controlURL>             
 <eventSubURL>_urn:schemas-upnp-org:service:ConnectionManager_event</eventSubURL>          
 </service>          
 <service>             
 <serviceType>urn:schemas-upnp-org:service:RenderingControl:1</serviceType>             
 <serviceId>urn:schemas-upnp-org:service:RenderingControl</serviceId>             
 <SCPDURL>_urn:schemas-upnp-org:service:RenderingControl_scpd.xml</SCPDURL>             
 <controlURL>_urn:schemas-upnp-org:service:RenderingControl_control</controlURL>             
<eventSubURL>_urn:schemas-upnp-org:service:RenderingControl_event</eventSubURL>        
  </service>       
  </serviceList>    
  </device> 
  </root>
enable=1
deviceName=ZTE-Media-Renderer 2.0.0 V2D  //DMR设备名 在DLNA网络中描述自己的名字。
//支持的媒体格式 DMR支持的媒体格式。根据DLNA的描述排列多个媒体格式。
protocolInfo="http-get:*:audio/mpeg:*;http-get:*:audio/wav:;http-get:*:audio/x-ms-wma:*;http-get:*:video/mp4:*;http-get:*:video/mpeg:*;http-get:*:video/mpeg2:*;http-get:*:video/avi:*;http-get:*:image/gif:*;http-get:*:image/jpeg:*;http-get:*:image/png:*;http-get:*:mpeg4:*;rtsp-rtp-udp:*:mpeg4/h.264:*;x-ctc_videophone_receive,rtp_udp:50500,50343:video/h.264:*"
searchTimeout=500 搜索设备超时 搜索设备超时时间。
AdverIntervalTime=60//广播间隔时间 广播本设备间隔时间。
port=60000

DMR_INITUPNP 1:将设备描述,设备句柄,设备端口号,设备回调函数等注册到全局数组信息区。
并设置底层服务器所用IP和port.设定设备运行时虚拟目录及所用的回调函数.
在底层SDK注册,并在网络上组播 "宣告有效"报文,以启动服务。
机顶盒DMR播放一个媒体的顺序大致:
1)执行SetAVTransportURI动作,AVTransportURI记录媒体URI,此时AVT模块并不立
即将媒体地址转交到主控。
2)只有在收到Play动作后,AVT模块才将媒体地址转给主控,再由主控转交给vod的STMeidaPlayer播放,此时STMeidaPlayer开始向DMS请求媒体播放。
所以,因网络原因或DMS原因导致的错误需要VOD模块告之AVT。TransportStatus初始默认值为OK,当收到主控转发vod的错误事件的时候,则记录TransportStatus值为ERROR_OCCURRED。

总结起来:
初始状态,没有任何URI资源信息时,为“NO MEDIA PRESENT”状态。
有URI信息,但没有播放或播放失败,为“STOPPED”。
有URI,正在启动播放,等待缓冲数据,为“TRANSITIONING” 。
启动播放成功,为“PLAYING”。
当媒体变更状态之后都需要上报变更结果。
5. Stop
检查当前的状态,如果出于非停止状态,向主控发送命令停止播放,并将状态变量转换为“STOP”状态。

6. Next
检查当前的track个数,如果是单个节目,不支持此命令;如果是多个节目,并且当前是最后一个节目,也不支持此命令;否者停止当前节目,获取下一节目信息,启动播放。CurrentTrack,CurrentTrackURI等变量也进行修改。

7. 传输状态的变更设计。
TransportState变量表示当前AVT服务的状态,但其状态个数比较有限,无法表达一些过渡状态。主控(包括maincontrol、vplayer、STMediaplay)如果有状态变化,将通过事件通知AVT服务。此时TransportState做相应变更。当发生不同时,以主控通知的状态为准。
此状态的变更在命令执行时,先行变更(等事件汇报再变更会比较慢)。变更为playing状态前,可以先变更为过渡状态“TRANSITIONING”。
每当当前状态有变化时,都调用函数SetLastChange发布自己的状态信息。对于有订购事件的控制端,可以发送事件通知。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值