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

Side by Side Diff: webkit/media/crypto/decoders/ffmpeg_video_decoder.h

Issue 10899021: Add CDM video decoder. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Compiles, does nothing. Created 8 years, 3 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_DECODERS_FFMPEG_VIDEO_DECODER_H_
6 #define WEBKIT_MEDIA_CRYPTO_DECODERS_FFMPEG_VIDEO_DECODER_H_
7
8 #include "base/basictypes.h"
9 #include "base/compiler_specific.h"
10 #include "webkit/media/crypto/decoders/video_decoder.h"
11 #include "webkit/media/crypto/ppapi/content_decryption_module.h"
12
13 struct AVCodecContext;
14 struct AVFrame;
15
16 namespace webkit_media {
17
18 class FFmpegVideoDecoder : public VideoDecoder {
19 public:
20 FFmpegVideoDecoder();
21 virtual ~FFmpegVideoDecoder();
22 virtual bool Initialize(const cdm::VideoDecoderConfig& config) OVERRIDE;
23 virtual bool DecodeFrame(const cdm::VideoFrame& compressed_frame,
24 cdm::VideoFrame* decompressed_frame) OVERRIDE;
25
26 // Callback called from within FFmpeg to allocate a buffer based on
27 // the dimensions of |codec_context|. See AVCodecContext.get_buffer
28 // documentation inside FFmpeg.
29 int GetVideoBuffer(AVCodecContext *codec_context, AVFrame* frame);
30
31 static bool IsValidConfig(cdm::VideoFrame::ColorFormat format,
32 const cdm::VideoFrame::Size& data_size);
33
34 cdm::VideoFrame* CreateVideoFrame(cdm::VideoFrame::ColorFormat format,
ddorwin 2012/09/02 21:39:08 A FrameDescription object would be useful here too
35 const cdm::VideoFrame::Size& size,
36 const base::TimeDelta& timestamp);
37 private:
38 void ReleaseFFmpegResources();
39
40 // FFmpeg structures owned by this object.
41 AVCodecContext* codec_context_;
42 AVFrame* av_frame_;
43
44 DISALLOW_COPY_AND_ASSIGN(FFmpegVideoDecoder);
45 };
46
47 } // namespace webkit_media
48
49 #endif // WEBKIT_MEDIA_CRYPTO_DECODERS_FFMPEG_VIDEO_DECODER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698