liveMedia/H263plusVideoFileServerMediaSubsession.cpp

Go to the documentation of this file.
00001 /**********
00002 This library is free software; you can redistribute it and/or modify it under
00003 the terms of the GNU Lesser General Public License as published by the
00004 Free Software Foundation; either version 2.1 of the License, or (at your
00005 option) any later version. (See <http://www.gnu.org/copyleft/lesser.html>.)
00006 
00007 This library is distributed in the hope that it will be useful, but WITHOUT
00008 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
00009 FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public License for
00010 more details.
00011 
00012 You should have received a copy of the GNU Lesser General Public License
00013 along with this library; if not, write to the Free Software Foundation, Inc.,
00014 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA
00015 **********/
00016 // "liveMedia"
00017 // Copyright (c) 1996-2012 Live Networks, Inc.  All rights reserved.
00018 // A 'ServerMediaSubsession' object that creates new, unicast, "RTPSink"s
00019 // on demand, from a H263 video file.
00020 // Implementation
00021 
00022 // Author: Bernhard Feiten. // Based on MPEG4VideoFileServerMediaSubsession
00023 // Updated by Ross FInlayson (December 2007)
00024 
00025 #include "H263plusVideoFileServerMediaSubsession.hh"
00026 #include "H263plusVideoRTPSink.hh"
00027 #include "ByteStreamFileSource.hh"
00028 #include "H263plusVideoStreamFramer.hh"
00029 
00030 H263plusVideoFileServerMediaSubsession*
00031 H263plusVideoFileServerMediaSubsession::createNew(UsageEnvironment& env,
00032                                                   char const* fileName,
00033                                                   Boolean reuseFirstSource) {
00034   return new H263plusVideoFileServerMediaSubsession(env, fileName, reuseFirstSource);
00035 }
00036 
00037 H263plusVideoFileServerMediaSubsession
00038 ::H263plusVideoFileServerMediaSubsession(UsageEnvironment& env,
00039                                          char const* fileName,
00040                                          Boolean reuseFirstSource)
00041   : FileServerMediaSubsession(env, fileName, reuseFirstSource) {
00042 }
00043 
00044 H263plusVideoFileServerMediaSubsession::~H263plusVideoFileServerMediaSubsession() {
00045 }
00046 
00047 FramedSource* H263plusVideoFileServerMediaSubsession
00048 ::createNewStreamSource(unsigned /*clientSessionId*/, unsigned& estBitrate) {
00049   estBitrate = 500; // kbps, estimate ??
00050 
00051   // Create the video source:
00052   ByteStreamFileSource* fileSource = ByteStreamFileSource::createNew(envir(), fFileName);
00053   if (fileSource == NULL) return NULL;
00054   fFileSize = fileSource->fileSize();
00055 
00056   // Create a framer for the Video Elementary Stream:
00057   return H263plusVideoStreamFramer::createNew(envir(), fileSource);
00058 }
00059 
00060 RTPSink* H263plusVideoFileServerMediaSubsession::createNewRTPSink(Groupsock* rtpGroupsock,
00061                                                                   unsigned char rtpPayloadTypeIfDynamic,
00062                                                                   FramedSource* /*inputSource*/) {
00063   return H263plusVideoRTPSink::createNew(envir(), rtpGroupsock, rtpPayloadTypeIfDynamic);
00064 }

Generated on Thu May 17 07:11:45 2012 for live by  doxygen 1.5.2