live
MPEG1or2AudioStreamFramer.hh
Go to the documentation of this file.
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-2024 Live Networks, Inc. All rights reserved.
18// A filter that breaks up an MPEG (1,2) audio elementary stream into frames
19// C++ header
20
21#ifndef _MPEG_1OR2_AUDIO_STREAM_FRAMER_HH
22#define _MPEG_1OR2_AUDIO_STREAM_FRAMER_HH
23
24#ifndef _FRAMED_FILTER_HH
25#include "FramedFilter.hh"
26#endif
27
29public:
32 Boolean syncWithInputSource = False);
33 // If "syncWithInputSource" is True, the stream's presentation time
34 // will be reset to that of the input source, whenever new data
35 // is read from it.
36
37 void flushInput(); // called if there is a discontinuity (seeking) in the input
38
39private:
41 Boolean syncWithInputSource);
42 // called only by createNew()
44
45 static void continueReadProcessing(void* clientData,
46 unsigned char* ptr, unsigned size,
47 struct timeval presentationTime);
49
50 void resetPresentationTime(struct timeval newPresentationTime);
51 // useful if we're being synced with a separate (e.g., video) stream
52
53private:
54 // redefined virtual functions:
55 virtual void doGetNextFrame();
56
57private:
58 void reset();
59 struct timeval currentFramePlayTime() const;
60
61private:
64
65private: // parsing state
67 friend class MPEG1or2AudioStreamParser; // hack
68};
69
70#endif
const Boolean False
Definition: Boolean.hh:28
unsigned char Boolean
Definition: Boolean.hh:25
FramedSource * inputSource() const
Definition: FramedFilter.hh:30
static MPEG1or2AudioStreamFramer * createNew(UsageEnvironment &env, FramedSource *inputSource, Boolean syncWithInputSource=False)
void resetPresentationTime(struct timeval newPresentationTime)
class MPEG1or2AudioStreamParser * fParser
static void continueReadProcessing(void *clientData, unsigned char *ptr, unsigned size, struct timeval presentationTime)
virtual void doGetNextFrame()
struct timeval currentFramePlayTime() const
virtual ~MPEG1or2AudioStreamFramer()
MPEG1or2AudioStreamFramer(UsageEnvironment &env, FramedSource *inputSource, Boolean syncWithInputSource)