VR-Forces 5.0.2 Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DtReadFramebufferCallback.h
Go to the documentation of this file.
1 /*****************************************************************************
2  * Copyright (c) 2022 MAK Technologies, Inc.
3  * All rights reserved.
4  *****************************************************************************/
5 
9 
10 #pragma once
15 
16 #include <osg/Camera>
17 #include <vector>
18 #include <list>
19 
20 namespace makVrv
21 {
22  class DtProcessImageTask;
23  class DtOsgChannel;
24  class DtPostProcessManager;
25  class DtVideoStreamPostProcessor;
26 
27  class DtEncoderIO;
28  class DtEncoderIOCallback;
29 
35  {
36  public:
38  friend class DtVideoStream;
39 
41  virtual ~DtReadFramebufferCallback();
42 
44  virtual void operator()(osg::RenderInfo& renderInfo) const;
45 
47  virtual void process(const std::vector<std::vector<uint8_t>>& encodedPackets);
48  protected:
49 
52 
54  virtual bool init();
55 
57  virtual void unInit();
58 
60  virtual void setupPixelBufferObjects( int numBuffers );
61 
63  virtual bool createProcessImageTask( DtDe& de, const DtVideoStream& stream );
64 
66  virtual bool setPixelFormatFromString( const DtUnicode& pxfString );
67 
69  virtual bool setReadBufferFromString( const DtUnicode& rbString );
70 
72  virtual bool setDataTypeFromString( const DtUnicode& dtString );
73 
75  virtual void readPixels(osg::RenderInfo& renderInfo) const;
76 
78  virtual void readPixelsPbo(osg::RenderInfo& renderInfo) const;
79 
81  virtual DtVideoStreamPostProcessor* findVideoStreamPostProcessor(void) const;
82 
84  virtual void registerPbosWithHardwareEncoderIfNecessary(void);
85  private:
87  DtReadFramebufferCallback() = delete;
88 
91 
93  DtReadFramebufferCallback& operator=( const DtReadFramebufferCallback& orig ) = delete;
94 
95  protected:
98 
101 
104 
106  double myFrequency;
107 
110 
112  int myWidth;
113 
115  int myHeight;
116 
118  int myX;
119 
121  int myY;
122 
125 
128 
131 
133  std::vector<unsigned int> myPbos;
134 
136  mutable int myMutableWriteIndex;
137 
139  mutable int myMutableReadIndex;
140 
143 
146 
149 
152 
154 
157 
160 
163 
164  int myId = 0;
165 
166  static int theRunningId;
167 
168  DtEncoderIOCallback* myEncoderCallback = nullptr;
169 
170  double myTimeNextFrame = 0.0;
171  };
172 }
DtReadFramebufferProcessData myProcessData
hardware frame buffer data
Definition: DtReadFramebufferCallback.h:159
A DtVideoStream instance will create a single streaming video pipeline on the channel indicated by wi...
Definition: DtVideoStream.h:35
DT_DLL_EXAMPLESCENEROOTPLUGIN void init(DtDe &anIG)
A DtReadFramebufferCallback instance is installed as the draw callback of the camera attached to the ...
Definition: DtReadFramebufferCallback.h:33
A unicode string. DtUnicode stores a UTF-16 encoded unicode string. Code Point, a Unicode character...
Definition: DtUnicode.h:33
create a post processor that will provide us with it&#39;s input texture id used by the video stream proc...
Definition: DtVideoStreamPostProcessor.h:25
static int theRunningId
Definition: DtReadFramebufferCallback.h:166
Contains the DtVideoStream class declaration.
bool myIsInitialized
is everything initialized
Definition: DtReadFramebufferCallback.h:148
This is a non-extendable container class used to send the information to the gstreamer pipeline...
Definition: DtReadFramebufferProcessData.h:20
bool myUseReadPixels
if set to true use CPU encoding / false GPU encoding
Definition: DtReadFramebufferCallback.h:109
DtEncoderIO * myEncoderIO
hardware encoding IO object
Definition: DtReadFramebufferCallback.h:156
DtProcessImageTask * myTask
Image processing task.
Definition: DtReadFramebufferCallback.h:145
#define DT_DLL_VRVVIDEOSTREAM
Definition: vrvVideoStream.h:20
DtDe & myDe
Copy of the DtDe.
Definition: DtReadFramebufferCallback.h:100
Contains the DtProcessImageTask class declaration.
This class provides the OSG-specific implementation of a DtChannel.
Definition: DtOsgChannel.h:52
osg::ref_ptr< osg::Image > myImage
Image pointer.
Definition: DtReadFramebufferCallback.h:142
DtVideoStream & myStream
Current VideoStream.
Definition: DtReadFramebufferCallback.h:97
int myY
Position in Y.
Definition: DtReadFramebufferCallback.h:121
GLenum myPixelFormat
Pixel format used.
Definition: DtReadFramebufferCallback.h:124
GLenum myReadBuffer
GL buffer used (back/front)
Definition: DtReadFramebufferCallback.h:130
bool myIsUsingHardware
Are using hardware encoding.
Definition: DtReadFramebufferCallback.h:151
This class provides the OSG-specific management of post-processing effects.
Definition: DtPostProcessManager.h:25
int myHeight
height of the image
Definition: DtReadFramebufferCallback.h:115
GLenum myDataType
Data type format.
Definition: DtReadFramebufferCallback.h:127
bool myReadFromTexture
Definition: DtReadFramebufferCallback.h:153
This is an abstract call back to process encoded packets.
Definition: DtEncoderIO.h:76
std::vector< unsigned int > myPbos
Pixel Buffer Object.
Definition: DtReadFramebufferCallback.h:133
int myMutableWriteIndex
Write buffer index.
Definition: DtReadFramebufferCallback.h:136
Contains the DtReadFramebufferProcessData class declaration.
voidpf stream
Definition: ioapi.h:39
unsigned int GLenum
Definition: DtGlTextureBufferObject.h:18
The EncoderIO class is responsible to initialize CUDA and NVidia encoder then will be responsible to ...
Definition: DtEncoderIO.h:99
DtProcessImageTask creates and manages all the process image pipeline elements.
Definition: DtProcessImageTask.h:35
int myWidth
width of the image
Definition: DtReadFramebufferCallback.h:112
double myFrequency
streaming frequency
Definition: DtReadFramebufferCallback.h:106
The DtDe is the core component of any VR-Vantage application. It owns a DtRenderer, DtDeCommunicator, as well as a DtDisplay and other things.
Definition: DtDe.h:70
DtPostProcessManager & myPostProcessManager
de-reference
Definition: DtReadFramebufferCallback.h:162
Contains DLL export macros.
int myX
Position in X.
Definition: DtReadFramebufferCallback.h:118
DtOsgChannel * myChannel
Ptr to the Channel.
Definition: DtReadFramebufferCallback.h:103
int myMutableReadIndex
Read buffer index.
Definition: DtReadFramebufferCallback.h:139

Document ID: Generated on Sun Dec 4 20:22:03 EST 2022 from SVN revision 249613
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)