Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(283)

Side by Side Diff: webkit/media/crypto/ppapi/libvpx_cdm_video_decoder.h

Issue 11316045: Add a libvpx video decoder to ClearKeyCdm and move the fake video decoder to its own class. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase, fix incorrect DCHECK and fix include order. Created 8 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(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 struct vpx_codec_ctx;
14 struct vpx_image;
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 virtual bool is_initialized() const OVERRIDE { return is_initialized_; }
32
33 // Returns true when |format| and |data_size| specify a supported video
34 // output configuration.
35 static bool IsValidOutputConfig(cdm::VideoFormat format,
36 const cdm::Size& data_size);
37
38 private:
39 // Allocates storage, then copies video frame stored in |vpx_image_| to
40 // |cdm_video_frame|. Returns true when allocation and copy succeed.
41 bool CopyVpxImageTo(cdm::VideoFrame* cdm_video_frame);
42
43 bool is_initialized_;
44
45 cdm::Allocator* const allocator_;
46
47 vpx_codec_ctx* vpx_codec_;
48 vpx_image* vpx_image_;
49
50 DISALLOW_COPY_AND_ASSIGN(LibvpxCdmVideoDecoder);
51 };
52
53 } // namespace webkit_media
54
55 #endif // WEBKIT_MEDIA_CRYPTO_PPAPI_LIBVPX_CDM_VIDEO_DECODER_H_
OLDNEW
« no previous file with comments | « webkit/media/crypto/ppapi/ffmpeg_cdm_video_decoder.h ('k') | webkit/media/crypto/ppapi/libvpx_cdm_video_decoder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698