200641

       今天愚人节,没有人愚弄我。

       经过二十多天的准备,阅读了著名播放器mplayer的源代码(顺便写了《mplayer 源码分析》),下载并安装了directx SDK platform SDK,阅读了directshow的相关资料,经过比较,终于决定使用directshow技术来实现视频流。初步设想,利用jrtplibRTP库编写出发送和接收视频流的filter,graphedit中测试一下,通过后,则整个框架都搭建起来了,编码就完成了一大半了,这个过程估计需要20天左右。再利用directshow的相关filter,实现CTCaptureCTPlayer类,这个过程又需要15天左右。待完成这些后,再考虑是否需要适应不同操作系统平台,不过,在前期就要为此设计合适的架构,以免到时需改动大量代码。

明天开始写RTP的发送filter

2006 42

       昨天还没有考虑到,应该在后期实现对复杂网络状况的自适应算法。

今天试用jrtplib的时候遇到一个问题。在建立win32控制台空项目后,加入example1.cpp,在附加包含目录中加入jrtplibjthread的源代码目录,在附加依赖项中加入jrtplib.libjthread.lib,编译出现42个错误,大致分两类,第一类是某某函数在某obj lib文件中已定义,第二类是无法解析的外部符号。经过googlebaidu一番,所得到的信息,都是建议正确设置库文件。第一类是运行时库设置不正确,库文件之间产生重定义冲突,经过查阅MSDN,终于找出解决之道,原来jrtplib的运行时库是多线程调试DLL/MDd),将运行时库设为多线程调试DLL后,解决第一类问题。第二类问题,是缺少库文件,经查,缺少网络库文件,在附加依赖项中加入WS2_32.LIB后,解决了第二类问题。编译通过后,测试了一下局域网内通信,数据包都能正常发送和接收,测试成功。

开发RTP filter的过程如下:

1. Download JRTPLIB (the RTP library)
2. Set up simple client/server app with JRTPLIB to send dummy data (doesn't
matter what the data is)
3. Read all the documentation about writing source filters
4. Read about the following base classes: CSource, CSourceStream, and
CBaseRenderer
5. Read the Ball Source Filter sample in the DXSDK line by line.  Make sure
you understand it well.  Modify it if that helps you understand it.
6. Read the Dump Filter sample (a rendering filter) line by line.  Instead
of writing the samples to a TEXT FILE, make it send the samples out via the
RTP library.  This should be easy since you previous wrote a client app, and
nothing is different.  Data on the network is just data on the
network--there's nothing special about it, really.
7. Write the source filter.
8. Debug like crazy.
明日看filter的相关文档。

-----------------------------------------------------------------

              上一页                  下一页

-----------------------------------------------------------------

参考文献:

[1]DirectShow实现QQ的音视频聊天功能

[2]DirectX  documentation for c++

[3]Platform SDK documentation

[4]Directshow RTP对网络多媒体应用 - 多媒体开发专栏

[5]Morgan Multimedia - RTP DirectShow Filters   

[6]基于DirectShow的MPEG-4视频传输系统的研究与实现

[7]Google Groups :  microsoft.public.win32.programmer.directx.video

[8]microsoft DirectShow

[9]Google 网上论坛 : microsoft.public.win32.programmer.directx.video

[10] Mplayer  

[11] C Runtime Labraries

ms-help://MS.MSDNQTR.2003FEB.2052/vclib/html/_CRT_C_Run.2d.Time_Libraries.htm

[12] http://groups.google.com/group/microsoft.public.cn.vc++?lnk=lr&hl=zh-CN

[13] http://groups.google.com/group/microsoft.public.win32.programmer.directx.video/browse_thread/thread/88ae47a178725d38/31a72133e1f889f6?lnk=st&q=jrtplib&rnum=17&hl=zh-CN#31a72133e1f889f6

--------------------------------------------------------------------------------------------------