Go to the documentation of this file.
1 /**********
2 This library is free software; you can redistribute it and/or modify it under
3 the terms of the GNU Lesser General Public License as published by the
4 Free Software Foundation; either version 3 of the License, or (at your
5 option) any later version. (See <>.)
7 This library is distributed in the hope that it will be useful, but WITHOUT
8 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
9 FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for
10 more details.
12 You should have received a copy of the GNU Lesser General Public License
13 along with this library; if not, write to the Free Software Foundation, Inc.,
14 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
15 **********/
16 // "liveMedia"
17 // Copyright (c) 1996-2022 Live Networks, Inc. All rights reserved.
18 // A 'ServerMediaSubsession' object that creates new, unicast, "RTPSink"s
19 // on demand, from an MP3 audio file.
20 // (Actually, any MPEG-1 or MPEG-2 audio file should work.)
21 // C++ header
28 #endif
30 #include "MP3ADUinterleaving.hh"
31 #endif
32 #ifndef _MP3_ADU_HH
33 #include "MP3ADU.hh"
34 #endif
37 public:
39  createNew(UsageEnvironment& env, char const* fileName, Boolean reuseFirstSource,
40  Boolean generateADUs, Interleaving* interleaving);
41  // Note: "interleaving" is used only if "generateADUs" is True,
42  // (and a value of NULL means 'no interleaving')
44 protected:
46  char const* fileName, Boolean reuseFirstSource,
47  Boolean generateADUs,
48  Interleaving* interleaving);
49  // called only by createNew();
52  FramedSource* createNewStreamSourceCommon(FramedSource* baseMP3Source, unsigned mp3NumBytes, unsigned& estBitrate);
53  void getBaseStreams(FramedSource* frontStream,
54  FramedSource*& sourceMP3Stream, ADUFromMP3Source*& aduStream/*if any*/);
56 protected: // redefined virtual functions
57  virtual void seekStreamSource(FramedSource* inputSource, double& seekNPT, double streamDuration, u_int64_t& numBytes);
58  virtual void setStreamSourceScale(FramedSource* inputSource, float scale);
59  virtual FramedSource* createNewStreamSource(unsigned clientSessionId,
60  unsigned& estBitrate);
61  virtual RTPSink* createNewRTPSink(Groupsock* rtpGroupsock,
62  unsigned char rtpPayloadTypeIfDynamic,
63  FramedSource* inputSource);
64  virtual void testScaleFactor(float& scale);
65  virtual float duration() const;
67 protected:
71 };
73 #endif
unsigned char Boolean
Definition: Boolean.hh:25
virtual float duration() const
MP3AudioFileServerMediaSubsession(UsageEnvironment &env, char const *fileName, Boolean reuseFirstSource, Boolean generateADUs, Interleaving *interleaving)
void getBaseStreams(FramedSource *frontStream, FramedSource *&sourceMP3Stream, ADUFromMP3Source *&aduStream)
virtual FramedSource * createNewStreamSource(unsigned clientSessionId, unsigned &estBitrate)
FramedSource * createNewStreamSourceCommon(FramedSource *baseMP3Source, unsigned mp3NumBytes, unsigned &estBitrate)
virtual RTPSink * createNewRTPSink(Groupsock *rtpGroupsock, unsigned char rtpPayloadTypeIfDynamic, FramedSource *inputSource)
virtual void setStreamSourceScale(FramedSource *inputSource, float scale)
virtual void testScaleFactor(float &scale)
static MP3AudioFileServerMediaSubsession * createNew(UsageEnvironment &env, char const *fileName, Boolean reuseFirstSource, Boolean generateADUs, Interleaving *interleaving)
virtual void seekStreamSource(FramedSource *inputSource, double &seekNPT, double streamDuration, u_int64_t &numBytes)