• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1/*
2 * Copyright (c) 2022 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 LowPowerPlayer
18 * @{
19 *
20 * @ @brief Provides unified APIs for media services to access low power player drivers.
21 *
22 * The media service can obtain a low power player driver object or proxy, and then invoke the
23 * API provided by the object or proxy, The module provides APIs for initializing the custom data
24 * and audio and video codecs, setting parameters, and controlling and transferring data.
25 *
26 * @since 6.0
27 * @version 1.0
28 */
29
30package ohos.hdi.low_power_player.v1_0;
31
32/**
33 * @brief Defines the callbacks of the lpp audio sink adapter.
34 *
35 * The following callbacks are provided:
36 * - Callback used to report events during audio Playback.
37 * - Callback invoked when obtains the compressed audio data.
38 * - Callback invoked when the playback is abnormal.
39 * - Callback invoked when the audio playback is complete.
40 * The callbacks are registered by using when the adapter is created.
41 */
42
43[callback] interface ILppAudioSinkCallback {
44
45    /**
46     * @brief Reports for Obtaining compressed audio data.
47     *
48     *
49     * @param size Indicates the data size.
50     *
51     * @return Returns <b>HDF_SUCCESS</b> if the operation is successful.
52     * @return Returns <b>HDF_FAILURE</b> if the execution fails.
53     *
54     * @since 6.0
55     * @version 1.0
56     */
57    OnDataNeeded([in] unsigned int size);
58
59    /**
60     * @brief Reports the error event.
61     *
62     *
63     * @param errorCode Indicates the error code.
64     * @param errorMsg Indicates the error message.
65     *
66     * @return Returns <b>HDF_SUCCESS</b> if the operation is successful.
67     * @return Returns <b>HDF_FAILURE</b> if the execution fails.
68     *
69     * @since 6.0
70     * @version 1.0
71     */
72    OnError([in] int errorCode, [in] String errorMsg);
73
74    /**
75     * @brief Reports when the audio has been played.
76     *
77     * @return Returns <b>HDF_SUCCESS</b> if the operation is successful.
78     * @return Returns <b>HDF_FAILURE</b> if the execution fails.
79     *
80     * @since 6.0
81     * @version 1.0
82     */
83    OnEos();
84
85    /**
86     * @brief Reports the process message.
87     *
88     *
89     * @param errorCode Indicates the info code.
90     * @param errorMsg Indicates the info message.
91     *
92     * @return Returns <b>HDF_SUCCESS</b> if the operation is successful.
93     * @return Returns <b>HDF_FAILURE</b> if the execution fails.
94     *
95     * @since 6.0
96     * @version 1.0
97     */
98    OnInfo([in] int infoCode, [in] String infoMsg);
99}