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 } KeyType; 58 59 /** 60 * @brief Defines a structure for configuring and obtaining dynamic parameters. 61 */ 62 typedef struct { 63 uint32_t key; /**< Key type. For details, see {@link KeyType} */ 64 int32_t size; /**< Data size, which indicates the size of the buffer memory pointed by <b>pValue</b> */ 65 /** 66 * @brief Defines value types of the parameters. 67 */ 68 union { 69 int32_t s32Value; /**< 32-bit integer */ 70 uint32_t u32Value; /**< 32-bit unsigned integer */ 71 int64_t s64Value; /**< 64-bit integer */ 72 uint64_t u64Value; /**< 64-bit unsigned integer */ 73 float fValue; /**< Single-precision floating point number */ 74 double dValue; /**< Double-precision floating point number */ 75 const void *pValue; /**< Pointer */ 76 } value; 77 } ParameterItem; 78 79 #endif // PARAMETER_ITEM_H 80 /** @} */