OLD | NEW |
---|---|
(Empty) | |
1 // Copyright (c) 2012 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. | |
4 | |
5 #ifndef WEBKIT_MEDIA_CRYPTO_PPAPI_LIBVPX_CDM_VIDEO_DECODER_H_ | |
6 #define WEBKIT_MEDIA_CRYPTO_PPAPI_LIBVPX_CDM_VIDEO_DECODER_H_ | |
7 | |
8 #include "base/basictypes.h" | |
9 #include "base/compiler_specific.h" | |
10 #include "webkit/media/crypto/ppapi/cdm_video_decoder.h" | |
11 #include "webkit/media/crypto/ppapi/content_decryption_module.h" | |
12 | |
13 typedef struct vpx_codec_ctx vpx_codec_ctx_t; | |
ddorwin
2012/11/17 02:56:22
Why?
There should at least be a comment.
Tom Finegan
2012/11/17 04:35:06
Switched weird looking duplicate typedefs to norma
| |
14 typedef struct vpx_image vpx_image_t; | |
15 | |
16 namespace webkit_media { | |
17 | |
18 class LibvpxCdmVideoDecoder : public CdmVideoDecoder { | |
19 public: | |
20 explicit LibvpxCdmVideoDecoder(cdm::Allocator* allocator); | |
21 virtual ~LibvpxCdmVideoDecoder(); | |
22 | |
23 // CdmVideoDecoder implementation. | |
24 virtual bool Initialize(const cdm::VideoDecoderConfig& config) OVERRIDE; | |
25 virtual void Deinitialize() OVERRIDE; | |
26 virtual void Reset() OVERRIDE; | |
27 virtual cdm::Status DecodeFrame(const uint8_t* compressed_frame, | |
28 int32_t compressed_frame_size, | |
29 int64_t timestamp, | |
30 cdm::VideoFrame* decoded_frame) OVERRIDE; | |
31 | |
32 // Returns true when |format| and |data_size| specify a supported video | |
33 // output configuration. | |
34 static bool IsValidOutputConfig(cdm::VideoFormat format, | |
35 const cdm::Size& data_size); | |
36 | |
37 private: | |
38 // Allocates storage, then copies video frame stored in |vpx_image_| to | |
39 // |cdm_video_frame|. Returns true when allocation and copy succeed. | |
40 bool CopyVpxImageTo(cdm::VideoFrame* cdm_video_frame); | |
41 | |
42 bool is_initialized_; | |
43 | |
44 cdm::Allocator* const allocator_; | |
45 | |
46 vpx_codec_ctx_t* vpx_codec_; | |
47 vpx_image_t* vpx_image_; | |
48 | |
49 DISALLOW_COPY_AND_ASSIGN(LibvpxCdmVideoDecoder); | |
50 }; | |
51 | |
52 } // namespace webkit_media | |
53 | |
54 #endif // WEBKIT_MEDIA_CRYPTO_PPAPI_LIBVPX_CDM_VIDEO_DECODER_H_ | |
OLD | NEW |