Rename Buffer{Producer, Consumer} to {Producer, Consumer}Buffer
Bug: 116855254
Test: Build
Change-Id: Ief03795d2093f817f135d33eb252e1e040e150f7
diff --git a/libs/vr/libvrflinger/acquired_buffer.h b/libs/vr/libvrflinger/acquired_buffer.h
index 9e35a39..7643e75 100644
--- a/libs/vr/libvrflinger/acquired_buffer.h
+++ b/libs/vr/libvrflinger/acquired_buffer.h
@@ -9,42 +9,42 @@
namespace android {
namespace dvr {
-// Manages the ACQUIRE/RELEASE ownership cycle of a BufferConsumer.
+// Manages the ACQUIRE/RELEASE ownership cycle of a ConsumerBuffer.
class AcquiredBuffer {
public:
static constexpr int kEmptyFence = pdx::LocalHandle::kEmptyFileHandle;
AcquiredBuffer() : buffer_(nullptr), acquire_fence_(kEmptyFence) {}
- // Constructs an AcquiredBuffer from a BufferConsumer pointer and an acquire
- // fence. The BufferConsumer MUST be in the ACQUIRED state prior to calling
+ // Constructs an AcquiredBuffer from a ConsumerBuffer pointer and an acquire
+ // fence. The ConsumerBuffer MUST be in the ACQUIRED state prior to calling
// this constructor; the constructor does not attempt to ACQUIRE the buffer
// itself.
- AcquiredBuffer(const std::shared_ptr<BufferConsumer>& buffer,
+ AcquiredBuffer(const std::shared_ptr<ConsumerBuffer>& buffer,
pdx::LocalHandle acquire_fence, std::size_t slot = 0);
- // Constructs an AcquiredBuffer from a BufferConsumer. The BufferConsumer MUST
+ // Constructs an AcquiredBuffer from a ConsumerBuffer. The ConsumerBuffer MUST
// be in the POSTED state prior to calling this constructor, as this
// constructor attempts to ACQUIRE the buffer. If ACQUIRING the buffer fails
// this instance is left in the empty state. An optional error code is
// returned in |error|, which may be nullptr if not needed.
- AcquiredBuffer(const std::shared_ptr<BufferConsumer>& buffer, int* error);
+ AcquiredBuffer(const std::shared_ptr<ConsumerBuffer>& buffer, int* error);
// Move constructor. Behaves similarly to the move assignment operator below.
AcquiredBuffer(AcquiredBuffer&& other) noexcept;
~AcquiredBuffer();
- // Move assignment operator. Moves the BufferConsumer and acquire fence from
- // |other| into this instance after RELEASING the current BufferConsumer and
+ // Move assignment operator. Moves the ConsumerBuffer and acquire fence from
+ // |other| into this instance after RELEASING the current ConsumerBuffer and
// closing the acquire fence. After the move |other| is left in the empty
// state.
AcquiredBuffer& operator=(AcquiredBuffer&& other) noexcept;
- // Accessors for the underlying BufferConsumer, the acquire fence, and the
+ // Accessors for the underlying ConsumerBuffer, the acquire fence, and the
// use-case specific sequence value from the acquisition (see
// private/dvr/consumer_buffer.h).
- std::shared_ptr<BufferConsumer> buffer() const { return buffer_; }
+ std::shared_ptr<ConsumerBuffer> buffer() const { return buffer_; }
int acquire_fence() const { return acquire_fence_.Get(); }
// When non-empty, returns true if the acquired fence was signaled (or if the
@@ -58,11 +58,11 @@
// Returns the buffer, passing ownership to the caller. Caller is responsible
// for calling Release on the returned buffer.
- std::shared_ptr<BufferConsumer> ClaimBuffer();
+ std::shared_ptr<ConsumerBuffer> ClaimBuffer();
- // Releases the BufferConsumer, passing the release fence in |release_fence|
- // to the producer. On success, the BufferConsumer and acquire fence are set
- // to empty state; if release fails, the BufferConsumer and acquire fence are
+ // Releases the ConsumerBuffer, passing the release fence in |release_fence|
+ // to the producer. On success, the ConsumerBuffer and acquire fence are set
+ // to empty state; if release fails, the ConsumerBuffer and acquire fence are
// left in place and a negative error code is returned.
int Release(pdx::LocalHandle release_fence = {});
@@ -71,7 +71,7 @@
std::size_t slot() const { return slot_; }
private:
- std::shared_ptr<BufferConsumer> buffer_;
+ std::shared_ptr<ConsumerBuffer> buffer_;
// Mutable so that the fence can be closed when it is determined to be
// signaled during IsAvailable().
mutable pdx::LocalHandle acquire_fence_;