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

Unified Diff: talk/media/webrtc/webrtcvideoframe.cc

Issue 1583223002: Revert of Delete remnants of non-square pixel support from cricket::VideoFrame. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 4 years, 11 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 | « talk/media/webrtc/webrtcvideoframe.h ('k') | talk/media/webrtc/webrtcvideoframe_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: talk/media/webrtc/webrtcvideoframe.cc
diff --git a/talk/media/webrtc/webrtcvideoframe.cc b/talk/media/webrtc/webrtcvideoframe.cc
index 911466493a2634975d13714513db3f6ce4cce493..fcc991c753c343a9102dca8916f831951a431ab2 100644
--- a/talk/media/webrtc/webrtcvideoframe.cc
+++ b/talk/media/webrtc/webrtcvideoframe.cc
@@ -40,6 +40,8 @@
namespace cricket {
WebRtcVideoFrame::WebRtcVideoFrame():
+ pixel_width_(0),
+ pixel_height_(0),
time_stamp_ns_(0),
rotation_(webrtc::kVideoRotation_0) {}
@@ -48,6 +50,8 @@
int64_t time_stamp_ns,
webrtc::VideoRotation rotation)
: video_frame_buffer_(buffer),
+ pixel_width_(1),
+ pixel_height_(1),
time_stamp_ns_(time_stamp_ns),
rotation_(rotation) {
}
@@ -61,10 +65,12 @@
int dh,
uint8_t* sample,
size_t sample_size,
+ size_t pixel_width,
+ size_t pixel_height,
int64_t time_stamp_ns,
webrtc::VideoRotation rotation) {
- return Reset(format, w, h, dw, dh, sample, sample_size,
- time_stamp_ns, rotation,
+ return Reset(format, w, h, dw, dh, sample, sample_size, pixel_width,
+ pixel_height, time_stamp_ns, rotation,
true /*apply_rotation*/);
}
@@ -72,13 +78,13 @@
bool apply_rotation) {
return Reset(frame->fourcc, frame->width, frame->height, dw, dh,
static_cast<uint8_t*>(frame->data), frame->data_size,
- frame->time_stamp,
+ frame->pixel_width, frame->pixel_height, frame->time_stamp,
frame->rotation, apply_rotation);
}
-bool WebRtcVideoFrame::InitToBlack(int w, int h,
- int64_t time_stamp_ns) {
- InitToEmptyBuffer(w, h, time_stamp_ns);
+bool WebRtcVideoFrame::InitToBlack(int w, int h, size_t pixel_width,
+ size_t pixel_height, int64_t time_stamp_ns) {
+ InitToEmptyBuffer(w, h, pixel_width, pixel_height, time_stamp_ns);
return SetToBlack();
}
@@ -145,6 +151,8 @@
VideoFrame* WebRtcVideoFrame::Copy() const {
WebRtcVideoFrame* new_frame = new WebRtcVideoFrame(
video_frame_buffer_, time_stamp_ns_, rotation_);
+ new_frame->pixel_width_ = pixel_width_;
+ new_frame->pixel_height_ = pixel_height_;
return new_frame;
}
@@ -188,6 +196,8 @@
int dh,
uint8_t* sample,
size_t sample_size,
+ size_t pixel_width,
+ size_t pixel_height,
int64_t time_stamp_ns,
webrtc::VideoRotation rotation,
bool apply_rotation) {
@@ -207,7 +217,7 @@
new_height = dw;
}
- InitToEmptyBuffer(new_width, new_height,
+ InitToEmptyBuffer(new_width, new_height, pixel_width, pixel_height,
time_stamp_ns);
rotation_ = apply_rotation ? webrtc::kVideoRotation_0 : rotation;
@@ -237,16 +247,19 @@
}
VideoFrame* WebRtcVideoFrame::CreateEmptyFrame(
- int w, int h,
+ int w, int h, size_t pixel_width, size_t pixel_height,
int64_t time_stamp_ns) const {
WebRtcVideoFrame* frame = new WebRtcVideoFrame();
- frame->InitToEmptyBuffer(w, h, time_stamp_ns);
+ frame->InitToEmptyBuffer(w, h, pixel_width, pixel_height, time_stamp_ns);
return frame;
}
-void WebRtcVideoFrame::InitToEmptyBuffer(int w, int h,
+void WebRtcVideoFrame::InitToEmptyBuffer(int w, int h, size_t pixel_width,
+ size_t pixel_height,
int64_t time_stamp_ns) {
video_frame_buffer_ = new rtc::RefCountedObject<webrtc::I420Buffer>(w, h);
+ pixel_width_ = pixel_width;
+ pixel_height_ = pixel_height;
time_stamp_ns_ = time_stamp_ns;
rotation_ = webrtc::kVideoRotation_0;
}
@@ -279,6 +292,7 @@
}
rotated_frame_.reset(CreateEmptyFrame(rotated_width, rotated_height,
+ GetPixelWidth(), GetPixelHeight(),
GetTimeStamp()));
// TODO(guoweis): Add a function in webrtc_libyuv.cc to convert from
« no previous file with comments | « talk/media/webrtc/webrtcvideoframe.h ('k') | talk/media/webrtc/webrtcvideoframe_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698