diff --git a/webrtc/api/java/jni/peerconnection_jni.cc b/webrtc/api/java/jni/peerconnection_jni.cc index a250b707e6..cbdcbe0285 100644 --- a/webrtc/api/java/jni/peerconnection_jni.cc +++ b/webrtc/api/java/jni/peerconnection_jni.cc @@ -783,7 +783,7 @@ class JavaVideoRendererWrapper return jni()->NewObject( *j_frame_class_, j_i420_frame_ctor_id_, frame->width(), frame->height(), - static_cast(frame->GetVideoRotation()), + static_cast(frame->rotation()), strides, planes, javaShallowCopy(frame)); } @@ -796,7 +796,7 @@ class JavaVideoRendererWrapper return jni()->NewObject( *j_frame_class_, j_texture_frame_ctor_id_, frame->width(), frame->height(), - static_cast(frame->GetVideoRotation()), + static_cast(frame->rotation()), handle->oes_texture_id, sampling_matrix, javaShallowCopy(frame)); } diff --git a/webrtc/api/objc/RTCVideoFrame.mm b/webrtc/api/objc/RTCVideoFrame.mm index 95f4ac82bf..6a4b1aab51 100644 --- a/webrtc/api/objc/RTCVideoFrame.mm +++ b/webrtc/api/objc/RTCVideoFrame.mm @@ -92,10 +92,10 @@ if (!_i420Buffer) { if (_videoFrame->GetNativeHandle()) { // Convert to I420. - _i420Buffer = _videoFrame->GetVideoFrameBuffer()->NativeToI420Buffer(); + _i420Buffer = _videoFrame->video_frame_buffer()->NativeToI420Buffer(); } else { // Should already be I420. - _i420Buffer = _videoFrame->GetVideoFrameBuffer(); + _i420Buffer = _videoFrame->video_frame_buffer(); } } } diff --git a/webrtc/media/base/fakevideorenderer.h b/webrtc/media/base/fakevideorenderer.h index f75888e1ee..51f1f90ee8 100644 --- a/webrtc/media/base/fakevideorenderer.h +++ b/webrtc/media/base/fakevideorenderer.h @@ -39,7 +39,7 @@ class FakeVideoRenderer : public rtc::VideoSinkInterface { ++num_rendered_frames_; width_ = frame.width(); height_ = frame.height(); - rotation_ = frame.GetVideoRotation(); + rotation_ = frame.rotation(); timestamp_ = frame.GetTimeStamp(); SignalRenderFrame(&frame); } diff --git a/webrtc/media/base/videobroadcaster.cc b/webrtc/media/base/videobroadcaster.cc index 704f408118..c9a2d99ab5 100644 --- a/webrtc/media/base/videobroadcaster.cc +++ b/webrtc/media/base/videobroadcaster.cc @@ -98,14 +98,14 @@ const cricket::VideoFrame& VideoBroadcaster::GetBlackFrame( const cricket::VideoFrame& frame) { if (black_frame_ && black_frame_->width() == frame.width() && black_frame_->height() == frame.height() && - black_frame_->GetVideoRotation() == frame.GetVideoRotation()) { + black_frame_->rotation() == frame.rotation()) { black_frame_->SetTimeStamp(frame.GetTimeStamp()); return *black_frame_; } black_frame_.reset(new cricket::WebRtcVideoFrame( new rtc::RefCountedObject( frame.width(), frame.height()), - frame.GetTimeStamp(), frame.GetVideoRotation())); + frame.GetTimeStamp(), frame.rotation())); black_frame_->SetToBlack(); return *black_frame_; } diff --git a/webrtc/media/base/videoframe.cc b/webrtc/media/base/videoframe.cc index 6fd8d8168b..be63157d7b 100644 --- a/webrtc/media/base/videoframe.cc +++ b/webrtc/media/base/videoframe.cc @@ -136,7 +136,7 @@ void VideoFrame::StretchToFrame(VideoFrame* dst, interpolate, vert_crop); dst->SetTimeStamp(GetTimeStamp()); // Stretched frame should have the same rotation as the source. - dst->SetRotation(GetVideoRotation()); + dst->set_rotation(rotation()); } VideoFrame* VideoFrame::Stretch(size_t dst_width, size_t dst_height, diff --git a/webrtc/media/base/videoframe.h b/webrtc/media/base/videoframe.h index 6045bc08b4..d1ae9d7bb8 100644 --- a/webrtc/media/base/videoframe.h +++ b/webrtc/media/base/videoframe.h @@ -54,14 +54,14 @@ class VideoFrame { // Returns the underlying video frame buffer. This function is ok to call // multiple times, but the returned object will refer to the same memory. - virtual rtc::scoped_refptr GetVideoFrameBuffer() + virtual rtc::scoped_refptr video_frame_buffer() const = 0; virtual int64_t GetTimeStamp() const = 0; virtual void SetTimeStamp(int64_t time_stamp) = 0; // Indicates the rotation angle in degrees. - virtual webrtc::VideoRotation GetVideoRotation() const = 0; + virtual webrtc::VideoRotation rotation() const = 0; // Make a shallow copy of the frame. The frame buffer itself is not copied. // Both the current and new VideoFrame will share a single reference-counted @@ -139,7 +139,7 @@ class VideoFrame { // Creates an empty frame. virtual VideoFrame *CreateEmptyFrame(int w, int h, int64_t time_stamp) const = 0; - virtual void SetRotation(webrtc::VideoRotation rotation) = 0; + virtual void set_rotation(webrtc::VideoRotation rotation) = 0; }; } // namespace cricket diff --git a/webrtc/media/engine/webrtcvideoengine2.cc b/webrtc/media/engine/webrtcvideoengine2.cc index b9dbd66684..ae727812ad 100644 --- a/webrtc/media/engine/webrtcvideoengine2.cc +++ b/webrtc/media/engine/webrtcvideoengine2.cc @@ -1574,8 +1574,8 @@ static void CreateBlackFrame(webrtc::VideoFrame* video_frame, void WebRtcVideoChannel2::WebRtcVideoSendStream::OnFrame( const VideoFrame& frame) { TRACE_EVENT0("webrtc", "WebRtcVideoSendStream::OnFrame"); - webrtc::VideoFrame video_frame(frame.GetVideoFrameBuffer(), 0, 0, - frame.GetVideoRotation()); + webrtc::VideoFrame video_frame(frame.video_frame_buffer(), 0, 0, + frame.rotation()); rtc::CritScope cs(&lock_); if (stream_ == NULL) { // Frame input before send codecs are configured, dropping frame. diff --git a/webrtc/media/engine/webrtcvideoframe.cc b/webrtc/media/engine/webrtcvideoframe.cc index 3a2d2def0e..b7d87a5bde 100644 --- a/webrtc/media/engine/webrtcvideoframe.cc +++ b/webrtc/media/engine/webrtcvideoframe.cc @@ -121,7 +121,7 @@ void* WebRtcVideoFrame::GetNativeHandle() const { } rtc::scoped_refptr -WebRtcVideoFrame::GetVideoFrameBuffer() const { +WebRtcVideoFrame::video_frame_buffer() const { return video_frame_buffer_; } @@ -213,7 +213,7 @@ void WebRtcVideoFrame::InitToEmptyBuffer(int w, int h, const VideoFrame* WebRtcVideoFrame::GetCopyWithRotationApplied() const { // If the frame is not rotated, the caller should reuse this frame instead of // making a redundant copy. - if (GetVideoRotation() == webrtc::kVideoRotation_0) { + if (rotation() == webrtc::kVideoRotation_0) { return this; } @@ -231,8 +231,8 @@ const VideoFrame* WebRtcVideoFrame::GetCopyWithRotationApplied() const { int rotated_width = orig_width; int rotated_height = orig_height; - if (GetVideoRotation() == webrtc::kVideoRotation_90 || - GetVideoRotation() == webrtc::kVideoRotation_270) { + if (rotation() == webrtc::kVideoRotation_90 || + rotation() == webrtc::kVideoRotation_270) { rotated_width = orig_height; rotated_height = orig_width; } @@ -248,7 +248,7 @@ const VideoFrame* WebRtcVideoFrame::GetCopyWithRotationApplied() const { rotated_frame_->GetUPlane(), rotated_frame_->GetUPitch(), rotated_frame_->GetVPlane(), rotated_frame_->GetVPitch(), orig_width, orig_height, - static_cast(GetVideoRotation())); + static_cast(rotation())); if (ret == 0) { return rotated_frame_.get(); } diff --git a/webrtc/media/engine/webrtcvideoframe.h b/webrtc/media/engine/webrtcvideoframe.h index cb280b5e15..0e1d8099bc 100644 --- a/webrtc/media/engine/webrtcvideoframe.h +++ b/webrtc/media/engine/webrtcvideoframe.h @@ -66,7 +66,7 @@ class WebRtcVideoFrame : public VideoFrame { int32_t GetUPitch() const override; int32_t GetVPitch() const override; void* GetNativeHandle() const override; - rtc::scoped_refptr GetVideoFrameBuffer() + rtc::scoped_refptr video_frame_buffer() const override; int64_t GetTimeStamp() const override { return time_stamp_ns_; } @@ -74,9 +74,7 @@ class WebRtcVideoFrame : public VideoFrame { time_stamp_ns_ = time_stamp_ns; } - webrtc::VideoRotation GetVideoRotation() const override { - return rotation_; - } + webrtc::VideoRotation rotation() const override { return rotation_; } VideoFrame* Copy() const override; bool IsExclusive() const override; @@ -88,7 +86,7 @@ class WebRtcVideoFrame : public VideoFrame { const VideoFrame* GetCopyWithRotationApplied() const override; protected: - void SetRotation(webrtc::VideoRotation rotation) override { + void set_rotation(webrtc::VideoRotation rotation) override { rotation_ = rotation; } // Creates a frame from a raw sample with FourCC |format| and size |w| x |h|. diff --git a/webrtc/media/engine/webrtcvideoframe_unittest.cc b/webrtc/media/engine/webrtcvideoframe_unittest.cc index 4b0e988d28..12c8bfe741 100644 --- a/webrtc/media/engine/webrtcvideoframe_unittest.cc +++ b/webrtc/media/engine/webrtcvideoframe_unittest.cc @@ -20,7 +20,7 @@ namespace { class WebRtcVideoTestFrame : public cricket::WebRtcVideoFrame { public: - using cricket::WebRtcVideoFrame::SetRotation; + using cricket::WebRtcVideoFrame::set_rotation; virtual VideoFrame* CreateEmptyFrame(int w, int h, @@ -68,9 +68,9 @@ class WebRtcVideoFrameTest : public VideoFrameTest { // Verify the new frame. EXPECT_EQ(5678, frame.GetTimeStamp()); if (apply_rotation) - EXPECT_EQ(webrtc::kVideoRotation_0, frame.GetVideoRotation()); + EXPECT_EQ(webrtc::kVideoRotation_0, frame.rotation()); else - EXPECT_EQ(frame_rotation, frame.GetVideoRotation()); + EXPECT_EQ(frame_rotation, frame.rotation()); // If |apply_rotation| and the frame rotation is 90 or 270, width and // height are flipped. if (apply_rotation && (frame_rotation == webrtc::kVideoRotation_90 @@ -303,22 +303,22 @@ TEST_F(WebRtcVideoFrameTest, ApplyRotationToFrame) { LoadFrame(ms.get(), cricket::FOURCC_I420, kWidth, kHeight, &applied0)); // Claim that this frame needs to be rotated for 90 degree. - applied0.SetRotation(webrtc::kVideoRotation_90); + applied0.set_rotation(webrtc::kVideoRotation_90); // Apply rotation on frame 1. Output should be different from frame 1. WebRtcVideoTestFrame* applied90 = const_cast( static_cast( applied0.GetCopyWithRotationApplied())); EXPECT_TRUE(applied90); - EXPECT_EQ(applied90->GetVideoRotation(), webrtc::kVideoRotation_0); + EXPECT_EQ(applied90->rotation(), webrtc::kVideoRotation_0); EXPECT_FALSE(IsEqual(applied0, *applied90, 0)); // Claim the frame 2 needs to be rotated for another 270 degree. The output // from frame 2 rotation should be the same as frame 1. - applied90->SetRotation(webrtc::kVideoRotation_270); + applied90->set_rotation(webrtc::kVideoRotation_270); const cricket::VideoFrame* applied360 = applied90->GetCopyWithRotationApplied(); EXPECT_TRUE(applied360); - EXPECT_EQ(applied360->GetVideoRotation(), webrtc::kVideoRotation_0); + EXPECT_EQ(applied360->rotation(), webrtc::kVideoRotation_0); EXPECT_TRUE(IsEqual(applied0, *applied360, 0)); } diff --git a/webrtc/media/engine/webrtcvideoframefactory_unittest.cc b/webrtc/media/engine/webrtcvideoframefactory_unittest.cc index e2630734ca..45de453f8b 100644 --- a/webrtc/media/engine/webrtcvideoframefactory_unittest.cc +++ b/webrtc/media/engine/webrtcvideoframefactory_unittest.cc @@ -48,11 +48,11 @@ class WebRtcVideoFrameFactoryTest int src_height, bool apply_rotation) { if (!apply_rotation) { - EXPECT_EQ(dest_frame->GetVideoRotation(), src_rotation); + EXPECT_EQ(dest_frame->rotation(), src_rotation); EXPECT_EQ(dest_frame->width(), src_width); EXPECT_EQ(dest_frame->height(), src_height); } else { - EXPECT_EQ(dest_frame->GetVideoRotation(), webrtc::kVideoRotation_0); + EXPECT_EQ(dest_frame->rotation(), webrtc::kVideoRotation_0); if (src_rotation == webrtc::kVideoRotation_90 || src_rotation == webrtc::kVideoRotation_270) { EXPECT_EQ(dest_frame->width(), src_height);