summaryrefslogtreecommitdiffstats
path: root/media/base/cdm_key_information.h
blob: 7ed8eff693e27264c72ad50c0ad1754465dd63e4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
// Copyright 2015 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef MEDIA_BASE_CDM_KEY_INFORMATION_H_
#define MEDIA_BASE_CDM_KEY_INFORMATION_H_

#include <stddef.h>
#include <stdint.h>

#include <string>
#include <vector>

#include "media/base/media_export.h"

namespace media {

struct MEDIA_EXPORT CdmKeyInformation {
  enum KeyStatus {
    USABLE = 0,
    INTERNAL_ERROR = 1,
    EXPIRED = 2,
    OUTPUT_RESTRICTED = 3,
    OUTPUT_DOWNSCALED = 4,
    KEY_STATUS_PENDING = 5,
    RELEASED = 6,
    KEY_STATUS_MAX = RELEASED
  };

  // Default constructor needed for passing this type through IPC. Regular
  // code should use one of the other constructors.
  CdmKeyInformation();
  CdmKeyInformation(const std::vector<uint8_t>& key_id,
                    KeyStatus status,
                    uint32_t system_code);
  CdmKeyInformation(const std::string& key_id,
                    KeyStatus status,
                    uint32_t system_code);
  CdmKeyInformation(const uint8_t* key_id_data,
                    size_t key_id_length,
                    KeyStatus status,
                    uint32_t system_code);
  CdmKeyInformation(const CdmKeyInformation& other);
  ~CdmKeyInformation();

  std::vector<uint8_t> key_id;
  KeyStatus status;
  uint32_t system_code;
};

}  // namespace media

#endif  // MEDIA_BASE_CDM_KEY_INFORMATION_H_