Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / media / cdm / ppapi / external_clear_key / cdm_video_decoder.h
blobfd84b773619816bbc7ef6ae6e4ecb876c585811c
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
3 // found in the LICENSE file.
5 #ifndef MEDIA_CDM_PPAPI_EXTERNAL_CLEAR_KEY_CDM_VIDEO_DECODER_H_
6 #define MEDIA_CDM_PPAPI_EXTERNAL_CLEAR_KEY_CDM_VIDEO_DECODER_H_
8 #include "base/basictypes.h"
9 #include "base/memory/scoped_ptr.h"
10 #include "media/cdm/ppapi/api/content_decryption_module.h"
11 #include "media/cdm/ppapi/external_clear_key/clear_key_cdm_common.h"
13 namespace media {
15 class CdmVideoDecoder {
16 public:
17 virtual ~CdmVideoDecoder() {}
18 virtual bool Initialize(const cdm::VideoDecoderConfig& config) = 0;
19 virtual void Deinitialize() = 0;
20 virtual void Reset() = 0;
21 virtual bool is_initialized() const = 0;
23 // Decodes |compressed_frame|. Stores output frame in |decoded_frame| and
24 // returns |cdm::kSuccess| when an output frame is available. Returns
25 // |cdm::kNeedMoreData| when |compressed_frame| does not produce an output
26 // frame. Returns |cdm::kDecodeError| when decoding fails.
28 // A null |compressed_frame| will attempt to flush the decoder of any
29 // remaining frames. |compressed_frame_size| and |timestamp| are ignored.
30 virtual cdm::Status DecodeFrame(const uint8_t* compressed_frame,
31 int32_t compressed_frame_size,
32 int64_t timestamp,
33 cdm::VideoFrame* decoded_frame) = 0;
36 // Initializes appropriate video decoder based on GYP flags and the value of
37 // |config.codec|. Returns a scoped_ptr containing a non-null initialized
38 // CdmVideoDecoder* upon success.
39 scoped_ptr<CdmVideoDecoder> CreateVideoDecoder(
40 ClearKeyCdmHost* host, const cdm::VideoDecoderConfig& config);
42 } // namespace media
44 #endif // MEDIA_CDM_PPAPI_EXTERNAL_CLEAR_KEY_CDM_VIDEO_DECODER_H_