• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 #include "output/capture_output.h"
17 
18 namespace OHOS {
19 namespace CameraStandard {
CaptureOutput(CaptureOutputType outputType,StreamType streamType,sptr<IStreamCommon> stream)20 CaptureOutput::CaptureOutput(CaptureOutputType outputType, StreamType streamType,
21     sptr<IStreamCommon> stream) : outputType_(outputType), streamType_(streamType), stream_(stream)
22 {
23     session_ = nullptr;
24 }
25 
GetOutputType()26 CaptureOutputType CaptureOutput::GetOutputType()
27 {
28     return outputType_;
29 }
30 
GetOutputTypeString()31 const char* CaptureOutput::GetOutputTypeString()
32 {
33     return g_captureOutputTypeString[outputType_];
34 }
35 
GetStreamType()36 StreamType CaptureOutput::GetStreamType()
37 {
38     return streamType_;
39 }
40 
GetStream()41 sptr<IStreamCommon> CaptureOutput::GetStream()
42 {
43     return stream_;
44 }
45 
GetSession()46 CaptureSession* CaptureOutput::GetSession()
47 {
48     return session_;
49 }
50 
Release()51 int32_t CaptureOutput::Release()
52 {
53     stream_ = nullptr;
54     session_ = nullptr;
55     return 0;
56 }
57 
SetSession(CaptureSession * captureSession)58 void CaptureOutput::SetSession(CaptureSession* captureSession)
59 {
60     session_ = captureSession;
61 }
62 } // CameraStandard
63 } // OHOS
64 
65