Index: webkit/media/crypto/ppapi/ffmpeg_cdm_video_decoder.h |
diff --git a/webkit/media/crypto/ppapi/ffmpeg_cdm_video_decoder.h b/webkit/media/crypto/ppapi/ffmpeg_cdm_video_decoder.h |
index a835673cbf00b2fbd8cdf2700344a433879d2df6..df583555902d2d221bc265d226fcfbe196ef81e8 100644 |
--- a/webkit/media/crypto/ppapi/ffmpeg_cdm_video_decoder.h |
+++ b/webkit/media/crypto/ppapi/ffmpeg_cdm_video_decoder.h |
@@ -12,6 +12,11 @@ |
struct AVCodecContext; |
struct AVFrame; |
+// TODO(tomfinegan): Move Libvpx VP8 support to a new source file. |
+typedef struct vpx_codec_ctx vpx_codec_ctx_t; |
+typedef struct vpx_image vpx_image_t; |
+ |
+ |
namespace webkit_media { |
class FFmpegCdmVideoDecoder { |
@@ -37,12 +42,28 @@ class FFmpegCdmVideoDecoder { |
cdm::VideoFrame* decoded_frame); |
private: |
+ // |
+ bool AllocateYuvFrameBuffer(int width, int height, |
+ cdm::VideoFrame* cdm_video_frame); |
+ |
// Allocates storage, then copies video frame stored in |av_frame_| to |
// |cdm_video_frame|. Returns true when allocation and copy succeed. |
bool CopyAvFrameTo(cdm::VideoFrame* cdm_video_frame); |
+ bool CopyVpxImageTo(cdm::VideoFrame* cdm_video_frame); |
void ReleaseFFmpegResources(); |
+ bool InitializeFFmpeg(const cdm::VideoDecoderConfig& config); |
+ bool InitializeLibvpx(const cdm::VideoDecoderConfig& config); |
+ cdm::Status DecodeFrameFFmpeg(const uint8_t* compressed_frame, |
+ int32_t compressed_frame_size, |
+ int64_t timestamp, |
+ cdm::VideoFrame* decoded_frame); |
+ cdm::Status DecodeFrameLibvpx(const uint8_t* compressed_frame, |
+ int32_t compressed_frame_size, |
+ int64_t timestamp, |
+ cdm::VideoFrame* decoded_frame); |
+ |
// FFmpeg structures owned by this object. |
AVCodecContext* codec_context_; |
AVFrame* av_frame_; |
@@ -51,6 +72,11 @@ class FFmpegCdmVideoDecoder { |
cdm::Allocator* const allocator_; |
+ // TODO(tomfinegan): Libvpx VP8 decoding support does not belong in this |
+ // class. |
+ vpx_codec_ctx_t* vpx_codec_; |
+ vpx_image_t* vpx_image_; |
+ |
DISALLOW_COPY_AND_ASSIGN(FFmpegCdmVideoDecoder); |
}; |