OLD | NEW |
(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_ |
OLD | NEW |