• 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 sync manager adapter.
34 *
35 * The following callbacks are provided:
36 * - Callback used to report events during Video Playback.
37 * - Callback invoked when the video playback is complete.
38 * - Callback invoked when the first frame of the video is ready.
39 * - Callback invoked when the playback is abnormal.
40 * - Callback invoked when the target frame has been decoded after precise seek.
41 * - Callback invoked when the first frame has been sent and displayed.
42 * The callbacks are registered by using when the adapter is created.
43 */
44
45[callback] interface ILppSyncManagerCallback {
46    /**
47     * @brief Reports error event.
48     *
49     *
50     * @param errorCode Indicates the error code.
51     * @param errorMsg Indicates the error message.
52     *
53     * @return Returns <b>HDF_SUCCESS</b> if the operation is successful.
54     * @return Returns <b>HDF_FAILURE</b> if the execution fails.
55     *
56     * @since 6.0
57     * @version 1.0
58     */
59    OnError([in] int errorCode, [in] String errorMsg);
60
61    /**
62     * @brief Reports when the target frame has been decoded after precise seek.
63     *
64     *
65     * @param targetPts Indicates pts of the target frame.
66     * @param isTimeout Indicates  whether the timeout occurs.
67     *
68     * @return Returns <b>HDF_SUCCESS</b> if the operation is successful.
69     * @return Returns <b>HDF_FAILURE</b> if the execution fails.
70     *
71     * @since 6.0
72     * @version 1.0
73     */
74    OnTargetArrived([in] long targetPts, [in] boolean isTimeout);
75
76    /**
77     * @brief Reports when the first frame has been sent and displayed.
78     *
79     * @return Returns <b>HDF_SUCCESS</b> if the operation is successful.
80     * @return Returns <b>HDF_FAILURE</b> if the execution fails.
81     *
82     * @since 6.0
83     * @version 1.0
84     */
85    OnRenderStarted();
86
87    /**
88     * @brief Reports when the video has been played.
89     *
90     * @return Returns <b>HDF_SUCCESS</b> if the operation is successful.
91     * @return Returns <b>HDF_FAILURE</b> if the execution fails.
92     *
93     * @since 6.0
94     * @version 1.0
95     */
96    OnEos();
97    /**
98     * @brief Reports when the first frame of the video is ready.
99     *
100     * @return Returns <b>HDF_SUCCESS</b> if the operation is successful.
101     * @return Returns <b>HDF_FAILURE</b> if the execution fails.
102     *
103     * @since 6.0
104     * @version 1.0
105     */
106    OnFirstFrameReady();
107
108    /**
109     * @brief Reports the process message.
110     *
111     *
112     * @param errorCode Indicates the info code.
113     * @param errorMsg Indicates the info message.
114     *
115     * @return Returns <b>HDF_SUCCESS</b> if the operation is successful.
116     * @return Returns <b>HDF_FAILURE</b> if the execution fails.
117     *
118     * @since 6.0
119     * @version 1.0
120     */
121    OnInfo([in] int infoCode, [in] String infoMsg);
122}