1/**********
2This library is free software; you can redistribute it and/or modify it under
3the terms of the GNU Lesser General Public License as published by the
4Free Software Foundation; either version 3 of the License, or (at your
5option) any later version. (See <http://www.gnu.org/copyleft/lesser.html>.)
6
7This library is distributed in the hope that it will be useful, but WITHOUT
8ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
9FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for
10more details.
11
12You should have received a copy of the GNU Lesser General Public License
13along with this library; if not, write to the Free Software Foundation, Inc.,
1451 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
15**********/
16// "liveMedia"
17// Copyright (c) 1996-2020 Live Networks, Inc. All rights reserved.
18// A 'ServerMediaSubsession' object that creates new, unicast, "RTPSink"s
19// on demand, from a H263 video file.
20// Implementation
21
22// Author: Bernhard Feiten. // Based on MPEG4VideoFileServerMediaSubsession
23// Updated by Ross FInlayson (December 2007)
24
25#include "H263plusVideoFileServerMediaSubsession.hh"
26#include "H263plusVideoRTPSink.hh"
27#include "ByteStreamFileSource.hh"
28#include "H263plusVideoStreamFramer.hh"
29
30H263plusVideoFileServerMediaSubsession*
31H263plusVideoFileServerMediaSubsession::createNew(UsageEnvironment& env,
32 char const* fileName,
33 Boolean reuseFirstSource) {
34 return new H263plusVideoFileServerMediaSubsession(env, fileName, reuseFirstSource);
35}
36
37H263plusVideoFileServerMediaSubsession
38::H263plusVideoFileServerMediaSubsession(UsageEnvironment& env,
39 char const* fileName,
40 Boolean reuseFirstSource)
41 : FileServerMediaSubsession(env, fileName, reuseFirstSource) {
42}
43
44H263plusVideoFileServerMediaSubsession::~H263plusVideoFileServerMediaSubsession() {
45}
46
47FramedSource* H263plusVideoFileServerMediaSubsession
48::createNewStreamSource(unsigned /*clientSessionId*/, unsigned& estBitrate) {
49 estBitrate = 500; // kbps, estimate ??
50
51 // Create the video source:
52 ByteStreamFileSource* fileSource = ByteStreamFileSource::createNew(envir(), fFileName);
53 if (fileSource == NULL) return NULL;
54 fFileSize = fileSource->fileSize();
55
56 // Create a framer for the Video Elementary Stream:
57 return H263plusVideoStreamFramer::createNew(envir(), fileSource);
58}
59
60RTPSink* H263plusVideoFileServerMediaSubsession::createNewRTPSink(Groupsock* rtpGroupsock,
61 unsigned char rtpPayloadTypeIfDynamic,
62 FramedSource* /*inputSource*/) {
63 return H263plusVideoRTPSink::createNew(envir(), rtpGroupsock, rtpPayloadTypeIfDynamic);
64}
65