1 /* 2 * Copyright (C) 2023 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 /** 17 * @addtogroup VideoEncoder 18 * @{ 19 * 20 * @brief The VideoEncoder module provides interfaces for video encoding. 21 * 22 * @syscap SystemCapability.Multimedia.VideoEncoder 23 * @since 9 24 */ 25 26 /** 27 * @file native_avcodec_videoencoder.h 28 * 29 * @brief Declare the interface used for video encoding. 30 * 31 * @kit AVCodecKit 32 * @library libnative_media_venc.so 33 * @syscap SystemCapability.Multimedia.Media.VideoEncoder 34 * @since 9 35 */ 36 37 #ifndef NATIVE_AVCODEC_VIDEOENCODER_H 38 #define NATIVE_AVCODEC_VIDEOENCODER_H 39 40 #include <stdint.h> 41 #include <stdio.h> 42 #include "native_avcodec_base.h" 43 44 #ifdef __cplusplus 45 extern "C" { 46 #endif 47 48 /** 49 * @brief When OH_AVCodec needs new input parameter during the running process, the function pointer will be called and 50 * carry an available OH_AVFormat to fill in the new input parameter. This parameter takes effect immediately with the 51 * frame. 52 * 53 * @syscap SystemCapability.Multimedia.Media.VideoEncoder 54 * @param codec OH_AVCodec instance 55 * @param index The index corresponding to the new OH_AVFormat instance 56 * @param parameter Parameter containing the new OH_AVFormat instance 57 * @param userData specified data 58 * @since 12 59 */ 60 typedef void (*OH_VideoEncoder_OnNeedInputParameter)(OH_AVCodec *codec, uint32_t index, OH_AVFormat *parameter, 61 void *userData); 62 63 /** 64 * @brief Creates a video encoder instance from the mime type, which is recommended in most cases. 65 * @syscap SystemCapability.Multimedia.Media.VideoEncoder 66 * @param mime mime type description string, refer to {@link AVCODEC_MIME_TYPE} 67 * @return Returns a Pointer to an OH_AVCodec instance. 68 * Return nullptr if memory ran out or the mime type is not supported. 69 * @since 9 70 */ 71 OH_AVCodec *OH_VideoEncoder_CreateByMime(const char *mime); 72 73 /** 74 * @brief Create a video encoder instance through the video encoder name. The premise of using this interface is to 75 * know the exact name of the encoder. 76 * @syscap SystemCapability.Multimedia.Media.VideoEncoder 77 * @param name Video encoder name 78 * @return Returns a Pointer to an OH_AVCodec instance. 79 * Return nullptr if memory ran out or the encoder name is not supported. 80 * @since 9 81 */ 82 OH_AVCodec *OH_VideoEncoder_CreateByName(const char *name); 83 84 /** 85 * @brief Clear the internal resources of the encoder and destroy the encoder instance 86 * @syscap SystemCapability.Multimedia.Media.VideoEncoder 87 * @param codec Pointer to an OH_AVCodec instance 88 * @return Returns AV_ERR_OK if the execution is successful, 89 * otherwise returns a specific error code, refer to {@link OH_AVErrCode}. 90 * {@link AV_ERR_NO_MEMORY}, inner resource has already released. 91 * {@link AV_ERR_INVALID_VAL}, the encoder is nullptr or invalid. 92 * {@link AV_ERR_UNKNOWN}, unknown error. 93 * {@link AV_ERR_SERVICE_DIED}, avcodec service is died. 94 * @since 9 95 */ 96 OH_AVErrCode OH_VideoEncoder_Destroy(OH_AVCodec *codec); 97 98 /** 99 * @brief Set the asynchronous callback function so that your application can respond to the events generated by the 100 * video encoder. This interface must be called before Prepare is called. 101 * @syscap SystemCapability.Multimedia.Media.VideoEncoder 102 * @param codec Pointer to an OH_AVCodec instance 103 * @param callback A collection of all callback functions, see {@link OH_AVCodecAsyncCallback} 104 * @param userData User specific data 105 * @return Returns AV_ERR_OK if the execution is successful, 106 * otherwise returns a specific error code, refer to {@link OH_AVErrCode}. 107 * {@link AV_ERR_NO_MEMORY}, inner resource has already released. 108 * {@link AV_ERR_INVALID_VAL}, the encoder is nullptr or invalid. 109 * {@link AV_ERR_UNKNOWN}, unknown error. 110 * {@link AV_ERR_SERVICE_DIED}, avcodec service is died. 111 * {@link AV_ERR_INVALID_STATE}, this interface was called in invalid state, must be called before Prepare. 112 * @deprecated since 11 113 * @useinstead OH_VideoEncoder_RegisterCallback 114 * @since 9 115 */ 116 OH_AVErrCode OH_VideoEncoder_SetCallback(OH_AVCodec *codec, OH_AVCodecAsyncCallback callback, void *userData); 117 118 /** 119 * @brief Set the asynchronous callback function so that your application can respond to the events generated by the 120 * video encoder. This interface must be called before Prepare is called. 121 * @syscap SystemCapability.Multimedia.Media.VideoEncoder 122 * @param codec Pointer to an OH_AVCodec instance 123 * @param callback A collection of all callback functions, see {@link OH_AVCodecCallback} 124 * @param userData User specific data 125 * @return Returns AV_ERR_OK if the execution is successful, 126 * otherwise returns a specific error code, refer to {@link OH_AVErrCode}. 127 * {@link AV_ERR_NO_MEMORY}, inner resource has already released. 128 * {@link AV_ERR_INVALID_VAL}, the encoder is nullptr or invalid. 129 * {@link AV_ERR_UNKNOWN}, unknown error. 130 * {@link AV_ERR_SERVICE_DIED}, avcodec service is died. 131 * {@link AV_ERR_INVALID_STATE}, this interface was called in invalid state, must be called before Prepare. 132 * @since 11 133 */ 134 OH_AVErrCode OH_VideoEncoder_RegisterCallback(OH_AVCodec *codec, OH_AVCodecCallback callback, void *userData); 135 136 /** 137 * @brief Set the asynchronous callback function so that your application can respond to the events generated by the 138 * video encoder. This interface is optional only for input surface. If this interface is used, it must be invoked 139 * before {@link OH_VideoEncoder_Configure}. 140 * 141 * @syscap SystemCapability.Multimedia.Media.VideoEncoder 142 * @param codec Pointer to an OH_AVCodec instance 143 * @param onInputParameter A callback functions, see {@link OH_VideoEncoder_OnNeedInputParameter} 144 * @param userData User specific data 145 * @return Returns AV_ERR_OK if the execution is successful, 146 * otherwise returns a specific error code, refer to {@link OH_AVErrCode}. 147 * {@link AV_ERR_NO_MEMORY}, inner resource has already released. 148 * {@link AV_ERR_INVALID_VAL}, the encoder is nullptr or invalid. 149 * {@link AV_ERR_UNKNOWN}, unknown error. 150 * {@link AV_ERR_SERVICE_DIED}, avcodec service is died. 151 * {@link AV_ERR_INVALID_STATE}, this interface was called in invalid state, must be called before Prepare. 152 * @since 12 153 */ 154 OH_AVErrCode OH_VideoEncoder_RegisterParameterCallback(OH_AVCodec *codec, 155 OH_VideoEncoder_OnNeedInputParameter onInputParameter, 156 void *userData); 157 158 /** 159 * @brief To configure the video encoder, typically, you need to configure the description information of the 160 * encoded video track. This interface must be called before Prepare is called. 161 * @syscap SystemCapability.Multimedia.Media.VideoEncoder 162 * @param codec Pointer to an OH_AVCodec instance 163 * @param format A pointer to an OH_AVFormat that gives the description of the video track to be encoded 164 * @return Returns AV_ERR_OK if the execution is successful, 165 * otherwise returns a specific error code, refer to {@link OH_AVErrCode}. 166 * {@link AV_ERR_NO_MEMORY}, instance has already released. 167 * {@link AV_ERR_INVALID_VAL}, the encoder is nullptr or invalid. Invalid param in format. 168 * {@link AV_ERR_UNKNOWN}, unknown error. 169 * {@link AV_ERR_SERVICE_DIED}, avcodec service is died. 170 * {@link AV_ERR_INVALID_STATE}, this interface was called in invalid state, must be called before Prepare. 171 * @since 9 172 */ 173 OH_AVErrCode OH_VideoEncoder_Configure(OH_AVCodec *codec, OH_AVFormat *format); 174 175 /** 176 * @brief To prepare the internal resources of the encoder, the Configure interface must be called before 177 * calling this interface. 178 * @syscap SystemCapability.Multimedia.Media.VideoEncoder 179 * @param codec Pointer to an OH_AVCodec instance 180 * @return Returns AV_ERR_OK if the execution is successful, 181 * otherwise returns a specific error code, refer to {@link OH_AVErrCode}. 182 * {@link AV_ERR_NO_MEMORY}, instance has already released. 183 * {@link AV_ERR_INVALID_VAL}, the encoder is nullptr or invalid. 184 * {@link AV_ERR_UNKNOWN}, unknown error. 185 * {@link AV_ERR_SERVICE_DIED}, avcodec service is died. 186 * {@link AV_ERR_INVALID_STATE}, this interface was called in invalid state. 187 * @since 9 188 */ 189 OH_AVErrCode OH_VideoEncoder_Prepare(OH_AVCodec *codec); 190 191 /** 192 * @brief Start the encoder, this interface must be called after the Prepare is successful. After being 193 * successfully started, the encoder will start reporting NeedInputData events. 194 * @syscap SystemCapability.Multimedia.Media.VideoEncoder 195 * @param codec Pointer to an OH_AVCodec instance 196 * @return Returns AV_ERR_OK if the execution is successful, 197 * otherwise returns a specific error code, refer to {@link OH_AVErrCode}. 198 * {@link AV_ERR_NO_MEMORY}, instance has already released. 199 * {@link AV_ERR_INVALID_VAL}, the encoder is nullptr or invalid. 200 * {@link AV_ERR_UNKNOWN}, unknown error. 201 * {@link AV_ERR_SERVICE_DIED}, avcodec service is died. 202 * {@link AV_ERR_INVALID_STATE}, this interface was called in invalid state. 203 * @since 9 204 */ 205 OH_AVErrCode OH_VideoEncoder_Start(OH_AVCodec *codec); 206 207 /** 208 * @brief Stop the encoder. After stopping, you can re-enter the Started state through Start. 209 * @syscap SystemCapability.Multimedia.Media.VideoEncoder 210 * @param codec Pointer to an OH_AVCodec instance 211 * @return Returns AV_ERR_OK if the execution is successful, 212 * otherwise returns a specific error code, refer to {@link OH_AVErrCode}. 213 * {@link AV_ERR_NO_MEMORY}, instance has already released. 214 * {@link AV_ERR_INVALID_VAL}, the encoder is nullptr or invalid. 215 * {@link AV_ERR_UNKNOWN}, unknown error. 216 * {@link AV_ERR_SERVICE_DIED}, avcodec service is died. 217 * {@link AV_ERR_INVALID_STATE}, this interface was called in invalid state. 218 * @since 9 219 */ 220 OH_AVErrCode OH_VideoEncoder_Stop(OH_AVCodec *codec); 221 222 /** 223 * @brief Clear the input and output data buffered in the encoder. After this interface is called, all the Buffer 224 * indexes previously reported through the asynchronous callback will be invalidated, make sure not to access the 225 * Buffers corresponding to these indexes. 226 * @syscap SystemCapability.Multimedia.Media.VideoEncoder 227 * @param codec Pointer to an OH_AVCodec instance 228 * @return Returns AV_ERR_OK if the execution is successful, 229 * otherwise returns a specific error code, refer to {@link OH_AVErrCode}. 230 * {@link AV_ERR_NO_MEMORY}, instance has already released. 231 * {@link AV_ERR_INVALID_VAL}, the encoder is nullptr or invalid. 232 * {@link AV_ERR_UNKNOWN}, unknown error. 233 * {@link AV_ERR_SERVICE_DIED}, avcodec service is died. 234 * {@link AV_ERR_INVALID_STATE}, this interface was called in invalid state. 235 * @since 9 236 */ 237 OH_AVErrCode OH_VideoEncoder_Flush(OH_AVCodec *codec); 238 239 /** 240 * @brief Reset the encoder. To continue coding, you need to call the Configure interface again to 241 * configure the encoder instance. 242 * @syscap SystemCapability.Multimedia.Media.VideoEncoder 243 * @param codec Pointer to an OH_AVCodec instance 244 * @return Returns AV_ERR_OK if the execution is successful, 245 * otherwise returns a specific error code, refer to {@link OH_AVErrCode}. 246 * {@link AV_ERR_NO_MEMORY}, instance has already released. 247 * {@link AV_ERR_INVALID_VAL}, the encoder is nullptr or invalid. 248 * {@link AV_ERR_UNKNOWN}, unknown error. 249 * {@link AV_ERR_SERVICE_DIED}, avcodec service is died. 250 * {@link AV_ERR_INVALID_STATE}, this interface was called in invalid state. 251 * @since 9 252 */ 253 OH_AVErrCode OH_VideoEncoder_Reset(OH_AVCodec *codec); 254 255 /** 256 * @brief Get the description information of the output data of the encoder, refer to {@link OH_AVFormat} for details. 257 * It should be noted that the life cycle of the OH_AVFormat instance pointed to by the return value * needs to 258 * be manually released by the caller. 259 * @syscap SystemCapability.Multimedia.Media.VideoEncoder 260 * @param codec Pointer to an OH_AVCodec instance 261 * @return Returns a pointer to an OH_AVFormat instance. 262 * Return nullptr if the codec is nullptr or invaild. 263 * @since 9 264 */ 265 OH_AVFormat *OH_VideoEncoder_GetOutputDescription(OH_AVCodec *codec); 266 267 /** 268 * @brief Set dynamic parameters to the encoder. Note: This interface can only be called after the encoder is started. 269 * At the same time, incorrect parameter settings may cause the encoding to fail. 270 * @syscap SystemCapability.Multimedia.Media.VideoEncoder 271 * @param codec Pointer to an OH_AVCodec instance 272 * @param format OH_AVFormat handle pointer 273 * @return Returns AV_ERR_OK if the execution is successful, 274 * otherwise returns a specific error code, refer to {@link OH_AVErrCode}. 275 * {@link AV_ERR_NO_MEMORY}, instance has already released. 276 * {@link AV_ERR_INVALID_VAL}, the encoder is nullptr or invalid. Invalid param in format. 277 * {@link AV_ERR_UNKNOWN}, unknown error. 278 * {@link AV_ERR_SERVICE_DIED}, avcodec service is died. 279 * {@link AV_ERR_INVALID_STATE}, this interface was called in invalid state. 280 * @since 9 281 */ 282 OH_AVErrCode OH_VideoEncoder_SetParameter(OH_AVCodec *codec, OH_AVFormat *format); 283 284 /** 285 * @brief Get the input Surface from the video encoder, this interface must be called before Prepare is called. 286 * @syscap SystemCapability.Multimedia.Media.VideoEncoder 287 * @param codec Pointer to an OH_AVCodec instance 288 * @param window A pointer to a OHNativeWindow instance, see {@link OHNativeWindow}, the application is responsible for 289 * managing the life cycle of the window, call OH_NativeWindow_DestroyNativeWindow() when done. 290 * @return Returns AV_ERR_OK if the execution is successful, 291 * otherwise returns a specific error code, refer to {@link OH_AVErrCode}. 292 * {@link AV_ERR_NO_MEMORY}, inner resource has already released. 293 * {@link AV_ERR_INVALID_VAL}, the encoder is nullptr or invalid. 294 * {@link AV_ERR_UNKNOWN}, unknown error. 295 * {@link AV_ERR_SERVICE_DIED}, avcodec service is died. 296 * {@link AV_ERR_INVALID_STATE}, this interface was called in invalid state. 297 * @since 9 298 */ 299 OH_AVErrCode OH_VideoEncoder_GetSurface(OH_AVCodec *codec, OHNativeWindow **window); 300 301 /** 302 * @brief Return the processed output Buffer to the encoder. 303 * @syscap SystemCapability.Multimedia.Media.VideoEncoder 304 * @param codec Pointer to an OH_AVCodec instance 305 * @param index The index value corresponding to the output Buffer 306 * @return Returns AV_ERR_OK if the execution is successful, 307 * otherwise returns a specific error code, refer to {@link OH_AVErrCode}. 308 * {@link AV_ERR_NO_MEMORY}, instance has already released. 309 * {@link AV_ERR_INVALID_VAL}, the encoder is nullptr or invalid. 310 * Buffer index should be given by {@link OH_AVCodecOnNewOutputData}. 311 * {@link AV_ERR_UNKNOWN}, unknown error. 312 * {@link AV_ERR_SERVICE_DIED}, avcodec service is died. 313 * {@link AV_ERR_INVALID_STATE}, this interface was called in invalid state. 314 * @deprecated since 11 315 * @useinstead OH_VideoEncoder_FreeOutputBuffer 316 * @since 9 317 */ 318 OH_AVErrCode OH_VideoEncoder_FreeOutputData(OH_AVCodec *codec, uint32_t index); 319 320 /** 321 * @brief Notifies the video encoder that the input stream has ended. It is recommended to use this interface to notify 322 * the encoder of the end of the stream in surface mode 323 * @syscap SystemCapability.Multimedia.Media.VideoEncoder 324 * @param codec Pointer to an OH_AVCodec instance 325 * @return Returns AV_ERR_OK if the execution is successful, 326 * otherwise returns a specific error code, refer to {@link OH_AVErrCode}. 327 * {@link AV_ERR_NO_MEMORY}, instance has already released. 328 * {@link AV_ERR_INVALID_VAL}, the encoder is nullptr or invalid. 329 * {@link AV_ERR_UNKNOWN}, unknown error. 330 * {@link AV_ERR_SERVICE_DIED}, avcodec service is died. 331 * {@link AV_ERR_INVALID_STATE}, this interface was called in invalid state. 332 * @since 9 333 */ 334 OH_AVErrCode OH_VideoEncoder_NotifyEndOfStream(OH_AVCodec *codec); 335 336 /** 337 * @brief Submit the input buffer filled with data to the video encoder. 338 * @syscap SystemCapability.Multimedia.Media.VideoEncoder 339 * @param codec Pointer to an OH_AVCodec instance 340 * @param index Enter the index value corresponding to the Buffer 341 * @param attr Information describing the data contained in the Buffer 342 * @return Returns AV_ERR_OK if the execution is successful, 343 * otherwise returns a specific error code, refer to {@link OH_AVErrCode}. 344 * {@link AV_ERR_NO_MEMORY}, instance has already released. 345 * {@link AV_ERR_INVALID_VAL}, the encoder is nullptr or invalid. 346 * Buffer index should be given by {@link OH_AVCodecOnNeedInputData}. 347 * {@link AV_ERR_UNKNOWN}, unknown error. 348 * {@link AV_ERR_SERVICE_DIED}, avcodec service is died. 349 * {@link AV_ERR_INVALID_STATE}, this interface was called in invalid state. 350 * @deprecated since 11 351 * @useinstead OH_VideoEncoder_PushInputBuffer 352 * @since 10 353 */ 354 OH_AVErrCode OH_VideoEncoder_PushInputData(OH_AVCodec *codec, uint32_t index, OH_AVCodecBufferAttr attr); 355 356 /** 357 * @brief Submit the input buffer filled with data to the video encoder. 358 * @syscap SystemCapability.Multimedia.Media.VideoEncoder 359 * @param codec Pointer to an OH_AVCodec instance 360 * @param index Enter the index value corresponding to the Buffer 361 * @return Returns AV_ERR_OK if the execution is successful, 362 * otherwise returns a specific error code, refer to {@link OH_AVErrCode}. 363 * {@link AV_ERR_NO_MEMORY}, instance has already released. 364 * {@link AV_ERR_INVALID_VAL}, the encoder is nullptr or invalid. 365 * Buffer index should be given by {@link OH_AVCodecOnNeedInputBuffer}. 366 * {@link AV_ERR_UNKNOWN}, unknown error. 367 * {@link AV_ERR_SERVICE_DIED}, avcodec service is died. 368 * {@link AV_ERR_INVALID_STATE}, this interface was called in invalid state. 369 370 * @since 11 371 */ 372 OH_AVErrCode OH_VideoEncoder_PushInputBuffer(OH_AVCodec *codec, uint32_t index); 373 374 /** 375 * @brief Submit the input parameter filled with data to the video encoder. 376 * 377 * @syscap SystemCapability.Multimedia.Media.VideoEncoder 378 * @param codec Pointer to an OH_AVCodec instance 379 * @param index Enter the index value corresponding to the input parameter 380 * @return Returns AV_ERR_OK if the execution is successful, 381 * otherwise returns a specific error code, refer to {@link OH_AVErrCode}. 382 * {@link AV_ERR_NO_MEMORY}, instance has already released. 383 * {@link AV_ERR_INVALID_VAL}, the encoder is nullptr or invalid. 384 * Index should be given by {@link OH_VideoEncoder_OnNeedInputParameter}. 385 * {@link AV_ERR_UNKNOWN}, unknown error. 386 * {@link AV_ERR_SERVICE_DIED}, avcodec service is died. 387 * {@link AV_ERR_INVALID_STATE}, this interface was called in invalid state. 388 * @since 12 389 */ 390 OH_AVErrCode OH_VideoEncoder_PushInputParameter(OH_AVCodec *codec, uint32_t index); 391 392 /** 393 * @brief Return the processed output Buffer to the encoder. 394 * @syscap SystemCapability.Multimedia.Media.VideoEncoder 395 * @param codec Pointer to an OH_AVCodec instance 396 * @param index The index value corresponding to the output Buffer 397 * @return Returns AV_ERR_OK if the execution is successful, 398 * otherwise returns a specific error code, refer to {@link OH_AVErrCode}. 399 * {@link AV_ERR_NO_MEMORY}, instance has already released. 400 * {@link AV_ERR_INVALID_VAL}, the encoder is nullptr or invalid. 401 * Buffer index should be given by {@link OH_AVCodecOnNewOutputBuffer}. 402 * {@link AV_ERR_UNKNOWN}, unknown error. 403 * {@link AV_ERR_SERVICE_DIED}, avcodec service is died. 404 * {@link AV_ERR_INVALID_STATE}, this interface was called in invalid state. 405 * @since 11 406 */ 407 OH_AVErrCode OH_VideoEncoder_FreeOutputBuffer(OH_AVCodec *codec, uint32_t index); 408 409 /** 410 * @brief Get the input data description of the encoder after call {@OH_VideoEncoder_Configure}, 411 * refer to {@link OH_AVFormat} for details. It should be noted that the life cycle of the OH_AVFormat 412 * instance pointed to by the return value needs to be manually released by the caller. 413 * @syscap SystemCapability.Multimedia.Media.VideoEncoder 414 * @param codec Pointer to an OH_AVCodec instance 415 * @return Returns a pointer to an OH_AVFormat instance. 416 * Return nullptr if the encoder is nullptr or invaild. 417 * @since 10 418 */ 419 OH_AVFormat *OH_VideoEncoder_GetInputDescription(OH_AVCodec *codec); 420 421 /** 422 * @brief Check whether the current codec instance is valid. It can be used fault recovery or app 423 * switchback from the background 424 * @syscap SystemCapability.Multimedia.Media.VideoEncoder 425 * @param codec Pointer to an OH_AVCodec instance 426 * @param isValid Output Parameter. A pointer to a boolean instance, it is true if the codec instance is valid, 427 * false if the codec instance is invalid 428 * @return Returns AV_ERR_OK if the execution is successful, 429 * otherwise returns a specific error code, refer to {@link OH_AVErrCode}. 430 * {@link AV_ERR_NO_MEMORY}, instance has already released. 431 * {@link AV_ERR_INVALID_VAL}, the encoder is nullptr or invalid. 432 * {@link AV_ERR_UNKNOWN}, unknown error. 433 * {@link AV_ERR_SERVICE_DIED}, avcodec service is died. 434 * @since 10 435 */ 436 OH_AVErrCode OH_VideoEncoder_IsValid(OH_AVCodec *codec, bool *isValid); 437 438 /** 439 * @brief The bitrate mode of video encoder. 440 * @syscap SystemCapability.Multimedia.Media.VideoEncoder 441 * @deprecated since 14 442 * @useinstead OH_BitrateMode 443 * @since 9 444 */ 445 typedef enum OH_VideoEncodeBitrateMode { 446 /** constant bit rate mode. 447 * @deprecated since 14 448 * @useinstead BITRATE_MODE_CBR 449 */ 450 CBR = 0, 451 /** variable bit rate mode. 452 * @deprecated since 14 453 * @useinstead BITRATE_MODE_VBR 454 */ 455 VBR = 1, 456 /** constant quality mode. 457 * @deprecated since 14 458 * @useinstead BITRATE_MODE_CQ 459 */ 460 CQ = 2, 461 } OH_VideoEncodeBitrateMode; 462 463 #ifdef __cplusplus 464 } 465 #endif 466 467 #endif // NATIVE_AVCODEC_VIDEOENCODER_H 468 /** @} */