| Index: webkit/media/crypto/decoders/ffmpeg_video_decoder.h
|
| diff --git a/webkit/media/crypto/decoders/ffmpeg_video_decoder.h b/webkit/media/crypto/decoders/ffmpeg_video_decoder.h
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..c65043203f992ab63b5779f8ceb2210fb5390b81
|
| --- /dev/null
|
| +++ b/webkit/media/crypto/decoders/ffmpeg_video_decoder.h
|
| @@ -0,0 +1,47 @@
|
| +// Copyright (c) 2012 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +#ifndef WEBKIT_MEDIA_CRYPTO_DECODERS_FFMPEG_VIDEO_DECODER_H_
|
| +#define WEBKIT_MEDIA_CRYPTO_DECODERS_FFMPEG_VIDEO_DECODER_H_
|
| +
|
| +#include "base/compiler_specific.h"
|
| +#include "webkit/media/crypto/decoders/video_decoder.h"
|
| +#include "webkit/media/crypto/ppapi/content_decryption_module.h"
|
| +
|
| +struct AVCodecContext;
|
| +struct AVFrame;
|
| +
|
| +namespace webkit_media {
|
| +
|
| +class FFmpegVideoDecoder : public VideoDecoder {
|
| + public:
|
| + FFmpegVideoDecoder();
|
| + virtual ~FFmpegVideoDecoder();
|
| + virtual bool Initialize(const cdm::VideoDecoderConfig& config) OVERRIDE;
|
| + virtual bool DecodeFrame(const cdm::VideoFrame& compressed_frame,
|
| + cdm::VideoFrame* decompressed_frame) OVERRIDE;
|
| +
|
| + // Callback called from within FFmpeg to allocate a buffer based on
|
| + // the dimensions of |codec_context|. See AVCodecContext.get_buffer
|
| + // documentation inside FFmpeg.
|
| + int GetVideoBuffer(AVCodecContext *codec_context, AVFrame* frame);
|
| +
|
| + static bool IsValidConfig(cdm::VideoFrame::Format format,
|
| + const cdm::VideoFrame::Size& data_size);
|
| +
|
| +
|
| + private:
|
| + void ReleaseFFmpegResources();
|
| +
|
| + // FFmpeg structures owned by this object.
|
| + AVCodecContext* codec_context_;
|
| + AVFrame* av_frame_;
|
| +
|
| + FFmpegVideoDecoder(const FFmpegVideoDecoder&);
|
| + void operator=(const FFmpegVideoDecoder&);
|
| +};
|
| +
|
| +} // namespace webkit_media
|
| +
|
| +#endif // WEBKIT_MEDIA_CRYPTO_DECODERS_FFMPEG_VIDEO_DECODER_H_
|
|
|