Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 62cfdc5d authored by Jiwen Cai's avatar Jiwen Cai Committed by Android (Google) Code Review
Browse files

Merge "Deprecate buffer_hub_client.{h, cpp}"

parents adb29b0a 088b3b61
Loading
Loading
Loading
Loading
+0 −1
Original line number Original line Diff line number Diff line
@@ -14,7 +14,6 @@


sourceFiles = [
sourceFiles = [
    "buffer_hub_base.cpp",
    "buffer_hub_base.cpp",
    "buffer_hub_client.cpp",
    "buffer_hub_metadata.cpp",
    "buffer_hub_metadata.cpp",
    "buffer_hub_rpc.cpp",
    "buffer_hub_rpc.cpp",
    "consumer_buffer.cpp",
    "consumer_buffer.cpp",
+0 −35
Original line number Original line Diff line number Diff line
#include <mutex>

#include <log/log.h>
#include <pdx/default_transport/client_channel.h>
#include <pdx/default_transport/client_channel_factory.h>
#include <private/dvr/buffer_hub_client.h>
#include <utils/Trace.h>

using android::pdx::LocalChannelHandle;
using android::pdx::default_transport::ClientChannel;
using android::pdx::default_transport::ClientChannelFactory;

namespace android {
namespace dvr {

BufferHubClient::BufferHubClient()
    : Client(ClientChannelFactory::Create(BufferHubRPC::kClientPath)) {}

BufferHubClient::BufferHubClient(LocalChannelHandle channel_handle)
    : Client(ClientChannel::Create(std::move(channel_handle))) {}

bool BufferHubClient::IsValid() const {
  return IsConnected() && GetChannelHandle().valid();
}

LocalChannelHandle BufferHubClient::TakeChannelHandle() {
  if (IsConnected()) {
    return std::move(GetChannelHandle());
  } else {
    return {};
  }
}

}  // namespace dvr
}  // namespace android
+24 −2
Original line number Original line Diff line number Diff line
#include <private/dvr/detached_buffer.h>
#include <pdx/default_transport/client_channel.h>

#include <pdx/default_transport/client_channel_factory.h>
#include <pdx/file_handle.h>
#include <pdx/file_handle.h>
#include <private/dvr/bufferhub_rpc.h>
#include <private/dvr/detached_buffer.h>
#include <ui/DetachedBufferHandle.h>
#include <ui/DetachedBufferHandle.h>


#include <poll.h>
#include <poll.h>
@@ -8,10 +10,30 @@
using android::pdx::LocalChannelHandle;
using android::pdx::LocalChannelHandle;
using android::pdx::LocalHandle;
using android::pdx::LocalHandle;
using android::pdx::Status;
using android::pdx::Status;
using android::pdx::default_transport::ClientChannel;
using android::pdx::default_transport::ClientChannelFactory;


namespace android {
namespace android {
namespace dvr {
namespace dvr {


BufferHubClient::BufferHubClient()
    : Client(ClientChannelFactory::Create(BufferHubRPC::kClientPath)) {}

BufferHubClient::BufferHubClient(LocalChannelHandle channel_handle)
    : Client(ClientChannel::Create(std::move(channel_handle))) {}

bool BufferHubClient::IsValid() const {
  return IsConnected() && GetChannelHandle().valid();
}

LocalChannelHandle BufferHubClient::TakeChannelHandle() {
  if (IsConnected()) {
    return std::move(GetChannelHandle());
  } else {
    return {};
  }
}

DetachedBuffer::DetachedBuffer(uint32_t width, uint32_t height,
DetachedBuffer::DetachedBuffer(uint32_t width, uint32_t height,
                               uint32_t layer_count, uint32_t format,
                               uint32_t layer_count, uint32_t format,
                               uint64_t usage, size_t user_metadata_size) {
                               uint64_t usage, size_t user_metadata_size) {
+3 −23
Original line number Original line Diff line number Diff line
#ifndef ANDROID_DVR_BUFFER_HUB_CLIENT_H_
#ifndef ANDROID_DVR_BUFFER_HUB_CLIENT_H_
#define ANDROID_DVR_BUFFER_HUB_CLIENT_H_
#define ANDROID_DVR_BUFFER_HUB_CLIENT_H_


#include <pdx/channel_handle.h>
// TODO(b/116855254): This header is completely deprecated and replaced by
#include <pdx/client.h>
// consumer_buffer.h and producer_buffer.h. Remove this file once all references
// to it has been removed.
#include <private/dvr/consumer_buffer.h>
#include <private/dvr/consumer_buffer.h>
#include <private/dvr/producer_buffer.h>
#include <private/dvr/producer_buffer.h>


namespace android {
namespace dvr {

class BufferHubClient : public pdx::Client {
 public:
  BufferHubClient();
  explicit BufferHubClient(pdx::LocalChannelHandle channel_handle);

  bool IsValid() const;
  pdx::LocalChannelHandle TakeChannelHandle();

  using pdx::Client::Close;
  using pdx::Client::GetChannel;
  using pdx::Client::InvokeRemoteMethod;
  using pdx::Client::IsConnected;
  using pdx::Client::event_fd;
};

}  // namespace dvr
}  // namespace android

#endif  // ANDROID_DVR_BUFFER_HUB_CLIENT_H_
#endif  // ANDROID_DVR_BUFFER_HUB_CLIENT_H_
+18 −1
Original line number Original line Diff line number Diff line
#ifndef ANDROID_DVR_DETACHED_BUFFER_H_
#ifndef ANDROID_DVR_DETACHED_BUFFER_H_
#define ANDROID_DVR_DETACHED_BUFFER_H_
#define ANDROID_DVR_DETACHED_BUFFER_H_


#include <private/dvr/buffer_hub_client.h>
#include <pdx/client.h>
#include <private/dvr/buffer_hub_defs.h>
#include <private/dvr/buffer_hub_metadata.h>
#include <private/dvr/ion_buffer.h>


namespace android {
namespace android {
namespace dvr {
namespace dvr {


class BufferHubClient : public pdx::Client {
 public:
  BufferHubClient();
  explicit BufferHubClient(pdx::LocalChannelHandle channel_handle);

  bool IsValid() const;
  pdx::LocalChannelHandle TakeChannelHandle();

  using pdx::Client::Close;
  using pdx::Client::event_fd;
  using pdx::Client::GetChannel;
  using pdx::Client::InvokeRemoteMethod;
};

class DetachedBuffer {
class DetachedBuffer {
 public:
 public:
  // Allocates a standalone DetachedBuffer not associated with any producer
  // Allocates a standalone DetachedBuffer not associated with any producer