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

Unified Diff: webrtc/common_video/video_frame_buffer.cc

Issue 2076113002: Revert of Delete unused and almost unused frame-related methods. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 4 years, 6 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 | « webrtc/common_video/video_frame.cc ('k') | webrtc/media/engine/webrtcvideoframe.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/common_video/video_frame_buffer.cc
diff --git a/webrtc/common_video/video_frame_buffer.cc b/webrtc/common_video/video_frame_buffer.cc
index 60ecae381c160b82f9dbb5af72d9140c714ad73f..14e19dc0e33f4bd90b07345ec387dd9b29495f40 100644
--- a/webrtc/common_video/video_frame_buffer.cc
+++ b/webrtc/common_video/video_frame_buffer.cc
@@ -30,6 +30,54 @@
} // namespace
+const uint8_t* VideoFrameBuffer::data(PlaneType type) const {
+ switch (type) {
+ case kYPlane:
+ return DataY();
+ case kUPlane:
+ return DataU();
+ case kVPlane:
+ return DataV();
+ default:
+ RTC_NOTREACHED();
+ return nullptr;
+ }
+}
+
+const uint8_t* VideoFrameBuffer::DataY() const {
+ return data(kYPlane);
+}
+const uint8_t* VideoFrameBuffer::DataU() const {
+ return data(kUPlane);
+}
+const uint8_t* VideoFrameBuffer::DataV() const {
+ return data(kVPlane);
+}
+
+int VideoFrameBuffer::stride(PlaneType type) const {
+ switch (type) {
+ case kYPlane:
+ return StrideY();
+ case kUPlane:
+ return StrideU();
+ case kVPlane:
+ return StrideV();
+ default:
+ RTC_NOTREACHED();
+ return 0;
+ }
+}
+
+int VideoFrameBuffer::StrideY() const {
+ return stride(kYPlane);
+}
+int VideoFrameBuffer::StrideU() const {
+ return stride(kUPlane);
+}
+int VideoFrameBuffer::StrideV() const {
+ return stride(kVPlane);
+}
+
uint8_t* VideoFrameBuffer::MutableDataY() {
RTC_NOTREACHED();
return nullptr;
@@ -41,6 +89,20 @@
uint8_t* VideoFrameBuffer::MutableDataV() {
RTC_NOTREACHED();
return nullptr;
+}
+
+uint8_t* VideoFrameBuffer::MutableData(PlaneType type) {
+ switch (type) {
+ case kYPlane:
+ return MutableDataY();
+ case kUPlane:
+ return MutableDataU();
+ case kVPlane:
+ return MutableDataV();
+ default:
+ RTC_NOTREACHED();
+ return nullptr;
+ }
}
VideoFrameBuffer::~VideoFrameBuffer() {}
« no previous file with comments | « webrtc/common_video/video_frame.cc ('k') | webrtc/media/engine/webrtcvideoframe.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698