没有找到合适的产品?
联系客服协助选型:023-68661681
提供3000多款全球软件/控件产品
针对软件研发的各个阶段提供专业培训与技术咨询
根据客户需求提供定制化的软件开发服务
全球知名设计软件,显著提升设计质量
打造以经营为中心,实现生产过程透明化管理
帮助企业合理产能分配,提高资源利用率
快速打造数字化生产线,实现全流程追溯
生产过程精准追溯,满足企业合规要求
以六西格玛为理论基础,实现产品质量全数字化管理
通过大屏电子看板,实现车间透明化管理
对设备进行全生命周期管理,提高设备综合利用率
实现设备数据的实时采集与监控
利用数字化技术提升油气勘探的效率和成功率
钻井计划优化、实时监控和风险评估
提供业务洞察与决策支持实现数据驱动决策
原创|其它|编辑:郝浩|2009-05-21 10:10:48.000|阅读 1308 次
概述:随着3G网络的普及,像多媒体和流媒体这样的技术需求会越来越大,比如视频通话。但是国内在这方面的高级人才不多,给我们这些做技术的指明了一个方向。
# 界面/图表报表/文档/IDE等千款热门软控件火热销售中 >>
随着3G网络的普及,像多媒体和流媒体这样的技术需求会越来越大,比如视频通话。但是国内在这方面的高级人才不多,给我们这些做技术的指明了一个方向。:)
在Windows Mobile下媒体播放器开发有两种选择,一种是扩展Windows Media Player(下文简称WMP),一种是完全自己开发播放器(使用DirectShow,或者使用开源库,比如解码MP3的libmad库)。开发播放器是个大骨头,要好好去啃啃,可惜现在没这样的项目需求。
这次要总结的仅仅是Windows Mobile 6.0/6.1(下文简称WM6.0/6.1)下的WMP扩展,WM6.0/6.1使用的是WMP10版本,见下图。
微软还未上市的WM6.5使用的WMP也是10版本,见下图。从图中可以看到菜单风格改了,其它基本没有变化。不知道在WMP扩展开发方面有没有变化。
言归正传,从网上下载WMP 10 SDK(只有桌面系统的SDK,没有Mobile版本的,而且文档只有英文的):
http://msdn.microsoft.com/en-us/windowsmedia/bb190309.aspx
先总结下WMP在桌面操作系统的扩展开发。Windows Media Player Moible是其一个子集。
微软在Moible上是完全支持皮肤的。如果你要想在Mobile上设计一个漂亮个性的Windows Media Player,需要注意设计好各部分(如按钮可用和不可用时)的图片以及skin definition file编写。下图展示的即时HTC一款Windows Mobile机子上的Windows Media Player。关于更多内容请见SDK,SDK上有专门的篇幅讲解的,标题为:Windows Media Player for Windows Mobile Skins。
在Mobile上仅仅支持User Interface Plug-ins(以下红色标识的)。
★DSP Plug-ins
-> Provides an architecture that enables the user to install and activate plug-in programs that add digital signal processing (DSP) functionality. DSP plug-ins are Microsoft DirectX Media Objects (DMOs) that connect to the Player by using COM interfaces. A typical DSP plug-in might be an audio equalizer or a video tint control.(用于数据信号处理,比如均衡器,如下图)
怎样让WMP知道你的存在?方法是调用IWMPMediaPluginRegistrar::WMPRegisterPlayerPlugin方法向WMP注册。
怎样与WMP进行数据通信?WMP通过提供一个分配好的input buffer向插件提供音频和视频数据,插件向output buffer(也是有WMP分配好的)中返回数据。
WMP通过调用被插件具体实现了的方法来管理自己与插件之间的数据传递,流程如下:
1.Windows Media Player calls IMediaObject::ProcessInput, passing a pointer to an IMediaBuffer object to the DSP plug-in.
2.The DSP plug-in keeps a reference count on the input buffer object. The DSP plug-in returns an appropriate success or failure HRESULT.
3.Windows Media Player calls IMediaObject::ProcessOutput, passing a pointer to an array of DMO_OUTPUT_DATA_BUFFER structures (which contain output buffers) to the DSP plug-in.
4.The DSP plug-in processes the data in the input buffer and then copies the data to the appropriate output buffer. The DSP plug-in releases the reference count on the input buffer object when all the data in the buffer has been processed. The DSP plug-in then returns an appropriate success or failure HRESULT.
5.Windows Media Player renders the content in the output buffer.
This process repeats continuously while the plug-in is enabled and Windows Media Player has content to render.
DoProcessOutput(在这个函数中对感兴趣的音频数据进行处理) is called each time Windows Media Player successfully calls IMediaObject::ProcessOutput. It is the function that performs the digital signal processing tasks that produce the audible result that the DSP plug-in is intended to produce.
比如当前插件没有被激活时,应该像这样实现DoProcessOutPut方法:
// Test whether the plug-in is disabled by the user.
if (!m_bEnabled)
{
// Just copy the data without changing it.
memcpy(pbOutputData, m_pbInputData, *cbBytesProcessed);
return S_OK;
}
相关接口和描述
IMediaObject Manages data exchange with Windows Media Player and performs digital signal processing tasks. Detailed documentation is included with the DirectX SDK.
IWMPMediaPluginRegistrar Manages plug-in registration.
IWMPPlugin Manages the connection to Windows Media Player.
IWMPPluginEnable Stores whether the plug-in is currently enabled by Windows Media Player.
IWMPServices Retrieves information from the Player about the current stream time and stream state.
相关枚举类型及描述
WMPPlugin_Caps Used with IWMPPlugin::GetCaps to indicate whether the plug-in can convert between formats.
WMPServices_StreamState Indicates the whether the stream is currently stopped, paused, or playing.
----------------------------------------------------------------------------------------------
★Custom Visualizations
-> Windows Media Player provides your code with snapshots of audio frequency and waveform data at timed intervals measured in fractions of a second. The graphical output from your visualization is a Microsoft Windows device context. This is a standard Windows drawing surface that you can draw upon every time an audio snapshot is provided. (用于根据音频信息输出相应的视觉效果,如下图)
相关接口及描述
IWMPEffects Interface An interface to custom visualizations.
IWMPEffects2 Interface An interface that extends IWMPEffects, allowing greater control over visualization behavior.
相关结构体和枚举类型
PlayerState Provides some basic states of Windows Media Player.
TimedLevel Holds data returned from the spectrum filter.
----------------------------------------------------------------------------------------------
★User Interface Plug-ins
-> Provides a variety of control panels that allow the user to modify various aspects of the player such as the video and graphic equalizer settings. Skins are one way to provide additional functionality, but they require the developer to recreate the entire user interface (UI). As an alternative, Windows Media Player allows the creation of custom UI plug-ins that display in the full mode of the player. This functionality is provided through a programming interface that follows standard Microsoft Component Object Model (COM) guidelines. (它可以实现部分UI定制,弥补了皮肤必须全部定制UI的不足。插件必须以COM服务器的形式开发出来,所以你不光要实现IWMPPluginUI接口,还要实现作为COM服务器所需要的接口,如DllGetClassObject, DllCanUnloadNow, DllRegisterServer等,使用ATL会更方便。)
相关接口及描述
WMPNotifyPluginAddRemove An independent function used to notify Windows Media Player that a plug-in has been installed or uninstalled.
IWMPPluginUI下的方法:
Create Called by Windows Media Player to instantiate the plug-in user interface.
Destroy Called by Windows Media Player to shut down the plug-in user interface.
DisplayPropertyPage Called by Windows Media Player to request that the plug-in display its property page.
GetProperty Called by Windows Media Player to retrieve name/value property pairs from the plug-in.
SetCore Called by Windows Media Player to provide plug-in access to the core Windows Media Player APIs. (这是个关键方法,你想要通过这个方法获得一个WMP接口指针,然后你可以通过这个指针进一步获得像IWMPControls、IWMPSettings这样的接口指针,这些接口指针提供了控制WMP的方法。 )
SetProperty Called by Windows Media Player to set name/value property pairs for the plug-in.
TranslateAccelerator Called as part of the Windows Media Player message loop to allow the plug-in to intercept and respond to keyboard events.
注册表键位置(每次WMP启动的时候会遍历这个位置,WMP通过这个位置继续找到你的DLL文件以便加载)
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MediaPlayer\UIPlugins\{ClassId}
----------------------------------------------------------------------------------------------
★Rendering Plug-ins
-> Microsoft Windows Media Player provides an architecture that enables you to develop plug-ins that decode (if necessary) and render custom data contained in a Windows Media format stream.
相关接口及描述
IWMPMediaPluginRegistrar Manages plug-in registration.
IWMPNodeRealEstate Obtains a rendering area from Windows Media Player.
IWMPNodeRealEstateHost Requests state changes from Windows Media Player.
IWMPNodeWindowed Stores a handle to the parent window used for rendering.
IWMPNodeWindowedHost Sends Windows messages from the plug-in to Windows Media Player.
IWMPNodeWindowless Stores a device context handle used by Windows Media Player when rendering in windowless mode.
IWMPNodeWindowlessHost Provides methods to direct Windows Media Player to update the rendering area in windowless mode.
IWMPPlugin Manages the connection to Windows Media Player.
IWMPPluginEnable Stores whether the plug-in is currently enabled by the user.
IWMPServices Retrieves information from Windows Media Player about the current stream time and stream state.
IWMPWindowMessageSink Receives messages when in windowless mode.
相关枚举类型及描述
WMPPlugin_Caps Used with IWMPPlugin::GetCaps to indicate whether the plug-in can convert between formats.
WMPServices_StreamState Indicates the whether the stream is currently stopped, paused, or playing.
本站文章除注明转载外,均为本站原创或翻译。欢迎任何形式的转载,但请务必注明出处、不得修改原文相关链接,如果存在内容上的异议请邮件反馈至chenjj@evget.com
文章转载自:博客园面对“数字中国”建设和中国制造2025战略实施的机遇期,中车信息公司紧跟时代的步伐,以“集约化、专业化、标准化、精益化、一体化、平台化”为工作目标,大力推进信息服务、工业软件等核心产品及业务的发展。在慧都3D解决方案的实施下,清软英泰建成了多模型来源的综合轻量化显示平台、实现文件不失真的百倍压缩比、针对模型中的大模型文件,在展示平台上进行流畅展示,提升工作效率,优化了使用体验。
本站的模型资源均免费下载,登录后即可下载。模型仅供学习交流,勿做商业用途。
本站的模型资源均免费下载,登录后即可下载。模型仅供学习交流,勿做商业用途。
本站的模型资源均免费下载,登录后即可下载。模型仅供学习交流,勿做商业用途。
服务电话
重庆/ 023-68661681
华东/ 13452821722
华南/ 18100878085
华北/ 17347785263
客户支持
技术支持咨询服务
服务热线:400-700-1020
邮箱:sales@evget.com
关注我们
地址 : 重庆市九龙坡区火炬大道69号6幢
慧都科技 版权所有 Copyright 2003-
2025 渝ICP备12000582号-13 渝公网安备
50010702500608号