FrameFactory class, which provides some static functions to create frame objects.
More...
#include <Frame.hpp>
|
| typedef std::function< void(uint8_t *)> | BufferDestroyCallback |
| | The callback function to destroy the buffer when the frame is destroyed.
|
|
| static std::shared_ptr< Frame > | createFrame (OBFrameType frameType, OBFormat format, uint32_t dataSize) |
| | Create a Frame object of a specific type with a given format and data size.
|
| static std::shared_ptr< VideoFrame > | createVideoFrame (OBFrameType frameType, OBFormat format, uint32_t width, uint32_t height, uint32_t stride=0) |
| | Create a VideoFrame object of a specific type with a given format, width, height, and stride.
|
| static std::shared_ptr< Frame > | createFrameFromOtherFrame (std::shared_ptr< const Frame > otherFrame, bool shouldCopyData=true) |
| | Create (clone) a frame object based on the specified other frame object.
|
| static std::shared_ptr< Frame > | createFrameFromStreamProfile (std::shared_ptr< const StreamProfile > profile) |
| | Create a Frame From (according to)Stream Profile object.
|
| static std::shared_ptr< Frame > | createFrameFromBuffer (OBFrameType frameType, OBFormat format, uint8_t *buffer, BufferDestroyCallback destroyCallback, uint32_t bufferSize) |
| | Create a frame object based on an externally created buffer.
|
| static std::shared_ptr< VideoFrame > | createVideoFrameFromBuffer (OBFrameType frameType, OBFormat format, uint32_t width, uint32_t height, uint8_t *buffer, BufferDestroyCallback destroyCallback, uint32_t bufferSize, uint32_t stride=0) |
| | Create a video frame object based on an externally created buffer.
|
| static std::shared_ptr< FrameSet > | createFrameSet () |
| | Create a new FrameSet object.
|
FrameFactory class, which provides some static functions to create frame objects.
Definition at line 871 of file Frame.hpp.
◆ BufferDestroyCallback
The callback function to destroy the buffer when the frame is destroyed.
Definition at line 946 of file Frame.hpp.
◆ createFrame()
Create a Frame object of a specific type with a given format and data size.
- Parameters
-
| frameType | The type of the frame. |
| format | The format of the frame. |
| dataSize | The size of the data in bytes. |
- Returns
- std::shared_ptr<Frame> The created frame object.
Definition at line 881 of file Frame.hpp.
◆ createVideoFrame()
| std::shared_ptr< VideoFrame > ob::FrameFactory::createVideoFrame |
( |
OBFrameType | frameType, |
|
|
OBFormat | format, |
|
|
uint32_t | width, |
|
|
uint32_t | height, |
|
|
uint32_t | stride = 0 ) |
|
inlinestatic |
Create a VideoFrame object of a specific type with a given format, width, height, and stride.
- Note
- If stride is not specified, it will be calculated based on the width and format.
- Parameters
-
| frameType | The type of the frame. |
| format | The format of the frame. |
| width | The width of the frame. |
| height | The height of the frame. |
| stride | The stride of the frame. |
- Returns
- std::shared_ptr<VideoFrame> The created video frame object.
Definition at line 901 of file Frame.hpp.
◆ createFrameFromOtherFrame()
| std::shared_ptr< Frame > ob::FrameFactory::createFrameFromOtherFrame |
( |
std::shared_ptr< const Frame > | otherFrame, |
|
|
bool | shouldCopyData = true ) |
|
inlinestatic |
Create (clone) a frame object based on the specified other frame object.
The new frame object will have the same properties as the other frame object, but the data buffer is newly allocated.
- Parameters
-
| shouldCopyData | If true, the data of the source frame object will be copied to the new frame object. If false, the new frame object will have a data buffer with random data. The default value is true. |
- Returns
- std::shared_ptr<Frame> The new frame object.
Definition at line 919 of file Frame.hpp.
◆ createFrameFromStreamProfile()
| std::shared_ptr< Frame > ob::FrameFactory::createFrameFromStreamProfile |
( |
std::shared_ptr< const StreamProfile > | profile | ) |
|
|
inlinestatic |
Create a Frame From (according to)Stream Profile object.
- Parameters
-
| profile | The stream profile object to create the frame from. |
- Returns
- std::shared_ptr<Frame> The created frame object.
Definition at line 935 of file Frame.hpp.
◆ createFrameFromBuffer()
Create a frame object based on an externally created buffer.
- Attention
- The buffer is owned by the caller, and will not be destroyed by the frame object. The user should ensure that the buffer is valid and not modified.
- Parameters
-
| [in] | frameType | Frame object type. |
| [in] | format | Frame object format. |
| [in] | buffer | Frame object buffer. |
| [in] | destroyCallback | Destroy callback, will be called when the frame object is destroyed. |
| [in] | bufferSize | Frame object buffer size. |
- Returns
- std::shared_ptr<Frame> The created frame object.
Definition at line 962 of file Frame.hpp.
◆ createVideoFrameFromBuffer()
Create a video frame object based on an externally created buffer.
- Attention
- The buffer is owned by the user and will not be destroyed by the frame object. The user should ensure that the buffer is valid and not modified.
-
The frame object is created with a reference count of 1, and the reference count should be decreased by calling ob_delete_frame() when it is no longer needed.
- Parameters
-
| [in] | frameType | Frame object type. |
| [in] | format | Frame object format. |
| [in] | width | Frame object width. |
| [in] | height | Frame object height. |
| [in] | buffer | Frame object buffer. |
| [in] | bufferSize | Frame object buffer size. |
| [in] | destroyCallback | Destroy callback, will be called when the frame object is destroyed. |
| [in] | stride | Row span in bytes. If 0, the stride is calculated based on the width and format. |
- Returns
- std::shared_ptr<VideoFrame> The created video frame object.
Definition at line 991 of file Frame.hpp.
◆ createFrameSet()
| std::shared_ptr< FrameSet > ob::FrameFactory::createFrameSet |
( |
| ) |
|
|
inlinestatic |
Create a new FrameSet object.
This function creates a new FrameSet instance by internally calling the native C API. The returned FrameSet is managed by a std::shared_ptr, and its lifetime will be automatically managed. When no references remain, the underlying native resources will be released.
- Returns
- std::shared_ptr<FrameSet> The created FrameSet object.
Definition at line 1011 of file Frame.hpp.
The documentation for this class was generated from the following file:
- E:/jenkins/workspace/OrbbecSDK/build_sdk/OpenOrbbecSDK/include/libobsensor/hpp/Frame.hpp