Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(621)

Unified Diff: media/filters/vpx_video_decoder.h

Issue 12263013: media: Add support for playback of VP8 Alpha video streams (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « media/filters/skcanvas_video_renderer.cc ('k') | media/filters/vpx_video_decoder.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
};
« no previous file with comments | « media/filters/skcanvas_video_renderer.cc ('k') | media/filters/vpx_video_decoder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698