• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2025 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 AVSinkBase
18  * @{
19  *
20  * @brief The AVSinkBase module provides variables, properties, and functions
21  * for lowpower audio sink and lowpower video sink.
22  *
23  * @since 20
24  */
25 
26 /**
27  * @file lowpower_avsink_base.h
28  *
29  * @brief Declare the Native API used for lowpower audio sink
30  * and lowpower video sink.
31  *
32  * @library liblowpower_avsink.so
33  * @kit MediaKit
34  * @syscap SystemCapability.Multimedia.Media.LowPowerAVSink
35  * @since 20
36  */
37 
38 #ifndef NATIVE_LOWPOWER_AVSINK_BASE_H
39 #define NATIVE_LOWPOWER_AVSINK_BASE_H
40 
41 #include <stdint.h>
42 #include "native_averrors.h"
43 #include "native_avbuffer.h"
44 
45 #ifdef __cplusplus
46 extern "C" {
47 #endif
48 
49 /**
50  * @brief Forward declaration of OH_AVSamplesBuffer.
51  *
52  * @since 20
53  */
54 typedef struct OH_AVSamplesBuffer OH_AVSamplesBuffer;
55 
56 /**
57  * @brief Append one OH_AVBuffer data to framePacketBuffer instance.
58  *
59  * @param samplesBuffer OH_AVSamplesBuffer instance
60  * @param avBuffer OH_AVBuffer buffer will be appended to
61  * @return Returns AV_ERR_OK if the execution is successful,
62  * otherwise returns a specific error code, refer to {@link OH_AVErrCode}.
63  * {@link AV_ERR_INVALID_VAL}, the samplesBuffer or the avBuffer or data pointer is nullptr or invalid.
64  * {@link AV_ERR_NO_MEMORY}, the framePacketBuffer has no enough remained capacity to append one OH_AVBuffer.
65  * {@link AV_ERR_UNKNOWN}, unknown error.
66  * @since 20
67  */
68 OH_AVErrCode OH_AVSamplesBuffer_AppendOneBuffer(OH_AVSamplesBuffer *samplesBuffer, OH_AVBuffer *avBuffer);
69 
70 /**
71  * @brief Get remaining capacity of OH_AVSamplesBuffer instance.
72  *
73  * @param {OH_AVSamplesBuffer} samplesBuffer OH_AVSamplesBuffer instance
74  * @return Returns remained capacity of OH_AVSamplesBuffer instance,
75  * return -1 if samplesBuffer or data poniter is is nullptr or invalid.
76  * @since 20
77  */
78 int32_t OH_AVSamplesBuffer_GetRemainedCapacity(OH_AVSamplesBuffer *samplesBuffer);
79 
80 #ifdef __cplusplus
81 }
82 #endif
83 #endif // NATIVE_LOWPOWER_AVSINK_BASE_H
84 
85 /** @} */