OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef MEDIA_CDM_PPAPI_EXTERNAL_CLEAR_KEY_CDM_VIDEO_DECODER_H_ | 5 #ifndef MEDIA_CDM_PPAPI_EXTERNAL_CLEAR_KEY_CDM_VIDEO_DECODER_H_ |
6 #define MEDIA_CDM_PPAPI_EXTERNAL_CLEAR_KEY_CDM_VIDEO_DECODER_H_ | 6 #define MEDIA_CDM_PPAPI_EXTERNAL_CLEAR_KEY_CDM_VIDEO_DECODER_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include "base/memory/scoped_ptr.h" | 10 #include <memory> |
| 11 |
11 #include "media/cdm/api/content_decryption_module.h" | 12 #include "media/cdm/api/content_decryption_module.h" |
12 #include "media/cdm/ppapi/external_clear_key/clear_key_cdm_common.h" | 13 #include "media/cdm/ppapi/external_clear_key/clear_key_cdm_common.h" |
13 | 14 |
14 namespace media { | 15 namespace media { |
15 | 16 |
16 class CdmVideoDecoder { | 17 class CdmVideoDecoder { |
17 public: | 18 public: |
18 virtual ~CdmVideoDecoder() {} | 19 virtual ~CdmVideoDecoder() {} |
19 virtual bool Initialize(const cdm::VideoDecoderConfig& config) = 0; | 20 virtual bool Initialize(const cdm::VideoDecoderConfig& config) = 0; |
20 virtual void Deinitialize() = 0; | 21 virtual void Deinitialize() = 0; |
21 virtual void Reset() = 0; | 22 virtual void Reset() = 0; |
22 virtual bool is_initialized() const = 0; | 23 virtual bool is_initialized() const = 0; |
23 | 24 |
24 // Decodes |compressed_frame|. Stores output frame in |decoded_frame| and | 25 // Decodes |compressed_frame|. Stores output frame in |decoded_frame| and |
25 // returns |cdm::kSuccess| when an output frame is available. Returns | 26 // returns |cdm::kSuccess| when an output frame is available. Returns |
26 // |cdm::kNeedMoreData| when |compressed_frame| does not produce an output | 27 // |cdm::kNeedMoreData| when |compressed_frame| does not produce an output |
27 // frame. Returns |cdm::kDecodeError| when decoding fails. | 28 // frame. Returns |cdm::kDecodeError| when decoding fails. |
28 // | 29 // |
29 // A null |compressed_frame| will attempt to flush the decoder of any | 30 // A null |compressed_frame| will attempt to flush the decoder of any |
30 // remaining frames. |compressed_frame_size| and |timestamp| are ignored. | 31 // remaining frames. |compressed_frame_size| and |timestamp| are ignored. |
31 virtual cdm::Status DecodeFrame(const uint8_t* compressed_frame, | 32 virtual cdm::Status DecodeFrame(const uint8_t* compressed_frame, |
32 int32_t compressed_frame_size, | 33 int32_t compressed_frame_size, |
33 int64_t timestamp, | 34 int64_t timestamp, |
34 cdm::VideoFrame* decoded_frame) = 0; | 35 cdm::VideoFrame* decoded_frame) = 0; |
35 }; | 36 }; |
36 | 37 |
37 // Initializes appropriate video decoder based on GYP flags and the value of | 38 // Initializes appropriate video decoder based on GYP flags and the value of |
38 // |config.codec|. Returns a scoped_ptr containing a non-null initialized | 39 // |config.codec|. Returns a scoped_ptr containing a non-null initialized |
39 // CdmVideoDecoder* upon success. | 40 // CdmVideoDecoder* upon success. |
40 scoped_ptr<CdmVideoDecoder> CreateVideoDecoder( | 41 std::unique_ptr<CdmVideoDecoder> CreateVideoDecoder( |
41 ClearKeyCdmHost* host, const cdm::VideoDecoderConfig& config); | 42 ClearKeyCdmHost* host, |
| 43 const cdm::VideoDecoderConfig& config); |
42 | 44 |
43 } // namespace media | 45 } // namespace media |
44 | 46 |
45 #endif // MEDIA_CDM_PPAPI_EXTERNAL_CLEAR_KEY_CDM_VIDEO_DECODER_H_ | 47 #endif // MEDIA_CDM_PPAPI_EXTERNAL_CLEAR_KEY_CDM_VIDEO_DECODER_H_ |
OLD | NEW |