Pepper_37_C++_interfaces
media_metadata_listener_samsung.h
Go to the documentation of this file.
1 // Copyright 2015 The Chromium Authors. 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_MEDIA_METADATA_LISTENER_SAMSUNG_H_
6 #define PPAPI_CPP_SAMSUNG_MEDIA_METADATA_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>MediaMetadataListener_Samsung</code> type
13 /// which allows plugin to receive media metadata changes events.
14 namespace pp {
15 
16 class MediaPlayer_Samsung;
17 
18 /// Listener for receiving media metadata changes.
20  public:
22 
23  /// Event is sent when information such as duration and video resolution
24  /// has been determined after parsing the stream.
25  virtual void OnMetadataLoaded();
26 
27  /// Duration of the media has been changed.
28  ///
29  /// @param[in] duration New duration of the played media.
30  virtual void OnDurationChanged(PP_TimeDelta duration);
31 
32  /// Video size of played media has been changed.
33  ///
34  /// @param[in] size New video size.
35  virtual void OnVideoSizeChanged(const PP_Size& size);
36 
37  /// Video bitrate of played media has been changed.
38  ///
39  /// @param[in] size New video bitrate.
40  virtual void OnVideoBitrateChanged(uint32_t bitrate);
41 
42  protected:
43  /// The default constructor which creates listener not attached
44  /// to the player
46 
47  /// Constructor which creates listener attached to the |player|.
49 
50  /// Attaches listener to the |player|.
51  void AttachTo(MediaPlayer_Samsung* player);
52 
53  private:
54  void Detach();
55  PP_Resource player_;
56 
57  // Disallow copy and assign
61 };
62 
63 } // namespace pp
64 
65 #endif // PPAPI_CPP_SAMSUNG_MEDIA_METADATA_LISTENER_SAMSUNG_H_
virtual void OnVideoBitrateChanged(uint32_t bitrate)
void AttachTo(MediaPlayer_Samsung *player)
Attaches listener to the |player|.
virtual void OnDurationChanged(PP_TimeDelta duration)
Listener for receiving media metadata changes.
virtual void OnVideoSizeChanged(const PP_Size &size)