123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354 |
- #ifndef ANDROID_RS_FIFO_SOCKET_H
- #define ANDROID_RS_FIFO_SOCKET_H
- #include "rsFifo.h"
- namespace android {
- namespace renderscript {
- class FifoSocket {
- public:
- FifoSocket();
- virtual ~FifoSocket();
- bool init(bool supportNonBlocking = true,
- bool supportReturnValues = true,
- size_t maxDataSize = 0);
- void shutdown();
- bool writeAsync(const void *data, size_t bytes, bool waitForSpace = true);
- void writeWaitReturn(void *ret, size_t retSize);
- size_t read(void *data, size_t bytes);
- void readReturn(const void *data, size_t bytes);
- bool isEmpty();
- int getWriteFd() {return sv[0];}
- int getReadFd() {return sv[1];}
- protected:
- int sv[2];
- bool mShutdown;
- };
- }
- }
- #endif
|