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

Unified Diff: webrtc/common_video/include/video_frame_buffer.h

Issue 2009193002: Delete IsMutable and IsExclusive methods. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Delete redundant RefCountedObject wrapping. Created 4 years, 7 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/include/i420_buffer_pool.h ('k') | webrtc/common_video/video_frame.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/common_video/include/video_frame_buffer.h
diff --git a/webrtc/common_video/include/video_frame_buffer.h b/webrtc/common_video/include/video_frame_buffer.h
index 6f082dee9bae928fbb005027b7262f03bdde3053..984bd50d674e78d7e7aedfc252fcfef8810b6963 100644
--- a/webrtc/common_video/include/video_frame_buffer.h
+++ b/webrtc/common_video/include/video_frame_buffer.h
@@ -33,18 +33,6 @@ enum PlaneType {
// not contain any frame metadata such as rotation, timestamp, pixel_width, etc.
class VideoFrameBuffer : public rtc::RefCountInterface {
public:
- // Returns true if the caller is exclusive owner, and allowed to
- // call MutableData.
-
- // TODO(nisse): Delete default implementation when subclasses in
- // Chrome are updated.
- virtual bool IsMutable() { return false; }
-
- // Underlying refcount access, used to implement IsMutable.
- // TODO(nisse): Demote to protected, as soon as Chrome is changed to
- // use IsMutable.
- virtual bool HasOneRef() const = 0;
-
// The resolution of the frame in pixels. For formats where some planes are
// subsampled, this is the highest-resolution plane.
virtual int width() const = 0;
@@ -67,7 +55,8 @@ class VideoFrameBuffer : public rtc::RefCountInterface {
// TODO(nisse): Delete after all users are updated.
virtual const uint8_t* data(PlaneType type) const;
- // Non-const data access is allowed only if HasOneRef() is true.
+ // TODO(nisse): Move MutableData methods to the I420Buffer subclass.
+ // Non-const data access.
virtual uint8_t* MutableDataY();
virtual uint8_t* MutableDataU();
virtual uint8_t* MutableDataV();
@@ -105,9 +94,7 @@ class I420Buffer : public VideoFrameBuffer {
const uint8_t* DataY() const override;
const uint8_t* DataU() const override;
const uint8_t* DataV() const override;
- // Non-const data access is only allowed if IsMutable() is true, to protect
- // against unexpected overwrites.
- bool IsMutable() override;
+
uint8_t* MutableDataY() override;
uint8_t* MutableDataU() override;
uint8_t* MutableDataV() override;
@@ -152,7 +139,6 @@ class NativeHandleBuffer : public VideoFrameBuffer {
int StrideV() const override;
void* native_handle() const override;
- bool IsMutable() override;
protected:
void* native_handle_;
@@ -174,8 +160,6 @@ class WrappedI420Buffer : public webrtc::VideoFrameBuffer {
int width() const override;
int height() const override;
- bool IsMutable() override;
-
const uint8_t* DataY() const override;
const uint8_t* DataU() const override;
const uint8_t* DataV() const override;
« no previous file with comments | « webrtc/common_video/include/i420_buffer_pool.h ('k') | webrtc/common_video/video_frame.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698