Varjo Native SDK
Varjo_datastream.h
Go to the documentation of this file.
1 // Copyright 2019-2020 Varjo Technologies Oy. All rights reserved.
2 
3 #ifndef VARJO_DATASTREAM_H
4 #define VARJO_DATASTREAM_H
5 
6 #include "Varjo_export.h"
7 #include "Varjo_types.h"
9 
10 #if defined __cplusplus
11 extern "C" {
12 #endif
13 
21 VARJO_API int32_t varjo_GetDataStreamConfigCount(struct varjo_Session* session);
22 
38 VARJO_API void varjo_GetDataStreamConfigs(struct varjo_Session* session, struct varjo_StreamConfig* configs, int32_t maxSize);
39 
63 VARJO_API void varjo_StartDataStream(
64  struct varjo_Session* session, varjo_StreamId id, varjo_ChannelFlag channels, varjo_FrameListener* callback, void* userData);
65 
82 VARJO_API void varjo_StopDataStream(struct varjo_Session* session, varjo_StreamId id);
83 
102  struct varjo_Session* session, varjo_StreamId id, int64_t frameNumber, varjo_ChannelIndex index);
103 
121 VARJO_API struct varjo_Matrix varjo_GetCameraExtrinsics(struct varjo_Session* session, varjo_StreamId id, int64_t frameNumber, varjo_ChannelIndex index);
122 
141 VARJO_API varjo_BufferId varjo_GetBufferId(struct varjo_Session* session, varjo_StreamId id, int64_t frameNumber, varjo_ChannelIndex index);
142 
166 VARJO_API void varjo_LockDataStreamBuffer(struct varjo_Session* session, varjo_BufferId id);
167 
168 /*
169  * Unlock a previously locked data stream buffer.
170  *
171  * Unlock can be called from any thread (i.e. not necessarily from the frame callback thread).
172  *
173  * Possible errors:
174  * #varjo_Error_OperationFailed, #varjo_Error_NotAvailable, #varjo_Error_CapabilityNotAvailable,
175  * #varjo_Error_DataStreamBufferNotLocked, #varjo_Error_DataStreamBufferInvalidId
176  *
177  * @param session Varjo session handle.
178  * @param id Buffer ID.
179  */
180 VARJO_API void varjo_UnlockDataStreamBuffer(struct varjo_Session* session, varjo_BufferId id);
181 
196 VARJO_API struct varjo_BufferMetadata varjo_GetBufferMetadata(struct varjo_Session* session, varjo_BufferId id);
197 
212 VARJO_API struct varjo_Texture varjo_GetBufferGPUData(struct varjo_Session* session, varjo_BufferId id);
213 
228 VARJO_API void* varjo_GetBufferCPUData(struct varjo_Session* session, varjo_BufferId id);
229 
230 #if defined __cplusplus
231 }
232 #endif
233 #endif // VARJO_DATASTREAM_H
varjo_BufferId
int64_t varjo_BufferId
Buffer ID to lock and use a data stream buffer.
Definition: Varjo_types_datastream.h:110
varjo_UnlockDataStreamBuffer
void varjo_UnlockDataStreamBuffer(struct varjo_Session *session, varjo_BufferId id)
varjo_GetBufferMetadata
struct varjo_BufferMetadata varjo_GetBufferMetadata(struct varjo_Session *session, varjo_BufferId id)
Get buffer related metadata.
varjo_StartDataStream
void varjo_StartDataStream(struct varjo_Session *session, varjo_StreamId id, varjo_ChannelFlag channels, varjo_FrameListener *callback, void *userData)
Start frame streaming into the provided callback.
Varjo_export.h
varjo_GetCameraExtrinsics
struct varjo_Matrix varjo_GetCameraExtrinsics(struct varjo_Session *session, varjo_StreamId id, int64_t frameNumber, varjo_ChannelIndex index)
Get camera extrinsics for the current frame.
varjo_GetDataStreamConfigCount
int32_t varjo_GetDataStreamConfigCount(struct varjo_Session *session)
Get number of available stream configurations.
varjo_BufferMetadata
Buffer for data streams.
Definition: Varjo_types_datastream.h:148
varjo_StreamConfig
Data stream configuration.
Definition: Varjo_types_datastream.h:120
varjo_GetDataStreamConfigs
void varjo_GetDataStreamConfigs(struct varjo_Session *session, struct varjo_StreamConfig *configs, int32_t maxSize)
Get available data stream configurations.
varjo_CameraIntrinsics
Camera intrinsics parameter for undistorting a distorted camera frame.
Definition: Varjo_types_datastream.h:136
varjo_StopDataStream
void varjo_StopDataStream(struct varjo_Session *session, varjo_StreamId id)
Stop frame streaming.
varjo_GetCameraIntrinsics
struct varjo_CameraIntrinsics varjo_GetCameraIntrinsics(struct varjo_Session *session, varjo_StreamId id, int64_t frameNumber, varjo_ChannelIndex index)
Get camera intrinsics for the current frame.
Varjo_types_datastream.h
varjo_GetBufferCPUData
void * varjo_GetBufferCPUData(struct varjo_Session *session, varjo_BufferId id)
Get data buffer if it resides in the CPU memory (can be checked with varjo_BufferMetadata::type).
varjo_Texture
API-agnostic texture handle.
Definition: Varjo_types.h:459
varjo_GetBufferId
varjo_BufferId varjo_GetBufferId(struct varjo_Session *session, varjo_StreamId id, int64_t frameNumber, varjo_ChannelIndex index)
Get bufferId for the current frame.
Varjo_types.h
varjo_GetBufferGPUData
struct varjo_Texture varjo_GetBufferGPUData(struct varjo_Session *session, varjo_BufferId id)
Get data buffer if it resides in the GPU memory (can be checked with varjo_BufferMetadata::type).
varjo_Matrix
Double precision 4x4 matrix.
Definition: Varjo_types.h:296
varjo_StreamId
int64_t varjo_StreamId
Stream ID to identify a data stream configuration.
Definition: Varjo_types_datastream.h:105
varjo_ChannelFlag
uint64_t varjo_ChannelFlag
Bitfield for different data stream channels.
Definition: Varjo_types_datastream.h:15
varjo_FrameListener
void() varjo_FrameListener(const struct varjo_StreamFrame *frame, struct varjo_Session *session, void *userData)
Camera frame stream callback function.
Definition: Varjo_types_datastream.h:224
varjo_LockDataStreamBuffer
void varjo_LockDataStreamBuffer(struct varjo_Session *session, varjo_BufferId id)
Lock a data stream buffer for reading.
varjo_ChannelIndex
int64_t varjo_ChannelIndex
Values for indexing buffers and settings of data streams.
Definition: Varjo_types_datastream.h:30