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 "offline_stream_operator_service.h"
17
18 namespace OHOS::Camera {
19
OfflineStreamOperatorService(OHOS::sptr<IOfflineStreamOperatorVdi> offlineStreamOperatorVdi)20 OfflineStreamOperatorService::OfflineStreamOperatorService(
21 OHOS::sptr<IOfflineStreamOperatorVdi> offlineStreamOperatorVdi)
22 : offlineStreamOperatorVdi_(offlineStreamOperatorVdi)
23 {
24 CAMERA_LOGD("ctor, instance");
25 }
26
~OfflineStreamOperatorService()27 OfflineStreamOperatorService::~OfflineStreamOperatorService()
28 {
29 CAMERA_LOGD("dtor, instance");
30 }
31
CancelCapture(int32_t captureId)32 int32_t OfflineStreamOperatorService::CancelCapture(int32_t captureId)
33 {
34 CHECK_IF_PTR_NULL_RETURN_VALUE(offlineStreamOperatorVdi_, OHOS::HDI::Camera::V1_0::INVALID_ARGUMENT);
35 return offlineStreamOperatorVdi_->CancelCapture(captureId);
36 }
37
ReleaseStreams(const std::vector<int32_t> & streamIds)38 int32_t OfflineStreamOperatorService::ReleaseStreams(const std::vector<int32_t> &streamIds)
39 {
40 CHECK_IF_PTR_NULL_RETURN_VALUE(offlineStreamOperatorVdi_, OHOS::HDI::Camera::V1_0::INVALID_ARGUMENT);
41 return offlineStreamOperatorVdi_->ReleaseStreams(streamIds);
42 }
43
Release()44 int32_t OfflineStreamOperatorService::Release()
45 {
46 CHECK_IF_PTR_NULL_RETURN_VALUE(offlineStreamOperatorVdi_, OHOS::HDI::Camera::V1_0::INVALID_ARGUMENT);
47 return offlineStreamOperatorVdi_->Release();
48 }
49 } // end namespace OHOS::Camera
50