45 #if defined(__ANDROID__)
52 JNIEXPORT
void JNICALL Java_com_osvr_android_jni_JNIBridge_reportFrame(JNIEnv * env, jclass clazz,
53 jbyteArray data, jlong width, jlong height);
56 JNIEXPORT
void JNICALL Java_com_osvr_android_jni_JNIBridge_reportFrame(JNIEnv * env, jclass clazz,
57 jbyteArray data, jlong width, jlong height) {
59 gLastFrameMetadata.
height = (OSVR_ImageDimension)height;
60 gLastFrameMetadata.
width = (OSVR_ImageDimension)width;
61 gLastFrameMetadata.
channels = (OSVR_ImageChannels)4;
62 gLastFrameMetadata.
depth = (OSVR_ImageDepth)1;
68 int size = env->GetArrayLength(data);
70 if(gLastFrameBuffer == NULL) {
73 gLastFrame = gLastFrameBuffer;
74 env->GetByteArrayRegion(data, 0, size, reinterpret_cast<jbyte*>(gLastFrameBuffer));
95 ifaceObj->imaging = imaging.get();
96 opts->addComponent(imaging);
107 auto guard = iface->getSendGuard();
109 iface->imaging->sendImageData(metadata, imageData, sensor, *timestamp);
uint32_t OSVR_ChannelCount
The integer type specifying a number of channels/sensors or a channel/sensor index.
A DeviceToken connects the generic device interaction code in PluginKit's C API with the workings of ...
typedefOSVR_EXTERN_C_BEGIN struct OSVR_ImagingDeviceInterfaceObject * OSVR_ImagingDeviceInterface
Opaque type used in conjunction with a device token to send data on an imaging interface.
static shared_ptr< ImagingComponent > create(OSVR_ChannelCount numSensor=0)
Factory method.
Structure used internally to construct the desired type of device.
detail::size< coerce_list< Ts...>> size
Get the size of a list (number of elements.)
#define OSVR_PLUGIN_HANDLE_NULL_CONTEXT(FUNC, CONTEXT_NAME)
Internal macro for use in C API function implementations to check the validity of a context parameter...
#define OSVR_RETURN_FAILURE
The "failure" value for an OSVR_ReturnCode.
#define OSVR_RETURN_SUCCESS
The "success" value for an OSVR_ReturnCode.
Internal, configured header file for verbosity macros.
OSVR_ReturnCode osvrDeviceImagingConfigure(OSVR_DeviceInitOptions opts, OSVR_ImagingDeviceInterface *iface, OSVR_ChannelCount numSensors)
Specify that your device will implement the Imaging interface.
Standardized, portable parallel to struct timeval for representing both absolute times and time inter...
unsigned char OSVR_ImageBufferElement
Type for raw buffer access to image data.
Base class for the DeviceInterfaceObjects retrieved by plugins to let them send data on an interface...
OSVR_ReturnCode osvrDeviceImagingReportFrame(OSVR_DeviceToken, OSVR_ImagingDeviceInterface iface, OSVR_ImagingMetadata metadata, OSVR_ImageBufferElement *imageData, OSVR_ChannelCount sensor, OSVR_TimeValue const *timestamp)
Report a frame for a sensor. Takes ownership of the buffer and frees it with the osvrAlignedFree func...