17777dab0Sopenharmony_ci/*
27777dab0Sopenharmony_ci * Copyright (C) 2023 Huawei Device Co., Ltd.
37777dab0Sopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License");
47777dab0Sopenharmony_ci * you may not use this file except in compliance with the License.
57777dab0Sopenharmony_ci * You may obtain a copy of the License at
67777dab0Sopenharmony_ci *
77777dab0Sopenharmony_ci *     http://www.apache.org/licenses/LICENSE-2.0
87777dab0Sopenharmony_ci *
97777dab0Sopenharmony_ci * Unless required by applicable law or agreed to in writing, software
107777dab0Sopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS,
117777dab0Sopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
127777dab0Sopenharmony_ci * See the License for the specific language governing permissions and
137777dab0Sopenharmony_ci * limitations under the License.
147777dab0Sopenharmony_ci */
157777dab0Sopenharmony_ci
167777dab0Sopenharmony_ci/**
177777dab0Sopenharmony_ci * @file native_avbuffer_info.h
187777dab0Sopenharmony_ci *
197777dab0Sopenharmony_ci * @brief Provides audio and video buffer info.
207777dab0Sopenharmony_ci *
217777dab0Sopenharmony_ci * @kit AVCodecKit
227777dab0Sopenharmony_ci * @library libnative_media_core.so
237777dab0Sopenharmony_ci * @syscap SystemCapability.Multimedia.Media.Core
247777dab0Sopenharmony_ci * @since 9
257777dab0Sopenharmony_ci */
267777dab0Sopenharmony_ci
277777dab0Sopenharmony_ci#ifndef NATIVE_AVBUFFER_INFO_H
287777dab0Sopenharmony_ci#define NATIVE_AVBUFFER_INFO_H
297777dab0Sopenharmony_ci
307777dab0Sopenharmony_ci#include <stdint.h>
317777dab0Sopenharmony_ci#include <stdio.h>
327777dab0Sopenharmony_ci
337777dab0Sopenharmony_ci#ifdef __cplusplus
347777dab0Sopenharmony_ciextern "C" {
357777dab0Sopenharmony_ci#endif
367777dab0Sopenharmony_ci/**
377777dab0Sopenharmony_ci * @brief Enumerate the categories of OH_AVCodec's Buffer tags.
387777dab0Sopenharmony_ci * @syscap SystemCapability.Multimedia.Media.Core
397777dab0Sopenharmony_ci * @since 9
407777dab0Sopenharmony_ci */
417777dab0Sopenharmony_citypedef enum OH_AVCodecBufferFlags {
427777dab0Sopenharmony_ci    AVCODEC_BUFFER_FLAGS_NONE = 0,
437777dab0Sopenharmony_ci    /** Indicates that the Buffer is an End-of-Stream frame. */
447777dab0Sopenharmony_ci    AVCODEC_BUFFER_FLAGS_EOS = 1 << 0,
457777dab0Sopenharmony_ci    /** Indicates that the Buffer contains keyframes. */
467777dab0Sopenharmony_ci    AVCODEC_BUFFER_FLAGS_SYNC_FRAME = 1 << 1,
477777dab0Sopenharmony_ci    /** Indicates that the data contained in the Buffer is only part of a frame. */
487777dab0Sopenharmony_ci    AVCODEC_BUFFER_FLAGS_INCOMPLETE_FRAME = 1 << 2,
497777dab0Sopenharmony_ci    /** Indicates that the Buffer contains Codec-Specific-Data. */
507777dab0Sopenharmony_ci    AVCODEC_BUFFER_FLAGS_CODEC_DATA = 1 << 3,
517777dab0Sopenharmony_ci    /** Flag is used to discard packets which are required to maintain valid decoder state but are not required
527777dab0Sopenharmony_ci     *  for output and should be dropped after decoding.
537777dab0Sopenharmony_ci     * @since 12
547777dab0Sopenharmony_ci     */
557777dab0Sopenharmony_ci    AVCODEC_BUFFER_FLAGS_DISCARD = 1 << 4,
567777dab0Sopenharmony_ci    /** Flag is used to indicate packets that contain frames that can be discarded by the decoder,
577777dab0Sopenharmony_ci     *  I.e. Non-reference frames.
587777dab0Sopenharmony_ci     * @since 12
597777dab0Sopenharmony_ci     */
607777dab0Sopenharmony_ci    AVCODEC_BUFFER_FLAGS_DISPOSABLE = 1 << 5,
617777dab0Sopenharmony_ci} OH_AVCodecBufferFlags;
627777dab0Sopenharmony_ci
637777dab0Sopenharmony_ci/**
647777dab0Sopenharmony_ci * @brief Define the Buffer description information of OH_AVCodec
657777dab0Sopenharmony_ci * @syscap SystemCapability.Multimedia.Media.Core
667777dab0Sopenharmony_ci * @since 9
677777dab0Sopenharmony_ci */
687777dab0Sopenharmony_citypedef struct OH_AVCodecBufferAttr {
697777dab0Sopenharmony_ci    /* Presentation timestamp of this Buffer in microseconds */
707777dab0Sopenharmony_ci    int64_t pts;
717777dab0Sopenharmony_ci    /* The size of the data contained in the Buffer in bytes */
727777dab0Sopenharmony_ci    int32_t size;
737777dab0Sopenharmony_ci    /* The starting offset of valid data in this Buffer */
747777dab0Sopenharmony_ci    int32_t offset;
757777dab0Sopenharmony_ci    /* The flags this Buffer has, which is also a combination of multiple {@link OH_AVCodecBufferFlags}. */
767777dab0Sopenharmony_ci    uint32_t flags;
777777dab0Sopenharmony_ci} OH_AVCodecBufferAttr;
787777dab0Sopenharmony_ci
797777dab0Sopenharmony_ci#ifdef __cplusplus
807777dab0Sopenharmony_ci}
817777dab0Sopenharmony_ci#endif
827777dab0Sopenharmony_ci
837777dab0Sopenharmony_ci#endif // NATIVE_AVBUFFER_INFO_H
84