Pepper_42_C++_interfaces
drm_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_DRM_LISTENER_SAMSUNG_H_
6 #define PPAPI_CPP_SAMSUNG_DRM_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>DRMListener_Samsung</code> type which allows
13 /// plugin to receive DRM events.
14 namespace pp {
15 
16 class MediaPlayer_Samsung;
17 
18 /// Listener for receiving DRM related events.
20  public:
21  virtual ~DRMListener_Samsung();
22 
23  /// During parsing media container encrypted track was found.
24  ///
25  /// @param[in] drm_type A type of DRM system
26  /// @param[in] init_data_size Size in bytes of |init_data| buffer.
27  /// @param[in] init_data A pointer to the buffer containing DRM specific
28  /// initialization data.
29  virtual void OnInitdataLoaded(
30  PP_MediaPlayerDRMType drm_type,
31  uint32_t init_data_size,
32  const void* init_data);
33 
34  /// Decryption license needs to be requested from the server and
35  /// provided to the player.
36  ///
37  /// @param[in] request_size Size in bytes of |request| buffer.
38  /// @param[in] request A pointer to the buffer containing DRM specific
39  /// request.
40  virtual void OnLicenseRequest(uint32_t request_size, const void* request);
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|.
48  explicit DRMListener_Samsung(MediaPlayer_Samsung* 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
59  DRMListener_Samsung& operator=(const DRMListener_Samsung&);
60 };
61 
62 } // namespace pp
63 
64 #endif // PPAPI_CPP_SAMSUNG_DRM_LISTENER_SAMSUNG_H_
virtual void OnLicenseRequest(uint32_t request_size, const void *request)
virtual ~DRMListener_Samsung()
Listener for receiving DRM related events.
void AttachTo(MediaPlayer_Samsung *player)
Attaches listener to the |player|.
virtual void OnInitdataLoaded(PP_MediaPlayerDRMType drm_type, uint32_t init_data_size, const void *init_data)