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

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: Address more comments. Created 8 years, 2 months 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 // Decodes |compressed_frame|. Stores output frame in |decoded_frame| and
26 // returns |cdm::kSuccess| when an output frame is available. Returns
27 // |cdm::kNeedMoreData| when |compressed_frame| does not produce an output
28 // frame. Returns |cdm::kDecodeError| when decoding fails.
29 cdm::Status DecodeFrame(const uint8_t* compressed_frame,
30 int32_t compressed_frame_size,
31 int64_t timestamp,
32 cdm::VideoFrame* decoded_frame);
33
34 // Callback called from within FFmpeg to allocate a buffer based on
35 // the dimensions of |codec_context|. See AVCodecContext.get_buffer
36 // documentation inside FFmpeg.
37 int GetVideoBuffer(AVCodecContext* codec_context, AVFrame* frame);
38
39 private:
40 void ReleaseFFmpegResources();
41
42 // FFmpeg structures owned by this object.
43 AVCodecContext* codec_context_;
44 AVFrame* av_frame_;
45
46 bool is_initialized_;
47
48 cdm::Allocator* const allocator_;
49 cdm::VideoDecoderConfig config_;
50
51 DISALLOW_COPY_AND_ASSIGN(FFmpegCdmVideoDecoder);
52 };
53
54 } // namespace webkit_media
55
56 #endif // WEBKIT_MEDIA_CRYPTO_PPAPI_FFMPEG_CDM_VIDEO_DECODER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698