• 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 RECORDER_SERVICE_PROXY_H
17 #define RECORDER_SERVICE_PROXY_H
18 
19 #include "i_standard_recorder_service.h"
20 #include "nocopyable.h"
21 
22 namespace OHOS {
23 namespace Media {
24 class RecorderServiceProxy : public IRemoteProxy<IStandardRecorderService>, public NoCopyable {
25 public:
26     explicit RecorderServiceProxy(const sptr<IRemoteObject> &impl);
27     virtual ~RecorderServiceProxy();
28 
29     int32_t SetListenerObject(const sptr<IRemoteObject> &object) override;
30     int32_t SetVideoSource(VideoSourceType source, int32_t &sourceId) override;
31     int32_t SetVideoEncoder(int32_t sourceId, VideoCodecFormat encoder) override;
32     int32_t SetVideoSize(int32_t sourceId, int32_t width, int32_t height) override;
33     int32_t SetVideoFrameRate(int32_t sourceId, int32_t frameRate) override;
34     int32_t SetVideoEncodingBitRate(int32_t sourceId, int32_t rate) override;
35     int32_t SetVideoIsHdr(int32_t sourceId, bool isHdr) override;
36     int32_t SetVideoEnableTemporalScale(int32_t sourceId, bool enableTemporalScale) override;
37     int32_t SetMetaConfigs(int32_t sourceId) override;
38     int32_t SetMetaSource(MetaSourceType source, int32_t &sourceId) override;
39     int32_t SetMetaMimeType(int32_t sourceId, const std::string_view &type) override;
40     int32_t SetMetaTimedKey(int32_t sourceId, const std::string_view &timedKey) override;
41     int32_t SetMetaSourceTrackMime(int32_t sourceId, const std::string_view &srcTrackMime) override;
42     int32_t SetCaptureRate(int32_t sourceId, double fps) override;
43     sptr<OHOS::Surface> GetSurface(int32_t sourceId) override;
44     sptr<OHOS::Surface> GetMetaSurface(int32_t sourceId) override;
45     int32_t SetAudioSource(AudioSourceType source, int32_t &sourceId) override;
46     int32_t SetAudioEncoder(int32_t sourceId, AudioCodecFormat encoder) override;
47     int32_t SetAudioSampleRate(int32_t sourceId, int32_t rate) override;
48     int32_t SetAudioChannels(int32_t sourceId, int32_t num) override;
49     int32_t SetAudioEncodingBitRate(int32_t sourceId, int32_t bitRate) override;
50     int32_t SetDataSource(DataSourceType dataType, int32_t &sourceId) override;
51     int32_t SetUserCustomInfo(Meta &userCustomInfo) override;
52     int32_t SetGenre(std::string &genre) override;
53     int32_t SetMaxDuration(int32_t duration) override;
54     int32_t SetOutputFormat(OutputFormatType format) override;
55     int32_t SetOutputFile(int32_t fd) override;
56     int32_t SetFileGenerationMode(FileGenerationMode mode) override;
57     int32_t SetNextOutputFile(int32_t fd) override;
58     int32_t SetMaxFileSize(int64_t size) override;
59     int32_t SetLocation(float latitude, float longitude) override;
60     int32_t SetOrientationHint(int32_t rotation) override;
61     int32_t Prepare() override;
62     int32_t Start() override;
63     int32_t Pause() override;
64     int32_t Resume() override;
65     int32_t Stop(bool block) override;
66     int32_t Reset() override;
67     int32_t Release() override;
68     int32_t SetFileSplitDuration(FileSplitType type, int64_t timestamp, uint32_t duration) override;
69     int32_t DestroyStub() override;
70     int32_t GetAVRecorderConfig(ConfigMap &configMap) override;
71     int32_t GetLocation(Location &location) override;
72     int32_t GetCurrentCapturerChangeInfo(AudioRecorderChangeInfo &changeInfo) override;
73     int32_t GetAvailableEncoder(std::vector<EncoderCapabilityData> &encoderInfo) override;
74     int32_t GetMaxAmplitude() override;
75     int32_t IsWatermarkSupported(bool &isWatermarkSupported) override;
76     int32_t SetWatermark(std::shared_ptr<AVBuffer> &waterMarkBuffer) override;
77 private:
78     static inline BrokerDelegator<RecorderServiceProxy> delegator_;
79 };
80 } // namespace Media
81 } // namespace OHOS
82 #endif // RECORDER_SERVICE_PROXY_H
83