1 | /* --------------------------------------------------------------------------- |
2 | ** This software is in the public domain, furnished "as is", without technical |
3 | ** support, and with no warranty, express or implied, as to its usefulness for |
4 | ** any purpose. |
5 | ** |
6 | ** TSServerMediaSubsession.h |
7 | ** |
8 | ** -------------------------------------------------------------------------*/ |
9 | |
10 | #pragma once |
11 | |
12 | #include <map> |
13 | #include "UnicastServerMediaSubsession.h" |
14 | #include "MemoryBufferSink.h" |
15 | |
16 | // ----------------------------------------- |
17 | // ServerMediaSubsession for HLS |
18 | // ----------------------------------------- |
19 | class TSServerMediaSubsession : public UnicastServerMediaSubsession |
20 | { |
21 | public: |
22 | static TSServerMediaSubsession* createNew(UsageEnvironment& env, StreamReplicator* videoreplicator, const std::string& videoformat, StreamReplicator* audioreplicator, const std::string& audioformat, unsigned int sliceDuration) |
23 | { |
24 | return new TSServerMediaSubsession(env, videoreplicator, videoformat, audioreplicator, audioformat, sliceDuration); |
25 | } |
26 | |
27 | protected: |
28 | TSServerMediaSubsession(UsageEnvironment& env, StreamReplicator* videoreplicator, const std::string& videoformat, StreamReplicator* audioreplicator, const std::string& audioformat, unsigned int sliceDuration); |
29 | virtual ~TSServerMediaSubsession(); |
30 | |
31 | virtual float getCurrentNPT(void* streamToken); |
32 | virtual float duration() const ; |
33 | virtual void seekStream(unsigned clientSessionId, void* streamToken, double& seekNPT, double streamDuration, u_int64_t& numBytes); |
34 | virtual FramedSource* getStreamSource(void* streamToken); |
35 | |
36 | protected: |
37 | unsigned int m_slice; |
38 | MemoryBufferSink* m_hlsSink; |
39 | }; |
40 | |
41 | |
42 | |