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

Unified Diff: webrtc/common_video/i420_buffer_pool.cc

Issue 1878623002: Added new VideoFrameBuffer methods Data[YUV]() etc. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Rebase. Created 4 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 | « no previous file | webrtc/common_video/i420_buffer_pool_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/common_video/i420_buffer_pool.cc
diff --git a/webrtc/common_video/i420_buffer_pool.cc b/webrtc/common_video/i420_buffer_pool.cc
index d00ab781aa12634ef3745f82c4a8fae178d0ed76..c382e9337835665d24e04d48778f72a1f55a0575 100644
--- a/webrtc/common_video/i420_buffer_pool.cc
+++ b/webrtc/common_video/i420_buffer_pool.cc
@@ -26,19 +26,28 @@ class PooledI420Buffer : public webrtc::VideoFrameBuffer {
int width() const override { return buffer_->width(); }
int height() const override { return buffer_->height(); }
- const uint8_t* data(webrtc::PlaneType type) const override {
- return buffer_->data(type);
- }
+ const uint8_t* DataY() const override { return buffer_->DataY(); }
+ const uint8_t* DataU() const override { return buffer_->DataU(); }
+ const uint8_t* DataV() const override { return buffer_->DataV(); }
+
bool IsMutable() { return HasOneRef(); }
- uint8_t* MutableData(webrtc::PlaneType type) override {
- // Make the HasOneRef() check here instead of in |buffer_|, because the pool
- // also has a reference to |buffer_|.
+ // Make the IsMutable() check here instead of in |buffer_|, because the pool
+ // also has a reference to |buffer_|.
+ uint8_t* MutableDataY() override {
RTC_DCHECK(IsMutable());
- return const_cast<uint8_t*>(buffer_->data(type));
+ return const_cast<uint8_t*>(buffer_->DataY());
}
- int stride(webrtc::PlaneType type) const override {
- return buffer_->stride(type);
+ uint8_t* MutableDataU() override {
+ RTC_DCHECK(IsMutable());
+ return const_cast<uint8_t*>(buffer_->DataU());
+ }
+ uint8_t* MutableDataV() override {
+ RTC_DCHECK(IsMutable());
+ return const_cast<uint8_t*>(buffer_->DataV());
}
+ int StrideY() const override { return buffer_->StrideY(); }
+ int StrideU() const override { return buffer_->StrideU(); }
+ int StrideV() const override { return buffer_->StrideV(); }
void* native_handle() const override { return nullptr; }
rtc::scoped_refptr<VideoFrameBuffer> NativeToI420Buffer() override {
« no previous file with comments | « no previous file | webrtc/common_video/i420_buffer_pool_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698