2 * Copyright (c) 2020-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
7 * http://www.apache.org/licenses/LICENSE-2.0
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.
16 #ifndef PLAYER_DEFINE_H
17 #define PLAYER_DEFINE_H
26 #endif /* __cplusplus */
36 #define REQUEST_SURFACE_BUFFER_FATAL (-2)
38 #define NOT_FOUND_ACTIVE_STREAME (-9)
40 #define MAX_AUD_DECODER_PATH_LEN 256
44 MEDIA_TYPE_VIDEO_AUDIO,
58 EVNET_ON_STATE_CHANGE,
59 EVNET_FIRST_VIDEO_REND,
60 EVNET_VIDEO_PTS_ERRGAP,
61 EVNET_AUDIO_PTS_ERRGAP,
62 EVNET_VIDEO_RUNNING_ERR,
63 EVNET_AUDIO_RUNNING_ERR,
67 EVNET_AUDIO_BUFFER_EMPTY,
68 EVNET_ON_JPEG_FRAME_RENDED,
69 EVNET_FRAME_CONTINUE_LOST,
70 EVNET_FIRST_AUDIO_REND,
85 RENDER_MODE_NORMAL = 0,
86 RENDER_MODE_PAUSE_AFTER_PLAY, /* pause after play the first frame */
96 } PlayControlVdecAttr;
102 uint32_t bitWidth; /* bits */
103 } PlayControlAdecAttr;
107 uint32_t videoBufSize;
108 uint32_t audioBufSize;
109 } PlayControlStreamAttr;
111 struct PlayVideoStreamInfo {
116 uint32_t freeEsBufSize;
120 struct PlayAudioStreamInfo {
122 uint32_t channel; /* only support 1-2 */
124 uint32_t freeEsBufSize;
128 struct PlaySyncStatus {
138 DECODER_STATUS_IDLE = 0,
140 DECODER_STATUS_TPLAY,
141 DECODER_STATUS_PAUSE,
146 struct PlayStatusInfo {
147 DecoderStatus vidStatus;
148 DecoderStatus audStatus;
149 PlaySyncStatus syncStatus;
150 uint64_t vidFrameCount;
151 uint64_t audFrameCount;
154 struct PlayerStreamInfo {
155 PlayVideoStreamInfo videoInfo;
156 PlayAudioStreamInfo audioInfo;
157 PlayStatusInfo avStatus;
166 INVOKE_ENABLE_PAUSE_AFTER_PLAYER = 0x100,
167 INVOKE_SET_AUDIO_SESSION,
168 INVOKE_SET_OUTPUT_DEVICE,
169 INVOKE_SET_AUDIOSTREAM_TYPE
172 struct InvokeParameter {
177 typedef int32_t (*OnEventCallback)(void* priv, EventCbType event, int32_t ext1, int32_t ext2);
180 OnEventCallback onEventCallback;
188 #endif /* __cplusplus */
190 #endif /* PLAYER_DEFINE_H */