Katana Plug-in APIs 0.1

FnDisplayDriverSuite.h

00001 // Copyright (c) 2016 The Foundry Visionmongers Ltd. All Rights Reserved.
00002 
00003 #ifndef FnDisplayDriverSuite_H
00004 #define FnDisplayDriverSuite_H
00005 
00006 #include <stdint.h>
00007 
00008 extern "C" {
00009 
00013 typedef struct FnKatanaPipeStruct* FnKatanaPipeHandle;
00014 
00018 typedef struct FnMessageStruct* FnMessageHandle;
00019 
00023 typedef void (*FnPixelDataDeleter)(void* pixelData);
00024 
00025 typedef int32_t FnKatMessageType;
00026 #define kFnKatNewFrameType 0
00027 #define kFnKatNewChannelType 1
00028 #define kFnKatDataMessageType 2
00029 #define kFnKatCloseMessageType 3
00030 #define kFnKatEndOfRenderMessageType 4
00031 #define kFnKatIsAliveMessageType 5
00032 #define kFnKatNewChannelv2Type 6
00033 
00034 typedef uint8_t FnKatPixelLayout;
00035 #define kFnKatPixelLayoutARGB 0
00036 #define kFnKatPixelLayoutRGBA 1
00037 #define kFnKatPixelLayoutUndefined 255
00038 
00039 #define kFnKatDefaultMaxQueueSize 16384
00040 
00041 #define FnDisplayDriverHostSuite_version 1
00042 
00051 struct FnDisplayDriverHostSuite_v1
00052 {
00053     // KatanaPipe
00054     FnKatanaPipeHandle (*createKatanaPipe)(const char* hostName,
00055                                            uint16_t portNumber,
00056                                            const uint64_t maxQueueSize);
00057     uint8_t (*connect)(FnKatanaPipeHandle handle);
00058     uint8_t (*send)(FnKatanaPipeHandle handle, FnMessageHandle message);
00059     void (*flushPipe)(FnKatanaPipeHandle handle, FnMessageHandle channel);
00060     void (*closeChannel)(FnKatanaPipeHandle handle, FnMessageHandle channel);
00061     void (*terminate)(FnKatanaPipeHandle handle);
00062 
00063     // Message
00064     void (*retainMessage)(FnMessageHandle handle);
00065     void (*releaseMessage)(FnMessageHandle handle);
00066 
00067     // CloseMessage
00068     FnMessageHandle (*createCloseMessage)(const uint8_t* frameID,
00069                                           uint16_t channelID);
00070 
00071     // EndOfRenderMessage
00072     FnMessageHandle (*createEndOfRenderMessage)(const uint8_t* frameID,
00073                                                 uint16_t channelID);
00074 
00075     // DataMessage
00076     FnMessageHandle (*createDataMessage)(const uint8_t* frameID,
00077                                          uint16_t channelID,
00078                                          uint32_t xMin,
00079                                          uint32_t width,
00080                                          uint32_t yMin,
00081                                          uint32_t height,
00082                                          uint32_t byteSkip);
00083     void (*setData)(FnMessageHandle handle, const void* data, uint32_t size);
00084     void (*setStartCoordinates)(FnMessageHandle handle, uint32_t x, uint32_t y);
00085     void (*setDataDimensions)(FnMessageHandle handle,
00086                               uint32_t width,
00087                               uint32_t height);
00088     void (*setByteSkip)(FnMessageHandle handle, uint32_t byteSkip);
00089     const uint8_t* (*dataFrameUUID)(FnMessageHandle handle);
00090     uint16_t (*dataChannelID)(FnMessageHandle handle);
00091     uint32_t (*xMin)(FnMessageHandle handle);
00092     uint32_t (*width)(FnMessageHandle handle);
00093     uint32_t (*yMin)(FnMessageHandle handle);
00094     uint32_t (*height)(FnMessageHandle handle);
00095     uint32_t (*bufferSize)(FnMessageHandle handle);
00096     const void* (*dataBuffer)(FnMessageHandle handle);
00097     uint32_t (*byteSkip)(FnMessageHandle handle);
00098 
00099     // NewChannelMessage
00100     FnMessageHandle (*createNewChannelMessage)(const uint8_t* frameID,
00101                                                uint16_t channelID,
00102                                                uint32_t height,
00103                                                uint32_t width,
00104                                                int xorigin,
00105                                                int yorigin,
00106                                                float sampleRate1,
00107                                                float sampleRate2,
00108                                                uint32_t dataSize);
00109     int8_t (*setChannelName)(FnMessageHandle handle, const char* name);
00110     void (*setChannelDimensions)(FnMessageHandle handle,
00111                                  uint32_t width,
00112                                  uint32_t height);
00113     void (*setChannelOrigin)(FnMessageHandle handle, int32_t ox, int32_t oy);
00114     void (*setDataSize)(FnMessageHandle handle, uint32_t dataSize);
00115     void (*setChannelID)(FnMessageHandle handle, uint16_t channelID);
00116     void (*setSampleRate)(FnMessageHandle handle, const float* sampleRate);
00117     const uint8_t* (*channelFrameUUID)(FnMessageHandle handle);
00118     uint16_t (*channelID)(FnMessageHandle handle);
00119     uint32_t (*channelHeight)(FnMessageHandle handle);
00120     uint32_t (*channelWidth)(FnMessageHandle handle);
00121     int32_t (*channelXOrigin)(FnMessageHandle handle);
00122     int32_t (*channelYOrigin)(FnMessageHandle handle);
00123     uint32_t (*channelDataSize)(FnMessageHandle handle);
00124     const char* (*channelName)(FnMessageHandle handle);
00125     uint32_t (*channelNameLength)(FnMessageHandle handle);
00126     const float* (*sampleRate)(FnMessageHandle handle);
00127 
00128     // NewFrameMessage
00129     FnMessageHandle (*createNewFrameMessage)(float frameTime,
00130                                              uint32_t height,
00131                                              uint32_t width,
00132                                              int32_t xorigin,
00133                                              int32_t yorigin);
00134     int8_t (*setFrameName)(FnMessageHandle handle, const char* name);
00135     void (*setFrameTime)(FnMessageHandle handle, float time);
00136     void (*setFrameDimensions)(FnMessageHandle handle,
00137                                uint32_t width,
00138                                uint32_t height);
00139     void (*setFrameOrigin)(FnMessageHandle handle, int32_t ox, int32_t oy);
00140     const uint8_t* (*frameUUID)(FnMessageHandle handle);
00141     uint32_t (*frameHeight)(FnMessageHandle handle);
00142     uint32_t (*frameWidth)(FnMessageHandle handle);
00143     int32_t (*frameXOrigin)(FnMessageHandle handle);
00144     int32_t (*frameYOrigin)(FnMessageHandle handle);
00145     float (*frameTime)(FnMessageHandle handle);
00146     const char* (*frameName)(FnMessageHandle handle);
00147     uint32_t (*frameNameLength)(FnMessageHandle handle);
00148 
00149     // NewChannelMessage_v2
00150     FnMessageHandle (*createNewChannelMessage_v2)(const uint8_t* frameID,
00151                                                   uint16_t channelID,
00152                                                   FnKatPixelLayout pixelLayout,
00153                                                   uint32_t height,
00154                                                   uint32_t width,
00155                                                   int xorigin,
00156                                                   int yorigin,
00157                                                   float sampleRate1,
00158                                                   float sampleRate2,
00159                                                   uint32_t dataSize);
00160     void (*setPixelLayout_v2)(FnMessageHandle handle,
00161                               FnKatPixelLayout pixelLayout);
00162     FnKatPixelLayout (*pixelLayout_v2)(FnMessageHandle handle);
00163 
00164     // DataMessage zero copy extension
00165     void (*setDataZeroCopy)(FnMessageHandle handle,
00166                             const void* data,
00167                             uint32_t size,
00168                             FnPixelDataDeleter freeDataFunction);
00169 
00170     // KatanaPipe v2
00171     FnKatanaPipeHandle (*createKatanaPipe_v2)(const char* hostName,
00172                                               uint16_t portNumber,
00173                                               uint64_t maxQueueSize,
00174                                               int linger);
00175 };
00176 }
00177 #endif  // FnDisplayDriverSuite_H
 All Classes Functions Variables Typedefs Enumerations Enumerator