Chromium Code Reviews| Index: webrtc/common_video/include/corevideo_frame_buffer.h |
| diff --git a/webrtc/common_video/include/corevideo_frame_buffer.h b/webrtc/common_video/include/corevideo_frame_buffer.h |
| index ed5361d5cf1f281ad26969fc1f98ee2123fc4f9d..2e108045c7d8309f25f5d7e864e59fe6c298d521 100644 |
| --- a/webrtc/common_video/include/corevideo_frame_buffer.h |
| +++ b/webrtc/common_video/include/corevideo_frame_buffer.h |
| @@ -13,6 +13,8 @@ |
| #include <CoreVideo/CoreVideo.h> |
| +#include <vector> |
| + |
| #include "webrtc/common_video/include/video_frame_buffer.h" |
| namespace webrtc { |
| @@ -20,12 +22,32 @@ namespace webrtc { |
| class CoreVideoFrameBuffer : public NativeHandleBuffer { |
| public: |
| explicit CoreVideoFrameBuffer(CVPixelBufferRef pixel_buffer); |
| + CoreVideoFrameBuffer(CVPixelBufferRef pixel_buffer, |
| + int adapted_width, |
| + int adapted_height, |
| + int crop_width, |
| + int crop_height, |
| + int crop_x, |
| + int crop_y); |
| ~CoreVideoFrameBuffer() override; |
| rtc::scoped_refptr<VideoFrameBuffer> NativeToI420Buffer() override; |
| + // Returns true if the internal pixel buffer needs to be cropped. |
| + bool RequiresCropping() const; |
| + // Crop and scales the internal pixel buffer to the output pixel buffer. The |
| + // tmp buffer is used for intermediary splitting the UV channels. This |
| + // function returns true if successful. |
| + bool CropAndScaleTo(std::vector<uint8_t>* tmp_buffer, |
| + CVPixelBufferRef output_pixel_buffer) const; |
| private: |
| CVPixelBufferRef pixel_buffer_; |
| + const int buffer_width_; |
|
tkchin_webrtc
2016/10/19 00:48:32
how is buffer width different from width/height of
magjed_webrtc
2016/10/19 13:19:34
I agree this is a bit confusing, but I don't see h
tkchin_webrtc
2016/10/19 22:50:17
gotcha. Maybe short comment along those lines some
|
| + const int buffer_height_; |
| + const int crop_width_; |
| + const int crop_height_; |
| + const int crop_x_; |
| + const int crop_y_; |
| }; |
| } // namespace webrtc |