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

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

Issue 10899021: Add CDM video decoder. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Comments addressed. Created 8 years, 1 month 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_FFMPEG_CDM_VIDEO_DECODER_H_
6 #define WEBKIT_MEDIA_CRYPTO_PPAPI_FFMPEG_CDM_VIDEO_DECODER_H_
7
8 #include "base/basictypes.h"
9 #include "base/compiler_specific.h"
10 #include "webkit/media/crypto/ppapi/content_decryption_module.h"
11
12 struct AVCodecContext;
13 struct AVFrame;
14
15 namespace webkit_media {
16
17 class FFmpegCdmVideoDecoder {
18 public:
19 FFmpegCdmVideoDecoder(cdm::Allocator* allocator);
20 ~FFmpegCdmVideoDecoder();
21 bool Initialize(const cdm::VideoDecoderConfig& config);
22 void Deinitialize();
23 void Reset();
24
25 // Returns true when |format| and |data_size| specify a supported video
26 // output configuration.
27 static bool IsValidOutputConfig(cdm::VideoFormat format,
28 const cdm::Size& data_size);
29
30 // Decodes |compressed_frame|. Stores output frame in |decoded_frame| and
31 // returns |cdm::kSuccess| when an output frame is available. Returns
32 // |cdm::kNeedMoreData| when |compressed_frame| does not produce an output
33 // frame. Returns |cdm::kDecodeError| when decoding fails.
34 cdm::Status DecodeFrame(const uint8_t* compressed_frame,
35 int32_t compressed_frame_size,
36 int64_t timestamp,
37 cdm::VideoFrame* decoded_frame);
38
39 private:
40 // Allocates storage, then copies video frame stored in |av_frame_| to
41 // |cdm_video_frame|. Returns true when allocation and copy succeed.
42 bool CopyAvFrameTo(cdm::VideoFrame* cdm_video_frame);
43
44 void ReleaseFFmpegResources();
45
46 // FFmpeg structures owned by this object.
47 AVCodecContext* codec_context_;
48 AVFrame* av_frame_;
49
50 bool is_initialized_;
51
52 cdm::Allocator* const allocator_;
53
54 DISALLOW_COPY_AND_ASSIGN(FFmpegCdmVideoDecoder);
55 };
56
57 } // namespace webkit_media
58
59 #endif // WEBKIT_MEDIA_CRYPTO_PPAPI_FFMPEG_CDM_VIDEO_DECODER_H_
OLDNEW
« no previous file with comments | « webkit/media/crypto/ppapi/content_decryption_module.h ('k') | webkit/media/crypto/ppapi/ffmpeg_cdm_video_decoder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698