1 #ifndef ANDROID_DVR_INTERNAL_H_
2 #define ANDROID_DVR_INTERNAL_H_
3 
4 #include <sys/cdefs.h>
5 
6 #include <memory>
7 
8 extern "C" {
9 
10 typedef struct DvrBuffer DvrBuffer;
11 typedef struct DvrReadBuffer DvrReadBuffer;
12 typedef struct DvrWriteBuffer DvrWriteBuffer;
13 
14 }  // extern "C"
15 
16 namespace android {
17 namespace dvr {
18 
19 class IonBuffer;
20 
21 DvrBuffer* CreateDvrBufferFromIonBuffer(
22     const std::shared_ptr<IonBuffer>& ion_buffer);
23 
24 }  // namespace dvr
25 }  // namespace android
26 
27 extern "C" {
28 
29 struct DvrWriteBuffer {
30   // The slot nubmer of the buffer, a valid slot number must be in the range of
31   // [0, android::BufferQueueDefs::NUM_BUFFER_SLOTS). This is only valid for
32   // DvrWriteBuffer acquired from a DvrWriteBufferQueue.
33   int32_t slot = -1;
34 
35   std::shared_ptr<android::dvr::ProducerBuffer> write_buffer;
36 };
37 
38 struct DvrReadBuffer {
39   // The slot nubmer of the buffer, a valid slot number must be in the range of
40   // [0, android::BufferQueueDefs::NUM_BUFFER_SLOTS). This is only valid for
41   // DvrReadBuffer acquired from a DvrReadBufferQueue.
42   int32_t slot = -1;
43 
44   std::shared_ptr<android::dvr::ConsumerBuffer> read_buffer;
45 };
46 
47 struct DvrBuffer {
48   std::shared_ptr<android::dvr::IonBuffer> buffer;
49 };
50 
51 }  // extern "C"
52 
53 #endif  // ANDROID_DVR_INTERNAL_H_
54