areaDetector  3-13
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
Definition: streamApi.h:33
~StreamAPI(void)
Definition: streamApi.cpp:144
int getFrame(stream_frame_t *frame, int timeout=0)
Definition: streamApi.cpp:210
StreamAPI(const char *hostname)
Definition: streamApi.cpp:127
int getHeader(stream_header_t *header, int timeout=0)
Definition: streamApi.cpp:151
static int uncompress(stream_frame_t *frame, char *data=NULL)
Definition: streamApi.cpp:342
stream_err
Definition: streamApi.h:7
@ STREAM_SUCCESS
Definition: streamApi.h:8
@ STREAM_ERROR
Definition: streamApi.h:11
@ STREAM_TIMEOUT
Definition: streamApi.h:9
@ STREAM_WRONG_HTYPE
Definition: streamApi.h:10
struct stream_frame stream_frame_t
Definition: streamApi.h:20
size_t series
Definition: streamApi.h:22
void * data
Definition: streamApi.h:29
size_t frame
Definition: streamApi.h:22
size_t compressedSize
Definition: streamApi.h:27
bool end
Definition: streamApi.h:21
size_t shape[2]
Definition: streamApi.h:23
@ UINT16
Definition: streamApi.h:24
@ UINT32
Definition: streamApi.h:24
@ UINT8
Definition: streamApi.h:24
char encoding[32]
Definition: streamApi.h:26
size_t uncompressedSize
Definition: streamApi.h:27
enum stream_frame::@5 type
Definition: streamApi.h:15
size_t series
Definition: streamApi.h:16