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

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: 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/compiler_specific.h"
9 #include "webkit/media/crypto/decoders/video_decoder.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 FFmpegVideoDecoder : public VideoDecoder {
18 public:
19 FFmpegVideoDecoder();
20 virtual ~FFmpegVideoDecoder();
21 virtual bool Initialize(const cdm::VideoDecoderConfig& config) OVERRIDE;
22 virtual bool DecodeFrame(const cdm::VideoFrame& compressed_frame,
23 cdm::VideoFrame* decompressed_frame) OVERRIDE;
24
25 // Callback called from within FFmpeg to allocate a buffer based on
26 // the dimensions of |codec_context|. See AVCodecContext.get_buffer
27 // documentation inside FFmpeg.
28 int GetVideoBuffer(AVCodecContext *codec_context, AVFrame* frame);
29
30 static bool IsValidConfig(cdm::VideoFrame::Format format,
31 const cdm::VideoFrame::Size& data_size);
32
33
34 private:
35 void ReleaseFFmpegResources();
36
37 // FFmpeg structures owned by this object.
38 AVCodecContext* codec_context_;
39 AVFrame* av_frame_;
40
41 FFmpegVideoDecoder(const FFmpegVideoDecoder&);
42 void operator=(const FFmpegVideoDecoder&);
43 };
44
45 } // namespace webkit_media
46
47 #endif // WEBKIT_MEDIA_CRYPTO_DECODERS_FFMPEG_VIDEO_DECODER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698