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

Unified Diff: webrtc/video_frame.h

Issue 2574123002: Revert of Delete VideoFrame default constructor, and IsZeroSize method. (Closed)
Patch Set: Created 4 years 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/video/vie_encoder.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/video_frame.h
diff --git a/webrtc/video_frame.h b/webrtc/video_frame.h
index 5fd62a6bbb08e30f41d229468adfaf5e0e3cd97b..a834f83ddf1333c74e3f3f70779e905248aceec2 100644
--- a/webrtc/video_frame.h
+++ b/webrtc/video_frame.h
@@ -22,6 +22,10 @@
class VideoFrame {
public:
+ // TODO(nisse): Deprecated. Using the default constructor violates the
+ // reasonable assumption that video_frame_buffer() returns a valid buffer.
+ VideoFrame();
+
// TODO(nisse): This constructor is consistent with
// cricket::WebRtcVideoFrame. After the class
// cricket::WebRtcVideoFrame and its baseclass cricket::VideoFrame
@@ -102,6 +106,15 @@
return timestamp_us() / rtc::kNumMicrosecsPerMillisec;
}
+ // Return true if and only if video_frame_buffer() is null. Which is possible
+ // only if the object was default-constructed.
+ // TODO(nisse): Deprecated. Should be deleted in the cricket::VideoFrame and
+ // webrtc::VideoFrame merge. The intention is that video_frame_buffer() never
+ // should return nullptr. To handle potentially uninitialized or non-existent
+ // frames, consider using rtc::Optional. Otherwise, IsZeroSize() can be
+ // replaced by video_frame_buffer() == nullptr.
+ bool IsZeroSize() const;
+
// Return the underlying buffer. Never nullptr for a properly
// initialized VideoFrame.
rtc::scoped_refptr<webrtc::VideoFrameBuffer> video_frame_buffer() const;
« no previous file with comments | « webrtc/video/vie_encoder.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698