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 SetVideoEnableStableQualityMode. 202 * 203 * @param sourceId Indicates the video source ID, which can be obtained from {@link SetVideoSource}. 204 * @param enableStableQualityMode Indicates the stable quality mode to set. 205 * @return Returns {@link MSERR_OK} if the setting is successful; returns an error code otherwise. 206 * @since 1.0 207 * @version 1.0 208 */ 209 virtual int32_t SetVideoEnableStableQualityMode(int32_t sourceId, bool enableStableQualityMode) = 0; 210 211 /** 212 * @brief Sets the video capture rate. 213 * 214 * This function must be called after {@link SetVideoSource} but before {@link Prepare}. It is valid when the 215 * video source is YUV or RGB. 216 * 217 * @param sourceId Indicates the video source ID, which can be obtained from {@link SetVideoSource}. 218 * @param fps Indicates the rate at which frames are captured per second. 219 * @return Returns {@link SUCCESS} if the setting is successful; returns an error code defined 220 * in {@link media_errors.h} otherwise. 221 * @since 1.0 222 * @version 1.0 223 */ 224 virtual int32_t SetCaptureRate(int32_t sourceId, double fps) = 0; 225 226 /** 227 * @brief Obtains the surface of the video source. 228 * 229 * @param sourceId Indicates the video source ID, which can be obtained from {@link SetVideoSource}. 230 * @return Returns the pointer to the surface. 231 * @since 1.0 232 * @version 1.0 233 */ 234 virtual sptr<OHOS::Surface> GetSurface(int32_t sourceId) = 0; 235 236 /** 237 * @brief Obtains the surface of the meta track. 238 * 239 * @param sourceId Indicates the video source ID, which can be obtained from {@link SetMetaSource}. 240 * @return Returns the pointer to the surface. 241 * @since 1.0 242 * @version 1.0 243 */ 244 virtual sptr<OHOS::Surface> GetMetaSurface(int32_t sourceId) = 0; 245 246 /** 247 * @brief Sets the audio source for recording. 248 * 249 * If this function is not called, the output file does not contain the audio track. 250 * 251 * @param source Indicates the audio source type. For details, see {@link AudioSourceType}. 252 * @param sourceId Indicates the audio source ID. The value <b>-1</b> indicates an invalid ID and the setting fails. 253 * @return Returns {@link SUCCESS} if the setting is successful; returns an error code defined 254 * in {@link media_errors.h} otherwise. 255 * @since 1.0 256 * @version 1.0 257 */ 258 virtual int32_t SetAudioSource(AudioSourceType source, int32_t &sourceId) = 0; 259 260 /** 261 * @brief Sets the audio data source for recording. 262 * 263 * If this function is not called, the output file does not contain the audio track. 264 * 265 * @param source Indicates the audio source type. For details, see {@link AudioSourceType}. 266 * @param sourceId Indicates the audio source ID. The value <b>-1</b> indicates an invalid ID and the setting fails. 267 * @return Returns {@link SUCCESS} if the setting is successful; returns an error code defined 268 * in {@link media_errors.h} otherwise. 269 * @since 12.0 270 * @version 12.0 271 */ SetAudioDataSource(const std::shared_ptr<IAudioDataSource> & audioSource,int32_t & sourceId)272 virtual int32_t SetAudioDataSource(const std::shared_ptr<IAudioDataSource>& audioSource, int32_t& sourceId) 273 { 274 (void)audioSource; 275 (void)sourceId; 276 return 0; 277 }; 278 279 /** 280 * @brief Sets an audio encoder for recording. 281 * 282 * If this function is not called, the output file does not contain the audio track. 283 * This function must be called after {@link SetAudioSource} but before {@link Prepare}. 284 * 285 * @param sourceId Indicates the audio source ID, which can be obtained from {@link SetAudioSource}. 286 * @param encoder Indicates the audio encoder to set. 287 * @return Returns {@link SUCCESS} if the setting is successful; returns an error code defined 288 * in {@link media_errors.h} otherwise. 289 * @since 1.0 290 * @version 1.0 291 */ 292 virtual int32_t SetAudioEncoder(int32_t sourceId, AudioCodecFormat encoder) = 0; 293 294 /** 295 * @brief Sets the audio sampling rate for recording. 296 * 297 * This function must be called after {@link SetAudioSource} but before {@link Prepare}. 298 * 299 * @param sourceId Indicates the audio source ID, which can be obtained from {@link SetAudioSource}. 300 * @param rate Indicates the sampling rate of the audio per second. 301 * @return Returns {@link SUCCESS} if the setting is successful; returns an error code defined 302 * in {@link media_errors.h} otherwise. 303 * @since 1.0 304 * @version 1.0 305 */ 306 virtual int32_t SetAudioSampleRate(int32_t sourceId, int32_t rate) = 0; 307 308 /** 309 * @brief Sets the number of audio channels to record. 310 * 311 * This function must be called after {@link SetAudioSource} but before {@link Prepare}. 312 * 313 * @param sourceId Indicates the audio source ID, which can be obtained from {@link SetAudioSource}. 314 * @param num Indicates the number of audio channels to set. 315 * @return Returns {@link SUCCESS} if the setting is successful; returns an error code defined 316 * in {@link media_errors.h} otherwise. 317 * @since 1.0 318 * @version 1.0 319 */ 320 virtual int32_t SetAudioChannels(int32_t sourceId, int32_t num) = 0; 321 322 /** 323 * @brief Sets the encoding bit rate of the audio to record. 324 * 325 * This function must be called after {@link SetAudioSource} but before {@link Prepare}. 326 * 327 * @param sourceId Indicates the audio source ID, which can be obtained from {@link SetAudioSource}. 328 * @param bitRate Indicates the audio encoding bit rate, in bit/s. 329 * @return Returns {@link SUCCESS} if the setting is successful; returns an error code defined 330 * in {@link media_errors.h} otherwise. 331 * @since 1.0 332 * @version 1.0 333 */ 334 virtual int32_t SetAudioEncodingBitRate(int32_t sourceId, int32_t bitRate) = 0; 335 336 /** 337 * @brief Sets a data source for recording. 338 * 339 * If this function is not called, the output file does not contain the data track. 340 * 341 * @param sourceId Indicates the data source ID. The value <b>-1</b> indicates an invalid ID and the setting fails. 342 * 343 * @return Returns {@link SUCCESS} if the setting is successful; returns an error code defined 344 * in {@link media_errors.h} otherwise. 345 * @since 1.0 346 * @version 1.0 347 */ 348 virtual int32_t SetDataSource(DataSourceType dataType, int32_t &sourceId) = 0; 349 350 /** 351 * @brief Sets the maximum duration of a recorded file, in seconds. 352 * 353 * This method must be called before {@link Prepare}. If the setting is valid, 354 * {@link RECORDER_INFO_MAX_DURATION_APPROACHING} is reported through {@link OnInfo} in the {@link RecorderCallback} 355 * class when only one second or 10% is left to reach the allowed duration. 356 * If the recording output file is set by calling {@link SetOutputFile}, call {@link SetNextOutputFile} to set the 357 * next output file. Otherwise, the current file will be overwritten when the allowed duration is reached. 358 * 359 * @param duration Indicates the maximum recording duration to set. If the value is <b>0</b> or a negative number, 360 * a failure message is returned. The default duration is 60s. 361 * @return Returns {@link SUCCESS} if the setting is successful; returns an error code defined 362 * in {@link media_errors.h} otherwise. 363 * @since 1.0 364 * @version 1.0 365 */ 366 virtual int32_t SetMaxDuration(int32_t duration) = 0; 367 368 /** 369 * @brief Sets the output file format. 370 * 371 * This function must be called before {@link Prepare}. 372 * 373 * @param format Indicates the output file format. For details, see {@link OutputFormatType}. 374 * @return Returns {@link SUCCESS} if the setting is successful; returns an error code defined 375 * in {@link media_errors.h} otherwise. 376 * @since 1.0 377 * @version 1.0 378 */ 379 virtual int32_t SetOutputFormat(OutputFormatType format) = 0; 380 381 /** 382 * @brief Sets the file descriptor (FD) of the output file. 383 * 384 * This function must be called before {@link Prepare}. 385 * 386 * @param fd Indicates the FD of the file. 387 * @return Returns {@link SUCCESS} if the setting is successful; returns an error code defined 388 * in {@link media_errors.h} otherwise. 389 * @since 1.0 390 * @version 1.0 391 */ 392 virtual int32_t SetOutputFile(int32_t fd) = 0; 393 394 virtual int32_t SetFileGenerationMode(FileGenerationMode mode) = 0; 395 396 /** 397 * @brief Sets the FD of the next output file. 398 * 399 * If {@link SetOutputFile} is successful, call this function to set the FD of the next output file after 400 * {@link RECORDER_INFO_MAX_DURATION_APPROACHING} or {@link RECORDER_INFO_MAX_FILESIZE_APPROACHING} is received. 401 * 402 * @param fd Indicates the FD of the next output file. 403 * @return Returns {@link SUCCESS} if the setting is successful; returns an error code defined 404 * in {@link media_errors.h} otherwise. 405 * @since 1.0 406 * @version 1.0 407 */ 408 virtual int32_t SetNextOutputFile(int32_t fd) = 0; 409 410 /** 411 * @brief Sets the maximum size of a recorded file, in bytes. 412 * 413 * This function must be called before {@link Prepare}. If the setting is valid, 414 * {@link RECORDER_INFO_MAX_DURATION_APPROACHING} is reported through {@link OnInfo} in the {@link RecorderCallback} 415 * class when only 100 KB or 10% is left to reach the allowed size. 416 * If the recording output file is set by calling {@link SetOutputFile}, call {@link SetNextOutputFile} to set the 417 * next output file. Otherwise, when the allowed size is reached, the current file will be overwritten. If 418 * <b>MaxDuration</b> is also set by calling {@link SetMaxDuration}, <b>MaxDuration</b> or <b>MaxFileSize</b> 419 * prevails depending on which of them is first satisfied. 420 * 421 * @param size Indicates the maximum file size to set. If the value is <b>0</b> or a negative number, a failure 422 * message is returned. 423 * By default, the maximum size of a single file supported by the current file system is used as the limit. 424 * @return Returns {@link SUCCESS} if the setting is successful; returns an error code defined 425 * in {@link media_errors.h} otherwise. 426 * @since 1.0 427 * @version 1.0 428 */ 429 virtual int32_t SetMaxFileSize(int64_t size) = 0; 430 431 /** 432 * @brief Set and store the geodata (latitude and longitude) in the output file. 433 * This method should be called before prepare(). The geodata is stored in udta box if 434 * the output format is OutputFormat.THREE_GPP or OutputFormat.MPEG_4, 435 * and is ignored for other output formats. 436 * 437 * @param latitude float: latitude in degrees. Its value must be in the range [-90, 90]. 438 * @param longitude float: longitude in degrees. Its value must be in the range [-180, 180]. 439 * @since openharmony 3.1 440 * @version 1.0 441 */ 442 virtual void SetLocation(float latitude, float longitude) = 0; 443 444 /** 445 * @brief set the orientation hint in output file, and for the file to playback. mp4 support. 446 * the range of orientation should be {0, 90, 180, 270}, default is 0. 447 * 448 * @param rotation int32_t: should be {0, 90, 180, 270}, default is 0. 449 * @since openharmony 3.1 450 * @version 1.0 451 */ 452 virtual void SetOrientationHint(int32_t rotation) = 0; 453 454 /** 455 * @brief Registers a recording listener. 456 * 457 * This function must be called before {@link Prepare}. 458 * 459 * @param callback Indicates the recording listener to register. For details, see {@link RecorderCallback}. 460 * @return Returns {@link SUCCESS} if the listener is registered; returns an error code defined 461 * in {@link media_errors.h} otherwise. 462 * @since 1.0 463 * @version 1.0 464 */ 465 virtual int32_t SetRecorderCallback(const std::shared_ptr<RecorderCallback> &callback) = 0; 466 467 /** 468 * @brief Prepares for recording. 469 * 470 * This function must be called before {@link Start}. 471 * 472 * @return Returns {@link SUCCESS} if the preparation is successful; returns an error code defined 473 * in {@link media_errors.h} otherwise. 474 * @since 1.0 475 * @version 1.0 476 */ 477 virtual int32_t Prepare() = 0; 478 479 /** 480 * @brief Starts recording. 481 * 482 * This function must be called after {@link Prepare}. 483 * 484 * @return Returns {@link SUCCESS} if the recording is started; returns an error code defined 485 * in {@link media_errors.h} otherwise. 486 * @since 1.0 487 * @version 1.0 488 */ 489 virtual int32_t Start() = 0; 490 491 /** 492 * @brief Pauses recording. 493 * 494 * After {@link Start} is called, you can call this function to pause recording. 495 * 496 * @return Returns {@link SUCCESS} if the recording is paused; returns an error code defined 497 * in {@link media_errors.h} otherwise. 498 * @since 1.0 499 * @version 1.0 500 */ 501 virtual int32_t Pause() = 0; 502 503 /** 504 * @brief Resumes recording. 505 * 506 * You can call this function to resume recording after {@link Pause} is called. 507 * 508 * @return Returns {@link SUCCESS} if the recording is resumed; returns an error code defined 509 * in {@link media_errors.h} otherwise. 510 * @since 1.0 511 * @version 1.0 512 */ 513 virtual int32_t Resume() = 0; 514 515 /** 516 * @brief Stops recording. 517 * 518 * @param block Indicates the stop mode. The value <b>true</b> indicates that the processing stops after all caches 519 * are processed, and <b>false</b> indicates that the processing stops immediately and all caches are discarded. 520 * @return Returns {@link SUCCESS} if the recording is stopped; returns an error code defined 521 * in {@link media_errors.h} otherwise. 522 * @since 1.0 523 * @version 1.0 524 */ 525 virtual int32_t Stop(bool block) = 0; 526 527 /** 528 * @brief Resets the recording. 529 * 530 * After the function is called, add a recording source by calling {@link SetVideoSource} or {@link SetAudioSource}, 531 * set related parameters, and call {@link Start} to start recording again after {@link Prepare} is called. 532 * 533 * @return Returns {@link SUCCESS} if the recording is reset; returns an error code defined 534 * in {@link media_errors.h} otherwise. 535 * @since 1.0 536 * @version 1.0 537 */ 538 virtual int32_t Reset() = 0; 539 540 /** 541 * @brief Releases recording resources. 542 * 543 * @return Returns {@link SUCCESS} if recording resources are released; returns an error code defined 544 * in {@link media_errors.h} otherwise. 545 * @since 1.0 546 * @version 1.0 547 */ 548 virtual int32_t Release() = 0; 549 550 /** 551 * @brief Manually splits a video. 552 * 553 * This function must be called after {@link Start}. After this function is called, the file is split based on the 554 * manual split type. After the manual split is complete, the initial split type is used. This function can be 555 * called again only after {@link RECORDER_INFO_FILE_SPLIT_FINISHED} is reported. 556 * 557 * @param type Indicates the file split type. For details, see {@link FileSplitType}. 558 * @param timestamp Indicates the file split timestamp. This parameter is not supported currently and can be set to 559 * <b>-1</b>. The recording module splits a file based on the call time. 560 * @param duration Indicates the duration for splitting the file. 561 * @return Returns {@link SUCCESS} if the video is manually split; returns an error code defined 562 * in {@link media_errors.h} otherwise. 563 * @since 1.0 564 * @version 1.0 565 */ 566 virtual int32_t SetFileSplitDuration(FileSplitType type, int64_t timestamp, uint32_t duration) = 0; 567 568 /** 569 * @brief Sets an extended parameter for recording, for example, {@link RECORDER_PRE_CACHE_DURATION}. 570 * 571 * @param sourceId Indicates the data source ID. The value <b>-1</b> indicates all sources. 572 * @param format Indicates the string key and value. For details, see {@link Format} and 573 * {@link RECORDER_PRE_CACHE_DURATION}. 574 * @return Returns {@link SUCCESS} if the setting is successful; returns an error code defined 575 * in {@link media_errors.h} otherwise. 576 * @since 1.0 577 * @version 1.0 578 */ 579 virtual int32_t SetParameter(int32_t sourceId, const Format &format) = 0; 580 581 virtual int32_t GetAVRecorderConfig(ConfigMap &configMap) = 0; 582 583 virtual int32_t GetLocation(Location &location) = 0; 584 585 virtual int32_t GetCurrentCapturerChangeInfo(AudioRecorderChangeInfo &changeInfo) = 0; 586 587 virtual int32_t GetAvailableEncoder(std::vector<EncoderCapabilityData> &encoderInfo) = 0; 588 589 virtual int32_t GetMaxAmplitude() = 0; 590 591 /** 592 * @brief Custom parameter 593 * 594 * @param userMeta The user Custom Parameters 595 * @return Returns {@link SUCCESS} if the setting is successful; returns an error code defined 596 * in {@link media_errors.h} otherwise. 597 */ 598 virtual int32_t SetUserCustomInfo(Meta &userCustomInfo) = 0; 599 600 /** 601 * @brief genre 602 * 603 * @param genre genre 604 * @return Returns {@link SUCCESS} if the setting is successful; returns an error code defined 605 * in {@link media_errors.h} otherwise. 606 */ 607 virtual int32_t SetGenre(std::string &genre) = 0; 608 609 /** 610 * @brief Check if the avrecorder has watermark capability. 611 * 612 * @param isWatermarkSupported 613 * @return Returns {@link SUCCESS} if the setting is successful; returns an error code defined 614 * in {@link media_errors.h} otherwise. 615 */ 616 virtual int32_t IsWatermarkSupported(bool &isWatermarkSupported) = 0; 617 618 virtual int32_t SetWatermark(std::shared_ptr<AVBuffer> &waterMarkBuffer) = 0; 619 }; 620 } // namespace Media 621 } // namespace OHOS 622 #endif // I_RECORDER_SERVICE_H 623