Alex Vakulenko | e4eec20 | 2017-01-27 14:41:04 -0800 | [diff] [blame] | 1 | #include "include/private/dvr/buffer_hub_queue_producer.h" |
| 2 | |
Alex Vakulenko | 4fe6058 | 2017-02-02 11:35:59 -0800 | [diff] [blame] | 3 | #include <inttypes.h> |
| 4 | #include <log/log.h> |
| 5 | |
Alex Vakulenko | e4eec20 | 2017-01-27 14:41:04 -0800 | [diff] [blame] | 6 | namespace android { |
| 7 | namespace dvr { |
| 8 | |
| 9 | BufferHubQueueProducer::BufferHubQueueProducer( |
| 10 | const std::shared_ptr<BufferHubQueueCore>& core) |
Jiwen 'Steve' Cai | 1601bcf | 2017-03-24 14:03:06 -0700 | [diff] [blame] | 11 | : core_(core) {} |
Alex Vakulenko | e4eec20 | 2017-01-27 14:41:04 -0800 | [diff] [blame] | 12 | |
| 13 | status_t BufferHubQueueProducer::requestBuffer(int slot, |
| 14 | sp<GraphicBuffer>* buf) { |
Jiwen 'Steve' Cai | 25fd3fa | 2017-03-20 15:30:21 -0700 | [diff] [blame] | 15 | ALOGD_IF(TRACE, "requestBuffer: slot=%d", slot); |
Alex Vakulenko | e4eec20 | 2017-01-27 14:41:04 -0800 | [diff] [blame] | 16 | |
| 17 | std::unique_lock<std::mutex> lock(core_->mutex_); |
| 18 | |
Jiwen 'Steve' Cai | 1601bcf | 2017-03-24 14:03:06 -0700 | [diff] [blame] | 19 | if (core_->connected_api_ == BufferHubQueueCore::kNoConnectedApi) { |
| 20 | ALOGE("requestBuffer: BufferHubQueueProducer has no connected producer"); |
| 21 | return NO_INIT; |
| 22 | } |
| 23 | |
| 24 | if (slot < 0 || slot >= max_buffer_count_) { |
Alex Vakulenko | 4fe6058 | 2017-02-02 11:35:59 -0800 | [diff] [blame] | 25 | ALOGE("requestBuffer: slot index %d out of range [0, %d)", slot, |
Jiwen 'Steve' Cai | 1601bcf | 2017-03-24 14:03:06 -0700 | [diff] [blame] | 26 | max_buffer_count_); |
Alex Vakulenko | e4eec20 | 2017-01-27 14:41:04 -0800 | [diff] [blame] | 27 | return BAD_VALUE; |
| 28 | } else if (!core_->buffers_[slot].mBufferState.isDequeued()) { |
Alex Vakulenko | 4fe6058 | 2017-02-02 11:35:59 -0800 | [diff] [blame] | 29 | ALOGE("requestBuffer: slot %d is not owned by the producer (state = %s)", |
| 30 | slot, core_->buffers_[slot].mBufferState.string()); |
Alex Vakulenko | e4eec20 | 2017-01-27 14:41:04 -0800 | [diff] [blame] | 31 | return BAD_VALUE; |
Jiwen 'Steve' Cai | 1601bcf | 2017-03-24 14:03:06 -0700 | [diff] [blame] | 32 | } else if (core_->buffers_[slot].mGraphicBuffer != nullptr) { |
| 33 | ALOGE("requestBuffer: slot %d is not empty.", slot); |
| 34 | return BAD_VALUE; |
| 35 | } else if (core_->buffers_[slot].mBufferProducer == nullptr) { |
| 36 | ALOGE("requestBuffer: slot %d is not dequeued.", slot); |
| 37 | return BAD_VALUE; |
Alex Vakulenko | e4eec20 | 2017-01-27 14:41:04 -0800 | [diff] [blame] | 38 | } |
| 39 | |
Jiwen 'Steve' Cai | 1601bcf | 2017-03-24 14:03:06 -0700 | [diff] [blame] | 40 | const auto& buffer_producer = core_->buffers_[slot].mBufferProducer; |
Corey Tabaka | cd52dd9 | 2017-04-07 18:03:57 -0700 | [diff] [blame] | 41 | sp<GraphicBuffer> graphic_buffer = buffer_producer->buffer()->buffer(); |
Jiwen 'Steve' Cai | 1601bcf | 2017-03-24 14:03:06 -0700 | [diff] [blame] | 42 | |
Jiwen 'Steve' Cai | 1601bcf | 2017-03-24 14:03:06 -0700 | [diff] [blame] | 43 | core_->buffers_[slot].mGraphicBuffer = graphic_buffer; |
Alex Vakulenko | e4eec20 | 2017-01-27 14:41:04 -0800 | [diff] [blame] | 44 | core_->buffers_[slot].mRequestBufferCalled = true; |
Jiwen 'Steve' Cai | 1601bcf | 2017-03-24 14:03:06 -0700 | [diff] [blame] | 45 | |
| 46 | *buf = graphic_buffer; |
Alex Vakulenko | e4eec20 | 2017-01-27 14:41:04 -0800 | [diff] [blame] | 47 | return NO_ERROR; |
| 48 | } |
| 49 | |
| 50 | status_t BufferHubQueueProducer::setMaxDequeuedBufferCount( |
| 51 | int max_dequeued_buffers) { |
Jiwen 'Steve' Cai | 25fd3fa | 2017-03-20 15:30:21 -0700 | [diff] [blame] | 52 | ALOGD_IF(TRACE, "setMaxDequeuedBufferCount: max_dequeued_buffers=%d", |
| 53 | max_dequeued_buffers); |
Alex Vakulenko | e4eec20 | 2017-01-27 14:41:04 -0800 | [diff] [blame] | 54 | |
| 55 | std::unique_lock<std::mutex> lock(core_->mutex_); |
| 56 | |
| 57 | if (max_dequeued_buffers <= 0 || |
| 58 | max_dequeued_buffers > |
Jiwen 'Steve' Cai | cb4751c | 2017-04-14 17:56:55 -0700 | [diff] [blame] | 59 | static_cast<int>(BufferHubQueue::kMaxQueueCapacity - |
| 60 | BufferHubQueueCore::kDefaultUndequeuedBuffers)) { |
Alex Vakulenko | 4fe6058 | 2017-02-02 11:35:59 -0800 | [diff] [blame] | 61 | ALOGE("setMaxDequeuedBufferCount: %d out of range (0, %zu]", |
| 62 | max_dequeued_buffers, BufferHubQueue::kMaxQueueCapacity); |
Alex Vakulenko | e4eec20 | 2017-01-27 14:41:04 -0800 | [diff] [blame] | 63 | return BAD_VALUE; |
| 64 | } |
| 65 | |
Jiwen 'Steve' Cai | 1601bcf | 2017-03-24 14:03:06 -0700 | [diff] [blame] | 66 | // The new dequeued_buffers count should not be violated by the number |
| 67 | // of currently dequeued buffers. |
| 68 | int dequeued_count = 0; |
| 69 | for (const auto& buf : core_->buffers_) { |
| 70 | if (buf.mBufferState.isDequeued()) { |
| 71 | dequeued_count++; |
| 72 | } |
| 73 | } |
| 74 | if (dequeued_count > max_dequeued_buffers) { |
| 75 | ALOGE( |
| 76 | "setMaxDequeuedBufferCount: the requested dequeued_buffers" |
| 77 | "count (%d) exceeds the current dequeued buffer count (%d)", |
| 78 | max_dequeued_buffers, dequeued_count); |
| 79 | return BAD_VALUE; |
| 80 | } |
| 81 | |
| 82 | max_dequeued_buffer_count_ = max_dequeued_buffers; |
Alex Vakulenko | e4eec20 | 2017-01-27 14:41:04 -0800 | [diff] [blame] | 83 | return NO_ERROR; |
| 84 | } |
| 85 | |
Jiwen 'Steve' Cai | 1601bcf | 2017-03-24 14:03:06 -0700 | [diff] [blame] | 86 | status_t BufferHubQueueProducer::setAsyncMode(bool async) { |
| 87 | if (async) { |
| 88 | // TODO(b/36724099) BufferHubQueue's consumer end always acquires the buffer |
| 89 | // automatically and behaves differently from IGraphicBufferConsumer. Thus, |
| 90 | // android::BufferQueue's async mode (a.k.a. allocating an additional buffer |
| 91 | // to prevent dequeueBuffer from being blocking) technically does not apply |
| 92 | // here. |
| 93 | // |
| 94 | // In Daydream, non-blocking producer side dequeue is guaranteed by careful |
| 95 | // buffer consumer implementations. In another word, BufferHubQueue based |
| 96 | // dequeueBuffer should never block whether setAsyncMode(true) is set or |
| 97 | // not. |
| 98 | // |
| 99 | // See: IGraphicBufferProducer::setAsyncMode and |
| 100 | // BufferQueueProducer::setAsyncMode for more about original implementation. |
| 101 | ALOGW( |
| 102 | "BufferHubQueueProducer::setAsyncMode: BufferHubQueue should always be " |
| 103 | "asynchronous. This call makes no effact."); |
| 104 | return NO_ERROR; |
| 105 | } |
| 106 | return NO_ERROR; |
Alex Vakulenko | e4eec20 | 2017-01-27 14:41:04 -0800 | [diff] [blame] | 107 | } |
| 108 | |
Jiwen 'Steve' Cai | 1601bcf | 2017-03-24 14:03:06 -0700 | [diff] [blame] | 109 | status_t BufferHubQueueProducer::dequeueBuffer( |
| 110 | int* out_slot, sp<Fence>* out_fence, uint32_t width, uint32_t height, |
| 111 | PixelFormat format, uint32_t usage, |
| 112 | FrameEventHistoryDelta* /* out_timestamps */) { |
Jiwen 'Steve' Cai | 25fd3fa | 2017-03-20 15:30:21 -0700 | [diff] [blame] | 113 | ALOGD_IF(TRACE, "dequeueBuffer: w=%u, h=%u, format=%d, usage=%u", width, |
| 114 | height, format, usage); |
Alex Vakulenko | e4eec20 | 2017-01-27 14:41:04 -0800 | [diff] [blame] | 115 | |
| 116 | status_t ret; |
| 117 | std::unique_lock<std::mutex> lock(core_->mutex_); |
| 118 | |
Jiwen 'Steve' Cai | 1601bcf | 2017-03-24 14:03:06 -0700 | [diff] [blame] | 119 | if (core_->connected_api_ == BufferHubQueueCore::kNoConnectedApi) { |
| 120 | ALOGE("dequeueBuffer: BufferQueue has no connected producer"); |
| 121 | return NO_INIT; |
| 122 | } |
| 123 | |
Hendrik Wagenaar | 108e84f | 2017-05-07 22:19:17 -0700 | [diff] [blame^] | 124 | const uint32_t kLayerCount = 1; |
Jiwen 'Steve' Cai | 1601bcf | 2017-03-24 14:03:06 -0700 | [diff] [blame] | 125 | if (static_cast<int32_t>(core_->producer_->capacity()) < |
Jiwen 'Steve' Cai | cb4751c | 2017-04-14 17:56:55 -0700 | [diff] [blame] | 126 | max_dequeued_buffer_count_ + |
| 127 | BufferHubQueueCore::kDefaultUndequeuedBuffers) { |
Alex Vakulenko | e4eec20 | 2017-01-27 14:41:04 -0800 | [diff] [blame] | 128 | // Lazy allocation. When the capacity of |core_->producer_| has not reach |
Jiwen 'Steve' Cai | 1601bcf | 2017-03-24 14:03:06 -0700 | [diff] [blame] | 129 | // |max_dequeued_buffer_count_|, allocate new buffer. |
Alex Vakulenko | e4eec20 | 2017-01-27 14:41:04 -0800 | [diff] [blame] | 130 | // TODO(jwcai) To save memory, the really reasonable thing to do is to go |
| 131 | // over existing slots and find first existing one to dequeue. |
Hendrik Wagenaar | 108e84f | 2017-05-07 22:19:17 -0700 | [diff] [blame^] | 132 | ret = core_->AllocateBuffer(width, height, kLayerCount, format, usage); |
Alex Vakulenko | e4eec20 | 2017-01-27 14:41:04 -0800 | [diff] [blame] | 133 | if (ret < 0) |
| 134 | return ret; |
| 135 | } |
| 136 | |
| 137 | size_t slot; |
| 138 | std::shared_ptr<BufferProducer> buffer_producer; |
| 139 | |
| 140 | for (size_t retry = 0; retry < BufferHubQueue::kMaxQueueCapacity; retry++) { |
Jiwen 'Steve' Cai | ed65432 | 2017-03-13 17:04:43 -0700 | [diff] [blame] | 141 | LocalHandle fence; |
Hendrik Wagenaar | 4d3590f | 2017-05-06 22:36:04 -0700 | [diff] [blame] | 142 | auto buffer_status = |
Jiwen 'Steve' Cai | ed65432 | 2017-03-13 17:04:43 -0700 | [diff] [blame] | 143 | core_->producer_->Dequeue(core_->dequeue_timeout_ms_, &slot, &fence); |
Alex Vakulenko | e4eec20 | 2017-01-27 14:41:04 -0800 | [diff] [blame] | 144 | if (!buffer_producer) |
| 145 | return NO_MEMORY; |
| 146 | |
Corey Tabaka | 9d8bd09 | 2017-04-25 16:47:44 -0700 | [diff] [blame] | 147 | buffer_producer = buffer_status.take(); |
| 148 | |
Corey Tabaka | cd52dd9 | 2017-04-07 18:03:57 -0700 | [diff] [blame] | 149 | if (width == buffer_producer->width() && |
| 150 | height == buffer_producer->height() && |
| 151 | static_cast<uint32_t>(format) == buffer_producer->format()) { |
Alex Vakulenko | e4eec20 | 2017-01-27 14:41:04 -0800 | [diff] [blame] | 152 | // The producer queue returns a buffer producer matches the request. |
| 153 | break; |
| 154 | } |
| 155 | |
| 156 | // Needs reallocation. |
| 157 | // TODO(jwcai) Consider use VLOG instead if we find this log is not useful. |
Alex Vakulenko | 4fe6058 | 2017-02-02 11:35:59 -0800 | [diff] [blame] | 158 | ALOGI( |
Corey Tabaka | cd52dd9 | 2017-04-07 18:03:57 -0700 | [diff] [blame] | 159 | "dequeueBuffer: requested buffer (w=%u, h=%u, format=%u) is different " |
| 160 | "from the buffer returned at slot: %zu (w=%u, h=%u, format=%u). Need " |
Alex Vakulenko | 4fe6058 | 2017-02-02 11:35:59 -0800 | [diff] [blame] | 161 | "re-allocattion.", |
| 162 | width, height, format, slot, buffer_producer->width(), |
| 163 | buffer_producer->height(), buffer_producer->format()); |
Alex Vakulenko | e4eec20 | 2017-01-27 14:41:04 -0800 | [diff] [blame] | 164 | // Mark the slot as reallocating, so that later we can set |
| 165 | // BUFFER_NEEDS_REALLOCATION when the buffer actually get dequeued. |
| 166 | core_->buffers_[slot].mIsReallocating = true; |
| 167 | |
| 168 | // Detach the old buffer once the allocation before allocating its |
| 169 | // replacement. |
| 170 | core_->DetachBuffer(slot); |
| 171 | |
| 172 | // Allocate a new producer buffer with new buffer configs. Note that if |
| 173 | // there are already multiple buffers in the queue, the next one returned |
| 174 | // from |core_->producer_->Dequeue| may not be the new buffer we just |
| 175 | // reallocated. Retry up to BufferHubQueue::kMaxQueueCapacity times. |
Hendrik Wagenaar | 108e84f | 2017-05-07 22:19:17 -0700 | [diff] [blame^] | 176 | ret = core_->AllocateBuffer(width, height, kLayerCount, format, usage); |
Alex Vakulenko | e4eec20 | 2017-01-27 14:41:04 -0800 | [diff] [blame] | 177 | if (ret < 0) |
| 178 | return ret; |
| 179 | } |
| 180 | |
| 181 | // With the BufferHub backed solution. Buffer slot returned from |
| 182 | // |core_->producer_->Dequeue| is guaranteed to avaiable for producer's use. |
| 183 | // It's either in free state (if the buffer has never been used before) or |
| 184 | // in queued state (if the buffer has been dequeued and queued back to |
| 185 | // BufferHubQueue). |
| 186 | // TODO(jwcai) Clean this up, make mBufferState compatible with BufferHub's |
| 187 | // model. |
Jiwen 'Steve' Cai | 1601bcf | 2017-03-24 14:03:06 -0700 | [diff] [blame] | 188 | LOG_ALWAYS_FATAL_IF((!core_->buffers_[slot].mBufferState.isFree() && |
| 189 | !core_->buffers_[slot].mBufferState.isQueued()), |
Alex Vakulenko | 4fe6058 | 2017-02-02 11:35:59 -0800 | [diff] [blame] | 190 | "dequeueBuffer: slot %zu is not free or queued.", slot); |
Alex Vakulenko | e4eec20 | 2017-01-27 14:41:04 -0800 | [diff] [blame] | 191 | |
| 192 | core_->buffers_[slot].mBufferState.freeQueued(); |
| 193 | core_->buffers_[slot].mBufferState.dequeue(); |
Jiwen 'Steve' Cai | 25fd3fa | 2017-03-20 15:30:21 -0700 | [diff] [blame] | 194 | ALOGD_IF(TRACE, "dequeueBuffer: slot=%zu", slot); |
Alex Vakulenko | e4eec20 | 2017-01-27 14:41:04 -0800 | [diff] [blame] | 195 | |
| 196 | // TODO(jwcai) Handle fence properly. |BufferHub| has full fence support, we |
| 197 | // just need to exopose that through |BufferHubQueue| once we need fence. |
| 198 | *out_fence = Fence::NO_FENCE; |
| 199 | *out_slot = slot; |
| 200 | ret = NO_ERROR; |
| 201 | |
| 202 | if (core_->buffers_[slot].mIsReallocating) { |
| 203 | ret |= BUFFER_NEEDS_REALLOCATION; |
| 204 | core_->buffers_[slot].mIsReallocating = false; |
| 205 | } |
| 206 | |
| 207 | return ret; |
| 208 | } |
| 209 | |
| 210 | status_t BufferHubQueueProducer::detachBuffer(int /* slot */) { |
Alex Vakulenko | 4fe6058 | 2017-02-02 11:35:59 -0800 | [diff] [blame] | 211 | ALOGE("BufferHubQueueProducer::detachBuffer not implemented."); |
Alex Vakulenko | e4eec20 | 2017-01-27 14:41:04 -0800 | [diff] [blame] | 212 | return INVALID_OPERATION; |
| 213 | } |
| 214 | |
| 215 | status_t BufferHubQueueProducer::detachNextBuffer( |
| 216 | sp<GraphicBuffer>* /* out_buffer */, sp<Fence>* /* out_fence */) { |
Alex Vakulenko | 4fe6058 | 2017-02-02 11:35:59 -0800 | [diff] [blame] | 217 | ALOGE("BufferHubQueueProducer::detachNextBuffer not implemented."); |
Alex Vakulenko | e4eec20 | 2017-01-27 14:41:04 -0800 | [diff] [blame] | 218 | return INVALID_OPERATION; |
| 219 | } |
| 220 | |
| 221 | status_t BufferHubQueueProducer::attachBuffer( |
| 222 | int* /* out_slot */, const sp<GraphicBuffer>& /* buffer */) { |
| 223 | // With this BufferHub backed implementation, we assume (for now) all buffers |
| 224 | // are allocated and owned by the BufferHub. Thus the attempt of transfering |
| 225 | // ownership of a buffer to the buffer queue is intentionally unsupported. |
Alex Vakulenko | 4fe6058 | 2017-02-02 11:35:59 -0800 | [diff] [blame] | 226 | LOG_ALWAYS_FATAL("BufferHubQueueProducer::attachBuffer not supported."); |
Alex Vakulenko | e4eec20 | 2017-01-27 14:41:04 -0800 | [diff] [blame] | 227 | return INVALID_OPERATION; |
| 228 | } |
| 229 | |
| 230 | status_t BufferHubQueueProducer::queueBuffer(int slot, |
| 231 | const QueueBufferInput& input, |
Jiwen 'Steve' Cai | 1601bcf | 2017-03-24 14:03:06 -0700 | [diff] [blame] | 232 | QueueBufferOutput* output) { |
Jiwen 'Steve' Cai | 25fd3fa | 2017-03-20 15:30:21 -0700 | [diff] [blame] | 233 | ALOGD_IF(TRACE, "queueBuffer: slot %d", slot); |
Alex Vakulenko | e4eec20 | 2017-01-27 14:41:04 -0800 | [diff] [blame] | 234 | |
Jiwen 'Steve' Cai | 1601bcf | 2017-03-24 14:03:06 -0700 | [diff] [blame] | 235 | if (output == nullptr) { |
| 236 | return BAD_VALUE; |
| 237 | } |
| 238 | |
Alex Vakulenko | e4eec20 | 2017-01-27 14:41:04 -0800 | [diff] [blame] | 239 | int64_t timestamp; |
Alex Vakulenko | e4eec20 | 2017-01-27 14:41:04 -0800 | [diff] [blame] | 240 | bool is_auto_timestamp; |
Jiwen 'Steve' Cai | cb4751c | 2017-04-14 17:56:55 -0700 | [diff] [blame] | 241 | android_dataspace dataspace; |
| 242 | Rect crop(Rect::EMPTY_RECT); |
| 243 | int scaling_mode; |
Alex Vakulenko | e4eec20 | 2017-01-27 14:41:04 -0800 | [diff] [blame] | 244 | uint32_t transform; |
Jiwen 'Steve' Cai | cb4751c | 2017-04-14 17:56:55 -0700 | [diff] [blame] | 245 | sp<Fence> fence; |
Alex Vakulenko | e4eec20 | 2017-01-27 14:41:04 -0800 | [diff] [blame] | 246 | |
Jiwen 'Steve' Cai | cb4751c | 2017-04-14 17:56:55 -0700 | [diff] [blame] | 247 | input.deflate(×tamp, &is_auto_timestamp, &dataspace, &crop, |
Alex Vakulenko | e4eec20 | 2017-01-27 14:41:04 -0800 | [diff] [blame] | 248 | &scaling_mode, &transform, &fence); |
| 249 | |
Jiwen 'Steve' Cai | 1601bcf | 2017-03-24 14:03:06 -0700 | [diff] [blame] | 250 | // Check input scaling mode is valid. |
| 251 | switch (scaling_mode) { |
| 252 | case NATIVE_WINDOW_SCALING_MODE_FREEZE: |
| 253 | case NATIVE_WINDOW_SCALING_MODE_SCALE_TO_WINDOW: |
| 254 | case NATIVE_WINDOW_SCALING_MODE_SCALE_CROP: |
| 255 | case NATIVE_WINDOW_SCALING_MODE_NO_SCALE_CROP: |
| 256 | break; |
| 257 | default: |
| 258 | ALOGE("queueBuffer: unknown scaling mode %d", scaling_mode); |
| 259 | return BAD_VALUE; |
| 260 | } |
| 261 | |
| 262 | // Check input fence is valid. |
Alex Vakulenko | e4eec20 | 2017-01-27 14:41:04 -0800 | [diff] [blame] | 263 | if (fence == nullptr) { |
Alex Vakulenko | 4fe6058 | 2017-02-02 11:35:59 -0800 | [diff] [blame] | 264 | ALOGE("queueBuffer: fence is NULL"); |
Alex Vakulenko | e4eec20 | 2017-01-27 14:41:04 -0800 | [diff] [blame] | 265 | return BAD_VALUE; |
| 266 | } |
| 267 | |
| 268 | status_t ret; |
| 269 | std::unique_lock<std::mutex> lock(core_->mutex_); |
| 270 | |
Jiwen 'Steve' Cai | 1601bcf | 2017-03-24 14:03:06 -0700 | [diff] [blame] | 271 | if (core_->connected_api_ == BufferHubQueueCore::kNoConnectedApi) { |
| 272 | ALOGE("queueBuffer: BufferQueue has no connected producer"); |
| 273 | return NO_INIT; |
| 274 | } |
| 275 | |
| 276 | if (slot < 0 || slot >= max_buffer_count_) { |
Alex Vakulenko | 4fe6058 | 2017-02-02 11:35:59 -0800 | [diff] [blame] | 277 | ALOGE("queueBuffer: slot index %d out of range [0, %d)", slot, |
Jiwen 'Steve' Cai | 1601bcf | 2017-03-24 14:03:06 -0700 | [diff] [blame] | 278 | max_buffer_count_); |
Alex Vakulenko | e4eec20 | 2017-01-27 14:41:04 -0800 | [diff] [blame] | 279 | return BAD_VALUE; |
| 280 | } else if (!core_->buffers_[slot].mBufferState.isDequeued()) { |
Alex Vakulenko | 4fe6058 | 2017-02-02 11:35:59 -0800 | [diff] [blame] | 281 | ALOGE("queueBuffer: slot %d is not owned by the producer (state = %s)", |
| 282 | slot, core_->buffers_[slot].mBufferState.string()); |
Alex Vakulenko | e4eec20 | 2017-01-27 14:41:04 -0800 | [diff] [blame] | 283 | return BAD_VALUE; |
Jiwen 'Steve' Cai | 1601bcf | 2017-03-24 14:03:06 -0700 | [diff] [blame] | 284 | } else if ((!core_->buffers_[slot].mRequestBufferCalled || |
| 285 | core_->buffers_[slot].mGraphicBuffer == nullptr)) { |
| 286 | ALOGE( |
| 287 | "queueBuffer: slot %d is not requested (mRequestBufferCalled=%d, " |
| 288 | "mGraphicBuffer=%p)", |
| 289 | slot, core_->buffers_[slot].mRequestBufferCalled, |
| 290 | core_->buffers_[slot].mGraphicBuffer.get()); |
| 291 | return BAD_VALUE; |
Alex Vakulenko | e4eec20 | 2017-01-27 14:41:04 -0800 | [diff] [blame] | 292 | } |
| 293 | |
| 294 | // Post the buffer producer with timestamp in the metadata. |
Jiwen 'Steve' Cai | 1601bcf | 2017-03-24 14:03:06 -0700 | [diff] [blame] | 295 | const auto& buffer_producer = core_->buffers_[slot].mBufferProducer; |
| 296 | |
| 297 | // Check input crop is not out of boundary of current buffer. |
| 298 | Rect buffer_rect(buffer_producer->width(), buffer_producer->height()); |
| 299 | Rect cropped_rect(Rect::EMPTY_RECT); |
| 300 | crop.intersect(buffer_rect, &cropped_rect); |
| 301 | if (cropped_rect != crop) { |
| 302 | ALOGE("queueBuffer: slot %d has out-of-boundary crop.", slot); |
| 303 | return BAD_VALUE; |
| 304 | } |
| 305 | |
Alex Vakulenko | e4eec20 | 2017-01-27 14:41:04 -0800 | [diff] [blame] | 306 | LocalHandle fence_fd(fence->isValid() ? fence->dup() : -1); |
| 307 | |
Jiwen 'Steve' Cai | cb4751c | 2017-04-14 17:56:55 -0700 | [diff] [blame] | 308 | BufferHubQueueCore::NativeBufferMetadata meta_data = {}; |
| 309 | meta_data.timestamp = timestamp; |
| 310 | meta_data.is_auto_timestamp = static_cast<int32_t>(is_auto_timestamp); |
| 311 | meta_data.dataspace = static_cast<int32_t>(dataspace); |
| 312 | meta_data.crop_left = crop.left; |
| 313 | meta_data.crop_top = crop.top; |
| 314 | meta_data.crop_right = crop.right; |
| 315 | meta_data.crop_bottom = crop.bottom; |
| 316 | meta_data.scaling_mode = static_cast<int32_t>(scaling_mode); |
| 317 | meta_data.transform = static_cast<int32_t>(transform); |
| 318 | |
Alex Vakulenko | e4eec20 | 2017-01-27 14:41:04 -0800 | [diff] [blame] | 319 | buffer_producer->Post(fence_fd, &meta_data, sizeof(meta_data)); |
| 320 | core_->buffers_[slot].mBufferState.queue(); |
| 321 | |
Jiwen 'Steve' Cai | 1601bcf | 2017-03-24 14:03:06 -0700 | [diff] [blame] | 322 | output->width = buffer_producer->width(); |
| 323 | output->height = buffer_producer->height(); |
Corey Tabaka | cd52dd9 | 2017-04-07 18:03:57 -0700 | [diff] [blame] | 324 | output->transformHint = 0; // default value, we don't use it yet. |
Jiwen 'Steve' Cai | 1601bcf | 2017-03-24 14:03:06 -0700 | [diff] [blame] | 325 | |
| 326 | // |numPendingBuffers| counts of the number of buffers that has been enqueued |
| 327 | // by the producer but not yet acquired by the consumer. Due to the nature |
| 328 | // of BufferHubQueue design, this is hard to trace from the producer's client |
| 329 | // side, but it's safe to assume it's zero. |
| 330 | output->numPendingBuffers = 0; |
| 331 | |
| 332 | // Note that we are not setting nextFrameNumber here as it seems to be only |
| 333 | // used by surface flinger. See more at b/22802885, ag/791760. |
| 334 | output->nextFrameNumber = 0; |
| 335 | |
Alex Vakulenko | e4eec20 | 2017-01-27 14:41:04 -0800 | [diff] [blame] | 336 | return NO_ERROR; |
| 337 | } |
| 338 | |
| 339 | status_t BufferHubQueueProducer::cancelBuffer(int slot, |
| 340 | const sp<Fence>& fence) { |
Jiwen 'Steve' Cai | 25fd3fa | 2017-03-20 15:30:21 -0700 | [diff] [blame] | 341 | ALOGD_IF(TRACE, __FUNCTION__); |
Alex Vakulenko | e4eec20 | 2017-01-27 14:41:04 -0800 | [diff] [blame] | 342 | |
| 343 | std::unique_lock<std::mutex> lock(core_->mutex_); |
| 344 | |
Jiwen 'Steve' Cai | 1601bcf | 2017-03-24 14:03:06 -0700 | [diff] [blame] | 345 | if (core_->connected_api_ == BufferHubQueueCore::kNoConnectedApi) { |
| 346 | ALOGE("cancelBuffer: BufferQueue has no connected producer"); |
| 347 | return NO_INIT; |
| 348 | } |
| 349 | |
| 350 | if (slot < 0 || slot >= max_buffer_count_) { |
Alex Vakulenko | 4fe6058 | 2017-02-02 11:35:59 -0800 | [diff] [blame] | 351 | ALOGE("cancelBuffer: slot index %d out of range [0, %d)", slot, |
Jiwen 'Steve' Cai | 1601bcf | 2017-03-24 14:03:06 -0700 | [diff] [blame] | 352 | max_buffer_count_); |
Alex Vakulenko | e4eec20 | 2017-01-27 14:41:04 -0800 | [diff] [blame] | 353 | return BAD_VALUE; |
| 354 | } else if (!core_->buffers_[slot].mBufferState.isDequeued()) { |
Alex Vakulenko | 4fe6058 | 2017-02-02 11:35:59 -0800 | [diff] [blame] | 355 | ALOGE("cancelBuffer: slot %d is not owned by the producer (state = %s)", |
| 356 | slot, core_->buffers_[slot].mBufferState.string()); |
Alex Vakulenko | e4eec20 | 2017-01-27 14:41:04 -0800 | [diff] [blame] | 357 | return BAD_VALUE; |
Jiwen 'Steve' Cai | 1601bcf | 2017-03-24 14:03:06 -0700 | [diff] [blame] | 358 | } else if (fence == nullptr) { |
Alex Vakulenko | 4fe6058 | 2017-02-02 11:35:59 -0800 | [diff] [blame] | 359 | ALOGE("cancelBuffer: fence is NULL"); |
Alex Vakulenko | e4eec20 | 2017-01-27 14:41:04 -0800 | [diff] [blame] | 360 | return BAD_VALUE; |
| 361 | } |
| 362 | |
| 363 | auto buffer_producer = core_->buffers_[slot].mBufferProducer; |
| 364 | core_->producer_->Enqueue(buffer_producer, slot); |
| 365 | core_->buffers_[slot].mBufferState.cancel(); |
| 366 | core_->buffers_[slot].mFence = fence; |
Jiwen 'Steve' Cai | 25fd3fa | 2017-03-20 15:30:21 -0700 | [diff] [blame] | 367 | ALOGD_IF(TRACE, "cancelBuffer: slot %d", slot); |
Alex Vakulenko | e4eec20 | 2017-01-27 14:41:04 -0800 | [diff] [blame] | 368 | |
| 369 | return NO_ERROR; |
| 370 | } |
| 371 | |
| 372 | status_t BufferHubQueueProducer::query(int what, int* out_value) { |
Jiwen 'Steve' Cai | 25fd3fa | 2017-03-20 15:30:21 -0700 | [diff] [blame] | 373 | ALOGD_IF(TRACE, __FUNCTION__); |
Alex Vakulenko | e4eec20 | 2017-01-27 14:41:04 -0800 | [diff] [blame] | 374 | |
| 375 | std::unique_lock<std::mutex> lock(core_->mutex_); |
| 376 | |
Jiwen 'Steve' Cai | 1601bcf | 2017-03-24 14:03:06 -0700 | [diff] [blame] | 377 | if (out_value == nullptr) { |
Alex Vakulenko | 4fe6058 | 2017-02-02 11:35:59 -0800 | [diff] [blame] | 378 | ALOGE("query: out_value was NULL"); |
Alex Vakulenko | e4eec20 | 2017-01-27 14:41:04 -0800 | [diff] [blame] | 379 | return BAD_VALUE; |
| 380 | } |
| 381 | |
| 382 | int value = 0; |
| 383 | switch (what) { |
| 384 | case NATIVE_WINDOW_MIN_UNDEQUEUED_BUFFERS: |
Jiwen 'Steve' Cai | cb4751c | 2017-04-14 17:56:55 -0700 | [diff] [blame] | 385 | // TODO(b/36187402) This should be the maximum number of buffers that this |
| 386 | // producer queue's consumer can acquire. Set to be at least one. Need to |
| 387 | // find a way to set from the consumer side. |
| 388 | value = BufferHubQueueCore::kDefaultUndequeuedBuffers; |
Alex Vakulenko | e4eec20 | 2017-01-27 14:41:04 -0800 | [diff] [blame] | 389 | break; |
| 390 | case NATIVE_WINDOW_BUFFER_AGE: |
| 391 | value = 0; |
| 392 | break; |
Jiwen 'Steve' Cai | 1601bcf | 2017-03-24 14:03:06 -0700 | [diff] [blame] | 393 | case NATIVE_WINDOW_WIDTH: |
| 394 | value = core_->producer_->default_width(); |
| 395 | break; |
| 396 | case NATIVE_WINDOW_HEIGHT: |
| 397 | value = core_->producer_->default_height(); |
| 398 | break; |
| 399 | case NATIVE_WINDOW_FORMAT: |
| 400 | value = core_->producer_->default_format(); |
| 401 | break; |
| 402 | case NATIVE_WINDOW_CONSUMER_RUNNING_BEHIND: |
| 403 | // BufferHubQueue is always operating in async mode, thus semantically |
| 404 | // consumer can never be running behind. See BufferQueueCore.cpp core |
| 405 | // for more information about the original meaning of this flag. |
| 406 | value = 0; |
| 407 | break; |
| 408 | case NATIVE_WINDOW_CONSUMER_USAGE_BITS: |
| 409 | // TODO(jwcai) This is currently not implement as we don't need |
| 410 | // IGraphicBufferConsumer parity. |
| 411 | value = 0; |
| 412 | break; |
Alex Vakulenko | e4eec20 | 2017-01-27 14:41:04 -0800 | [diff] [blame] | 413 | case NATIVE_WINDOW_DEFAULT_DATASPACE: |
Jiwen 'Steve' Cai | cb4751c | 2017-04-14 17:56:55 -0700 | [diff] [blame] | 414 | // TODO(jwcai) Return the default value android::BufferQueue is using as |
| 415 | // there is no way dvr::ConsumerQueue can set it. |
| 416 | value = 0; // HAL_DATASPACE_UNKNOWN |
| 417 | break; |
| 418 | case NATIVE_WINDOW_STICKY_TRANSFORM: |
| 419 | // TODO(jwcai) Return the default value android::BufferQueue is using as |
| 420 | // there is no way dvr::ConsumerQueue can set it. |
| 421 | value = 0; |
| 422 | break; |
Alex Vakulenko | e4eec20 | 2017-01-27 14:41:04 -0800 | [diff] [blame] | 423 | default: |
| 424 | return BAD_VALUE; |
| 425 | } |
| 426 | |
Jiwen 'Steve' Cai | 25fd3fa | 2017-03-20 15:30:21 -0700 | [diff] [blame] | 427 | ALOGD_IF(TRACE, "query: key=%d, v=%d", what, value); |
Alex Vakulenko | e4eec20 | 2017-01-27 14:41:04 -0800 | [diff] [blame] | 428 | *out_value = value; |
| 429 | return NO_ERROR; |
| 430 | } |
| 431 | |
| 432 | status_t BufferHubQueueProducer::connect( |
Jiwen 'Steve' Cai | 1601bcf | 2017-03-24 14:03:06 -0700 | [diff] [blame] | 433 | const sp<IProducerListener>& /* listener */, int api, |
| 434 | bool /* producer_controlled_by_app */, QueueBufferOutput* output) { |
Alex Vakulenko | e4eec20 | 2017-01-27 14:41:04 -0800 | [diff] [blame] | 435 | // Consumer interaction are actually handled by buffer hub, and we need |
Jiwen 'Steve' Cai | 1601bcf | 2017-03-24 14:03:06 -0700 | [diff] [blame] | 436 | // to maintain consumer operations here. We only need to perform basic input |
| 437 | // parameter checks here. |
Jiwen 'Steve' Cai | 25fd3fa | 2017-03-20 15:30:21 -0700 | [diff] [blame] | 438 | ALOGD_IF(TRACE, __FUNCTION__); |
Jiwen 'Steve' Cai | 1601bcf | 2017-03-24 14:03:06 -0700 | [diff] [blame] | 439 | |
| 440 | if (output == nullptr) { |
| 441 | return BAD_VALUE; |
| 442 | } |
| 443 | |
| 444 | std::unique_lock<std::mutex> lock(core_->mutex_); |
| 445 | |
| 446 | if (core_->connected_api_ != BufferHubQueueCore::kNoConnectedApi) { |
| 447 | return BAD_VALUE; |
| 448 | } |
| 449 | |
| 450 | switch (api) { |
| 451 | case NATIVE_WINDOW_API_EGL: |
| 452 | case NATIVE_WINDOW_API_CPU: |
| 453 | case NATIVE_WINDOW_API_MEDIA: |
| 454 | case NATIVE_WINDOW_API_CAMERA: |
| 455 | core_->connected_api_ = api; |
Jiwen 'Steve' Cai | cb4751c | 2017-04-14 17:56:55 -0700 | [diff] [blame] | 456 | |
| 457 | output->width = core_->producer_->default_width(); |
| 458 | output->height = core_->producer_->default_height(); |
| 459 | |
| 460 | // default values, we don't use them yet. |
| 461 | output->transformHint = 0; |
| 462 | output->numPendingBuffers = 0; |
| 463 | output->nextFrameNumber = 0; |
| 464 | output->bufferReplaced = false; |
| 465 | |
Jiwen 'Steve' Cai | 1601bcf | 2017-03-24 14:03:06 -0700 | [diff] [blame] | 466 | break; |
| 467 | default: |
| 468 | ALOGE("BufferHubQueueProducer::connect: unknow API %d", api); |
| 469 | return BAD_VALUE; |
| 470 | } |
| 471 | |
Alex Vakulenko | e4eec20 | 2017-01-27 14:41:04 -0800 | [diff] [blame] | 472 | return NO_ERROR; |
| 473 | } |
| 474 | |
Corey Tabaka | cd52dd9 | 2017-04-07 18:03:57 -0700 | [diff] [blame] | 475 | status_t BufferHubQueueProducer::disconnect(int api, DisconnectMode /*mode*/) { |
Alex Vakulenko | e4eec20 | 2017-01-27 14:41:04 -0800 | [diff] [blame] | 476 | // Consumer interaction are actually handled by buffer hub, and we need |
Jiwen 'Steve' Cai | 1601bcf | 2017-03-24 14:03:06 -0700 | [diff] [blame] | 477 | // to maintain consumer operations here. We only need to perform basic input |
| 478 | // parameter checks here. |
Jiwen 'Steve' Cai | 25fd3fa | 2017-03-20 15:30:21 -0700 | [diff] [blame] | 479 | ALOGD_IF(TRACE, __FUNCTION__); |
Jiwen 'Steve' Cai | 1601bcf | 2017-03-24 14:03:06 -0700 | [diff] [blame] | 480 | |
| 481 | std::unique_lock<std::mutex> lock(core_->mutex_); |
| 482 | |
Wonsik Kim | 3e198b2 | 2017-04-07 15:43:16 -0700 | [diff] [blame] | 483 | if (BufferHubQueueCore::kNoConnectedApi == core_->connected_api_) { |
| 484 | return NO_INIT; |
| 485 | } else if (api != core_->connected_api_) { |
Jiwen 'Steve' Cai | 1601bcf | 2017-03-24 14:03:06 -0700 | [diff] [blame] | 486 | return BAD_VALUE; |
| 487 | } |
| 488 | |
| 489 | core_->connected_api_ = BufferHubQueueCore::kNoConnectedApi; |
Alex Vakulenko | e4eec20 | 2017-01-27 14:41:04 -0800 | [diff] [blame] | 490 | return NO_ERROR; |
| 491 | } |
| 492 | |
| 493 | status_t BufferHubQueueProducer::setSidebandStream( |
| 494 | const sp<NativeHandle>& stream) { |
Jiwen 'Steve' Cai | 1601bcf | 2017-03-24 14:03:06 -0700 | [diff] [blame] | 495 | if (stream != nullptr) { |
Alex Vakulenko | e4eec20 | 2017-01-27 14:41:04 -0800 | [diff] [blame] | 496 | // TODO(jwcai) Investigate how is is used, maybe use BufferHubBuffer's |
| 497 | // metadata. |
Alex Vakulenko | 4fe6058 | 2017-02-02 11:35:59 -0800 | [diff] [blame] | 498 | ALOGE("SidebandStream is not currently supported."); |
Alex Vakulenko | e4eec20 | 2017-01-27 14:41:04 -0800 | [diff] [blame] | 499 | return INVALID_OPERATION; |
| 500 | } |
| 501 | return NO_ERROR; |
| 502 | } |
| 503 | |
| 504 | void BufferHubQueueProducer::allocateBuffers(uint32_t /* width */, |
| 505 | uint32_t /* height */, |
| 506 | PixelFormat /* format */, |
| 507 | uint32_t /* usage */) { |
| 508 | // TODO(jwcai) |allocateBuffers| aims to preallocate up to the maximum number |
| 509 | // of buffers permitted by the current BufferQueue configuration (aka |
Jiwen 'Steve' Cai | 1601bcf | 2017-03-24 14:03:06 -0700 | [diff] [blame] | 510 | // |max_buffer_count_|). |
Alex Vakulenko | 4fe6058 | 2017-02-02 11:35:59 -0800 | [diff] [blame] | 511 | ALOGE("BufferHubQueueProducer::allocateBuffers not implemented."); |
Alex Vakulenko | e4eec20 | 2017-01-27 14:41:04 -0800 | [diff] [blame] | 512 | } |
| 513 | |
| 514 | status_t BufferHubQueueProducer::allowAllocation(bool /* allow */) { |
Alex Vakulenko | 4fe6058 | 2017-02-02 11:35:59 -0800 | [diff] [blame] | 515 | ALOGE("BufferHubQueueProducer::allowAllocation not implemented."); |
Alex Vakulenko | e4eec20 | 2017-01-27 14:41:04 -0800 | [diff] [blame] | 516 | return INVALID_OPERATION; |
| 517 | } |
| 518 | |
| 519 | status_t BufferHubQueueProducer::setGenerationNumber( |
| 520 | uint32_t generation_number) { |
Jiwen 'Steve' Cai | 25fd3fa | 2017-03-20 15:30:21 -0700 | [diff] [blame] | 521 | ALOGD_IF(TRACE, __FUNCTION__); |
Alex Vakulenko | e4eec20 | 2017-01-27 14:41:04 -0800 | [diff] [blame] | 522 | |
| 523 | std::unique_lock<std::mutex> lock(core_->mutex_); |
| 524 | core_->generation_number_ = generation_number; |
| 525 | return NO_ERROR; |
| 526 | } |
| 527 | |
| 528 | String8 BufferHubQueueProducer::getConsumerName() const { |
| 529 | // BufferHub based implementation could have one to many producer/consumer |
| 530 | // relationship, thus |getConsumerName| from the producer side does not |
| 531 | // make any sense. |
Alex Vakulenko | 4fe6058 | 2017-02-02 11:35:59 -0800 | [diff] [blame] | 532 | ALOGE("BufferHubQueueProducer::getConsumerName not supported."); |
Alex Vakulenko | e4eec20 | 2017-01-27 14:41:04 -0800 | [diff] [blame] | 533 | return String8("BufferHubQueue::DummyConsumer"); |
| 534 | } |
| 535 | |
Jiwen 'Steve' Cai | cb4751c | 2017-04-14 17:56:55 -0700 | [diff] [blame] | 536 | status_t BufferHubQueueProducer::setSharedBufferMode(bool shared_buffer_mode) { |
| 537 | if (shared_buffer_mode) { |
Hendrik Wagenaar | 4d3590f | 2017-05-06 22:36:04 -0700 | [diff] [blame] | 538 | ALOGE( |
| 539 | "BufferHubQueueProducer::setSharedBufferMode(true) is not supported."); |
Jiwen 'Steve' Cai | cb4751c | 2017-04-14 17:56:55 -0700 | [diff] [blame] | 540 | // TODO(b/36373181) Front buffer mode for buffer hub queue as ANativeWindow. |
| 541 | return INVALID_OPERATION; |
| 542 | } |
| 543 | // Setting to default should just work as a no-op. |
| 544 | return NO_ERROR; |
Alex Vakulenko | e4eec20 | 2017-01-27 14:41:04 -0800 | [diff] [blame] | 545 | } |
| 546 | |
Jiwen 'Steve' Cai | cb4751c | 2017-04-14 17:56:55 -0700 | [diff] [blame] | 547 | status_t BufferHubQueueProducer::setAutoRefresh(bool auto_refresh) { |
| 548 | if (auto_refresh) { |
| 549 | ALOGE("BufferHubQueueProducer::setAutoRefresh(true) is not supported."); |
| 550 | return INVALID_OPERATION; |
| 551 | } |
| 552 | // Setting to default should just work as a no-op. |
| 553 | return NO_ERROR; |
Alex Vakulenko | e4eec20 | 2017-01-27 14:41:04 -0800 | [diff] [blame] | 554 | } |
| 555 | |
| 556 | status_t BufferHubQueueProducer::setDequeueTimeout(nsecs_t timeout) { |
Jiwen 'Steve' Cai | 25fd3fa | 2017-03-20 15:30:21 -0700 | [diff] [blame] | 557 | ALOGD_IF(TRACE, __FUNCTION__); |
Alex Vakulenko | e4eec20 | 2017-01-27 14:41:04 -0800 | [diff] [blame] | 558 | |
| 559 | std::unique_lock<std::mutex> lock(core_->mutex_); |
| 560 | core_->dequeue_timeout_ms_ = static_cast<int>(timeout / (1000 * 1000)); |
| 561 | return NO_ERROR; |
| 562 | } |
| 563 | |
| 564 | status_t BufferHubQueueProducer::getLastQueuedBuffer( |
| 565 | sp<GraphicBuffer>* /* out_buffer */, sp<Fence>* /* out_fence */, |
| 566 | float /*out_transform_matrix*/[16]) { |
Alex Vakulenko | 4fe6058 | 2017-02-02 11:35:59 -0800 | [diff] [blame] | 567 | ALOGE("BufferHubQueueProducer::getLastQueuedBuffer not implemented."); |
Alex Vakulenko | e4eec20 | 2017-01-27 14:41:04 -0800 | [diff] [blame] | 568 | return INVALID_OPERATION; |
| 569 | } |
| 570 | |
| 571 | void BufferHubQueueProducer::getFrameTimestamps( |
| 572 | FrameEventHistoryDelta* /*outDelta*/) { |
Alex Vakulenko | 4fe6058 | 2017-02-02 11:35:59 -0800 | [diff] [blame] | 573 | ALOGE("BufferHubQueueProducer::getFrameTimestamps not implemented."); |
Alex Vakulenko | e4eec20 | 2017-01-27 14:41:04 -0800 | [diff] [blame] | 574 | } |
| 575 | |
| 576 | status_t BufferHubQueueProducer::getUniqueId(uint64_t* out_id) const { |
Jiwen 'Steve' Cai | 25fd3fa | 2017-03-20 15:30:21 -0700 | [diff] [blame] | 577 | ALOGD_IF(TRACE, __FUNCTION__); |
Alex Vakulenko | e4eec20 | 2017-01-27 14:41:04 -0800 | [diff] [blame] | 578 | |
| 579 | *out_id = core_->unique_id_; |
| 580 | return NO_ERROR; |
| 581 | } |
| 582 | |
| 583 | IBinder* BufferHubQueueProducer::onAsBinder() { |
| 584 | // BufferHubQueueProducer is a non-binder implementation of |
| 585 | // IGraphicBufferProducer. |
Jiwen 'Steve' Cai | cb4751c | 2017-04-14 17:56:55 -0700 | [diff] [blame] | 586 | ALOGW("BufferHubQueueProducer::onAsBinder is not efficiently supported."); |
| 587 | return this; |
Alex Vakulenko | e4eec20 | 2017-01-27 14:41:04 -0800 | [diff] [blame] | 588 | } |
| 589 | |
| 590 | } // namespace dvr |
| 591 | } // namespace android |