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 #include "ohos_adapter/bridge/ark_video_info_adapter_impl.h"
17 
18 #include "ohos_adapter/bridge/ark_video_capture_info_adapter_impl.h"
19 #include "ohos_adapter/bridge/ark_video_enc_info_adapter_impl.h"
20 
21 #include "base/bridge/ark_web_bridge_macros.h"
22 
23 namespace OHOS::ArkWeb {
ArkVideoInfoAdapterImpl(std::shared_ptr<OHOS::NWeb::VideoInfoAdapter> ref)24 ArkVideoInfoAdapterImpl::ArkVideoInfoAdapterImpl(std::shared_ptr<OHOS::NWeb::VideoInfoAdapter> ref) : real_(ref) {}
25 
GetVideoCapInfo()26 ArkWebRefPtr<ArkVideoCaptureInfoAdapter> ArkVideoInfoAdapterImpl::GetVideoCapInfo()
27 {
28     std::shared_ptr<OHOS::NWeb::VideoCaptureInfoAdapter> info = real_->GetVideoCapInfo();
29     if (CHECK_SHARED_PTR_IS_NULL(info)) {
30         return nullptr;
31     }
32     return new ArkVideoCaptureInfoAdapterImpl(info);
33 }
34 
GetVideoEncInfo()35 ArkWebRefPtr<ArkVideoEncInfoAdapter> ArkVideoInfoAdapterImpl::GetVideoEncInfo()
36 {
37     std::shared_ptr<OHOS::NWeb::VideoEncInfoAdapter> info = real_->GetVideoEncInfo();
38     if (CHECK_SHARED_PTR_IS_NULL(info)) {
39         return nullptr;
40     }
41     return new ArkVideoEncInfoAdapterImpl(info);
42 }
43 
44 } // namespace OHOS::ArkWeb
45