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

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: Add NOLINT for the unusual combination virtual final. 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
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 82a10797b353d3b9978411f1ce9e1c7edf878748..b814c04ca8392f92c8976858b6b03c6664e09a23 100644
--- a/webrtc/common_video/i420_buffer_pool.cc
+++ b/webrtc/common_video/i420_buffer_pool.cc
@@ -26,18 +26,27 @@ 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(); }
+
+ // Make the HasOneRef() check here instead of in |buffer_|, because the pool
+ // also has a reference to |buffer_|.
+ uint8_t* MutableDataY() override {
+ RTC_DCHECK(HasOneRef());
+ return const_cast<uint8_t*>(buffer_->DataY());
}
- 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_|.
+ uint8_t* MutableDataU() override {
RTC_DCHECK(HasOneRef());
- return const_cast<uint8_t*>(buffer_->data(type));
+ return const_cast<uint8_t*>(buffer_->DataU());
}
- int stride(webrtc::PlaneType type) const override {
- return buffer_->stride(type);
+ uint8_t* MutableDataV() override {
+ RTC_DCHECK(HasOneRef());
+ 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') | webrtc/common_video/include/video_frame_buffer.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698