dvr_internal.h 1.2 KB

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