14ed2deddSopenharmony_ci/* 24ed2deddSopenharmony_ci * Copyright (c) 2020-2021 Huawei Device Co., Ltd. 34ed2deddSopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License"); 44ed2deddSopenharmony_ci * you may not use this file except in compliance with the License. 54ed2deddSopenharmony_ci * You may obtain a copy of the License at 64ed2deddSopenharmony_ci * 74ed2deddSopenharmony_ci * http://www.apache.org/licenses/LICENSE-2.0 84ed2deddSopenharmony_ci * 94ed2deddSopenharmony_ci * Unless required by applicable law or agreed to in writing, software 104ed2deddSopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS, 114ed2deddSopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 124ed2deddSopenharmony_ci * See the License for the specific language governing permissions and 134ed2deddSopenharmony_ci * limitations under the License. 144ed2deddSopenharmony_ci */ 154ed2deddSopenharmony_ci 164ed2deddSopenharmony_ci#include "buffer_queue_consumer.h" 174ed2deddSopenharmony_ci 184ed2deddSopenharmony_ci#include "buffer_common.h" 194ed2deddSopenharmony_ci#include "buffer_queue.h" 204ed2deddSopenharmony_ci 214ed2deddSopenharmony_cinamespace OHOS { 224ed2deddSopenharmony_ciBufferQueueConsumer::BufferQueueConsumer(BufferQueue& bufferQueue) 234ed2deddSopenharmony_ci{ 244ed2deddSopenharmony_ci bufferQueue_ = &bufferQueue; 254ed2deddSopenharmony_ci} 264ed2deddSopenharmony_ci 274ed2deddSopenharmony_ciBufferQueueConsumer::~BufferQueueConsumer() 284ed2deddSopenharmony_ci{ 294ed2deddSopenharmony_ci bufferQueue_ = nullptr; 304ed2deddSopenharmony_ci} 314ed2deddSopenharmony_ci 324ed2deddSopenharmony_ciSurfaceBufferImpl* BufferQueueConsumer::AcquireBuffer() 334ed2deddSopenharmony_ci{ 344ed2deddSopenharmony_ci return bufferQueue_->AcquireBuffer(); 354ed2deddSopenharmony_ci} 364ed2deddSopenharmony_ci 374ed2deddSopenharmony_cibool BufferQueueConsumer::ReleaseBuffer(const SurfaceBufferImpl& buffer) 384ed2deddSopenharmony_ci{ 394ed2deddSopenharmony_ci return bufferQueue_->ReleaseBuffer(buffer); 404ed2deddSopenharmony_ci} 414ed2deddSopenharmony_ci} // end namespace OHOS 42