• 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 I_STANDARD_RECORDER_SERVICE_H
17 #define I_STANDARD_RECORDER_SERVICE_H
18 
19 #include "ipc_types.h"
20 #include "iremote_broker.h"
21 #include "iremote_proxy.h"
22 #include "iremote_stub.h"
23 #include "recorder.h"
24 
25 namespace OHOS {
26 namespace Media {
27 class IStandardRecorderService : public IRemoteBroker {
28 public:
29     virtual ~IStandardRecorderService() = default;
30     virtual int32_t SetListenerObject(const sptr<IRemoteObject> &object) = 0;
31     virtual int32_t SetVideoSource(VideoSourceType source, int32_t &sourceId) = 0;
32     virtual int32_t SetVideoEncoder(int32_t sourceId, VideoCodecFormat encoder) = 0;
33     virtual int32_t SetVideoSize(int32_t sourceId, int32_t width, int32_t height) = 0;
34     virtual int32_t SetVideoFrameRate(int32_t sourceId, int32_t frameRate) = 0;
35     virtual int32_t SetVideoEncodingBitRate(int32_t sourceId, int32_t rate) = 0;
36     virtual int32_t SetCaptureRate(int32_t sourceId, double fps) = 0;
37     virtual sptr<OHOS::Surface> GetSurface(int32_t sourceId) = 0;
38     virtual int32_t SetAudioSource(AudioSourceType source, int32_t &sourceId) = 0;
39     virtual int32_t SetAudioEncoder(int32_t sourceId, AudioCodecFormat encoder) = 0;
40     virtual int32_t SetAudioSampleRate(int32_t sourceId, int32_t rate) = 0;
41     virtual int32_t SetAudioChannels(int32_t sourceId, int32_t num) = 0;
42     virtual int32_t SetAudioEncodingBitRate(int32_t sourceId, int32_t bitRate) = 0;
43     virtual int32_t SetDataSource(DataSourceType dataType, int32_t &sourceId) = 0;
44     virtual int32_t SetMaxDuration(int32_t duration) = 0;
45     virtual int32_t SetOutputFormat(OutputFormatType format) = 0;
46     virtual int32_t SetOutputFile(int32_t fd) = 0;
47     virtual int32_t SetNextOutputFile(int32_t fd) = 0;
48     virtual int32_t SetMaxFileSize(int64_t size) = 0;
49     virtual int32_t SetLocation(float latitude, float longitude) = 0;
50     virtual int32_t SetOrientationHint(int32_t rotation) = 0;
51     virtual int32_t Prepare() = 0;
52     virtual int32_t Start() = 0;
53     virtual int32_t Pause() = 0;
54     virtual int32_t Resume() = 0;
55     virtual int32_t Stop(bool block) = 0;
56     virtual int32_t Reset() = 0;
57     virtual int32_t Release() = 0;
58     virtual int32_t SetFileSplitDuration(FileSplitType type, int64_t timestamp, uint32_t duration) = 0;
59     virtual int32_t DestroyStub() = 0;
60     /**
61      * IPC code ID
62      */
63     enum RecorderServiceMsg {
64         SET_LISTENER_OBJ = 0,
65         SET_VIDEO_SOURCE,
66         SET_VIDEO_ENCODER,
67         SET_VIDEO_SIZE,
68         SET_VIDEO_FARAME_RATE,
69         SET_VIDEO_ENCODING_BIT_RATE,
70         SET_CAPTURE_RATE,
71         GET_SURFACE,
72         SET_AUDIO_SOURCE,
73         SET_AUDIO_ENCODER,
74         SET_AUDIO_SAMPLE_RATE,
75         SET_AUDIO_CHANNELS,
76         SET_AUDIO_ENCODING_BIT_RATE,
77         SET_DATA_SOURCE,
78         SET_MAX_DURATION,
79         SET_OUTPUT_FORMAT,
80         SET_OUTPUT_FILE,
81         SET_NEXT_OUTPUT_FILE,
82         SET_MAX_FILE_SIZE,
83         SET_LOCATION,
84         SET_ORIENTATION_HINT,
85         PREPARE,
86         START,
87         PAUSE,
88         RESUME,
89         STOP,
90         RESET,
91         RELEASE,
92         SET_FILE_SPLIT_DURATION,
93         DESTROY,
94     };
95 
96     DECLARE_INTERFACE_DESCRIPTOR(u"IStandardRecorderService");
97 };
98 } // namespace Media
99 } // namespace OHOS
100 #endif // I_STANDARD_RECORDER_SERVICE_H
101