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

Side by Side Diff: media/filters/vpx_video_decoder.h

Issue 1561703002: media/vpx: Add support for VP9 alpha channel (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: avoid copying y,u and v. Created 4 years, 11 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef MEDIA_FILTERS_VPX_VIDEO_DECODER_H_ 5 #ifndef MEDIA_FILTERS_VPX_VIDEO_DECODER_H_
6 #define MEDIA_FILTERS_VPX_VIDEO_DECODER_H_ 6 #define MEDIA_FILTERS_VPX_VIDEO_DECODER_H_
7 7
8 #include "base/callback.h" 8 #include "base/callback.h"
9 #include "base/macros.h" 9 #include "base/macros.h"
10 #include "base/threading/thread_checker.h" 10 #include "base/threading/thread_checker.h"
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 61
62 void CloseDecoder(); 62 void CloseDecoder();
63 63
64 // Try to decode |buffer| into |video_frame|. Return true if all decoding 64 // Try to decode |buffer| into |video_frame|. Return true if all decoding
65 // succeeded. Note that decoding can succeed and still |video_frame| be 65 // succeeded. Note that decoding can succeed and still |video_frame| be
66 // nullptr if there has been a partial decoding. 66 // nullptr if there has been a partial decoding.
67 bool VpxDecode(const scoped_refptr<DecoderBuffer>& buffer, 67 bool VpxDecode(const scoped_refptr<DecoderBuffer>& buffer,
68 scoped_refptr<VideoFrame>* video_frame); 68 scoped_refptr<VideoFrame>* video_frame);
69 69
70 bool CopyVpxImageToVideoFrame(const struct vpx_image* vpx_image, 70 bool CopyVpxImageToVideoFrame(const struct vpx_image* vpx_image,
71 const struct vpx_image* vpx_image_alpha,
71 scoped_refptr<VideoFrame>* video_frame); 72 scoped_refptr<VideoFrame>* video_frame);
72 73
73 base::ThreadChecker thread_checker_; 74 base::ThreadChecker thread_checker_;
74 75
75 DecoderState state_; 76 DecoderState state_;
76 77
77 OutputCB output_cb_; 78 OutputCB output_cb_;
78 79
79 VideoDecoderConfig config_; 80 VideoDecoderConfig config_;
80 81
81 vpx_codec_ctx* vpx_codec_; 82 vpx_codec_ctx* vpx_codec_;
82 vpx_codec_ctx* vpx_codec_alpha_; 83 vpx_codec_ctx* vpx_codec_alpha_;
83 84
84 // |memory_pool_| is a single-threaded memory pool used for VP9 decoding 85 // |memory_pool_| is a single-threaded memory pool used for VP9 decoding
85 // with no alpha. |frame_pool_| is used for all other cases. 86 // with no alpha. |frame_pool_| is used for all other cases.
86 class MemoryPool; 87 class MemoryPool;
87 scoped_refptr<MemoryPool> memory_pool_; 88 scoped_refptr<MemoryPool> memory_pool_;
88 89
89 VideoFramePool frame_pool_; 90 VideoFramePool frame_pool_;
90 91
91 DISALLOW_COPY_AND_ASSIGN(VpxVideoDecoder); 92 DISALLOW_COPY_AND_ASSIGN(VpxVideoDecoder);
92 }; 93 };
93 94
94 } // namespace media 95 } // namespace media
95 96
96 #endif // MEDIA_FILTERS_VPX_VIDEO_DECODER_H_ 97 #endif // MEDIA_FILTERS_VPX_VIDEO_DECODER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698