From 90685ba0c19e0de94116eb4eac5a6d355e1aac20 Mon Sep 17 00:00:00 2001 From: ajose Date: Tue, 25 Aug 2015 15:11:22 -0700 Subject: [PATCH] Change VideoCaptureDeliverFrameCB's signature from |const base::TimeTicks&| to |base::TimeTicks|. BUG=524589 Review URL: https://codereview.chromium.org/1304393004 Cr-Commit-Position: refs/heads/master@{#345453} --- chrome/renderer/media/cast_rtp_stream.cc | 2 +- .../renderer/media/media_stream_video_capture_source_unittest.cc | 2 +- content/renderer/media/media_stream_video_track.cc | 4 ++-- content/renderer/media/media_stream_video_track_unittest.cc | 2 +- content/renderer/media/mock_media_stream_video_sink.cc | 2 +- content/renderer/media/mock_media_stream_video_sink.h | 2 +- content/renderer/media/rtc_video_renderer.cc | 2 +- content/renderer/media/rtc_video_renderer.h | 2 +- content/renderer/media/video_capture_impl_manager_unittest.cc | 2 +- content/renderer/media/video_capture_impl_unittest.cc | 3 +-- content/renderer/media/video_source_handler.cc | 2 +- content/renderer/media/video_track_adapter.cc | 2 +- content/renderer/media/video_track_adapter.h | 5 ++--- content/renderer/media/webrtc/webrtc_video_track_adapter.cc | 4 ++-- content/renderer/pepper/pepper_media_stream_video_track_host.cc | 2 +- content/renderer/pepper/pepper_media_stream_video_track_host.h | 2 +- content/renderer/pepper/pepper_platform_video_capture.cc | 2 +- content/renderer/pepper/pepper_platform_video_capture.h | 2 +- media/base/video_capturer_source.h | 7 +++---- 19 files changed, 24 insertions(+), 27 deletions(-) diff --git a/chrome/renderer/media/cast_rtp_stream.cc b/chrome/renderer/media/cast_rtp_stream.cc index 4873619b3ef5..1b9d2da7b055 100644 --- a/chrome/renderer/media/cast_rtp_stream.cc +++ b/chrome/renderer/media/cast_rtp_stream.cc @@ -272,7 +272,7 @@ class CastVideoSink : public base::SupportsWeakPtr, const scoped_refptr frame_input, // These parameters are passed for each frame. const scoped_refptr& frame, - const base::TimeTicks& estimated_capture_time) { + base::TimeTicks estimated_capture_time) { const base::TimeTicks timestamp = estimated_capture_time.is_null() ? base::TimeTicks::Now() : estimated_capture_time; diff --git a/content/renderer/media/media_stream_video_capture_source_unittest.cc b/content/renderer/media/media_stream_video_capture_source_unittest.cc index 3efc0cb969ac..a8591359e41c 100644 --- a/content/renderer/media/media_stream_video_capture_source_unittest.cc +++ b/content/renderer/media/media_stream_video_capture_source_unittest.cc @@ -265,7 +265,7 @@ class FakeMediaStreamVideoSink : public MediaStreamVideoSink { } void OnVideoFrame(const scoped_refptr& frame, - const base::TimeTicks& capture_time) { + base::TimeTicks capture_time) { *capture_time_ = capture_time; metadata_->Clear(); base::DictionaryValue tmp; diff --git a/content/renderer/media/media_stream_video_track.cc b/content/renderer/media/media_stream_video_track.cc index 725218f93ca6..1da51c12d3d1 100644 --- a/content/renderer/media/media_stream_video_track.cc +++ b/content/renderer/media/media_stream_video_track.cc @@ -55,7 +55,7 @@ class MediaStreamVideoTrack::FrameDeliverer // Triggers all registered callbacks with |frame|, |format| and // |estimated_capture_time| as parameters. Must be called on the IO-thread. void DeliverFrameOnIO(const scoped_refptr& frame, - const base::TimeTicks& estimated_capture_time); + base::TimeTicks estimated_capture_time); private: friend class base::RefCountedThreadSafe; @@ -154,7 +154,7 @@ void MediaStreamVideoTrack::FrameDeliverer::SetEnabledOnIO(bool enabled) { void MediaStreamVideoTrack::FrameDeliverer::DeliverFrameOnIO( const scoped_refptr& frame, - const base::TimeTicks& estimated_capture_time) { + base::TimeTicks estimated_capture_time) { DCHECK(io_task_runner_->BelongsToCurrentThread()); const scoped_refptr& video_frame = enabled_ ? frame : GetBlackFrame(frame); diff --git a/content/renderer/media/media_stream_video_track_unittest.cc b/content/renderer/media/media_stream_video_track_unittest.cc index cd59b18f11fe..0e9e0d14485e 100644 --- a/content/renderer/media/media_stream_video_track_unittest.cc +++ b/content/renderer/media/media_stream_video_track_unittest.cc @@ -137,7 +137,7 @@ class CheckThreadHelper { void CheckThreadVideoFrameReceiver( CheckThreadHelper* helper, const scoped_refptr& frame, - const base::TimeTicks& estimated_capture_time) { + base::TimeTicks estimated_capture_time) { // Do nothing. } diff --git a/content/renderer/media/mock_media_stream_video_sink.cc b/content/renderer/media/mock_media_stream_video_sink.cc index c1b9647eaced..6292eec55f27 100644 --- a/content/renderer/media/mock_media_stream_video_sink.cc +++ b/content/renderer/media/mock_media_stream_video_sink.cc @@ -29,7 +29,7 @@ MockMediaStreamVideoSink::GetDeliverFrameCB() { void MockMediaStreamVideoSink::DeliverVideoFrame( const scoped_refptr& frame, - const base::TimeTicks& estimated_capture_time) { + base::TimeTicks estimated_capture_time) { last_frame_ = frame; ++number_of_frames_; format_ = frame->format(); diff --git a/content/renderer/media/mock_media_stream_video_sink.h b/content/renderer/media/mock_media_stream_video_sink.h index 651387835ddf..91270190d8f3 100644 --- a/content/renderer/media/mock_media_stream_video_sink.h +++ b/content/renderer/media/mock_media_stream_video_sink.h @@ -39,7 +39,7 @@ class MockMediaStreamVideoSink : public MediaStreamVideoSink { private: void DeliverVideoFrame(const scoped_refptr& frame, - const base::TimeTicks& estimated_capture_time); + base::TimeTicks estimated_capture_time); int number_of_frames_; bool enabled_; diff --git a/content/renderer/media/rtc_video_renderer.cc b/content/renderer/media/rtc_video_renderer.cc index 534a84191509..2d72b3774854 100644 --- a/content/renderer/media/rtc_video_renderer.cc +++ b/content/renderer/media/rtc_video_renderer.cc @@ -81,7 +81,7 @@ void RTCVideoRenderer::OnReadyStateChanged( void RTCVideoRenderer::OnVideoFrame( const scoped_refptr& frame, - const base::TimeTicks& estimated_capture_time) { + base::TimeTicks estimated_capture_time) { DCHECK(task_runner_->BelongsToCurrentThread()); if (state_ != STARTED) return; diff --git a/content/renderer/media/rtc_video_renderer.h b/content/renderer/media/rtc_video_renderer.h index 67a62af89692..94c8a29dd9d2 100644 --- a/content/renderer/media/rtc_video_renderer.h +++ b/content/renderer/media/rtc_video_renderer.h @@ -56,7 +56,7 @@ class CONTENT_EXPORT RTCVideoRenderer }; void OnVideoFrame(const scoped_refptr& frame, - const base::TimeTicks& estimated_capture_time); + base::TimeTicks estimated_capture_time); // MediaStreamVideoSink implementation. Called on the main thread. void OnReadyStateChanged( diff --git a/content/renderer/media/video_capture_impl_manager_unittest.cc b/content/renderer/media/video_capture_impl_manager_unittest.cc index 122244007db9..470e7ffbdca4 100644 --- a/content/renderer/media/video_capture_impl_manager_unittest.cc +++ b/content/renderer/media/video_capture_impl_manager_unittest.cc @@ -91,7 +91,7 @@ class VideoCaptureImplManagerTest : public ::testing::Test { protected: MOCK_METHOD2(OnFrameReady, void(const scoped_refptr&, - const base::TimeTicks& estimated_capture_time)); + base::TimeTicks estimated_capture_time)); MOCK_METHOD0(OnStarted, void()); MOCK_METHOD0(OnStopped, void()); diff --git a/content/renderer/media/video_capture_impl_unittest.cc b/content/renderer/media/video_capture_impl_unittest.cc index 0cbaceaa6b78..3860080eb49a 100644 --- a/content/renderer/media/video_capture_impl_unittest.cc +++ b/content/renderer/media/video_capture_impl_unittest.cc @@ -133,8 +133,7 @@ class VideoCaptureImplTest : public ::testing::Test { protected: MOCK_METHOD2(OnFrameReady, - void(const scoped_refptr&, - const base::TimeTicks&)); + void(const scoped_refptr&, base::TimeTicks)); MOCK_METHOD1(OnStateUpdate, void(VideoCaptureState)); MOCK_METHOD1(OnDeviceFormatsInUse, void(const media::VideoCaptureFormats&)); diff --git a/content/renderer/media/video_source_handler.cc b/content/renderer/media/video_source_handler.cc index 2eb868111070..4f690c174ef4 100644 --- a/content/renderer/media/video_source_handler.cc +++ b/content/renderer/media/video_source_handler.cc @@ -52,7 +52,7 @@ class PpFrameReceiver : public MediaStreamVideoSink { } void OnVideoFrame(const scoped_refptr& frame, - const base::TimeTicks& estimated_capture_time) { + base::TimeTicks estimated_capture_time) { TRACE_EVENT0("video", "PpFrameReceiver::OnVideoFrame"); if (reader_) reader_->GotFrame(frame); diff --git a/content/renderer/media/video_track_adapter.cc b/content/renderer/media/video_track_adapter.cc index 27d326739d9f..d9cfd384bd9f 100644 --- a/content/renderer/media/video_track_adapter.cc +++ b/content/renderer/media/video_track_adapter.cc @@ -479,7 +479,7 @@ void VideoTrackAdapter::RemoveTrackOnIO(const MediaStreamVideoTrack* track) { void VideoTrackAdapter::DeliverFrameOnIO( const scoped_refptr& frame, - const base::TimeTicks& estimated_capture_time) { + base::TimeTicks estimated_capture_time) { DCHECK(io_task_runner_->BelongsToCurrentThread()); TRACE_EVENT0("video", "VideoTrackAdapter::DeliverFrameOnIO"); ++frame_counter_; diff --git a/content/renderer/media/video_track_adapter.h b/content/renderer/media/video_track_adapter.h index 179deb8cebdd..a63b6e1e49db 100644 --- a/content/renderer/media/video_track_adapter.h +++ b/content/renderer/media/video_track_adapter.h @@ -48,9 +48,8 @@ class VideoTrackAdapter // Delivers |frame| to all tracks that have registered a callback. // Must be called on the IO-thread. - void DeliverFrameOnIO( - const scoped_refptr& frame, - const base::TimeTicks& estimated_capture_time); + void DeliverFrameOnIO(const scoped_refptr& frame, + base::TimeTicks estimated_capture_time); base::SingleThreadTaskRunner* io_task_runner() const { DCHECK(thread_checker_.CalledOnValidThread()); diff --git a/content/renderer/media/webrtc/webrtc_video_track_adapter.cc b/content/renderer/media/webrtc/webrtc_video_track_adapter.cc index 372fd542cd86..d2c989ece7c2 100644 --- a/content/renderer/media/webrtc/webrtc_video_track_adapter.cc +++ b/content/renderer/media/webrtc/webrtc_video_track_adapter.cc @@ -48,7 +48,7 @@ class WebRtcVideoTrackAdapter::WebRtcVideoSourceAdapter void ReleaseSourceOnMainThread(); void OnVideoFrameOnIO(const scoped_refptr& frame, - const base::TimeTicks& estimated_capture_time); + base::TimeTicks estimated_capture_time); private: void OnVideoFrameOnWorkerThread( @@ -114,7 +114,7 @@ ReleaseSourceOnMainThread() { void WebRtcVideoTrackAdapter::WebRtcVideoSourceAdapter::OnVideoFrameOnIO( const scoped_refptr& frame, - const base::TimeTicks& estimated_capture_time) { + base::TimeTicks estimated_capture_time) { DCHECK(io_thread_checker_.CalledOnValidThread()); libjingle_worker_thread_->PostTask( FROM_HERE, diff --git a/content/renderer/pepper/pepper_media_stream_video_track_host.cc b/content/renderer/pepper/pepper_media_stream_video_track_host.cc index c2e22e0895a8..3193d0438587 100644 --- a/content/renderer/pepper/pepper_media_stream_video_track_host.cc +++ b/content/renderer/pepper/pepper_media_stream_video_track_host.cc @@ -371,7 +371,7 @@ int32_t PepperMediaStreamVideoTrackHost::SendFrameToTrack(int32_t index) { void PepperMediaStreamVideoTrackHost::OnVideoFrame( const scoped_refptr& frame, - const base::TimeTicks& estimated_capture_time) { + base::TimeTicks estimated_capture_time) { DCHECK(frame.get()); // TODO(penghuang): Check |frame->end_of_stream()| and close the track. PP_VideoFrame_Format ppformat = ToPpapiFormat(frame->format()); diff --git a/content/renderer/pepper/pepper_media_stream_video_track_host.h b/content/renderer/pepper/pepper_media_stream_video_track_host.h index b0c7f6791398..cdb1bbcac563 100644 --- a/content/renderer/pepper/pepper_media_stream_video_track_host.h +++ b/content/renderer/pepper/pepper_media_stream_video_track_host.h @@ -56,7 +56,7 @@ class PepperMediaStreamVideoTrackHost : public PepperMediaStreamTrackHostBase, int32_t SendFrameToTrack(int32_t index); void OnVideoFrame(const scoped_refptr& frame, - const base::TimeTicks& estimated_capture_time); + base::TimeTicks estimated_capture_time); // MediaStreamVideoSource overrides: void GetCurrentSupportedFormats( diff --git a/content/renderer/pepper/pepper_platform_video_capture.cc b/content/renderer/pepper/pepper_platform_video_capture.cc index eb6e748a5fa9..13ad0136cc9b 100644 --- a/content/renderer/pepper/pepper_platform_video_capture.cc +++ b/content/renderer/pepper/pepper_platform_video_capture.cc @@ -141,7 +141,7 @@ void PepperPlatformVideoCapture::OnStateUpdate(VideoCaptureState state) { void PepperPlatformVideoCapture::OnFrameReady( const scoped_refptr& frame, - const base::TimeTicks& estimated_capture_time) { + base::TimeTicks estimated_capture_time) { if (handler_ && !stop_capture_cb_.is_null()) handler_->OnFrameReady(frame); } diff --git a/content/renderer/pepper/pepper_platform_video_capture.h b/content/renderer/pepper/pepper_platform_video_capture.h index dd6ed78dade5..02afc6ff73d3 100644 --- a/content/renderer/pepper/pepper_platform_video_capture.h +++ b/content/renderer/pepper/pepper_platform_video_capture.h @@ -42,7 +42,7 @@ class PepperPlatformVideoCapture { void OnDeviceOpened(int request_id, bool succeeded, const std::string& label); void OnStateUpdate(VideoCaptureState state); void OnFrameReady(const scoped_refptr& frame, - const base::TimeTicks& estimated_capture_time); + base::TimeTicks estimated_capture_time); // Can return NULL if the RenderFrame referenced by |render_frame_id_| has // gone away. diff --git a/media/base/video_capturer_source.h b/media/base/video_capturer_source.h index 774f28da02fa..dc37e96aec99 100644 --- a/media/base/video_capturer_source.h +++ b/media/base/video_capturer_source.h @@ -40,10 +40,9 @@ class MEDIA_EXPORT VideoCapturerSource { // frame relative to the first frame generated by the corresponding source. // Because a source can start generating frames before a subscriber is added, // the first video frame delivered may not have timestamp equal to 0. - typedef base::Callback< - void(const scoped_refptr& video_frame, - const base::TimeTicks& estimated_capture_time)> - VideoCaptureDeliverFrameCB; + typedef base::Callback& video_frame, + base::TimeTicks estimated_capture_time)> VideoCaptureDeliverFrameCB; typedef base::Callback VideoCaptureDeviceFormatsCB; -- 2.11.4.GIT