[IE][VPU][XLink]: XLink semaphore wrappers impl (#3079)
[platform/upstream/dldt.git] / inference-engine / thirdparty / movidius / XLink / shared / include / XLinkStream.h
1 // Copyright (C) 2018-2020 Intel Corporation
2 // SPDX-License-Identifier: Apache-2.0
3 //
4
5 #ifndef _XLINKSTREAM_H
6 #define _XLINKSTREAM_H
7
8 #include "XLinkPublicDefines.h"
9 #include "XLinkSemaphore.h"
10
11 /**
12  * @brief Streams opened to device
13  */
14 typedef struct{
15     char name[MAX_STREAM_NAME_LENGTH];
16     streamId_t id;
17     uint32_t writeSize;
18     uint32_t readSize;  /*No need of read buffer. It's on remote,
19     will read it directly to the requested buffer*/
20     streamPacketDesc_t packets[XLINK_MAX_PACKETS_PER_STREAM];
21     uint32_t availablePackets;
22     uint32_t blockedPackets;
23
24     uint32_t firstPacket;
25     uint32_t firstPacketUnused;
26     uint32_t firstPacketFree;
27
28     uint32_t remoteFillLevel;
29     uint32_t localFillLevel;
30     uint32_t remoteFillPacketLevel;
31
32     uint32_t closeStreamInitiated;
33
34     XLink_sem_t sem;
35 }streamDesc_t;
36
37 XLinkError_t XLinkStreamInitialize(
38     streamDesc_t* stream, streamId_t id, const char* name);
39
40 void XLinkStreamReset(streamDesc_t* stream);
41
42 #endif //_XLINKSTREAM_H