hc
2023-05-26 a23f51ed7a39e452c1037343a84d7db1ca2c5bd7
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
// Copyright 2019 Fuzhou Rockchip Electronics Co., Ltd. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
 
#ifndef EASYMEDIA_MP2_SERVER_MEDIA_SUBSESSION_HH_
#define EASYMEDIA_MP2_SERVER_MEDIA_SUBSESSION_HH_
 
#include <list>
#include <mutex>
 
#include "live555_media_input.hh"
#include <liveMedia/OnDemandServerMediaSubsession.hh>
 
namespace easymedia {
class MP2ServerMediaSubsession : public OnDemandServerMediaSubsession {
public:
  static MP2ServerMediaSubsession *createNew(UsageEnvironment &env,
                                             Live555MediaInput &wisInput);
 
protected: // we're a virtual base class
  MP2ServerMediaSubsession(UsageEnvironment &env,
                           Live555MediaInput &mediaInput);
  virtual ~MP2ServerMediaSubsession();
 
protected:
  Live555MediaInput &fMediaInput;
  void startStream(
      unsigned clientSessionId, void *streamToken, TaskFunc *rtcpRRHandler,
      void *rtcpRRHandlerClientData, unsigned short &rtpSeqNum,
      unsigned &rtpTimestamp,
      ServerRequestAlternativeByteHandler *serverRequestAlternativeByteHandler,
      void *serverRequestAlternativeByteHandlerClientData) override;
  void deleteStream(unsigned clientSessionId, void *&streamToken) override;
 
private: // redefined virtual functions
  virtual FramedSource *createNewStreamSource(unsigned clientSessionId,
                                              unsigned &estBitrate);
  virtual RTPSink *createNewRTPSink(Groupsock *rtpGroupsock,
                                    unsigned char rtpPayloadTypeIfDynamic,
                                    FramedSource *inputSource);
  std::list<unsigned int> kSessionIdList;
  // static std::mutex kMutex;
};
} // namespace easymedia
 
#endif // #ifndef EASYMEDIA_MP2_SERVER_MEDIA_SUBSESSION_HH_