Pepper_47_C_interfaces
ppp_media_player_samsung.h
Go to the documentation of this file.
1 /* Copyright (c) 2016 Samsung Electronics. All rights reserved.
2  */
3 
4 /* From samsung/ppp_media_player_samsung.idl,
5  * modified Wed Mar 30 10:21:58 2016.
6  */
7 
8 #ifndef PPAPI_C_SAMSUNG_PPP_MEDIA_PLAYER_SAMSUNG_H_
9 #define PPAPI_C_SAMSUNG_PPP_MEDIA_PLAYER_SAMSUNG_H_
10 
11 #include "ppapi/c/pp_macros.h"
12 #include "ppapi/c/pp_stdint.h"
13 #include "ppapi/c/pp_time.h"
15 
16 #define PPP_MEDIAEVENTSLISTENER_SAMSUNG_INTERFACE_1_0 \
17  "PPP_MediaEventsListener_Samsung;1.0"
18 #define PPP_MEDIAEVENTSLISTENER_SAMSUNG_INTERFACE \
19  PPP_MEDIAEVENTSLISTENER_SAMSUNG_INTERFACE_1_0
20 
21 #define PPP_SUBTITLELISTENER_SAMSUNG_INTERFACE_1_0 \
22  "PPP_SubtitleListener_Samsung;1.0"
23 #define PPP_SUBTITLELISTENER_SAMSUNG_INTERFACE \
24  PPP_SUBTITLELISTENER_SAMSUNG_INTERFACE_1_0
25 
26 #define PPP_BUFFERINGLISTENER_SAMSUNG_INTERFACE_1_0 \
27  "PPP_BufferingListener_Samsung;1.0"
28 #define PPP_BUFFERINGLISTENER_SAMSUNG_INTERFACE \
29  PPP_BUFFERINGLISTENER_SAMSUNG_INTERFACE_1_0
30 
31 #define PPP_DRMLISTENER_SAMSUNG_INTERFACE_1_0 "PPP_DRMListener_Samsung;1.0"
32 #define PPP_DRMLISTENER_SAMSUNG_INTERFACE PPP_DRMLISTENER_SAMSUNG_INTERFACE_1_0
33 
34 /**
35  * @file
36  * This file defines events listeners used with the
37  * <code>PPB_MediaPlayer_Samsung</code> interface.
38  *
39  * Part of Pepper Media Player interfaces (Samsung's extension).
40  * See comments in ppb_media_player_samsung.idl.
41  */
42 
43 
44 /**
45  * @addtogroup Interfaces
46  * @{
47  */
48 /**
49  * Structure containing pointers to functions provided by plugin,
50  * and called when player or playback related event occurs.
51  */
53  /**
54  * Event sent periodically during clip playback and indicates playback
55  * progress.
56  *
57  * Event will be sent at least twice per second.
58  *
59  * @param[in] time current media time.
60  * @param[in] user_data A pointer to user data passed to a listener function.
61  */
62  void (*OnTimeUpdate)(PP_TimeTicks time, void* user_data);
63  /**
64  * Played clip has ended.
65  *
66  * @param[in] user_data A pointer to user data passed to a listener function.
67  */
68  void (*OnEnded)(void* user_data);
69  /**
70  * Error during playback has occurred.
71  *
72  * @param[in] error An error code signalizing type of occurred error.
73  * @param[in] user_data A pointer to user data passed to a listener function.
74  */
75  void (*OnError)(PP_MediaPlayerError error, void* user_data);
76 };
77 
80 
81 /**
82  * Listener for receiving subtitle updates provided by the player's internal
83  * subtitle parser. This listener will be notified every time active and visible
84  * text track contains a subtitle that should be displayed at the current
85  * playback position.
86  */
88  /**
89  * Event sent when a subtitle should be displayed.
90  *
91  * @param[in] duration Duration for which the text should be displayed.
92  * @param[in] text The UTF-8 encoded string that contains a subtitle text
93  * that should be displayed. Please note text encoding will be UTF-8
94  * independently from the source subtitle file encoding.
95  * @param[in] user_data A pointer to user data passed to a listener function.
96  */
97  void (*OnShowSubtitle)(PP_TimeDelta duration,
98  const char* text,
99  void* user_data);
100 };
101 
103 
104 /**
105  * Listener for receiving initial media buffering related events, sent
106  * before playback can be started.
107  *
108  * Those event can be used by the application to show buffering progress bar
109  * to the user.
110  *
111  * Those events are sent only when media buffering is managed by the player
112  * implementation (see <code>PPB_URLDataSource_Samsung</code>), not by the
113  * user (see <code>PPB_ESDataSource_Samsung</code>).
114  */
116  /**
117  * Initial media buffering has been started by the player.
118  *
119  * @param[in] user_data A pointer to user data passed to a listener function.
120  */
121  void (*OnBufferingStart)(void* user_data);
122  /**
123  * Initial buffering in progress.
124  *
125  * @param[in] percent Indicates how much of the initial data has been
126  * buffered by the player.
127  * @param[in] user_data A pointer to user data passed to a listener function.
128  */
129  void (*OnBufferingProgress)(uint32_t percent, void* user_data);
130  /**
131  * Initial media buffering has been completed by the player, after that
132  * event playback might be started.
133  *
134  * @param[in] user_data A pointer to user data passed to a listener function.
135  */
136  void (*OnBufferingComplete)(void* user_data);
137 };
138 
140 
141 /**
142  * Listener for receiving DRM related events.
143  */
145  /**
146  * During parsing media container encrypted track was found.
147  *
148  * @param[in] drm_type A type of DRM system
149  * @param[in] init_data_size Size in bytes of |init_data| buffer.
150  * @param[in] init_data A pointer to the buffer containing DRM specific
151  * initialization data
152  * @param[in] user_data A pointer to user data passed to a listener function.
153  */
155  uint32_t init_data_size,
156  const void* init_data,
157  void* user_data);
158  /**
159  * Decryption license needs to be requested from the server and
160  * provided to the player.
161  *
162  * @param[in] request_size Size in bytes of |request| buffer.
163  * @param[in] request A pointer to the buffer containing DRM specific request.
164  * @param[in] user_data A pointer to user data passed to a listener function.
165  */
166  void (*OnLicenseRequest)(uint32_t request_size,
167  const void* request,
168  void* user_data);
169 };
170 
172 /**
173  * @}
174  */
175 
176 #endif /* PPAPI_C_SAMSUNG_PPP_MEDIA_PLAYER_SAMSUNG_H_ */
177 
void(* OnInitdataLoaded)(PP_MediaPlayerDRMType drm_type, uint32_t init_data_size, const void *init_data, void *user_data)
void(* OnShowSubtitle)(PP_TimeDelta duration, const char *text, void *user_data)
double PP_TimeTicks
Definition: pp_time.h:42
void(* OnError)(PP_MediaPlayerError error, void *user_data)
void(* OnBufferingComplete)(void *user_data)
double PP_TimeDelta
Definition: pp_time.h:49
void(* OnBufferingProgress)(uint32_t percent, void *user_data)
void(* OnLicenseRequest)(uint32_t request_size, const void *request, void *user_data)
void(* OnTimeUpdate)(PP_TimeTicks time, void *user_data)