在移动设备上实现 DLNA/UPnP (Win7 Play To)

发布于 2024-08-10 08:35:44 字数 524 浏览 6 评论 0原文

对于一个学期项目,我有一个想法,即实现 Windows 7 的 Play 基础设施,以使用手机作为端点(播放器)或将内容从手机流式传输到 Windows 7 计算机。有人有使用这个 API 的经验吗?这是否可以在几周内完成(原型,只是概念验证,尚未为最终用户做好准备),或者对于这种范围的项目来说是否太多?注意:我不是在寻找代码示例,只是对该项目的可行性进行评估。如果您有 MS 或其他方面的任何文档,那就太好了,尽管不是问题的关键。

编辑:我发现 Windows 7 Play-to 功能基于 DLNA,并且任何支持 DLNA 的设备(我认为)都可以用作 Play-To 上下文菜单的目标。然而,我很难找到任何有关 DLNA 的文档。我想知道您是否需要成为 DNLA 的成员才能真正访问该规范?或者,我知道 DLNA 是建立在 UPnP 之上的,它不会完全满足我的要求,但这将是朝着正确方向迈出的一步,因此,修改我的问题有人知道任何开源 C/ C++ 或 Java(首选)库可以帮助我实现 UPnP 或 DLNA?

谢谢! 克里斯

For a semester project, I had the idea to implement Windows 7's Play to infrastructure to either use a phone as the end point (the player) or to stream stuff from the phone to a Windows 7 machine. Does anybody have experience working with this API? Is this do able over a couple of weeks (prototype, just proof of concept, not end-user ready) or is it too much for a project of this scope? Note: I'm not looking for code samples, just an assessment of the feasibility of this project. If you have any documentation from MS or otherwise that would be awesome although not the crux of the question.

Edit: I discovered that the Windows 7 Play-to functionality is based on DLNA and any device supporting DLNA (I think) can be used as a destination for the Play-To context menu. However, I'm having a really difficult time finding any sort of documentation on DLNA. I'm wondering if you need to be a member of the DNLA to actually get access to the spec? Alternatively, I know DLNA is built on UPnP, it wouldn't exactly do what I want, but it would be a step in the right direction, so, to revise my question does anybody know of any open-source C/C++ or Java (preferable) libraries that would help me implement UPnP or DLNA?

Thanks!
Chris

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

韵柒 2024-08-17 08:35:44

PlayTo 完全基于 UPnP。 DLNA 只是 UPnP 之上的一层标准化。因此任何 UPnP 设备都能够与 DLNA 设备(例如 Win7 机器)通信。
DLNA指定了4种类型的设备:DMP、DMR、DMC和DMS。
DMP(又名数字媒体播放器)是一种能够查找和浏览远程服务器(DMS=数字媒体服务器)并使用内容(或拉取内容)的设备。 PS3 是 DMP 的完美例子。 DMP 在网络上不可发现,它只是发现和使用内容。由于它不可发现,因此您无法使用 PlayTo 控制它。
DMR(又名数字媒体渲染器)是一种可以接受从网络接收的命令的设备。它是可发现的,公开 UPnP 描述文档和 AVTransport 和 ConnectionManager 或 RenderingControl 等 UPnP 服务。 PlayTo 设备能够在网络上找到该设备,并且可以将内容推送到该设备。它可以通过AVTransport服务和RenderingControl服务来控制播放。
如今许多设备要么是 100% DMP(无法通过 PlayTo 控制),要么是 DMP-DMR。这意味着它们不仅公开 AVTransport 和 RenderingControl 服务,而且还具有用户可以用来从服务器提取媒体的 GUI。
DMS(又名数字媒体服务器)是一种媒体服务器设备。您可以将媒体内容存储在其中,然后可以从其他网络设备使用它。这些通常是 NAS 设备,但也可能是移动电话、Win7/Vista 机器等。DMS 在网络上是可发现的,并将 UPnP 服务公开为 ContentDirectory 服务。这公开了浏览和搜索等方法,您可以使用它们来查找内容。
DMC 设备(又名数字媒体控制器)是一种没有播放功能的设备。它只有控制能力,需要远程DMS(暴露内容)和远程DMR(播放内容)来完成媒体体验。 PlayTo 就是一个例子。诺基亚 N95/诺基亚 N78 手机或 iPhone 上也有类似的应用程序。 Twonky 也有一个基于网络的 DMC。

