• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2021 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 HOS_CAMERA_STREAM_OPERATOR_C_IF_H
17 #define HOS_CAMERA_STREAM_OPERATOR_C_IF_H
18 
19 #include "camera_types_c_if.h"
20 #include "camera_metadata_c_if.h"
21 
22 #ifdef __cplusplus
23 extern "C" {
24 #endif
25 
26 typedef struct StreamOperatorCallbackCIF {
27     void (*OnCaptureStarted)(int captureId, int* streamId, int count);
28     void (*OnCaptureEnded)(int captureId, CaptureEndedInfoCIF* info, int count);
29     void (*OnCaptureError)(int captureId, CaptureErrorInfoCIF* info, int count);
30     void (*OnFrameShutter)(int captureId, int* streamId, int count, uint64_t timestamp);
31 } StreamOperatorCallbackCIF;
32 
33 typedef struct OfflineStreamOperatorCIF {
34     int (*CancelCapture)(int captureId);
35     int (*ReleaseStreams)(int* streamIds, int count);
36     int (*Release)();
37 } OfflineStreamOperatorCIF;
38 
39 typedef struct StreamOperatorCIF {
40     int (*IsStreamSupported)(int mode,
41                              CameraMetadataCIF* meta,
42                              StreamInfoCIF info,
43                              int* support);
44 
45     int (*CreateStreams)(StreamInfoCIF* info, int count);
46     int (*ReleaseStreams)(int* streamIds, int count);
47     int (*CommitStreams)(int mode, CameraMetadataCIF* meta);
48     int (*GetStreamAttributes)(StreamAttributeCIF** attributes, int* count);
49     int (*AttachBufferQueue)(int streamId, BufferProducerCIF producer);
50     int (*DetachBufferQueue)(int streamId);
51     int (*Capture)(int captureId, CaptureInfoCIF info, int isStreaming);
52     int (*CancelCapture)(int captureId);
53     int (*ChangeToOfflineStream)(int* streamIds,
54                                  int count,
55                                  StreamOperatorCallbackCIF callback,
56                                  OfflineStreamOperatorCIF* op);
57 } StreamOperatorCIF;
58 
59 #ifdef __cplusplus
60 }
61 #endif
62 
63 #endif
64