DM365+live555实现RTSP直播服务器(广播)

来源:互联网 发布:淘宝借贷有保证吗 编辑:程序博客网 时间:2024/05/21 11:09

在http://blog.csdn.net/zhangjikuan/article/details/38520203基础上加以改进其缺点1,实现广播的形式

1.连接中的博客live555部分主要是参考testOnDemandRTSPServer例程,单播的形式

  此博客live555部分主要是参考testH264videoStreamer例程,广播的形式  关于广播准备参考博客:单播

在play函数中替换自己的类,自己的类,类似于单播中

void play(WriterEnv *envp) {  // Open the input file as a 'byte-stream file source':  //替换为自己写的类,目的是为了重写函数为直播做准备  H264FramedLiveSource* liveSource    = H264FramedLiveSource::createNew(*env, inputFileName,envp);  if (liveSource == NULL) {    *env << "Unable to open file \"" << inputFileName         << "\" as a byte-stream file source\n";    exit(1);  }  FramedSource* videoES = liveSource;  // Create a framer for the Video Elementary Stream:  videoSource = H264VideoStreamFramer::createNew(*env, videoES);  // Finally, start playing:  *env << "Beginning to read from file...\n";  videoSink->startPlaying(*videoSource, afterPlaying, videoSink);}




0 0