Pepper_42_C++_interfaces
buffering_listener_samsung.h
Go to the documentation of this file.
1 // Copyright (c) 2016 Samsung Electronics. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 #ifndef PPAPI_CPP_SAMSUNG_BUFFERING_LISTENER_SAMSUNG_H_
6 #define PPAPI_CPP_SAMSUNG_BUFFERING_LISTENER_SAMSUNG_H_
7 
8 #include "ppapi/c/pp_resource.h"
9 #include "ppapi/c/samsung/ppp_media_player_samsung.h"
10 
11 /// @file
12 /// This file defines a <code>BufferingListener_Samsung</code> type which
13 /// allows plugin to receive initial media buffering events.
14 namespace pp {
15 
16 class MediaPlayer_Samsung;
17 
18 /// Listener for receiving initial media buffering related events, sent
19 /// before playback can be started.
20 ///
21 /// Those event can be used by the application to show buffering progress bar
22 /// to the user.
23 ///
24 /// Those events are sent only when media buffering is managed by the player
25 /// implementation (see <code>URLDataSource_Samsung</code>), not by the user
26 /// (see <code>ESDataSource_Samsung</code>).
28  public:
30 
31  /// Initial media buffering has been started by the player.
32  virtual void OnBufferingStart();
33 
34  /// Initial buffering in progress.
35  ///
36  /// @param[in] percent Indicates how much of the initial data has been
37  /// buffered by the player.
38  virtual void OnBufferingProgress(uint32_t percent);
39 
40  /// Initial media buffering has been completed by the player, after that
41  /// event playback might be started.
42  virtual void OnBufferingComplete();
43 
44  protected:
45  /// The default constructor which creates listener not attached
46  /// to the player
48 
49  /// Constructor which creates listener attached to the |player|.
51 
52  /// Attaches listener to the |player|.
53  void AttachTo(MediaPlayer_Samsung* player);
54 
55  private:
56  void Detach();
57  PP_Resource player_;
58 
59  // Disallow copy and assign
62 };
63 
64 } // namespace pp
65 
66 #endif // PPAPI_CPP_SAMSUNG_BUFFERING_LISTENER_SAMSUNG_H_
void AttachTo(MediaPlayer_Samsung *player)
Attaches listener to the |player|.
virtual void OnBufferingComplete()
virtual void OnBufferingStart()
Initial media buffering has been started by the player.
virtual void OnBufferingProgress(uint32_t percent)