RsSink.h
Go to the documentation of this file.
1 // License: Apache 2.0. See LICENSE file in root directory.
2 // Copyright(c) 2020 Intel Corporation. All Rights Reserved.
3 
4 #ifndef RS_SINK_H
5 #define RS_SINK_H
6 
7 #include "BasicUsageEnvironment.hh"
8 #include "liveMedia.hh"
9 
10 #include "rtp_callback.hh"
13 
15 
16 class RsSink : public MediaSink
17 {
18 public:
19  static RsSink* createNew(UsageEnvironment& t_env,
20  MediaSubsession& t_subsession,
21  rs2_video_stream t_stream, // identifies the kind of data that's being received
22  MemoryPool* t_mempool,
23  char const* t_streamId = NULL); // identifies the stream itself (optional)
24 
25  void setCallback(rtp_callback* t_callback);
26 
27 private:
28  RsSink(UsageEnvironment& t_env, MediaSubsession& t_subsession, rs2_video_stream t_stream, MemoryPool* t_mempool, char const* t_streamId);
29  // called only by "createNew()"
30  virtual ~RsSink();
31 
32  static void afterGettingFrameUid0(void* t_clientData, unsigned t_frameSize, unsigned t_numTruncatedBytes, struct timeval t_presentationTime, unsigned t_durationInMicroseconds);
33  static void afterGettingFrameUid1(void* t_clientData, unsigned t_frameSize, unsigned t_numTruncatedBytes, struct timeval t_presentationTime, unsigned t_durationInMicroseconds);
34  static void afterGettingFrameUid2(void* t_clientData, unsigned t_frameSize, unsigned t_numTruncatedBytes, struct timeval t_presentationTime, unsigned t_durationInMicroseconds);
35  static void afterGettingFrameUid3(void* t_clientData, unsigned t_frameSize, unsigned t_numTruncatedBytes, struct timeval t_presentationTime, unsigned t_durationInMicroseconds);
36  void afterGettingFrame(unsigned t_frameSize, unsigned t_numTruncatedBytes, struct timeval t_presentationTime, unsigned t_durationInMicroseconds);
37 
38 private:
39  // redefined virtual functions:
40  virtual Boolean continuePlaying();
41 
42 private:
43  unsigned char* m_receiveBuffer;
44  unsigned char* m_to;
46  MediaSubsession& m_subsession;
47  char* m_streamId;
48  FILE* m_fp;
49 
52  std::shared_ptr<ICompression> m_iCompress;
54  std::vector<FramedSource::afterGettingFunc*> m_afterGettingFunctions;
55 };
56 
57 #endif // RS_SINK_H
void setCallback(rtp_callback *t_callback)
Definition: RsSink.cpp:171
Definition: RsSink.h:16
All the parameters required to define a video stream.
Definition: rs_internal.h:41
std::vector< FramedSource::afterGettingFunc * > m_afterGettingFunctions
Definition: RsSink.h:54
RsSink(UsageEnvironment &t_env, MediaSubsession &t_subsession, rs2_video_stream t_stream, MemoryPool *t_mempool, char const *t_streamId)
Definition: RsSink.cpp:19
unsigned char * m_to
Definition: RsSink.h:44
char * m_streamId
Definition: RsSink.h:47
static void afterGettingFrameUid0(void *t_clientData, unsigned t_frameSize, unsigned t_numTruncatedBytes, struct timeval t_presentationTime, unsigned t_durationInMicroseconds)
Definition: RsSink.cpp:70
virtual Boolean continuePlaying()
Definition: RsSink.cpp:147
MemoryPool * m_memPool
Definition: RsSink.h:53
unsigned char * m_receiveBuffer
Definition: RsSink.h:43
std::shared_ptr< ICompression > m_iCompress
Definition: RsSink.h:52
FILE * m_fp
Definition: RsSink.h:48
rtp_callback * m_rtpCallback
Definition: RsSink.h:50
MediaSubsession & m_subsession
Definition: RsSink.h:46
virtual ~RsSink()
Definition: RsSink.cpp:60
static void afterGettingFrameUid2(void *t_clientData, unsigned t_frameSize, unsigned t_numTruncatedBytes, struct timeval t_presentationTime, unsigned t_durationInMicroseconds)
Definition: RsSink.cpp:84
static RsSink * createNew(UsageEnvironment &t_env, MediaSubsession &t_subsession, rs2_video_stream t_stream, MemoryPool *t_mempool, char const *t_streamId=NULL)
Definition: RsSink.cpp:14
void afterGettingFrame(unsigned t_frameSize, unsigned t_numTruncatedBytes, struct timeval t_presentationTime, unsigned t_durationInMicroseconds)
Definition: RsSink.cpp:101
#define NULL
Definition: tinycthread.c:47
static void afterGettingFrameUid1(void *t_clientData, unsigned t_frameSize, unsigned t_numTruncatedBytes, struct timeval t_presentationTime, unsigned t_durationInMicroseconds)
Definition: RsSink.cpp:77
int m_bufferSize
Definition: RsSink.h:45
static void afterGettingFrameUid3(void *t_clientData, unsigned t_frameSize, unsigned t_numTruncatedBytes, struct timeval t_presentationTime, unsigned t_durationInMicroseconds)
Definition: RsSink.cpp:91
rs2_video_stream m_stream
Definition: RsSink.h:51


librealsense2
Author(s): Sergey Dorodnicov , Doron Hirshberg , Mark Horn , Reagan Lopez , Itay Carpis
autogenerated on Mon May 3 2021 02:47:41