Index: media/filters/vpx_video_decoder.h |
diff --git a/media/filters/vpx_video_decoder.h b/media/filters/vpx_video_decoder.h |
index 77578fdc90f7e6c82de90090cadff43857e1a886..b363d8b040fa7a21f8af6b1e86090e64f4be4183 100644 |
--- a/media/filters/vpx_video_decoder.h |
+++ b/media/filters/vpx_video_decoder.h |
@@ -9,6 +9,16 @@ |
#include "base/memory/ref_counted.h" |
#include "media/base/demuxer_stream.h" |
#include "media/base/video_decoder.h" |
+#include "media/base/video_frame.h" |
+ |
+// Include libvpx header files. |
+// VPX_CODEC_DISABLE_COMPAT excludes parts of the libvpx API that provide |
+// backwards compatibility for legacy applications using the library. |
+#define VPX_CODEC_DISABLE_COMPAT 1 |
+extern "C" { |
+#include "third_party/libvpx/source/libvpx/vpx/vpx_decoder.h" |
+#include "third_party/libvpx/source/libvpx/vpx/vp8dx.h" |
+} |
struct vpx_codec_ctx; |
struct vpx_image; |
@@ -19,6 +29,15 @@ class MessageLoopProxy; |
namespace media { |
+struct VpxDeleter { |
+ inline void operator()(vpx_codec_ctx* ptr) const { |
+ if (ptr) { |
+ vpx_codec_destroy(ptr); |
+ delete ptr; |
+ } |
+ } |
+}; |
+ |
class MEDIA_EXPORT VpxVideoDecoder : public VideoDecoder { |
public: |
explicit VpxVideoDecoder( |
@@ -47,7 +66,6 @@ class MEDIA_EXPORT VpxVideoDecoder : public VideoDecoder { |
// Returns true when initialization was successful. |
bool ConfigureDecoder(); |
- void CloseDecoder(); |
void ReadFromDemuxerStream(); |
// Carries out the buffer processing operation scheduled by |
@@ -62,7 +80,8 @@ class MEDIA_EXPORT VpxVideoDecoder : public VideoDecoder { |
// Reset decoder and call |reset_cb_|. |
void DoReset(); |
- void CopyVpxImageTo(const vpx_image* vpx_image, |
+ void CopyVpxImageTo(const struct vpx_image* vpx_image, |
+ const struct vpx_image* vpx_image_alpha, |
scoped_refptr<VideoFrame>* video_frame); |
scoped_refptr<base::MessageLoopProxy> message_loop_; |
@@ -76,7 +95,8 @@ class MEDIA_EXPORT VpxVideoDecoder : public VideoDecoder { |
// Pointer to the demuxer stream that will feed us compressed buffers. |
scoped_refptr<DemuxerStream> demuxer_stream_; |
- vpx_codec_ctx* vpx_codec_; |
+ scoped_ptr<vpx_codec_ctx, VpxDeleter> vpx_codec_; |
+ scoped_ptr<vpx_codec_ctx, VpxDeleter> vpx_codec_alpha_; |
DISALLOW_COPY_AND_ASSIGN(VpxVideoDecoder); |
}; |