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

Side by Side Diff: content/renderer/media/webmediaplayer_ms.cc

Issue 229453004: Rename VideoFrame::{Get,Set}Timestamp() to {set_}timestamp(). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix compile failure Created 6 years, 8 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/renderer/media/webmediaplayer_ms.h" 5 #include "content/renderer/media/webmediaplayer_ms.h"
6 6
7 #include <limits> 7 #include <limits>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/callback.h" 10 #include "base/callback.h"
(...skipping 30 matching lines...) Expand all
41 scoped_refptr<media::VideoFrame> CopyFrameToYV12( 41 scoped_refptr<media::VideoFrame> CopyFrameToYV12(
42 const scoped_refptr<media::VideoFrame>& frame) { 42 const scoped_refptr<media::VideoFrame>& frame) {
43 DCHECK(frame->format() == media::VideoFrame::YV12 || 43 DCHECK(frame->format() == media::VideoFrame::YV12 ||
44 frame->format() == media::VideoFrame::I420 || 44 frame->format() == media::VideoFrame::I420 ||
45 frame->format() == media::VideoFrame::NATIVE_TEXTURE); 45 frame->format() == media::VideoFrame::NATIVE_TEXTURE);
46 scoped_refptr<media::VideoFrame> new_frame = 46 scoped_refptr<media::VideoFrame> new_frame =
47 media::VideoFrame::CreateFrame(media::VideoFrame::YV12, 47 media::VideoFrame::CreateFrame(media::VideoFrame::YV12,
48 frame->coded_size(), 48 frame->coded_size(),
49 frame->visible_rect(), 49 frame->visible_rect(),
50 frame->natural_size(), 50 frame->natural_size(),
51 frame->GetTimestamp()); 51 frame->timestamp());
52 52
53 if (frame->format() == media::VideoFrame::NATIVE_TEXTURE) { 53 if (frame->format() == media::VideoFrame::NATIVE_TEXTURE) {
54 SkBitmap bitmap; 54 SkBitmap bitmap;
55 bitmap.allocN32Pixels(frame->visible_rect().width(), 55 bitmap.allocN32Pixels(frame->visible_rect().width(),
56 frame->visible_rect().height()); 56 frame->visible_rect().height());
57 frame->ReadPixelsFromNativeTexture(bitmap); 57 frame->ReadPixelsFromNativeTexture(bitmap);
58 58
59 media::CopyRGBToVideoFrame( 59 media::CopyRGBToVideoFrame(
60 reinterpret_cast<uint8*>(bitmap.getPixels()), 60 reinterpret_cast<uint8*>(bitmap.getPixels()),
61 bitmap.rowBytes(), 61 bitmap.rowBytes(),
(...skipping 358 matching lines...) Expand 10 before | Expand all | Expand 10 after
420 GetClient()->setWebLayer(video_weblayer_.get()); 420 GetClient()->setWebLayer(video_weblayer_.get());
421 } 421 }
422 } 422 }
423 423
424 // Do not update |current_frame_| when paused. 424 // Do not update |current_frame_| when paused.
425 if (paused_) 425 if (paused_)
426 return; 426 return;
427 427
428 if (!sequence_started_) { 428 if (!sequence_started_) {
429 sequence_started_ = true; 429 sequence_started_ = true;
430 start_time_ = frame->GetTimestamp(); 430 start_time_ = frame->timestamp();
431 } 431 }
432 bool size_changed = !current_frame_.get() || 432 bool size_changed = !current_frame_.get() ||
433 current_frame_->natural_size() != frame->natural_size(); 433 current_frame_->natural_size() != frame->natural_size();
434 434
435 { 435 {
436 base::AutoLock auto_lock(current_frame_lock_); 436 base::AutoLock auto_lock(current_frame_lock_);
437 if (!current_frame_used_ && current_frame_.get()) 437 if (!current_frame_used_ && current_frame_.get())
438 ++dropped_frame_count_; 438 ++dropped_frame_count_;
439 current_frame_ = frame; 439 current_frame_ = frame;
440 current_time_ = frame->GetTimestamp() - start_time_; 440 current_time_ = frame->timestamp() - start_time_;
441 current_frame_used_ = false; 441 current_frame_used_ = false;
442 } 442 }
443 443
444 if (size_changed) 444 if (size_changed)
445 GetClient()->sizeChanged(); 445 GetClient()->sizeChanged();
446 446
447 GetClient()->repaint(); 447 GetClient()->repaint();
448 } 448 }
449 449
450 void WebMediaPlayerMS::RepaintInternal() { 450 void WebMediaPlayerMS::RepaintInternal() {
(...skipping 23 matching lines...) Expand all
474 GetClient()->readyStateChanged(); 474 GetClient()->readyStateChanged();
475 } 475 }
476 476
477 blink::WebMediaPlayerClient* WebMediaPlayerMS::GetClient() { 477 blink::WebMediaPlayerClient* WebMediaPlayerMS::GetClient() {
478 DCHECK(thread_checker_.CalledOnValidThread()); 478 DCHECK(thread_checker_.CalledOnValidThread());
479 DCHECK(client_); 479 DCHECK(client_);
480 return client_; 480 return client_;
481 } 481 }
482 482
483 } // namespace content 483 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698