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

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

Issue 1307973002: AndroidVideoCapturerJni: Fix threading issues (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Addressing tommi@s comments Created 5 years, 4 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
Index: webrtc/common_video/interface/video_frame_buffer.h
diff --git a/webrtc/common_video/interface/video_frame_buffer.h b/webrtc/common_video/interface/video_frame_buffer.h
index 4079019ccc8cb220221134dd43f6a4c514c7238a..a7ac8d84d708b7f22b62f38251c86cab6f795a2e 100644
--- a/webrtc/common_video/interface/video_frame_buffer.h
+++ b/webrtc/common_video/interface/video_frame_buffer.h
@@ -109,9 +109,7 @@ class NativeHandleBuffer : public VideoFrameBuffer {
class WrappedI420Buffer : public webrtc::VideoFrameBuffer {
public:
- WrappedI420Buffer(int desired_width,
- int desired_height,
- int width,
+ WrappedI420Buffer(int width,
int height,
const uint8_t* y_plane,
int y_stride,
@@ -135,17 +133,24 @@ class WrappedI420Buffer : public webrtc::VideoFrameBuffer {
friend class rtc::RefCountedObject<WrappedI420Buffer>;
~WrappedI420Buffer() override;
- int width_;
- int height_;
- const uint8_t* y_plane_;
- const uint8_t* u_plane_;
- const uint8_t* v_plane_;
+ const int width_;
+ const int height_;
+ const uint8_t* const y_plane_;
+ const uint8_t* const u_plane_;
+ const uint8_t* const v_plane_;
const int y_stride_;
const int u_stride_;
const int v_stride_;
rtc::Callback0<void> no_longer_used_cb_;
};
+// Helper function to crop |buffer| without making a deep copy. May only be used
+// for non-native frames.
+rtc::scoped_refptr<VideoFrameBuffer> ShallowCenterCrop(
+ const rtc::scoped_refptr<VideoFrameBuffer>& buffer,
+ int cropped_width,
+ int cropped_height);
+
} // namespace webrtc
#endif // WEBRTC_VIDEO_FRAME_BUFFER_H_
« no previous file with comments | « talk/app/webrtc/java/src/org/webrtc/VideoCapturerAndroid.java ('k') | webrtc/common_video/video_frame_buffer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698