live
MP3ADU.hh
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 <http://www.gnu.org/copyleft/lesser.html>.)
6 
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.
11 
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-2021 Live Networks, Inc. All rights reserved.
18 // 'ADU' MP3 streams (for improved loss-tolerance)
19 // C++ header
20 
21 #ifndef _MP3_ADU_HH
22 #define _MP3_ADU_HH
23 
24 #ifndef _FRAMED_FILTER_HH
25 #include "FramedFilter.hh"
26 #endif
27 
29 public:
32  Boolean includeADUdescriptors = True);
33 
34  void resetInput();
35  // This is called whenever there's a discontinuity in the input MP3 source
36  // (e.g., due to seeking within the source). It causes any still-unprocessed
37  // MP3 frame data within our queue to be discarded, so that it does not
38  // erroneously get used by backpointers from the new MP3 frames.
39 
40  Boolean setScaleFactor(int scale);
41 
42 protected:
45  Boolean includeADUdescriptors);
46  // called only by createNew()
47  virtual ~ADUFromMP3Source();
48 
49 private:
50  // Redefined virtual functions:
51  virtual void doGetNextFrame();
52  virtual char const* MIMEtype() const;
53 
54 private:
56 
57 private:
59  class SegmentQueue* fSegments;
62  int fScale;
63  unsigned fFrameCounter;
64 };
65 
67 public:
70  Boolean includeADUdescriptors = True);
71 
72 protected:
75  Boolean includeADUdescriptors);
76  // called only by createNew()
77  virtual ~MP3FromADUSource();
78 
79 private:
80  // Redefined virtual functions:
81  virtual void doGetNextFrame();
82  virtual char const* MIMEtype() const;
83 
84 private:
88 
89 private:
91  class SegmentQueue* fSegments;
92 };
93 
94 #endif
const Boolean True
Definition: Boolean.hh:31
unsigned char Boolean
Definition: Boolean.hh:25
ADUFromMP3Source(UsageEnvironment &env, FramedSource *inputSource, Boolean includeADUdescriptors)
class SegmentQueue * fSegments
Definition: MP3ADU.hh:59
static ADUFromMP3Source * createNew(UsageEnvironment &env, FramedSource *inputSource, Boolean includeADUdescriptors=True)
Boolean fAreEnqueueingMP3Frame
Definition: MP3ADU.hh:58
Boolean setScaleFactor(int scale)
virtual ~ADUFromMP3Source()
Boolean fIncludeADUdescriptors
Definition: MP3ADU.hh:60
unsigned fTotalDataSizeBeforePreviousRead
Definition: MP3ADU.hh:61
unsigned fFrameCounter
Definition: MP3ADU.hh:63
virtual void doGetNextFrame()
Boolean doGetNextFrame1()
virtual char const * MIMEtype() const
FramedSource * inputSource() const
Definition: FramedFilter.hh:30
Boolean generateFrameFromHeadADU()
virtual char const * MIMEtype() const
class SegmentQueue * fSegments
Definition: MP3ADU.hh:91
static MP3FromADUSource * createNew(UsageEnvironment &env, FramedSource *inputSource, Boolean includeADUdescriptors=True)
MP3FromADUSource(UsageEnvironment &env, FramedSource *inputSource, Boolean includeADUdescriptors)
Boolean fAreEnqueueingADU
Definition: MP3ADU.hh:90
virtual ~MP3FromADUSource()
void insertDummyADUsIfNecessary()
Boolean needToGetAnADU()
virtual void doGetNextFrame()