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() {} |