VR-Forces 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) 2025 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 
34  {
35  public:
37  friend class DtVideoStream;
38 
40  virtual ~DtReadFramebufferCallback();
41 
43  virtual void operator()(osg::RenderInfo& renderInfo) const;
44  protected:
45 
48 
50  virtual bool init();
51 
53  virtual void unInit();
54 
56  virtual void setupPixelBufferObjects( int numBuffers );
57 
59  virtual bool createProcessImageTask();
60 
62  virtual bool setPixelFormatFromString( const DtUnicode& pxfString );
63 
65  virtual bool setReadBufferFromString( const DtUnicode& rbString );
66 
68  virtual bool setDataTypeFromString( const DtUnicode& dtString );
69 
71  virtual void readPixels(osg::RenderInfo& renderInfo) const;
72 
74  virtual void readPixelsPbo(osg::RenderInfo& renderInfo) const;
75 
77  virtual DtVideoStreamPostProcessor* findVideoStreamPostProcessor(void) const;
78 
80  virtual void registerPbosWithHardwareEncoderIfNecessary(void);
81  private:
83  DtReadFramebufferCallback() = delete;
84 
87 
89  DtReadFramebufferCallback& operator=( const DtReadFramebufferCallback& orig ) = delete;
90 
91  protected:
94 
97 
100 
102  double myFrequency;
103 
106 
108  int myWidth;
109 
111  int myHeight;
112 
114  int myX;
115 
117  int myY;
118 
121 
124 
127 
129  std::vector<unsigned int> myPbos;
130 
132  mutable int myMutableWriteIndex;
133 
135  mutable int myMutableReadIndex;
136 
139 
142 
145 
148 
150 
153 
156 
159 
160  int myId = 0;
161 
162  static int theRunningId;
163 
164  double myTimeNextFrame = 0.0;
165  };
166 }
DtReadFramebufferProcessData myProcessData
hardware frame buffer data
Definition: DtReadFramebufferCallback.h:155
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:32
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:162
Contains the DtVideoStream class declaration.
bool myIsInitialized
is everything initialized
Definition: DtReadFramebufferCallback.h:144
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:105
DtEncoderIO * myEncoderIO
hardware encoding IO object
Definition: DtReadFramebufferCallback.h:152
DtProcessImageTask * myTask
Image processing task.
Definition: DtReadFramebufferCallback.h:141
#define DT_DLL_VRVVIDEOSTREAM
Definition: vrvVideoStream.h:20
DtDe & myDe
Copy of the DtDe.
Definition: DtReadFramebufferCallback.h:96
Contains the DtProcessImageTask class declaration.
This class provides the OSG-specific implementation of a DtChannel.
Definition: DtOsgChannel.h:58
osg::ref_ptr< osg::Image > myImage
Image pointer.
Definition: DtReadFramebufferCallback.h:138
DtVideoStream & myStream
Current VideoStream.
Definition: DtReadFramebufferCallback.h:93
int myY
Position in Y.
Definition: DtReadFramebufferCallback.h:117
GLenum myPixelFormat
Pixel format used.
Definition: DtReadFramebufferCallback.h:120
GLenum myReadBuffer
GL buffer used (back/front)
Definition: DtReadFramebufferCallback.h:126
bool myIsUsingHardware
Are using hardware encoding.
Definition: DtReadFramebufferCallback.h:147
This class provides the OSG-specific management of post-processing effects.
Definition: DtPostProcessManager.h:27
int myHeight
height of the image
Definition: DtReadFramebufferCallback.h:111
GLenum myDataType
Data type format.
Definition: DtReadFramebufferCallback.h:123
bool myReadFromTexture
Definition: DtReadFramebufferCallback.h:149
std::vector< unsigned int > myPbos
Pixel Buffer Object.
Definition: DtReadFramebufferCallback.h:129
int myMutableWriteIndex
Write buffer index.
Definition: DtReadFramebufferCallback.h:132
Contains the DtReadFramebufferProcessData class declaration.
voidpf stream
Definition: ioapi.h:39
unsigned int GLenum
Definition: DtGlTextureBufferObject.h:19
The EncoderIO class is responsible to initialize CUDA and NVidia encoder then will be responsible to ...
Definition: DtEncoderIO.h:93
DtProcessImageTask creates and manages all the process image pipeline elements.
Definition: DtProcessImageTask.h:35
int myWidth
width of the image
Definition: DtReadFramebufferCallback.h:108
double myFrequency
streaming frequency
Definition: DtReadFramebufferCallback.h:102
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:76
DtPostProcessManager & myPostProcessManager
de-reference
Definition: DtReadFramebufferCallback.h:158
Contains DLL export macros.
int myX
Position in X.
Definition: DtReadFramebufferCallback.h:114
DtOsgChannel * myChannel
Ptr to the Channel.
Definition: DtReadFramebufferCallback.h:99
int myMutableReadIndex
Read buffer index.
Definition: DtReadFramebufferCallback.h:135

Document ID: Generated on Thu Oct 15 21:27:02 EDT 2026 from SVN revision 296421
Copyright © 2005-2026 MAK Technologies. All Rights Reserved (www.mak.com)