1 /* 2 * Copyright (c) 2023 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16 #ifndef VIDEO_DEVICE_DESCRIPTOR_ADAPTER_IMPL_H 17 #define VIDEO_DEVICE_DESCRIPTOR_ADAPTER_IMPL_H 18 19 #include "camera_manager_adapter.h" 20 21 namespace OHOS::NWeb { 22 23 class VideoDeviceDescriptorAdapterImpl : public VideoDeviceDescriptorAdapter { 24 public: 25 VideoDeviceDescriptorAdapterImpl() = default; 26 27 std::string GetDisplayName() override; 28 29 std::string GetDeviceId() override; 30 31 std::string GetModelId() override; 32 33 std::shared_ptr<VideoControlSupportAdapter> GetControlSupport() override; 34 35 VideoTransportType GetTransportType() override; 36 37 VideoFacingModeAdapter GetFacingMode() override; 38 39 std::vector<std::shared_ptr<FormatAdapter>> GetSupportCaptureFormats() override; 40 41 void SetDisplayName(std::string name); 42 43 void SetDeviceId(std::string deviceId); 44 45 void SetModelId(std::string modelId); 46 47 void SetControlSupport(std::shared_ptr<VideoControlSupportAdapter>); 48 49 void SetTransportType(VideoTransportType); 50 51 void SetFacingMode(VideoFacingModeAdapter); 52 53 void SetSupportCaptureFormats(std::vector<std::shared_ptr<FormatAdapter>>); 54 55 #if defined(NWEB_CAMERA_ENABLE) 56 private: 57 std::string display_name_ = ""; 58 std::string device_id_ = ""; 59 std::string model_id_ = ""; 60 std::shared_ptr<VideoControlSupportAdapter> control_support_ = nullptr; 61 VideoTransportType transport_type_ = VideoTransportType::VIDEO_TRANS_TYPE_OTHER; 62 VideoFacingModeAdapter facing_ = VideoFacingModeAdapter::FACING_NONE; 63 std::vector<std::shared_ptr<FormatAdapter>> support_formats_; 64 #endif 65 }; 66 67 } // namespace OHOS::NWeb 68 #endif // VIDEO_DEVICE_DESCRIPTOR_ADAPTER_IMPL_H 69