IVRTrackedCamera

extern (C++, vr) abstract
class IVRTrackedCamera {}

Members

Functions

AcquireVideoStreamingService
EVRTrackedCameraError AcquireVideoStreamingService(TrackedDeviceIndex_t nDeviceIndex, TrackedCameraHandle_t* pHandle)

Acquiring streaming service permits video streaming for the caller. Releasing hints the system that video services do not need to be maintained for this client. If the camera has not already been activated, a one time spin up may incur some auto exposure as well as initial streaming frame delays. The camera should be considered a global resource accessible for shared consumption but not exclusive to any caller. The camera may go inactive due to lack of active consumers or headset idleness.

GetCameraErrorNameFromEnum
const(char)* GetCameraErrorNameFromEnum(EVRTrackedCameraError eCameraError)
Undocumented in source.
GetCameraFrameSize
EVRTrackedCameraError GetCameraFrameSize(TrackedDeviceIndex_t nDeviceIndex, EVRTrackedCameraFrameType eFrameType, uint* pnWidth, uint* pnHeight, uint* pnFrameBufferSize)
Undocumented in source.
GetCameraIntrinsics
EVRTrackedCameraError GetCameraIntrinsics(TrackedDeviceIndex_t nDeviceIndex, uint nCameraIndex, EVRTrackedCameraFrameType eFrameType, HmdVector2_t* pFocalLength, HmdVector2_t* pCenter)
Undocumented in source.
GetCameraProjection
EVRTrackedCameraError GetCameraProjection(TrackedDeviceIndex_t nDeviceIndex, uint nCameraIndex, EVRTrackedCameraFrameType eFrameType, float flZNear, float flZFar, HmdMatrix44_t* pProjection)
Undocumented in source.
GetCameraTrackingSpace
ETrackingUniverseOrigin GetCameraTrackingSpace()
Undocumented in source.
GetVideoStreamFrameBuffer
EVRTrackedCameraError GetVideoStreamFrameBuffer(TrackedCameraHandle_t hTrackedCamera, EVRTrackedCameraFrameType eFrameType, void* pFrameBuffer, uint nFrameBufferSize, CameraVideoStreamFrameHeader_t* pFrameHeader, uint nFrameHeaderSize)

Copies the image frame into a caller's provided buffer. The image data is currently provided as RGBA data, 4 bytes per pixel. A caller can provide null for the framebuffer or frameheader if not desired. Requesting the frame header first, followed by the frame buffer allows the caller to determine if the frame as advanced per the frame header sequence. If there is no frame available yet, due to initial camera spinup or re-activation, the error will be VRTrackedCameraError_NoFrameAvailable. Ideally a caller should be polling at ~16ms intervals

GetVideoStreamTextureD3D11
EVRTrackedCameraError GetVideoStreamTextureD3D11(TrackedCameraHandle_t hTrackedCamera, EVRTrackedCameraFrameType eFrameType, void* pD3D11DeviceOrResource, void** ppD3D11ShaderResourceView, CameraVideoStreamFrameHeader_t* pFrameHeader, uint nFrameHeaderSize)

Access a shared D3D11 texture for the specified tracked camera stream. The camera frame type VRTrackedCameraFrameType_Undistorted is not supported directly as a shared texture. It is an interior subregion of the shared texture VRTrackedCameraFrameType_MaximumUndistorted. Instead, use GetVideoStreamTextureSize() with VRTrackedCameraFrameType_Undistorted to determine the proper interior subregion bounds along with GetVideoStreamTextureD3D11() with VRTrackedCameraFrameType_MaximumUndistorted to provide the texture. The VRTrackedCameraFrameType_MaximumUndistorted will yield an image where the invalid regions are decoded by the alpha channel having a zero component. The valid regions all have a non-zero alpha component. The subregion as described by VRTrackedCameraFrameType_Undistorted guarantees a rectangle where all pixels are valid.

GetVideoStreamTextureGL
EVRTrackedCameraError GetVideoStreamTextureGL(TrackedCameraHandle_t hTrackedCamera, EVRTrackedCameraFrameType eFrameType, glUInt_t* pglTextureId, CameraVideoStreamFrameHeader_t* pFrameHeader, uint nFrameHeaderSize)
Undocumented in source.
GetVideoStreamTextureSize
EVRTrackedCameraError GetVideoStreamTextureSize(TrackedDeviceIndex_t nDeviceIndex, EVRTrackedCameraFrameType eFrameType, VRTextureBounds_t* pTextureBounds, uint* pnWidth, uint* pnHeight)
Undocumented in source.
HasCamera
EVRTrackedCameraError HasCamera(TrackedDeviceIndex_t nDeviceIndex, bool* pHasCamera)
Undocumented in source.
ReleaseVideoStreamTextureGL
EVRTrackedCameraError ReleaseVideoStreamTextureGL(TrackedCameraHandle_t hTrackedCamera, glUInt_t glTextureId)
Undocumented in source.
ReleaseVideoStreamingService
EVRTrackedCameraError ReleaseVideoStreamingService(TrackedCameraHandle_t hTrackedCamera)
Undocumented in source.
SetCameraTrackingSpace
void SetCameraTrackingSpace(ETrackingUniverseOrigin eUniverse)
Undocumented in source.

Meta