基于DirectShow的网络音视频通信系统的开发
发布时间:
2014-10-21
来源:
人大经济论坛
目录
摘 要I
AbstractII
前 言1
1 DirectShow简介2
1.1 COM基础2
1.1.1 COM组件标准2
1.1.2 COM组件类型3
1.2 DirectShow体系结构3
1.3 DirectShow的 Filter4
1.3.1 注册Filter5
1.3.2Filter的媒体类型5
1.3.3 连接Fliter6
1.3.4 Filter重组6
1.3.5 数据传输8
1.4关于Filter Graph Manager10
1.5 GraphEdit的使用10
2 音视频编码标准13
2.1 MPEG系列编码13
2.1.1 MPEG-213
2.1.2 MPEG-414
3 网络传输协议18
3.1网络协议18
3.1.1TCP/IP协议18
3.1.2 UDP协议19
3.1.3 UDP协议的特性20
3.1.4 TCP协议和UDP协议的区别21
3.2 Socket介绍22
3.2.1常用的Socket类型22
4 音视频系统开发23
4.1 Filter组件的开发23
4.1.1VC环境设置23
4.1.2 创建工程以及Filter的入口函数24
4.1.3 实现Filter 的类厂对象26
4.1.4 实现自己的 Filter28
4.1.5 开发Filter需要的条件30
4.2 DirectShow应用开发32
4.2.1 开发环境的配置32
4.2.2 Filter Graph Manager接口32
4.2.3创建 Filter Graph Manager接口33
4.2.4创建 Filter Graph34
4.2.5使用 DirectShow的事件响应机制34
4.3音视频系统开发35
4.3.1实现原理35
4.3.2开发网络发送、接收Filter38
4.3.3设备自检40
4.3.4角色控制40
5总结42
致 谢43
参考文献44
摘 要
个人电脑和各种网络电子产品(手提电脑、智能手机、MP4等)的空前繁荣伴随着因特网的普及,使得流媒体在网络上的广泛应用,于是流媒体处理的复杂性和技术性使怎样处理流媒体变得简单而富有成效逐渐成为了焦点问题。选择一种合适的应用方案处理媒体流,事半功倍。微软的DirectShow给了我们一个不错的选择。DirectShow是微软公司提供的一套在Windows平台上进行流媒体处理的开发包,与DirectX开发包一起发布。
DirectX是一套基于Windows平台的编程接口,它能出色的完成高速的实时动画渲染、交互式音乐和环境音效、高效多媒体数据处理等一般API很难完成的任务。
DirectShow为在Windows平台上处理各种格式的媒体文件的回放、音视频采集等高性能要求的多媒体应用,提供了完整的解决方案。
多媒体应用开发所面临的众多挑战:需要高效的处理巨大的数据量,音频和视频时刻保持同步,还需用简单的方法处理复杂的媒体源问题,还需处理各种各样不同的媒体格式,支持系统中不可预知的硬件等。
Directshow的设计初衷就是尽量要让应用程序开发人员从复杂的数据传输、硬件差异、同步性等工作中解脱出来,总体应用框架和底层工作由Directshow来完成,这样,基于Directshow框架开发多媒体应用程序就会变得非常简单。
关键词 DirectShow; 流媒体; 音视频; API
Abstract
along with the popularity of Internet,personal computers and networks of electronic products (laptops, smart phones, MP4, etc.) become unprecedented prosper, so streaming media is on the network everywhere,which makes how to deal with easy and effective streaming media a focal point,with extensive use of streaming media handling the complexity and technical nature. Selecting an appropriate media stream processing applications is more efficiently. Microsoft's DirectShow, gives us a good choice. DirectShow provides a set of the development of streaming media processing package on Microsoft Windows platform, released with DirectX SDK.
DirectX is a Windows-based platform programming interface, it can outstanding in completing the high-speed real-time animation rendering, interactive music and environment sound, efficient processing of multimedia data, which the general API is difficult to accomplish.
DirectShow provides a complete solution for handling playback of various formats of media file , multimedia applications of high-performance requirements such as capturing audio and video on Windows platform.
Multimedia application development faces many challenges: the need for efficiently handling of huge amount of data, audio and video time synchronized, a simple way to deal with the complex issue of media source, also need to address a variety of different media formats, support unpredictable hardware in system.
Directshow is designed is to try to let the application developer freed from the complexity of the data transmission, hardware differences, synchronization, the general application framework and the underlying work to be completed by the Directshow, so the development of multimedia applications based on Directshow framework becomes very simple.
Keywords DirectShow ; streaming; audio and video; API