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 6f49e8aef9d0f1f387ff15cce119aca0699567ac..6ce806e35e5b1a490c301fd9c18374954f9528a2 100644 |
--- a/webrtc/common_video/video_frame_buffer.cc |
+++ b/webrtc/common_video/video_frame_buffer.cc |
@@ -89,8 +89,12 @@ const uint8_t* I420Buffer::data(PlaneType type) const { |
} |
} |
+bool I420Buffer::IsMutable() { |
+ return HasOneRef(); |
+} |
+ |
uint8_t* I420Buffer::MutableData(PlaneType type) { |
- RTC_DCHECK(HasOneRef()); |
+ RTC_DCHECK(IsMutable()); |
return const_cast<uint8_t*>( |
static_cast<const VideoFrameBuffer*>(this)->data(type)); |
} |
@@ -144,6 +148,10 @@ NativeHandleBuffer::NativeHandleBuffer(void* native_handle, |
RTC_DCHECK_GT(height, 0); |
} |
+bool NativeHandleBuffer::IsMutable() { |
+ return false; |
+} |
+ |
int NativeHandleBuffer::width() const { |
return width_; |
} |
@@ -190,6 +198,11 @@ WrappedI420Buffer::~WrappedI420Buffer() { |
no_longer_used_cb_(); |
} |
+// Data owned by creator; never mutable. |
+bool WrappedI420Buffer::IsMutable() { |
+ return false; |
+} |
+ |
int WrappedI420Buffer::width() const { |
return width_; |
} |