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 WEBKIT_RENDERER_MEDIA_CRYPTO_PPAPI_CDM_VIDEO_DECODER_H_ | 5 #ifndef MEDIA_CDM_PPAPI_CDM_VIDEO_DECODER_H_ |
6 #define WEBKIT_RENDERER_MEDIA_CRYPTO_PPAPI_CDM_VIDEO_DECODER_H_ | 6 #define MEDIA_CDM_PPAPI_CDM_VIDEO_DECODER_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "webkit/renderer/media/crypto/ppapi/cdm/content_decryption_module.h" | 10 #include "media/cdm/ppapi/api/content_decryption_module.h" |
11 | 11 |
12 namespace webkit_media { | 12 namespace media { |
13 | 13 |
14 class CdmVideoDecoder { | 14 class CdmVideoDecoder { |
15 public: | 15 public: |
16 virtual ~CdmVideoDecoder() {} | 16 virtual ~CdmVideoDecoder() {} |
17 virtual bool Initialize(const cdm::VideoDecoderConfig& config) = 0; | 17 virtual bool Initialize(const cdm::VideoDecoderConfig& config) = 0; |
18 virtual void Deinitialize() = 0; | 18 virtual void Deinitialize() = 0; |
19 virtual void Reset() = 0; | 19 virtual void Reset() = 0; |
20 virtual bool is_initialized() const = 0; | 20 virtual bool is_initialized() const = 0; |
21 | 21 |
22 // Decodes |compressed_frame|. Stores output frame in |decoded_frame| and | 22 // Decodes |compressed_frame|. Stores output frame in |decoded_frame| and |
23 // returns |cdm::kSuccess| when an output frame is available. Returns | 23 // returns |cdm::kSuccess| when an output frame is available. Returns |
24 // |cdm::kNeedMoreData| when |compressed_frame| does not produce an output | 24 // |cdm::kNeedMoreData| when |compressed_frame| does not produce an output |
25 // frame. Returns |cdm::kDecodeError| when decoding fails. | 25 // frame. Returns |cdm::kDecodeError| when decoding fails. |
26 // | 26 // |
27 // A null |compressed_frame| will attempt to flush the decoder of any | 27 // A null |compressed_frame| will attempt to flush the decoder of any |
28 // remaining frames. |compressed_frame_size| and |timestamp| are ignored. | 28 // remaining frames. |compressed_frame_size| and |timestamp| are ignored. |
29 virtual cdm::Status DecodeFrame(const uint8_t* compressed_frame, | 29 virtual cdm::Status DecodeFrame(const uint8_t* compressed_frame, |
30 int32_t compressed_frame_size, | 30 int32_t compressed_frame_size, |
31 int64_t timestamp, | 31 int64_t timestamp, |
32 cdm::VideoFrame* decoded_frame) = 0; | 32 cdm::VideoFrame* decoded_frame) = 0; |
33 }; | 33 }; |
34 | 34 |
35 // Initializes appropriate video decoder based on GYP flags and the value of | 35 // Initializes appropriate video decoder based on GYP flags and the value of |
36 // |config.codec|. Returns a scoped_ptr containing a non-null initialized | 36 // |config.codec|. Returns a scoped_ptr containing a non-null initialized |
37 // CdmVideoDecoder* upon success. | 37 // CdmVideoDecoder* upon success. |
38 scoped_ptr<CdmVideoDecoder> CreateVideoDecoder( | 38 scoped_ptr<CdmVideoDecoder> CreateVideoDecoder( |
39 cdm::Host* host, const cdm::VideoDecoderConfig& config); | 39 cdm::Host* host, const cdm::VideoDecoderConfig& config); |
40 | 40 |
41 } // namespace webkit_media | 41 } // namespace media |
42 | 42 |
43 #endif // WEBKIT_RENDERER_MEDIA_CRYPTO_PPAPI_CDM_VIDEO_DECODER_H_ | 43 #endif // MEDIA_CDM_PPAPI_CDM_VIDEO_DECODER_H_ |
OLD | NEW |