1094332d3Sopenharmony_ci/*
2094332d3Sopenharmony_ci * Copyright (c) 2020-2021 Huawei Device Co., Ltd.
3094332d3Sopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License");
4094332d3Sopenharmony_ci * you may not use this file except in compliance with the License.
5094332d3Sopenharmony_ci * You may obtain a copy of the License at
6094332d3Sopenharmony_ci *
7094332d3Sopenharmony_ci *     http://www.apache.org/licenses/LICENSE-2.0
8094332d3Sopenharmony_ci *
9094332d3Sopenharmony_ci * Unless required by applicable law or agreed to in writing, software
10094332d3Sopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS,
11094332d3Sopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12094332d3Sopenharmony_ci * See the License for the specific language governing permissions and
13094332d3Sopenharmony_ci * limitations under the License.
14094332d3Sopenharmony_ci */
15094332d3Sopenharmony_ci
16094332d3Sopenharmony_ci/**
17094332d3Sopenharmony_ci * @addtogroup format
18094332d3Sopenharmony_ci * @{
19094332d3Sopenharmony_ci *
20094332d3Sopenharmony_ci * @brief Defines format-related APIs.
21094332d3Sopenharmony_ci *
22094332d3Sopenharmony_ci * For example, you use this module to define custom data types and to initialize, create,
23094332d3Sopenharmony_ci * destroy the muxer and demuxer, and set their parameters. Also, you can read demuxer data frames,
24094332d3Sopenharmony_ci * select demuxer tracks, add muxer tracks, and write data frames into a container.
25094332d3Sopenharmony_ci *
26094332d3Sopenharmony_ci * @since 1.0
27094332d3Sopenharmony_ci * @version 1.0
28094332d3Sopenharmony_ci */
29094332d3Sopenharmony_ci
30094332d3Sopenharmony_ci/**
31094332d3Sopenharmony_ci * @file parameter_item.h
32094332d3Sopenharmony_ci *
33094332d3Sopenharmony_ci * @brief Defines format-related structures and enumerations used to configure and obtain dynamic parameters.
34094332d3Sopenharmony_ci *
35094332d3Sopenharmony_ci *
36094332d3Sopenharmony_ci *
37094332d3Sopenharmony_ci * @since 1.0
38094332d3Sopenharmony_ci * @version 1.0
39094332d3Sopenharmony_ci */
40094332d3Sopenharmony_ci
41094332d3Sopenharmony_ci#ifndef PARAMETER_ITEM_H
42094332d3Sopenharmony_ci#define PARAMETER_ITEM_H
43094332d3Sopenharmony_ci
44094332d3Sopenharmony_ci/**
45094332d3Sopenharmony_ci * @brief Enumerates key types used for setting and obtaining parameters.
46094332d3Sopenharmony_ci *
47094332d3Sopenharmony_ci * @since 1.0
48094332d3Sopenharmony_ci * @version 1.0
49094332d3Sopenharmony_ci */
50094332d3Sopenharmony_citypedef enum {
51094332d3Sopenharmony_ci    KEY_TYPE_MIME = 0x6d696d65,         /**< MIME type. The value type is <b>cstring</b>. */
52094332d3Sopenharmony_ci    KEY_TYPE_HTTP_HEADERS = 0x68706864, /**< HTTP header. The value type is <b>cstring</b>. */
53094332d3Sopenharmony_ci    KEY_TYPE_LANGUAGE     = 0x6c616e67, /**< Track language, which is usually the language of audio and subtitles.
54094332d3Sopenharmony_ci                                         * The value type is <b>cstring</b>.
55094332d3Sopenharmony_ci                                         */
56094332d3Sopenharmony_ci    KEY_TYPE_PRE_CACHE    = 0x70726361,  /**< Precapture cache size. The value type is <b>int</b> */
57094332d3Sopenharmony_ci    KEY_TYPE_SET_SYNC_BUFFER_MSEC = 0x73796e62, /**< Set sync buffer size, uint ms. The value type is <b>int</b> */
58094332d3Sopenharmony_ci    KEY_TYPE_EXTRADATA = 0x65787472, /**< Extra data. The value type is <b>pointer</b> */
59094332d3Sopenharmony_ci    KEY_TYPE_THUMBNAIL = 0x74686e6c /**< Thumbnail. The value type is <b>pointer<b>. */
60094332d3Sopenharmony_ci} KeyType;
61094332d3Sopenharmony_ci
62094332d3Sopenharmony_ci/**
63094332d3Sopenharmony_ci * @brief Defines a structure for configuring and obtaining dynamic parameters.
64094332d3Sopenharmony_ci */
65094332d3Sopenharmony_citypedef struct {
66094332d3Sopenharmony_ci    uint32_t key; /**< Key type. For details, see {@link KeyType} */
67094332d3Sopenharmony_ci    int32_t size; /**< Data size, which indicates the size of the buffer memory pointed by <b>pValue</b> */
68094332d3Sopenharmony_ci    /**
69094332d3Sopenharmony_ci     * @brief Defines value types of the parameters.
70094332d3Sopenharmony_ci     */
71094332d3Sopenharmony_ci    union {
72094332d3Sopenharmony_ci        int32_t s32Value;  /**< 32-bit integer */
73094332d3Sopenharmony_ci        uint32_t u32Value; /**< 32-bit unsigned integer */
74094332d3Sopenharmony_ci        int64_t s64Value;  /**< 64-bit integer */
75094332d3Sopenharmony_ci        uint64_t u64Value; /**< 64-bit unsigned integer */
76094332d3Sopenharmony_ci        float fValue;      /**< Single-precision floating point number */
77094332d3Sopenharmony_ci        double dValue;      /**< Double-precision floating point number */
78094332d3Sopenharmony_ci        const void *pValue; /**< Pointer */
79094332d3Sopenharmony_ci    } value;
80094332d3Sopenharmony_ci} ParameterItem;
81094332d3Sopenharmony_ci
82094332d3Sopenharmony_ci#endif  // PARAMETER_ITEM_H
83094332d3Sopenharmony_ci/** @} */
84