所有这些设备都有一个共同点:它们理解并使用 UPnP。它们可以用 C+、C#、Java 实现,可以在 Windows、Linux 或 Apple 平台上运行,但它们都是基于 UPnP 的。因此,您所需要做的就是熟悉 UPnP 标准。我建议从 upnp.org 和 Intel Device Spy(以及其他相关的 Intel UPnP 工具)下载论文并开始使用它们。
如果您想编写 DMC(或 PlayTo)——这是最容易做的事情——您需要了解的只是一些基本的 UPnP 概念(SOAP、XML、网络发现等)。如果您想在 Win7 平台上编写应用程序,您可能需要使用 Win UPnP API 来发现设备并向它们发送命令。或者您可以编写自己的 API 来执行此操作(这并不难)。我不知道你在手机上可能会使用什么API。但是,您始终可以进行基本操作:使用基本网络 API 通过线路发送 SOAP 消息。
对于 DMP/DMR,您将需要播放功能,这可能取决于平台以及您拥有的编解码器。

如果这对您入门有所帮助,请告诉我。
谢谢
查赞

The PlayTo is all UPnP based. DLNA is just a layer of standardization on top of UPnP. So any UPnP device is able to talk with a DLNA device so to a Win7 machine.
DLNA specifies 4 type of devices: DMP, DMR, DMC and DMS.
A DMP (aka Digital Media Player) is a device, that is capable of finding and browsing remote servers (DMS=Digital Media Servers) and consume content (or pull content). PS3 is the perfect example of DMP. A DMP is not discoverable on the network, it just discovers and consumes content. Because it is not discoverable, you cannot control it with PlayTo.
A DMR (aka Digital Media Renders) is a device that can accept commands received from the network. It is discoverable, exposes an UPnP description document and UPnP services like AVTransport and ConnectionManager or RenderingControl. A PlayTo device, is capable to find this device on a network, and it can push content to it. It can control the playback via AVTransport service and RenderingControl service.
Many devices today are either 100% DMPs (cannot be controlled via PlayTo) or DMP-DMRs. That means they both expose the AVTransport and RenderingControl services but also have a GUI that the user can use to pull media from a server.
A DMS (aka Digital Media Server) is a media server device. You can store media content in there and than you can consume it from other network devices. These are usually NAS devices, but they may also be mobile phones, Win7/Vista machines, etc. A DMS is discoverable on the network and exposes UPnP services as ContentDirectory service. This exposes methods as Browse and Search, which you may use to locate the content.
A DMC device (aka Digital Media Controller) is a device that has no playback capabilities. It has only controlling capabilities, and it needs a remote DMS (to expose the content) and a remote DMR (to play the content) for completing the media experience. PlayTo is an example. There are also similar apps on Nokia N95/Nokia N78 phones or on iPhone. Twonky has a web based DMC also.

All these devices have one thing in common: they understand and speak UPnP. They may be implemented in C+, C#, Java, they may run on Windows, Linux or Apple platform but they are all UPnP based. So all you need to do is to get familiar with UPnP standard. I would recommend downloading the papers from upnp.org and the Intel Device Spy (and other related Intel UPnP tools) and start playing with those.
If you want to write a DMC (or PlayTo) - which is the easiest thing to do - all you need to understand is just some basic UPnP concepts (SOAP, XML, network discovery, etc). If you want to write your app on top of Win7 platform, you may want to use the Win UPnP API to discover the devices and send commands to them. Or you can write your own API for doing that (it is not that hard). I do not know on the phone what API you may use. However, you can always go to the basic: sending SOAP messages over the wire using basic network APIs.
For a DMP/DMR, you will need playback capabilities, and that may depend on the platform and what codecs you have there.

Let me know if this helps a bit to get you started.
Thx
CCazang

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文