diff options
author | scherkus@chromium.org <scherkus@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-04-10 04:51:23 +0000 |
---|---|---|
committer | scherkus@chromium.org <scherkus@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-04-10 04:51:23 +0000 |
commit | cbcc6c1ee96bd8dcb980dce4ad89f6f7575f73cb (patch) | |
tree | aa647e46e4c6de4ddbb938e3cd9e614bef5553a7 /media | |
parent | 007cdc1f6ac88ae7cca165a6e33fc5ffb1417667 (diff) | |
download | chromium_src-cbcc6c1ee96bd8dcb980dce4ad89f6f7575f73cb.zip chromium_src-cbcc6c1ee96bd8dcb980dce4ad89f6f7575f73cb.tar.gz chromium_src-cbcc6c1ee96bd8dcb980dce4ad89f6f7575f73cb.tar.bz2 |
Rename VideoFrame::{Get,Set}Timestamp() to {set_}timestamp().
Makes the naming consistent with AudioBuffer, which is helpful now that DecoderStream<T> enforces API consistency.
TBR=dmichael
Review URL: https://codereview.chromium.org/229453004
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@262914 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'media')
-rw-r--r-- | media/base/video_frame.cc | 2 | ||||
-rw-r--r-- | media/base/video_frame.h | 4 | ||||
-rw-r--r-- | media/base/video_frame_pool.cc | 2 | ||||
-rw-r--r-- | media/base/video_frame_pool_unittest.cc | 2 | ||||
-rw-r--r-- | media/base/video_frame_unittest.cc | 2 | ||||
-rw-r--r-- | media/filters/ffmpeg_video_decoder.cc | 2 | ||||
-rw-r--r-- | media/filters/skcanvas_video_renderer.cc | 4 | ||||
-rw-r--r-- | media/filters/skcanvas_video_renderer_unittest.cc | 10 | ||||
-rw-r--r-- | media/filters/video_renderer_impl.cc | 18 | ||||
-rw-r--r-- | media/filters/video_renderer_impl_unittest.cc | 2 | ||||
-rw-r--r-- | media/filters/vpx_video_decoder.cc | 2 |
11 files changed, 25 insertions, 25 deletions
diff --git a/media/base/video_frame.cc b/media/base/video_frame.cc index 874e23a..1e33fbe 100644 --- a/media/base/video_frame.cc +++ b/media/base/video_frame.cc @@ -234,7 +234,7 @@ scoped_refptr<VideoFrame> VideoFrame::WrapVideoFrame( DCHECK(frame->visible_rect().Contains(visible_rect)); scoped_refptr<VideoFrame> wrapped_frame(new VideoFrame( frame->format(), frame->coded_size(), visible_rect, natural_size, - frame->GetTimestamp(), frame->end_of_stream())); + frame->timestamp(), frame->end_of_stream())); for (size_t i = 0; i < NumPlanes(frame->format()); ++i) { wrapped_frame->strides_[i] = frame->stride(i); diff --git a/media/base/video_frame.h b/media/base/video_frame.h index aa9c078..8106a27 100644 --- a/media/base/video_frame.h +++ b/media/base/video_frame.h @@ -212,10 +212,10 @@ class MEDIA_EXPORT VideoFrame : public base::RefCountedThreadSafe<VideoFrame> { // Returns true if this VideoFrame represents the end of the stream. bool end_of_stream() const { return end_of_stream_; } - base::TimeDelta GetTimestamp() const { + base::TimeDelta timestamp() const { return timestamp_; } - void SetTimestamp(const base::TimeDelta& timestamp) { + void set_timestamp(const base::TimeDelta& timestamp) { timestamp_ = timestamp; } diff --git a/media/base/video_frame_pool.cc b/media/base/video_frame_pool.cc index a0f8682..800d047 100644 --- a/media/base/video_frame_pool.cc +++ b/media/base/video_frame_pool.cc @@ -75,7 +75,7 @@ scoped_refptr<VideoFrame> VideoFramePool::PoolImpl::CreateFrame( pool_frame->visible_rect() == visible_rect && pool_frame->natural_size() == natural_size) { frame = pool_frame; - frame->SetTimestamp(timestamp); + frame->set_timestamp(timestamp); break; } } diff --git a/media/base/video_frame_pool_unittest.cc b/media/base/video_frame_pool_unittest.cc index 7850e04..7f3694b 100644 --- a/media/base/video_frame_pool_unittest.cc +++ b/media/base/video_frame_pool_unittest.cc @@ -23,7 +23,7 @@ class VideoFramePoolTest : public ::testing::Test { base::TimeDelta::FromMilliseconds(timestamp_ms)); EXPECT_EQ(format, frame->format()); EXPECT_EQ(base::TimeDelta::FromMilliseconds(timestamp_ms), - frame->GetTimestamp()); + frame->timestamp()); EXPECT_EQ(coded_size, frame->coded_size()); EXPECT_EQ(visible_rect, frame->visible_rect()); EXPECT_EQ(natural_size, frame->natural_size()); diff --git a/media/base/video_frame_unittest.cc b/media/base/video_frame_unittest.cc index 9229b6a..8e7ce8f 100644 --- a/media/base/video_frame_unittest.cc +++ b/media/base/video_frame_unittest.cc @@ -170,7 +170,7 @@ TEST(VideoFrame, CreateBlackFrame) { ASSERT_TRUE(frame.get()); // Test basic properties. - EXPECT_EQ(0, frame->GetTimestamp().InMicroseconds()); + EXPECT_EQ(0, frame->timestamp().InMicroseconds()); EXPECT_FALSE(frame->end_of_stream()); // Test |frame| properties. diff --git a/media/filters/ffmpeg_video_decoder.cc b/media/filters/ffmpeg_video_decoder.cc index 53ee437..5e1a8ec 100644 --- a/media/filters/ffmpeg_video_decoder.cc +++ b/media/filters/ffmpeg_video_decoder.cc @@ -321,7 +321,7 @@ bool FFmpegVideoDecoder::FFmpegDecode( } *video_frame = static_cast<VideoFrame*>(av_frame_->opaque); - (*video_frame)->SetTimestamp( + (*video_frame)->set_timestamp( base::TimeDelta::FromMicroseconds(av_frame_->reordered_opaque)); return true; diff --git a/media/filters/skcanvas_video_renderer.cc b/media/filters/skcanvas_video_renderer.cc index 90f872b..9781b4c 100644 --- a/media/filters/skcanvas_video_renderer.cc +++ b/media/filters/skcanvas_video_renderer.cc @@ -321,9 +321,9 @@ void SkCanvasVideoRenderer::Paint(media::VideoFrame* video_frame, // Check if we should convert and update |last_frame_|. if (last_frame_.isNull() || - video_frame->GetTimestamp() != last_frame_timestamp_) { + video_frame->timestamp() != last_frame_timestamp_) { ConvertVideoFrameToBitmap(video_frame, &last_frame_); - last_frame_timestamp_ = video_frame->GetTimestamp(); + last_frame_timestamp_ = video_frame->timestamp(); } // Do a slower paint using |last_frame_|. diff --git a/media/filters/skcanvas_video_renderer_unittest.cc b/media/filters/skcanvas_video_renderer_unittest.cc index 842a8f7..73d8501 100644 --- a/media/filters/skcanvas_video_renderer_unittest.cc +++ b/media/filters/skcanvas_video_renderer_unittest.cc @@ -103,9 +103,9 @@ SkCanvasVideoRendererTest::SkCanvasVideoRendererTest() fast_path_canvas_(AllocBitmap(kWidth, kHeight, true)), slow_path_canvas_(AllocBitmap(kWidth, kHeight, false)) { // Give each frame a unique timestamp. - natural_frame_->SetTimestamp(base::TimeDelta::FromMilliseconds(1)); - larger_frame_->SetTimestamp(base::TimeDelta::FromMilliseconds(2)); - smaller_frame_->SetTimestamp(base::TimeDelta::FromMilliseconds(3)); + natural_frame_->set_timestamp(base::TimeDelta::FromMilliseconds(1)); + larger_frame_->set_timestamp(base::TimeDelta::FromMilliseconds(2)); + smaller_frame_->set_timestamp(base::TimeDelta::FromMilliseconds(3)); // Make sure the cropped video frame's aspect ratio matches the output device. // Update cropped_frame_'s crop dimensions if this is not the case. @@ -271,14 +271,14 @@ TEST_F(SkCanvasVideoRendererTest, SlowPaint_Smaller) { TEST_F(SkCanvasVideoRendererTest, FastPaint_NoTimestamp) { VideoFrame* video_frame = natural_frame(); - video_frame->SetTimestamp(media::kNoTimestamp()); + video_frame->set_timestamp(media::kNoTimestamp()); Paint(video_frame, fast_path_canvas(), kRed); EXPECT_EQ(SK_ColorRED, GetColor(fast_path_canvas())); } TEST_F(SkCanvasVideoRendererTest, SlowPaint_NoTimestamp) { VideoFrame* video_frame = natural_frame(); - video_frame->SetTimestamp(media::kNoTimestamp()); + video_frame->set_timestamp(media::kNoTimestamp()); Paint(video_frame, slow_path_canvas(), kRed); EXPECT_EQ(SK_ColorRED, GetColor(slow_path_canvas())); } diff --git a/media/filters/video_renderer_impl.cc b/media/filters/video_renderer_impl.cc index 3b9851f..93deb57 100644 --- a/media/filters/video_renderer_impl.cc +++ b/media/filters/video_renderer_impl.cc @@ -294,8 +294,8 @@ void VideoRendererImpl::ThreadMain() { // the accuracy of our frame timing code. http://crbug.com/149829 if (drop_frames_ && last_timestamp_ != kNoTimestamp()) { base::TimeDelta now = get_time_cb_.Run(); - base::TimeDelta deadline = ready_frames_.front()->GetTimestamp() + - (ready_frames_.front()->GetTimestamp() - last_timestamp_) / 2; + base::TimeDelta deadline = ready_frames_.front()->timestamp() + + (ready_frames_.front()->timestamp() - last_timestamp_) / 2; if (now > deadline) { DropNextReadyFrame_Locked(); @@ -318,7 +318,7 @@ void VideoRendererImpl::PaintNextReadyFrame_Locked() { ready_frames_.pop_front(); frames_decoded_++; - last_timestamp_ = next_frame->GetTimestamp(); + last_timestamp_ = next_frame->timestamp(); paint_cb_.Run(next_frame); @@ -332,7 +332,7 @@ void VideoRendererImpl::DropNextReadyFrame_Locked() { lock_.AssertAcquired(); - last_timestamp_ = ready_frames_.front()->GetTimestamp(); + last_timestamp_ = ready_frames_.front()->timestamp(); ready_frames_.pop_front(); frames_decoded_++; frames_dropped_++; @@ -396,7 +396,7 @@ void VideoRendererImpl::FrameReady(VideoFrameStream::Status status, // Maintain the latest frame decoded so the correct frame is displayed after // prerolling has completed. if (state_ == kPrerolling && preroll_timestamp_ != kNoTimestamp() && - frame->GetTimestamp() <= preroll_timestamp_) { + frame->timestamp() <= preroll_timestamp_) { ready_frames_.clear(); } @@ -429,15 +429,15 @@ void VideoRendererImpl::AddReadyFrame_Locked( // frame rate. Another way for this to happen is for the container to state // a smaller duration than the largest packet timestamp. base::TimeDelta duration = get_duration_cb_.Run(); - if (frame->GetTimestamp() > duration) { - frame->SetTimestamp(duration); + if (frame->timestamp() > duration) { + frame->set_timestamp(duration); } ready_frames_.push_back(frame); DCHECK_LE(ready_frames_.size(), static_cast<size_t>(limits::kMaxVideoFrames)); - max_time_cb_.Run(frame->GetTimestamp()); + max_time_cb_.Run(frame->timestamp()); // Avoid needlessly waking up |thread_| unless playing. if (state_ == kPlaying) @@ -499,7 +499,7 @@ base::TimeDelta VideoRendererImpl::CalculateSleepDuration( float playback_rate) { // Determine the current and next presentation timestamps. base::TimeDelta now = get_time_cb_.Run(); - base::TimeDelta next_pts = next_frame->GetTimestamp(); + base::TimeDelta next_pts = next_frame->timestamp(); // Scale our sleep based on the playback rate. base::TimeDelta sleep = next_pts - now; diff --git a/media/filters/video_renderer_impl_unittest.cc b/media/filters/video_renderer_impl_unittest.cc index 86fb17e..f4cc46f 100644 --- a/media/filters/video_renderer_impl_unittest.cc +++ b/media/filters/video_renderer_impl_unittest.cc @@ -235,7 +235,7 @@ class VideoRendererImplTest : public ::testing::Test { scoped_refptr<VideoFrame> frame = GetCurrentFrame(); if (!frame.get()) return -1; - return frame->GetTimestamp().InMilliseconds(); + return frame->timestamp().InMilliseconds(); } void WaitForError(PipelineStatus expected) { diff --git a/media/filters/vpx_video_decoder.cc b/media/filters/vpx_video_decoder.cc index 69d137b..286629d 100644 --- a/media/filters/vpx_video_decoder.cc +++ b/media/filters/vpx_video_decoder.cc @@ -444,7 +444,7 @@ bool VpxVideoDecoder::VpxDecode(const scoped_refptr<DecoderBuffer>& buffer, } CopyVpxImageTo(vpx_image, vpx_image_alpha, video_frame); - (*video_frame)->SetTimestamp(base::TimeDelta::FromMicroseconds(timestamp)); + (*video_frame)->set_timestamp(base::TimeDelta::FromMicroseconds(timestamp)); return true; } |