Chromium Code Reviews| 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_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 "base/memory/ref_counted.h" | |
|
ddorwin
2012/10/17 03:18:20
still here
Tom Finegan
2012/10/17 04:25:29
But I fixed it in the .cc file... Done.
| |
| 11 #include "webkit/media/crypto/ppapi/content_decryption_module.h" | |
| 12 | |
| 13 struct AVCodecContext; | |
| 14 struct AVFrame; | |
| 15 | |
| 16 namespace webkit_media { | |
| 17 | |
| 18 static const uint32_t kBufferAlignment = 32; | |
| 19 static const uint32_t kBufferPadBytes = kBufferAlignment - 1; | |
| 20 static const int kDecodeThreads = 1; | |
| 21 | |
| 22 class FFmpegCdmVideoDecoder { | |
| 23 public: | |
| 24 FFmpegCdmVideoDecoder(cdm::Allocator* allocator); | |
| 25 ~FFmpegCdmVideoDecoder(); | |
| 26 bool Initialize(const cdm::VideoDecoderConfig& config); | |
| 27 void Deinitialize(); | |
| 28 void Reset(); | |
| 29 | |
| 30 // Decodes |compressed_frame|. Stores output frame in |decoded_frame| and | |
| 31 // returns |cdm::kSuccess| when an output frame is available. Returns | |
| 32 // |cdm::kNeedMoreData| when |compressed_frame| does not produce an output | |
| 33 // frame. Returns |cdm::kDecodeError| when decoding fails. | |
| 34 cdm::Status DecodeFrame(const uint8_t* compressed_frame, | |
| 35 int32_t compressed_frame_size, | |
| 36 int64_t timestamp, | |
| 37 cdm::VideoFrame* decoded_frame); | |
| 38 | |
| 39 private: | |
| 40 // Callback called from within FFmpeg to allocate a buffer based on | |
| 41 // the dimensions of |codec_context|. See AVCodecContext.get_buffer | |
| 42 // documentation inside FFmpeg. | |
| 43 int GetVideoBuffer(AVCodecContext* codec_context, AVFrame* frame); | |
| 44 | |
| 45 void ReleaseFFmpegResources(); | |
| 46 | |
| 47 // FFmpeg structures owned by this object. | |
| 48 AVCodecContext* codec_context_; | |
| 49 AVFrame* av_frame_; | |
| 50 | |
| 51 bool is_initialized_; | |
| 52 | |
| 53 cdm::Allocator* const allocator_; | |
| 54 cdm::VideoDecoderConfig config_; | |
| 55 | |
| 56 friend int GetCdmVideoBufferImpl(AVCodecContext* s, AVFrame* frame); | |
| 57 | |
| 58 DISALLOW_COPY_AND_ASSIGN(FFmpegCdmVideoDecoder); | |
| 59 }; | |
| 60 | |
| 61 } // namespace webkit_media | |
| 62 | |
| 63 #endif // WEBKIT_MEDIA_CRYPTO_PPAPI_FFMPEG_CDM_VIDEO_DECODER_H_ | |
| OLD | NEW |