diff --git a/talk/app/webrtc/objc/RTCI420Frame.mm b/talk/app/webrtc/objc/RTCI420Frame.mm index d8be8ceed1..8c1a9efcf2 100644 --- a/talk/app/webrtc/objc/RTCI420Frame.mm +++ b/talk/app/webrtc/objc/RTCI420Frame.mm @@ -82,10 +82,6 @@ return _videoFrame->GetVPitch(); } -- (BOOL)makeExclusive { - return _videoFrame->MakeExclusive(); -} - @end @implementation RTCI420Frame (Internal) diff --git a/talk/app/webrtc/objc/public/RTCI420Frame.h b/talk/app/webrtc/objc/public/RTCI420Frame.h index be16a04c3d..42d2f9cd52 100644 --- a/talk/app/webrtc/objc/public/RTCI420Frame.h +++ b/talk/app/webrtc/objc/public/RTCI420Frame.h @@ -43,8 +43,6 @@ @property(nonatomic, readonly) NSInteger uPitch; @property(nonatomic, readonly) NSInteger vPitch; -- (BOOL)makeExclusive; - #ifndef DOXYGEN_SHOULD_SKIP_THIS // Disallow init and don't add to documentation - (id)init __attribute__(( @@ -52,4 +50,3 @@ #endif /* DOXYGEN_SHOULD_SKIP_THIS */ @end - diff --git a/webrtc/media/base/videoframe.cc b/webrtc/media/base/videoframe.cc index c50d31fe6c..3fe19e1b28 100644 --- a/webrtc/media/base/videoframe.cc +++ b/webrtc/media/base/videoframe.cc @@ -46,16 +46,6 @@ bool VideoFrame::CopyToPlanes(uint8_t* dst_y, src_width, src_height) == 0; } -void VideoFrame::CopyToFrame(VideoFrame* dst) const { - if (!dst) { - LOG(LS_ERROR) << "NULL dst pointer."; - return; - } - - CopyToPlanes(dst->GetYPlane(), dst->GetUPlane(), dst->GetVPlane(), - dst->GetYPitch(), dst->GetUPitch(), dst->GetVPitch()); -} - size_t VideoFrame::ConvertToRgbBuffer(uint32_t to_fourcc, uint8_t* buffer, size_t size, diff --git a/webrtc/media/base/videoframe.h b/webrtc/media/base/videoframe.h index 0206ab8252..8a03188e25 100644 --- a/webrtc/media/base/videoframe.h +++ b/webrtc/media/base/videoframe.h @@ -88,15 +88,6 @@ class VideoFrame { // be shared, this function can be used to check exclusive ownership. virtual bool IsExclusive() const = 0; - // In case VideoFrame needs exclusive access of the frame buffer, user can - // call MakeExclusive() to make sure the frame buffer is exclusively - // accessible to the current object. This might mean a deep copy of the frame - // buffer if it is currently shared by other objects. - virtual bool MakeExclusive() = 0; - - // Writes the frame into the target VideoFrame. - virtual void CopyToFrame(VideoFrame* target) const; - // Return a copy of frame which has its pending rotation applied. The // ownership of the returned frame is held by this frame. virtual const VideoFrame* GetCopyWithRotationApplied() const = 0; diff --git a/webrtc/media/base/videoframe_unittest.h b/webrtc/media/base/videoframe_unittest.h index 88119fd672..44570c4e19 100644 --- a/webrtc/media/base/videoframe_unittest.h +++ b/webrtc/media/base/videoframe_unittest.h @@ -1807,37 +1807,6 @@ class VideoFrameTest : public testing::Test { EXPECT_EQ(const_source->GetVPlane(), target->GetVPlane()); } - void MakeExclusive() { - std::unique_ptr source(new T); - std::unique_ptr target; - ASSERT_TRUE(LoadFrameNoRepeat(source.get())); - target.reset(source->Copy()); - EXPECT_TRUE(target->MakeExclusive()); - EXPECT_TRUE(IsEqual(*source, *target, 0)); - EXPECT_NE(target->GetYPlane(), source->GetYPlane()); - EXPECT_NE(target->GetUPlane(), source->GetUPlane()); - EXPECT_NE(target->GetVPlane(), source->GetVPlane()); - } - - void CopyToFrame() { - T source; - std::unique_ptr ms( - LoadSample(kImageFilename)); - ASSERT_TRUE(ms.get() != NULL); - ASSERT_TRUE(LoadFrame(ms.get(), cricket::FOURCC_I420, kWidth, kHeight, - &source)); - - // Create the target frame by loading from a file. - T target; - ASSERT_TRUE(LoadFrameNoRepeat(&target)); - EXPECT_FALSE(IsBlack(target)); - - // Stretch and check if the stretched target is black. - source.CopyToFrame(&target); - - EXPECT_TRUE(IsEqual(source, target, 0)); - } - void StretchToFrame() { // Create the source frame as a black frame. T source; diff --git a/webrtc/media/engine/webrtcvideoframe.cc b/webrtc/media/engine/webrtcvideoframe.cc index 61a561f47a..5694ec8454 100644 --- a/webrtc/media/engine/webrtcvideoframe.cc +++ b/webrtc/media/engine/webrtcvideoframe.cc @@ -131,30 +131,6 @@ VideoFrame* WebRtcVideoFrame::Copy() const { return new_frame; } -bool WebRtcVideoFrame::MakeExclusive() { - RTC_DCHECK(video_frame_buffer_->native_handle() == nullptr); - if (IsExclusive()) - return true; - - // Not exclusive already, need to copy buffer. - rtc::scoped_refptr new_buffer = - new rtc::RefCountedObject( - video_frame_buffer_->width(), video_frame_buffer_->height(), - video_frame_buffer_->stride(kYPlane), - video_frame_buffer_->stride(kUPlane), - video_frame_buffer_->stride(kVPlane)); - - if (!CopyToPlanes( - new_buffer->MutableData(kYPlane), new_buffer->MutableData(kUPlane), - new_buffer->MutableData(kVPlane), new_buffer->stride(kYPlane), - new_buffer->stride(kUPlane), new_buffer->stride(kVPlane))) { - return false; - } - - video_frame_buffer_ = new_buffer; - return true; -} - size_t WebRtcVideoFrame::ConvertToRgbBuffer(uint32_t to_fourcc, uint8_t* buffer, size_t size, diff --git a/webrtc/media/engine/webrtcvideoframe.h b/webrtc/media/engine/webrtcvideoframe.h index ccdcf76f29..50e68bdcf4 100644 --- a/webrtc/media/engine/webrtcvideoframe.h +++ b/webrtc/media/engine/webrtcvideoframe.h @@ -91,7 +91,6 @@ class WebRtcVideoFrame : public VideoFrame { VideoFrame* Copy() const override; bool IsExclusive() const override; - bool MakeExclusive() override; size_t ConvertToRgbBuffer(uint32_t to_fourcc, uint8_t* buffer, size_t size, diff --git a/webrtc/media/engine/webrtcvideoframe_unittest.cc b/webrtc/media/engine/webrtcvideoframe_unittest.cc index 808d7124b8..dfd3bf5760 100644 --- a/webrtc/media/engine/webrtcvideoframe_unittest.cc +++ b/webrtc/media/engine/webrtcvideoframe_unittest.cc @@ -235,13 +235,11 @@ TEST_WEBRTCVIDEOFRAME(ConvertFromUYVYBuffer) TEST_WEBRTCVIDEOFRAME(ConvertFromUYVYBufferStride) TEST_WEBRTCVIDEOFRAME(ConvertFromUYVYBufferInverted) // TEST_WEBRTCVIDEOFRAME(ConvertToI422Buffer) -TEST_WEBRTCVIDEOFRAME(CopyToFrame) // TEST_WEBRTCVIDEOFRAME(ConstructARGBBlackWhitePixel) TEST_WEBRTCVIDEOFRAME(StretchToFrame) TEST_WEBRTCVIDEOFRAME(Copy) TEST_WEBRTCVIDEOFRAME(CopyIsRef) -TEST_WEBRTCVIDEOFRAME(MakeExclusive) // These functions test implementation-specific details. // Tests the Init function with different cropped size.