Shaka Player Embedded
data.h
Go to the documentation of this file.
1 // Copyright 2018 Google LLC
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 // https://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14 
15 #ifndef SHAKA_EMBEDDED_EME_DATA_H_
16 #define SHAKA_EMBEDDED_EME_DATA_H_
17 
18 #include <stddef.h> // For size_t
19 #include <stdint.h> // For uint8_t
20 
21 #include <memory>
22 
23 #include "../macros.h"
24 
25 namespace shaka {
26 
27 class ByteBuffer;
28 
29 namespace js {
30 namespace eme {
31 class MediaKeys;
32 class MediaKeySession;
33 } // namespace eme
34 } // namespace js
35 
36 namespace eme {
37 
46 class SHAKA_EXPORT Data final {
47  public:
48  Data(const Data& other) = delete;
49  Data(Data&& other);
50  ~Data();
51 
52  Data& operator=(const Data& other) = delete;
53  Data& operator=(Data&& other);
54 
56  const uint8_t* data() const;
58  size_t size() const;
59 
60  private:
61  friend class ClearKeyImplementationTest;
62  friend class js::eme::MediaKeys;
64  Data(ByteBuffer* buffer);
65 
66  class Impl;
67  std::unique_ptr<Impl> impl_;
68 };
69 
70 } // namespace eme
71 } // namespace shaka
72 
73 #endif // SHAKA_EMBEDDED_EME_DATA_H_
#define SHAKA_EXPORT
Definition: macros.h:30