live
ByteStreamMultiFileSource.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 // A source that consists of multiple byte-stream files, read sequentially.
19 // (The input is an array of file names, with a terminating 'file name' of NULL.)
20 // C++ header
21 
22 #ifndef _BYTE_STREAM_MULTI_FILE_SOURCE_HH
23 #define _BYTE_STREAM_MULTI_FILE_SOURCE_HH
24 
25 #ifndef _BYTE_STREAM_FILE_SOURCE_HH
26 #include "ByteStreamFileSource.hh"
27 #endif
28 
30 public:
32  createNew(UsageEnvironment& env, char const** fileNameArray,
33  unsigned preferredFrameSize = 0, unsigned playTimePerFrame = 0);
34  // "fileNameArray" is a pointer to an array of (char const*) file names, with
35  // A 'file name' of NULL indicating the end of the array
36 
38  // True iff the most recently delivered frame was the first from a newly-opened file
39 
40 protected:
41  ByteStreamMultiFileSource(UsageEnvironment& env, char const** fileNameArray,
42  unsigned preferredFrameSize, unsigned playTimePerFrame);
43  // called only by createNew()
44 
46 
47 private:
48  // redefined virtual functions:
49  virtual void doGetNextFrame();
50 
51 private:
52  static void onSourceClosure(void* clientData);
54  static void afterGettingFrame(void* clientData,
55  unsigned frameSize, unsigned numTruncatedBytes,
56  struct timeval presentationTime,
57  unsigned durationInMicroseconds);
58 
59 private:
62  unsigned fNumSources;
65  char const** fFileNameArray;
67 };
68 
69 #endif
unsigned char Boolean
Definition: Boolean.hh:25
static ByteStreamMultiFileSource * createNew(UsageEnvironment &env, char const **fileNameArray, unsigned preferredFrameSize=0, unsigned playTimePerFrame=0)
ByteStreamFileSource ** fSourceArray
virtual ~ByteStreamMultiFileSource()
static void onSourceClosure(void *clientData)
virtual void doGetNextFrame()
static void afterGettingFrame(void *clientData, unsigned frameSize, unsigned numTruncatedBytes, struct timeval presentationTime, unsigned durationInMicroseconds)
ByteStreamMultiFileSource(UsageEnvironment &env, char const **fileNameArray, unsigned preferredFrameSize, unsigned playTimePerFrame)