Pepper_37_C_interfaces
ppp_media_player_samsung.h
Go to the documentation of this file.
1 /* Copyright (c) 2015 Samsung Electronics. All rights reserved.
2  */
3 
4 /* From samsung/ppp_media_player_samsung.idl,
5  * modified Mon Jul 20 09:41:40 2015.
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_size.h"
13 #include "ppapi/c/pp_stdint.h"
14 #include "ppapi/c/pp_time.h"
15 #include "ppapi/c/samsung/pp_media_player_samsung.h"
16 
17 #define PPP_MEDIAEVENTSLISTENER_SAMSUNG_INTERFACE_0_1 \
18  "PPP_MediaEventsListener_Samsung;0.1"
19 #define PPP_MEDIAEVENTSLISTENER_SAMSUNG_INTERFACE \
20  PPP_MEDIAEVENTSLISTENER_SAMSUNG_INTERFACE_0_1
21 
22 #define PPP_MEDIAMETADATALISTENER_SAMSUNG_INTERFACE_0_1 \
23  "PPP_MediaMetadataListener_Samsung;0.1"
24 #define PPP_MEDIAMETADATALISTENER_SAMSUNG_INTERFACE \
25  PPP_MEDIAMETADATALISTENER_SAMSUNG_INTERFACE_0_1
26 
27 #define PPP_BUFFERINGLISTENER_SAMSUNG_INTERFACE_0_1 \
28  "PPP_BufferingListener_Samsung;0.1"
29 #define PPP_BUFFERINGLISTENER_SAMSUNG_INTERFACE \
30  PPP_BUFFERINGLISTENER_SAMSUNG_INTERFACE_0_1
31 
32 #define PPP_DRMLISTENER_SAMSUNG_INTERFACE_0_1 "PPP_DRMListener_Samsung;0.1"
33 #define PPP_DRMLISTENER_SAMSUNG_INTERFACE PPP_DRMLISTENER_SAMSUNG_INTERFACE_0_1
34 
35 /**
36  * @file
37  * This file defines events listeners used with the
38  * <code>PPB_MediaPlayer_Samsung</code> interface.
39  *
40  * Part of Pepper Media Player interfaces (Samsung's extension).
41  * See comments in ppb_media_player_samsung.idl.
42  */
43 
44 
45 /**
46  * @addtogroup Interfaces
47  * @{
48  */
49 /**
50  * Structure containing pointers to functions provided by plugin,
51  * and called when player or playback related event occurs.
52  */
54  /**
55  * Event sent periodically during clip playback and indicates playback
56  * progress.
57  *
58  * Event will be sent at least twice per second.
59  *
60  * @param[in] time current media time.
61  * @param[in] user_data A pointer to user data passed to a listener function.
62  */
63  void (*OnTimeUpdate)(PP_TimeTicks time, void* user_data);
64  /**
65  * Played clip has ended.
66  *
67  * @param[in] user_data A pointer to user data passed to a listener function.
68  */
69  void (*OnEnded)(void* user_data);
70  /**
71  * Error during playback has occurred.
72  *
73  * @param[in] error An error code signalizing type of occurred error.
74  * @param[in] user_data A pointer to user data passed to a listener function.
75  */
76  void (*OnError)(PP_MediaPlayerError error, void* user_data);
77 };
78 
81 
82 /**
83  * Listener for receiving media metadata changes.
84  */
86  /**
87  * Event is sent when information such as duration and video resolution
88  * has been determined after parsing the stream.
89  *
90  * @param[in] user_data A pointer to user data passed to a listener function.
91  */
92  void (*OnMetadataLoaded)(void* user_data);
93  /**
94  * Duration of the media has been changed.
95  *
96  * @param[in] duration New duration of the played media.
97  * @param[in] user_data A pointer to user data passed to a listener function.
98  */
99  void (*OnDurationChanged)(PP_TimeDelta duration, void* user_data);
100  /**
101  * Video size of played media has been changed.
102  *
103  * @param[in] size New video size.
104  * @param[in] user_data A pointer to user data passed to a listener function.
105  */
106  void (*OnVideoSizeChanged)(const struct PP_Size* size, void* user_data);
107  /**
108  * Video bitrate of played media has been changed.
109  *
110  * @param[in] size New video bitrate.
111  * @param[in] user_data A pointer to user data passed to a listener function.
112  */
113  void (*OnVideoBitrateChanged)(uint32_t bitrate, void* user_data);
114 };
115 
118 
119 /**
120  * Listener for receiving initial media buffering related events, sent
121  * before playback can be started.
122  *
123  * Those event can be used by the application to show buffering progress bar
124  * to the user.
125  *
126  * Those events are sent only when media buffering is managed by the player
127  * implementation (see <code>PPB_URLDataSource_Samsung</code>), not by the
128  * user (see <code>PPB_ESDataSource_Samsung</code>).
129  */
131  /**
132  * Initial media buffering has been started by the player.
133  *
134  * @param[in] user_data A pointer to user data passed to a listener function.
135  */
136  void (*OnBufferingStart)(void* user_data);
137  /**
138  * Initial buffering in progress.
139  *
140  * @param[in] percent Indicates how much of the initial data has been
141  * buffered by the player.
142  * @param[in] user_data A pointer to user data passed to a listener function.
143  */
144  void (*OnBufferingProgress)(uint32_t percent, void* user_data);
145  /**
146  * Initial media buffering has been completed by the player, after that
147  * event playback might be started.
148  *
149  * @param[in] user_data A pointer to user data passed to a listener function.
150  */
151  void (*OnBufferingComplete)(void* user_data);
152 };
153 
155 
156 /**
157  * Listener for receiving DRM related events.
158  */
160  /**
161  * During parsing media container encrypted track was found.
162  *
163  * @param[in] drm_type A type of DRM system
164  * @param[in] init_data_size Size in bytes of |init_data| buffer.
165  * @param[in] init_data A pointer to the buffer containing DRM specific
166  * initialization data
167  * @param[in] user_data A pointer to user data passed to a listener function.
168  */
170  uint32_t init_data_size,
171  const void* init_data,
172  void* user_data);
173  /**
174  * Decryption license needs to be requested from the server and
175  * provided to the player.
176  *
177  * @param[in] request_size Size in bytes of |request| buffer.
178  * @param[in] request A pointer to the buffer containing DRM specific request.
179  * @param[in] user_data A pointer to user data passed to a listener function.
180  */
181  void (*OnLicenseRequest)(uint32_t request_size,
182  const void* request,
183  void* user_data);
184 };
185 
187 /**
188  * @}
189  */
190 
191 #endif /* PPAPI_C_SAMSUNG_PPP_MEDIA_PLAYER_SAMSUNG_H_ */
192 
void(* OnBufferingProgress)(uint32_t percent, void *user_data)
void(* OnVideoSizeChanged)(const struct PP_Size *size, void *user_data)
void(* OnVideoBitrateChanged)(uint32_t bitrate, void *user_data)
void(* OnLicenseRequest)(uint32_t request_size, const void *request, void *user_data)
void(* OnError)(PP_MediaPlayerError error, void *user_data)
double PP_TimeTicks
Definition: pp_time.h:42
void(* OnBufferingComplete)(void *user_data)
double PP_TimeDelta
Definition: pp_time.h:49
void(* OnDurationChanged)(PP_TimeDelta duration, void *user_data)
void(* OnInitdataLoaded)(PP_MediaPlayerDRMType drm_type, uint32_t init_data_size, const void *init_data, void *user_data)
void(* OnTimeUpdate)(PP_TimeTicks time, void *user_data)