forked from alibaba/CicadaPlayer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgetListener.cpp
120 lines (97 loc) · 2.69 KB
/
getListener.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
//
// Created by moqi on 2019/12/4.
//
#include "getListener.h"
static void onCircleStart(void *userData)
{
}
static void onAutoPlayStart(void *userData)
{
}
static void onFirstFrameShow(void *userData)
{
}
static void onVideoSizeChanged(int64_t width, int64_t height, void *userData)
{
AF_LOGI("AliyunCorePlayer onVideoSizeChanged width = %d ,height = %d", width, height);
}
static void onCurrentPositionUpdate(int64_t position, void *userData)
{
}
static void onBufferPositionUpdate(int64_t position, void *userData)
{
}
static void onLoadingStart(void *userData)
{
}
static void onLoadingProgress(int64_t percent, void *userData)
{
}
static void onLoadingEnd(void *userData)
{
}
static void onSeekEnd(int64_t seekInCache, void *userData)
{
}
static void onPlayerStatusChanged(int64_t oldStatus, int64_t newStatus, void *userData)
{
}
static void onCaptureScreen(int64_t width, int64_t height, const void *buffer, void *userData)
{
if (userData == nullptr) {
return;
}
}
static void onSubTitleExtAdd(int64_t index, const void *url, void *userData)
{
}
static void onShowSubtitle(int64_t id, int64_t size, const void *content, void *userData)
{
}
static void onHideSubtitle(int64_t id, int64_t size, const void *content, void *userData)
{
}
static void onEvent(int64_t code, const void *msg, void *userData)
{
}
static void onError(int64_t code, const void *msg, void *userData)
{
}
static void onPrepared(void *userData)
{
}
static void onCompletion(void *userData)
{
}
static void onStreamInfoGet(int64_t count, const void *infos, void *userData)
{
}
static void onSwitchStreamSuccess(int64_t type, const void *item, void *userData)
{
}
playerListener getListener()
{
playerListener listener{nullptr};
listener.userData = nullptr;//userData;
listener.LoopingStart = onCircleStart;
listener.AutoPlayStart = onAutoPlayStart;
listener.FirstFrameShow = onFirstFrameShow;
listener.VideoSizeChanged = onVideoSizeChanged;
listener.PositionUpdate = onCurrentPositionUpdate;
listener.BufferPositionUpdate = onBufferPositionUpdate;
listener.LoadingStart = onLoadingStart;
listener.LoadingProgress = onLoadingProgress;
listener.LoadingEnd = onLoadingEnd;
listener.SeekEnd = onSeekEnd;
listener.StreamInfoGet = onStreamInfoGet;
listener.StreamSwitchSuc = onSwitchStreamSuccess;
listener.StatusChanged = onPlayerStatusChanged;
listener.CaptureScreen = onCaptureScreen;
listener.SubtitleShow = onShowSubtitle;
listener.SubtitleHide = onHideSubtitle;
listener.EventCallback = onEvent;
listener.ErrorCallback = onError;
listener.Prepared = onPrepared;
listener.Completion = onCompletion;
listener.SubtitleExtAdd = onSubTitleExtAdd;
}