areaDetector  3-12-1
EPICS areaDetector framework
streamApi.h
Go to the documentation of this file.
1 #ifndef STREAM_API_H
2 #define STREAM_API_H
3 
4 #include <stdlib.h>
5 
7 {
12 };
13 
14 typedef struct
15 {
16  size_t series;
18 
19 typedef struct stream_frame
20 {
21  bool end;
22  size_t series, frame;
23  size_t shape[2];
24  enum { UINT8, UINT16, UINT32 } type;
25 
26  char encoding[32];
28 
29  void *data;
31 
32 class StreamAPI
33 {
34 private:
35  char *mHostname;
36  void *mCtx, *mSock;
37 
38  int poll (int timeout); // timeout in seconds
39 
40 public:
41  StreamAPI (const char *hostname);
42  ~StreamAPI (void);
43  int getHeader (stream_header_t *header, int timeout = 0);
44  int getFrame (stream_frame_t *frame, int timeout = 0);
45 
46  static int uncompress (stream_frame_t *frame, char *data = NULL);
47 
48 };
49 
50 #endif
size_t uncompressedSize
Definition: streamApi.h:27
void * data
Definition: streamApi.h:29
size_t shape[2]
Definition: streamApi.h:23
Definition: streamApi.h:24
enum stream_frame::@5 type
int getFrame(stream_frame_t *frame, int timeout=0)
Definition: streamApi.cpp:210
size_t compressedSize
Definition: streamApi.h:27
size_t series
Definition: streamApi.h:22
StreamAPI(const char *hostname)
Definition: streamApi.cpp:127
bool end
Definition: streamApi.h:21
Definition: streamApi.h:19
Definition: streamApi.h:24
Definition: streamApi.h:8
int getHeader(stream_header_t *header, int timeout=0)
Definition: streamApi.cpp:151
stream_err
Definition: streamApi.h:6
Definition: streamApi.h:32
Definition: streamApi.h:14
~StreamAPI(void)
Definition: streamApi.cpp:144
static int uncompress(stream_frame_t *frame, char *data=NULL)
Definition: streamApi.cpp:342
size_t series
Definition: streamApi.h:16
char encoding[32]
Definition: streamApi.h:26
Definition: streamApi.h:24
Definition: streamApi.h:10
Definition: streamApi.h:9
Definition: streamApi.h:11
size_t frame
Definition: streamApi.h:22
struct stream_frame stream_frame_t