• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 #ifndef NATIVE_AVBUFFER_INFO_H
17 #define NATIVE_AVBUFFER_INFO_H
18 
19 #include <stdint.h>
20 #include <stdio.h>
21 
22 #ifdef __cplusplus
23 extern "C" {
24 #endif
25 /**
26  * @brief Enumerate the categories of OH_AVCodec's Buffer tags
27  * @syscap SystemCapability.Multimedia.Media.Core
28  * @since 9
29  */
30 typedef enum OH_AVCodecBufferFlags {
31     AVCODEC_BUFFER_FLAGS_NONE = 0,
32     /* Indicates that the Buffer is an End-of-Stream frame */
33     AVCODEC_BUFFER_FLAGS_EOS = 1 << 0,
34     /* Indicates that the Buffer contains keyframes */
35     AVCODEC_BUFFER_FLAGS_SYNC_FRAME = 1 << 1,
36     /* Indicates that the data contained in the Buffer is only part of a frame */
37     AVCODEC_BUFFER_FLAGS_INCOMPLETE_FRAME = 1 << 2,
38     /* Indicates that the Buffer contains Codec-Specific-Data */
39     AVCODEC_BUFFER_FLAGS_CODEC_DATA = 1 << 3,
40 } OH_AVCodecBufferFlags;
41 
42 /**
43  * @brief Define the Buffer description information of OH_AVCodec
44  * @syscap SystemCapability.Multimedia.Media.Core
45  * @since 9
46  */
47 typedef struct OH_AVCodecBufferAttr {
48     /* Presentation timestamp of this Buffer in microseconds */
49     int64_t pts;
50     /* The size of the data contained in the Buffer in bytes */
51     int32_t size;
52     /* The starting offset of valid data in this Buffer */
53     int32_t offset;
54     /* The flags this Buffer has, which is also a combination of multiple {@link OH_AVCodecBufferFlags}. */
55     uint32_t flags;
56 } OH_AVCodecBufferAttr;
57 
58 #ifdef __cplusplus
59 }
60 #endif
61 
62 #endif // NATIVE_AVBUFFER_INFO_H
63