1 /* 2 * Copyright (c) 2021-2022 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 OHOS_CAMERA_ICAPTURE_SESSION_H 17 #define OHOS_CAMERA_ICAPTURE_SESSION_H 18 19 #include "icamera_device_service.h" 20 #include "icapture_session_callback.h" 21 #include "iremote_broker.h" 22 #include "istream_common.h" 23 24 namespace OHOS { 25 namespace CameraStandard { 26 enum class CaptureSessionState { 27 SESSION_INIT = 0, 28 SESSION_CONFIG_INPROGRESS, 29 SESSION_CONFIG_COMMITTED, 30 }; 31 32 class ICaptureSession : public IRemoteBroker { 33 public: 34 virtual int32_t BeginConfig() = 0; 35 36 virtual int32_t AddInput(sptr<ICameraDeviceService> cameraDevice) = 0; 37 38 virtual int32_t AddOutput(StreamType streamType, sptr<IStreamCommon> stream) = 0; 39 40 virtual int32_t RemoveInput(sptr<ICameraDeviceService> cameraDevice) = 0; 41 42 virtual int32_t RemoveOutput(StreamType streamType, sptr<IStreamCommon> stream) = 0; 43 44 virtual int32_t CommitConfig() = 0; 45 46 virtual int32_t Start() = 0; 47 48 virtual int32_t Stop() = 0; 49 50 virtual int32_t Release(pid_t pid) = 0; 51 52 virtual int32_t SetCallback(sptr<ICaptureSessionCallback> &callback) = 0; 53 54 virtual int32_t GetSessionState(CaptureSessionState &sessionState) = 0; 55 56 DECLARE_INTERFACE_DESCRIPTOR(u"ICaptureSession"); 57 }; 58 } // namespace CameraStandard 59 } // namespace OHOS 60 #endif // OHOS_CAMERA_ICAPTURE_SESSION_H 61