1 /* 2 * Copyright (c) 2020-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 /** 17 * @addtogroup format 18 * @{ 19 * 20 * @brief Defines format-related APIs. 21 * 22 * For example, you use this module to define custom data types and to initialize, create, 23 * destroy the muxer and demuxer, and set their parameters. Also, you can read demuxer data frames, 24 * select demuxer tracks, add muxer tracks, and write data frames into a container. 25 * 26 * @since 1.0 27 * @version 1.0 28 */ 29 30 /** 31 * @file parameter_item.h 32 * 33 * @brief Defines format-related structures and enumerations used to configure and obtain dynamic parameters. 34 * 35 * 36 * 37 * @since 1.0 38 * @version 1.0 39 */ 40 41 #ifndef PARAMETER_ITEM_H 42 #define PARAMETER_ITEM_H 43 44 /** 45 * @brief Enumerates key types used for setting and obtaining parameters. 46 * 47 * @since 1.0 48 * @version 1.0 49 */ 50 typedef enum { 51 KEY_TYPE_MIME = 0x6d696d65, /**< MIME type. The value type is <b>cstring</b>. */ 52 KEY_TYPE_HTTP_HEADERS = 0x68706864, /**< HTTP header. The value type is <b>cstring</b>. */ 53 KEY_TYPE_LANGUAGE = 0x6c616e67, /**< Track language, which is usually the language of audio and subtitles. 54 * The value type is <b>cstring</b>. 55 */ 56 KEY_TYPE_PRE_CACHE = 0x70726361, /**< Precapture cache size. The value type is <b>int</b> */ 57 KEY_TYPE_SET_SYNC_BUFFER_MSEC = 0x73796e62, /**< Set sync buffer size, uint ms. The value type is <b>int</b> */ 58 KEY_TYPE_EXTRADATA = 0x65787472, /**< Extra data. The value type is <b>pointer</b> */ 59 KEY_TYPE_THUMBNAIL = 0x74686e6c /**< Thumbnail. The value type is <b>pointer<b>. */ 60 } KeyType; 61 62 /** 63 * @brief Defines a structure for configuring and obtaining dynamic parameters. 64 */ 65 typedef struct { 66 uint32_t key; /**< Key type. For details, see {@link KeyType} */ 67 int32_t size; /**< Data size, which indicates the size of the buffer memory pointed by <b>pValue</b> */ 68 /** 69 * @brief Defines value types of the parameters. 70 */ 71 union { 72 int32_t s32Value; /**< 32-bit integer */ 73 uint32_t u32Value; /**< 32-bit unsigned integer */ 74 int64_t s64Value; /**< 64-bit integer */ 75 uint64_t u64Value; /**< 64-bit unsigned integer */ 76 float fValue; /**< Single-precision floating point number */ 77 double dValue; /**< Double-precision floating point number */ 78 const void *pValue; /**< Pointer */ 79 } value; 80 } ParameterItem; 81 82 #endif // PARAMETER_ITEM_H 83 /** @} */ 84