live
OggFileServerDemux.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 server demultiplexor for an Ogg file
19// C++ header
20
21#ifndef _OGG_FILE_SERVER_DEMUX_HH
22#define _OGG_FILE_SERVER_DEMUX_HH
23
24#ifndef _SERVER_MEDIA_SESSION_HH
25#include "ServerMediaSession.hh"
26#endif
27
28#ifndef _OGG_FILE_HH
29#include "OggFile.hh"
30#endif
31
33public:
34 typedef void (onCreationFunc)(OggFileServerDemux* newDemux, void* clientData);
35 static void createNew(UsageEnvironment& env, char const* fileName,
36 onCreationFunc* onCreation, void* onCreationClientData);
37 // Note: Unlike most "createNew()" functions, this one doesn't return a new object immediately. Instead, because this class
38 // requires file reading (to parse the Ogg 'Track' headers) before a new object can be initialized, the creation of a new
39 // object is signalled by calling - from the event loop - an 'onCreationFunc' that is passed as a parameter to "createNew()".
40
42 ServerMediaSubsession* newServerMediaSubsession(u_int32_t& resultTrackNumber);
43 // Returns a new "ServerMediaSubsession" object that represents the next media track
44 // from the file. This function returns NULL when no more media tracks exist.
45
47 // As above, but creates a new "ServerMediaSubsession" object for a specific track number
48 // within the Ogg file.
49 // (You should not call this function more than once with the same track number.)
50
51 // The following public: member functions are called only by the "ServerMediaSubsession" objects:
52
54 char const* fileName() const { return fFileName; }
55
56 FramedSource* newDemuxedTrack(unsigned clientSessionId, u_int32_t trackNumber);
57 // Used by the "ServerMediaSubsession" objects to implement their "createNewStreamSource()" virtual function.
58
59private:
61 onCreationFunc* onCreation, void* onCreationClientData);
62 // called only by createNew()
64
65 static void onOggFileCreation(OggFile* newFile, void* clientData);
66 void onOggFileCreation(OggFile* newFile);
67
68 static void onDemuxDeletion(void* clientData, OggDemux* demuxBeingDeleted);
69 void onDemuxDeletion(OggDemux* demuxBeingDeleted);
70
71private:
72 char const* fFileName;
76
77 // Used to implement "newServerMediaSubsession()":
79
80 // Used to set up demuxing, to implement "newDemuxedTrack()":
83};
84
85#endif
Definition: Media.hh:50
FramedSource * newDemuxedTrack(unsigned clientSessionId, u_int32_t trackNumber)
char const * fileName() const
virtual ~OggFileServerDemux()
ServerMediaSubsession * newServerMediaSubsession(u_int32_t &resultTrackNumber)
ServerMediaSubsession * newServerMediaSubsession()
void onDemuxDeletion(OggDemux *demuxBeingDeleted)
void() onCreationFunc(OggFileServerDemux *newDemux, void *clientData)
OggFileServerDemux(UsageEnvironment &env, char const *fileName, onCreationFunc *onCreation, void *onCreationClientData)
static void onOggFileCreation(OggFile *newFile, void *clientData)
ServerMediaSubsession * newServerMediaSubsessionByTrackNumber(u_int32_t trackNumber)
void onOggFileCreation(OggFile *newFile)
static void createNew(UsageEnvironment &env, char const *fileName, onCreationFunc *onCreation, void *onCreationClientData)
onCreationFunc * fOnCreation
OggTrackTableIterator * fIter
static void onDemuxDeletion(void *clientData, OggDemux *demuxBeingDeleted)