/* * Copyright (c) 2020 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef HOS_CAMERA_STREAM_CUSTOMER_H #define HOS_CAMERA_STREAM_CUSTOMER_H #include #include #include #include #include #include #include "display_format.h" #include "camera_metadata_info.h" #include "ibuffer.h" #include "iconsumer_surface.h" #include "v1_0/ioffline_stream_operator.h" #include "camera.h" #ifndef CAMERA_BUILT_ON_OHOS_LITE #include "if_system_ability_manager.h" #include "iservice_registry.h" #endif class StreamCustomer { public: StreamCustomer(); ~StreamCustomer(); #ifdef CAMERA_BUILT_ON_OHOS_LITE std::shared_ptr CreateProducer(); #else OHOS::sptr CreateProducer(); #endif void CamFrame(const std::function callback); OHOS::Camera::RetCode ReceiveFrameOn(const std::function callback); void ReceiveFrameOff(); #ifndef CAMERA_BUILT_ON_OHOS_LITE class TestBuffersConsumerListener : public OHOS::IBufferConsumerListener { public: TestBuffersConsumerListener() { } ~TestBuffersConsumerListener() { } void OnBufferAvailable() { } }; #endif private: unsigned int camFrameExit_ = 1; #ifdef CAMERA_BUILT_ON_OHOS_LITE std::shared_ptr consumer_ = nullptr; #else OHOS::sptr consumer_ = nullptr; #endif std::thread* previewThreadId_ = nullptr; }; #endif // HOS_CAMERA_STREAM_CUSTOMER_H