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_RECORDER_SERVICE_H
17 #define I_RECORDER_SERVICE_H
18 
19 #include <string>
20 #include "recorder.h"
21 #include "refbase.h"
22 #include "surface.h"
23 #include "media_data_source.h"
24 
25 namespace OHOS {
26 namespace Media {
27 class IRecorderService {
28 public:
29     virtual ~IRecorderService() = default;
30 
31     /**
32      * @brief Sets a video source for recording.
33      *
34      * If this function is not called, the output file does not contain the video track.
35      *
36      * @param source Indicates the video source type. For details, see {@link VideoSourceType}.
37      * @param sourceId Indicates the video source ID. The value <b>-1</b> indicates an invalid ID and the setting fails.
38      *
39      * @return Returns {@link SUCCESS} if the setting is successful; returns an error code defined
40      * in {@link media_errors.h} otherwise.
41      * @since 1.0
42      * @version 1.0
43      */
44     virtual int32_t SetVideoSource(VideoSourceType source, int32_t &sourceId) = 0;
45 
46     /**
47      * @brief Sets a meta source for recording.
48      *
49      * If this function is not called, the output file does not contain the meta track.
50      *
51      * @param source Indicates the meta source type. For details, see {@link MetaSourceType}.
52      * @param sourceId Indicates the meta source ID. The value <b>-1</b> indicates an invalid ID and the setting fails.
53      *
54      * @return Returns {@link SUCCESS} if the setting is successful; returns an error code defined
55      * in {@link media_errors.h} otherwise.
56      * @since 1.0
57      * @version 1.0
58      */
59     virtual int32_t SetMetaSource(MetaSourceType source, int32_t &sourceId) = 0;
60 
61     /**
62      * @brief Sets a meta configurations for recording.
63      *
64      * If this function is not called, the output file does not contain the meta track.
65      *
66      * @param source Indicates the meta source type. For details, see {@link MetaSourceType}.
67      * @param sourceId Indicates the meta source ID. The value <b>-1</b> indicates an invalid ID and the setting fails.
68      *
69      * @return Returns {@link SUCCESS} if the setting is successful; returns an error code defined
70      * in {@link media_errors.h} otherwise.
71      * @since 1.0
72      * @version 1.0
73      */
74     virtual int32_t SetMetaConfigs(int32_t sourceId) = 0;
75 
76     /**
77      * @brief Sets the meta mime type.
78      *
79      * This function must be called after {@link SetVideoSource} but before {@link Prepare}.
80      *
81      * @param sourceId Indicates the meta source ID, which can be obtained from {@link SetVideoSource}.
82      * @param type mime type.
83      * @return Returns {@link SUCCESS} if the setting is successful; returns an error code defined
84      * in {@link media_errors.h} otherwise.
85      * @since 1.0
86      * @version 1.0
87      */
88     virtual int32_t SetMetaMimeType(int32_t sourceId, const std::string_view &type) = 0;
89 
90     /**
91      * @brief Sets the meta timed key.
92      *
93      * This function must be called after {@link SetVideoSource} but before {@link Prepare}.
94      *
95      * @param sourceId Indicates the meta source ID, which can be obtained from {@link SetVideoSource}.
96      * @param key meta data timed key.
97      * @return Returns {@link SUCCESS} if the setting is successful; returns an error code defined
98      * in {@link media_errors.h} otherwise.
99      * @since 1.0
100      * @version 1.0
101      */
102     virtual int32_t SetMetaTimedKey(int32_t sourceId, const std::string_view &timedKey) = 0;
103 
104     /**
105      * @brief Sets the meta timed key.
106      *
107      * This function must be called after {@link SetVideoSource} but before {@link Prepare}.
108      *
109      * @param sourceId Indicates the meta source ID, which can be obtained from {@link SetVideoSource}.
110      * @param type meta data source track mime type.
111      * @return Returns {@link SUCCESS} if the setting is successful; returns an error code defined
112      * in {@link media_errors.h} otherwise.
113      * @since 1.0
114      * @version 1.0
115      */
116     virtual int32_t SetMetaSourceTrackMime(int32_t sourceId, const std::string_view &srcTrackMime) = 0;
117 
118     /**
119      * @brief Sets a video encoder for recording.
120      *
121      * If this function is not called, the output file does not contain the video track.
122      * This function must be called after {@link SetVideoSource} but before {@link Prepare}.
123      *
124      * @param sourceId Indicates the video source ID, which can be obtained from {@link SetVideoSource}.
125      * @param encoder Indicates the video encoder to set.
126      * @return Returns {@link SUCCESS} if the setting is successful; returns an error code defined
127      * in {@link media_errors.h} otherwise.
128      * @since 1.0
129      * @version 1.0
130      */
131     virtual int32_t SetVideoEncoder(int32_t sourceId, VideoCodecFormat encoder) = 0;
132 
133     /**
134      * @brief Sets the width and height of the video to record.
135      *
136      * This function must be called after {@link SetVideoSource} but before {@link Prepare}.
137      *
138      * @param sourceId Indicates the video source ID, which can be obtained from {@link SetVideoSource}.
139      * @param width Indicates the video width to set.
140      * @param height Indicates the video height to set.
141      * @return Returns {@link SUCCESS} if the setting is successful; returns an error code defined
142      * in {@link media_errors.h} otherwise.
143      * @since 1.0
144      * @version 1.0
145      */
146     virtual int32_t SetVideoSize(int32_t sourceId, int32_t width, int32_t height) = 0;
147 
148     /**
149      * @brief Sets the frame rate of the video to record.
150      *
151      * This function must be called after {@link SetVideoSource} but before {@link Prepare}.
152      *
153      * @param sourceId Indicates the video source ID, which can be obtained from {@link SetVideoSource}.
154      * @param frameRate Indicates the frame rate to set.
155      * @return Returns {@link SUCCESS} if the setting is successful; returns an error code defined
156      * in {@link media_errors.h} otherwise.
157      * @since 1.0
158      * @version 1.0
159      */
160     virtual int32_t SetVideoFrameRate(int32_t sourceId, int32_t frameRate) = 0;
161 
162     /**
163      * @brief Sets the encoding bit rate of the video to record.
164      *
165      * This function must be called after {@link SetVideoSource} but before {@link Prepare}.
166      *
167      * @param sourceId Indicates the video source ID, which can be obtained from {@link SetVideoSource}.
168      * @param rate Indicates the encoding bit rate to set.
169      * @return Returns {@link SUCCESS} if the setting is successful; returns an error code defined
170      * in {@link media_errors.h} otherwise.
171      * @since 1.0
172      * @version 1.0
173      */
174     virtual int32_t SetVideoEncodingBitRate(int32_t sourceId, int32_t rate) = 0;
175 
176     /**
177      * @brief Sets the status of the video to record.
178      *
179      * This function must be called after {@link SetOutputFormat}
180      *
181      * @param sourceId Indicates the video source ID, which can be obtained from {@link SetVideoSource}.
182      * @param isHdr Indicates the HDR status to set.
183      * @return Returns {@link MSERR_OK} if the setting is successful; returns an error code otherwise.
184      * @since 1.0
185      * @version 1.0
186      */
187     virtual int32_t SetVideoIsHdr(int32_t sourceId, bool isHdr) = 0;
188 
189     /**
190      * @brief Sets the status of the video whether to encode the video in temporal scale mode.
191      *
192      * @param sourceId Indicates the video source ID, which can be obtained from {@link SetVideoSource}.
193      * @param enableTemporalScale Indicates the temporal scale mode to set.
194      * @return Returns {@link MSERR_OK} if the setting is successful; returns an error code otherwise.
195      * @since 1.0
196      * @version 1.0
197      */
198     virtual int32_t SetVideoEnableTemporalScale(int32_t sourceId, bool enableTemporalScale) = 0;
199 
200     /**
201      * @brief Sets the video capture rate.
202      *
203      * This function must be called after {@link SetVideoSource} but before {@link Prepare}. It is valid when the
204      * video source is YUV or RGB.
205      *
206      * @param sourceId Indicates the video source ID, which can be obtained from {@link SetVideoSource}.
207      * @param fps Indicates the rate at which frames are captured per second.
208      * @return Returns {@link SUCCESS} if the setting is successful; returns an error code defined
209      * in {@link media_errors.h} otherwise.
210      * @since 1.0
211      * @version 1.0
212      */
213     virtual int32_t SetCaptureRate(int32_t sourceId, double fps) = 0;
214 
215     /**
216      * @brief Obtains the surface of the video source.
217      *
218      * @param sourceId Indicates the video source ID, which can be obtained from {@link SetVideoSource}.
219      * @return Returns the pointer to the surface.
220      * @since 1.0
221      * @version 1.0
222      */
223     virtual sptr<OHOS::Surface> GetSurface(int32_t sourceId) = 0;
224 
225     /**
226      * @brief Obtains the surface of the meta track.
227      *
228      * @param sourceId Indicates the video source ID, which can be obtained from {@link SetMetaSource}.
229      * @return Returns the pointer to the surface.
230      * @since 1.0
231      * @version 1.0
232      */
233     virtual sptr<OHOS::Surface> GetMetaSurface(int32_t sourceId) = 0;
234 
235     /**
236      * @brief Sets the audio source for recording.
237      *
238      * If this function is not called, the output file does not contain the audio track.
239      *
240      * @param source Indicates the audio source type. For details, see {@link AudioSourceType}.
241      * @param sourceId Indicates the audio source ID. The value <b>-1</b> indicates an invalid ID and the setting fails.
242      * @return Returns {@link SUCCESS} if the setting is successful; returns an error code defined
243      * in {@link media_errors.h} otherwise.
244      * @since 1.0
245      * @version 1.0
246      */
247     virtual int32_t SetAudioSource(AudioSourceType source, int32_t &sourceId) = 0;
248 
249     /**
250      * @brief Sets the audio data source for recording.
251      *
252      * If this function is not called, the output file does not contain the audio track.
253      *
254      * @param source Indicates the audio source type. For details, see {@link AudioSourceType}.
255      * @param sourceId Indicates the audio source ID. The value <b>-1</b> indicates an invalid ID and the setting fails.
256      * @return Returns {@link SUCCESS} if the setting is successful; returns an error code defined
257      * in {@link media_errors.h} otherwise.
258      * @since 12.0
259      * @version 12.0
260      */
SetAudioDataSource(const std::shared_ptr<IAudioDataSource> & audioSource,int32_t & sourceId)261     virtual int32_t SetAudioDataSource(const std::shared_ptr<IAudioDataSource>& audioSource, int32_t& sourceId)
262     {
263         (void)audioSource;
264         (void)sourceId;
265         return 0;
266     };
267 
268     /**
269      * @brief Sets an audio encoder for recording.
270      *
271      * If this function is not called, the output file does not contain the audio track.
272      * This function must be called after {@link SetAudioSource} but before {@link Prepare}.
273      *
274      * @param sourceId Indicates the audio source ID, which can be obtained from {@link SetAudioSource}.
275      * @param encoder Indicates the audio encoder to set.
276      * @return Returns {@link SUCCESS} if the setting is successful; returns an error code defined
277      * in {@link media_errors.h} otherwise.
278      * @since 1.0
279      * @version 1.0
280      */
281     virtual int32_t SetAudioEncoder(int32_t sourceId, AudioCodecFormat encoder) = 0;
282 
283     /**
284      * @brief Sets the audio sampling rate for recording.
285      *
286      * This function must be called after {@link SetAudioSource} but before {@link Prepare}.
287      *
288      * @param sourceId Indicates the audio source ID, which can be obtained from {@link SetAudioSource}.
289      * @param rate Indicates the sampling rate of the audio per second.
290      * @return Returns {@link SUCCESS} if the setting is successful; returns an error code defined
291      * in {@link media_errors.h} otherwise.
292      * @since 1.0
293      * @version 1.0
294      */
295     virtual int32_t SetAudioSampleRate(int32_t sourceId, int32_t rate) = 0;
296 
297     /**
298      * @brief Sets the number of audio channels to record.
299      *
300      * This function must be called after {@link SetAudioSource} but before {@link Prepare}.
301      *
302      * @param sourceId Indicates the audio source ID, which can be obtained from {@link SetAudioSource}.
303      * @param num Indicates the number of audio channels to set.
304      * @return Returns {@link SUCCESS} if the setting is successful; returns an error code defined
305      * in {@link media_errors.h} otherwise.
306      * @since 1.0
307      * @version 1.0
308      */
309     virtual int32_t SetAudioChannels(int32_t sourceId, int32_t num) = 0;
310 
311     /**
312      * @brief Sets the encoding bit rate of the audio to record.
313      *
314      * This function must be called after {@link SetAudioSource} but before {@link Prepare}.
315      *
316      * @param sourceId Indicates the audio source ID, which can be obtained from {@link SetAudioSource}.
317      * @param bitRate Indicates the audio encoding bit rate, in bit/s.
318      * @return Returns {@link SUCCESS} if the setting is successful; returns an error code defined
319      * in {@link media_errors.h} otherwise.
320      * @since 1.0
321      * @version 1.0
322      */
323     virtual int32_t SetAudioEncodingBitRate(int32_t sourceId, int32_t bitRate) = 0;
324 
325     /**
326      * @brief Sets a data source for recording.
327      *
328      * If this function is not called, the output file does not contain the data track.
329      *
330      * @param sourceId Indicates the data source ID. The value <b>-1</b> indicates an invalid ID and the setting fails.
331      *
332      * @return Returns {@link SUCCESS} if the setting is successful; returns an error code defined
333      * in {@link media_errors.h} otherwise.
334      * @since 1.0
335      * @version 1.0
336      */
337     virtual int32_t SetDataSource(DataSourceType dataType, int32_t &sourceId) = 0;
338 
339     /**
340      * @brief Sets the maximum duration of a recorded file, in seconds.
341      *
342      * This method must be called before {@link Prepare}. If the setting is valid,
343      * {@link RECORDER_INFO_MAX_DURATION_APPROACHING} is reported through {@link OnInfo} in the {@link RecorderCallback}
344      * class when only one second or 10% is left to reach the allowed duration.
345      * If the recording output file is set by calling {@link SetOutputFile}, call {@link SetNextOutputFile} to set the
346      * next output file. Otherwise, the current file will be overwritten when the allowed duration is reached.
347      *
348      * @param duration Indicates the maximum recording duration to set. If the value is <b>0</b> or a negative number,
349      * a failure message is returned. The default duration is 60s.
350      * @return Returns {@link SUCCESS} if the setting is successful; returns an error code defined
351      * in {@link media_errors.h} otherwise.
352      * @since 1.0
353      * @version 1.0
354      */
355     virtual int32_t SetMaxDuration(int32_t duration) = 0;
356 
357     /**
358      * @brief Sets the output file format.
359      *
360      * This function must be called before {@link Prepare}.
361      *
362      * @param format Indicates the output file format. For details, see {@link OutputFormatType}.
363      * @return Returns {@link SUCCESS} if the setting is successful; returns an error code defined
364      * in {@link media_errors.h} otherwise.
365      * @since 1.0
366      * @version 1.0
367      */
368     virtual int32_t SetOutputFormat(OutputFormatType format) = 0;
369 
370     /**
371      * @brief Sets the file descriptor (FD) of the output file.
372      *
373      * This function must be called before {@link Prepare}.
374      *
375      * @param fd Indicates the FD of the file.
376      * @return Returns {@link SUCCESS} if the setting is successful; returns an error code defined
377      * in {@link media_errors.h} otherwise.
378      * @since 1.0
379      * @version 1.0
380      */
381     virtual int32_t SetOutputFile(int32_t fd) = 0;
382 
383     virtual int32_t SetFileGenerationMode(FileGenerationMode mode) = 0;
384 
385     /**
386      * @brief Sets the FD of the next output file.
387      *
388      * If {@link SetOutputFile} is successful, call this function to set the FD of the next output file after
389      * {@link RECORDER_INFO_MAX_DURATION_APPROACHING} or {@link RECORDER_INFO_MAX_FILESIZE_APPROACHING} is received.
390      *
391      * @param fd Indicates the FD of the next output file.
392      * @return Returns {@link SUCCESS} if the setting is successful; returns an error code defined
393      * in {@link media_errors.h} otherwise.
394      * @since 1.0
395      * @version 1.0
396      */
397     virtual int32_t SetNextOutputFile(int32_t fd) = 0;
398 
399     /**
400      * @brief Sets the maximum size of a recorded file, in bytes.
401      *
402      * This function must be called before {@link Prepare}. If the setting is valid,
403      * {@link RECORDER_INFO_MAX_DURATION_APPROACHING} is reported through {@link OnInfo} in the {@link RecorderCallback}
404      * class when only 100 KB or 10% is left to reach the allowed size.
405      * If the recording output file is set by calling {@link SetOutputFile}, call {@link SetNextOutputFile} to set the
406      * next output file. Otherwise, when the allowed size is reached, the current file will be overwritten. If
407      * <b>MaxDuration</b> is also set by calling {@link SetMaxDuration}, <b>MaxDuration</b> or <b>MaxFileSize</b>
408      * prevails depending on which of them is first satisfied.
409      *
410      * @param size Indicates the maximum file size to set. If the value is <b>0</b> or a negative number, a failure
411      * message is returned.
412      * By default, the maximum size of a single file supported by the current file system is used as the limit.
413      * @return Returns {@link SUCCESS} if the setting is successful; returns an error code defined
414      * in {@link media_errors.h} otherwise.
415      * @since 1.0
416      * @version 1.0
417      */
418     virtual int32_t SetMaxFileSize(int64_t size) = 0;
419 
420     /**
421      * @brief Set and store the geodata (latitude and longitude) in the output file.
422      * This method should be called before prepare(). The geodata is stored in udta box if
423      * the output format is OutputFormat.THREE_GPP or OutputFormat.MPEG_4,
424      * and is ignored for other output formats.
425      *
426      * @param latitude float: latitude in degrees. Its value must be in the range [-90, 90].
427      * @param longitude float: longitude in degrees. Its value must be in the range [-180, 180].
428      * @since openharmony 3.1
429      * @version 1.0
430      */
431     virtual void SetLocation(float latitude, float longitude) = 0;
432 
433     /**
434      * @brief set the orientation hint in output file, and for the file to playback. mp4 support.
435      * the range of orientation should be {0, 90, 180, 270}, default is 0.
436      *
437      * @param rotation int32_t: should be {0, 90, 180, 270}, default is 0.
438      * @since openharmony 3.1
439      * @version 1.0
440      */
441     virtual void SetOrientationHint(int32_t rotation) = 0;
442 
443     /**
444      * @brief Registers a recording listener.
445      *
446      * This function must be called before {@link Prepare}.
447      *
448      * @param callback Indicates the recording listener to register. For details, see {@link RecorderCallback}.
449      * @return Returns {@link SUCCESS} if the listener is registered; returns an error code defined
450      * in {@link media_errors.h} otherwise.
451      * @since 1.0
452      * @version 1.0
453      */
454     virtual int32_t SetRecorderCallback(const std::shared_ptr<RecorderCallback> &callback) = 0;
455 
456     /**
457      * @brief Prepares for recording.
458      *
459      * This function must be called before {@link Start}.
460      *
461      * @return Returns {@link SUCCESS} if the preparation is successful; returns an error code defined
462      * in {@link media_errors.h} otherwise.
463      * @since 1.0
464      * @version 1.0
465      */
466     virtual int32_t Prepare() = 0;
467 
468     /**
469      * @brief Starts recording.
470      *
471      * This function must be called after {@link Prepare}.
472      *
473      * @return Returns {@link SUCCESS} if the recording is started; returns an error code defined
474      * in {@link media_errors.h} otherwise.
475      * @since 1.0
476      * @version 1.0
477      */
478     virtual int32_t Start() = 0;
479 
480     /**
481      * @brief Pauses recording.
482      *
483      * After {@link Start} is called, you can call this function to pause recording.
484      *
485      * @return Returns {@link SUCCESS} if the recording is paused; returns an error code defined
486      * in {@link media_errors.h} otherwise.
487      * @since 1.0
488      * @version 1.0
489      */
490     virtual int32_t Pause() = 0;
491 
492     /**
493     * @brief Resumes recording.
494     *
495     * You can call this function to resume recording after {@link Pause} is called.
496      *
497      * @return Returns {@link SUCCESS} if the recording is resumed; returns an error code defined
498      * in {@link media_errors.h} otherwise.
499      * @since 1.0
500      * @version 1.0
501      */
502     virtual int32_t Resume() = 0;
503 
504     /**
505      * @brief Stops recording.
506      *
507      * @param block Indicates the stop mode. The value <b>true</b> indicates that the processing stops after all caches
508      * are processed, and <b>false</b> indicates that the processing stops immediately and all caches are discarded.
509      * @return Returns {@link SUCCESS} if the recording is stopped; returns an error code defined
510      * in {@link media_errors.h} otherwise.
511      * @since 1.0
512      * @version 1.0
513      */
514     virtual int32_t Stop(bool block) = 0;
515 
516     /**
517      * @brief Resets the recording.
518      *
519      * After the function is called, add a recording source by calling {@link SetVideoSource} or {@link SetAudioSource},
520      * set related parameters, and call {@link Start} to start recording again after {@link Prepare} is called.
521      *
522      * @return Returns {@link SUCCESS} if the recording is reset; returns an error code defined
523      * in {@link media_errors.h} otherwise.
524      * @since 1.0
525      * @version 1.0
526      */
527     virtual int32_t Reset() = 0;
528 
529     /**
530      * @brief Releases recording resources.
531      *
532      * @return Returns {@link SUCCESS} if recording resources are released; returns an error code defined
533      * in {@link media_errors.h} otherwise.
534      * @since 1.0
535      * @version 1.0
536      */
537     virtual int32_t Release() = 0;
538 
539     /**
540      * @brief Manually splits a video.
541      *
542      * This function must be called after {@link Start}. After this function is called, the file is split based on the
543      * manual split type. After the manual split is complete, the initial split type is used. This function can be
544      * called again only after {@link RECORDER_INFO_FILE_SPLIT_FINISHED} is reported.
545      *
546      * @param type Indicates the file split type. For details, see {@link FileSplitType}.
547      * @param timestamp Indicates the file split timestamp. This parameter is not supported currently and can be set to
548      * <b>-1</b>. The recording module splits a file based on the call time.
549      * @param duration Indicates the duration for splitting the file.
550      * @return Returns {@link SUCCESS} if the video is manually split; returns an error code defined
551      * in {@link media_errors.h} otherwise.
552      * @since 1.0
553      * @version 1.0
554      */
555     virtual int32_t SetFileSplitDuration(FileSplitType type, int64_t timestamp, uint32_t duration) = 0;
556 
557     /**
558      * @brief Sets an extended parameter for recording, for example, {@link RECORDER_PRE_CACHE_DURATION}.
559      *
560      * @param sourceId Indicates the data source ID. The value <b>-1</b> indicates all sources.
561      * @param format Indicates the string key and value. For details, see {@link Format} and
562      * {@link RECORDER_PRE_CACHE_DURATION}.
563      * @return Returns {@link SUCCESS} if the setting is successful; returns an error code defined
564      * in {@link media_errors.h} otherwise.
565      * @since 1.0
566      * @version 1.0
567      */
568     virtual int32_t SetParameter(int32_t sourceId, const Format &format) = 0;
569 
570     virtual int32_t GetAVRecorderConfig(ConfigMap &configMap) = 0;
571 
572     virtual int32_t GetLocation(Location &location) = 0;
573 
574     virtual int32_t GetCurrentCapturerChangeInfo(AudioRecorderChangeInfo &changeInfo) = 0;
575 
576     virtual int32_t GetAvailableEncoder(std::vector<EncoderCapabilityData> &encoderInfo) = 0;
577 
578     virtual int32_t GetMaxAmplitude() = 0;
579 
580     /**
581      * @brief Custom parameter
582      *
583      * @param userMeta The user Custom Parameters
584      * @return Returns {@link SUCCESS} if the setting is successful; returns an error code defined
585      * in {@link media_errors.h} otherwise.
586     */
587     virtual int32_t SetUserCustomInfo(Meta &userCustomInfo) = 0;
588 
589     /**
590      * @brief genre
591      *
592      * @param genre genre
593      * @return Returns {@link SUCCESS} if the setting is successful; returns an error code defined
594      * in {@link media_errors.h} otherwise.
595     */
596     virtual int32_t SetGenre(std::string &genre) = 0;
597 
598     /**
599      * @brief Check if the avrecorder has watermark capability.
600      *
601      * @param isWatermarkSupported
602      * @return Returns {@link SUCCESS} if the setting is successful; returns an error code defined
603      * in {@link media_errors.h} otherwise.
604     */
605     virtual int32_t IsWatermarkSupported(bool &isWatermarkSupported) = 0;
606 
607     virtual int32_t SetWatermark(std::shared_ptr<AVBuffer> &waterMarkBuffer) = 0;
608 };
609 } // namespace Media
610 } // namespace OHOS
611 #endif // I_RECORDER_SERVICE_H
612