OLD | NEW |
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 "media/blink/webmediaplayer_impl.h" | 5 #include "media/blink/webmediaplayer_impl.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <cmath> | 8 #include <cmath> |
9 #include <limits> | 9 #include <limits> |
10 | 10 |
(...skipping 759 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
770 | 770 |
771 pipeline_metadata_ = metadata; | 771 pipeline_metadata_ = metadata; |
772 | 772 |
773 UMA_HISTOGRAM_ENUMERATION("Media.VideoRotation", metadata.video_rotation, | 773 UMA_HISTOGRAM_ENUMERATION("Media.VideoRotation", metadata.video_rotation, |
774 VIDEO_ROTATION_MAX + 1); | 774 VIDEO_ROTATION_MAX + 1); |
775 SetReadyState(WebMediaPlayer::ReadyStateHaveMetadata); | 775 SetReadyState(WebMediaPlayer::ReadyStateHaveMetadata); |
776 | 776 |
777 if (hasVideo()) { | 777 if (hasVideo()) { |
778 DCHECK(!video_weblayer_); | 778 DCHECK(!video_weblayer_); |
779 scoped_refptr<cc::VideoLayer> layer = | 779 scoped_refptr<cc::VideoLayer> layer = |
780 cc::VideoLayer::Create(compositor_, pipeline_metadata_.video_rotation); | 780 cc::VideoLayer::Create(cc_blink::WebLayerImpl::LayerSettings(), |
| 781 compositor_, pipeline_metadata_.video_rotation); |
781 | 782 |
782 if (pipeline_metadata_.video_rotation == VIDEO_ROTATION_90 || | 783 if (pipeline_metadata_.video_rotation == VIDEO_ROTATION_90 || |
783 pipeline_metadata_.video_rotation == VIDEO_ROTATION_270) { | 784 pipeline_metadata_.video_rotation == VIDEO_ROTATION_270) { |
784 gfx::Size size = pipeline_metadata_.natural_size; | 785 gfx::Size size = pipeline_metadata_.natural_size; |
785 pipeline_metadata_.natural_size = gfx::Size(size.height(), size.width()); | 786 pipeline_metadata_.natural_size = gfx::Size(size.height(), size.width()); |
786 } | 787 } |
787 | 788 |
788 video_weblayer_.reset(new cc_blink::WebLayerImpl(layer)); | 789 video_weblayer_.reset(new cc_blink::WebLayerImpl(layer)); |
789 video_weblayer_->setOpaque(opaque_); | 790 video_weblayer_->setOpaque(opaque_); |
790 client_->setWebLayer(video_weblayer_.get()); | 791 client_->setWebLayer(video_weblayer_.get()); |
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1010 | 1011 |
1011 // pause() may be called after playback has ended and the HTMLMediaElement | 1012 // pause() may be called after playback has ended and the HTMLMediaElement |
1012 // requires that currentTime() == duration() after ending. We want to ensure | 1013 // requires that currentTime() == duration() after ending. We want to ensure |
1013 // |paused_time_| matches currentTime() in this case or a future seek() may | 1014 // |paused_time_| matches currentTime() in this case or a future seek() may |
1014 // incorrectly discard what it thinks is a seek to the existing time. | 1015 // incorrectly discard what it thinks is a seek to the existing time. |
1015 paused_time_ = | 1016 paused_time_ = |
1016 ended_ ? pipeline_.GetMediaDuration() : pipeline_.GetMediaTime(); | 1017 ended_ ? pipeline_.GetMediaDuration() : pipeline_.GetMediaTime(); |
1017 } | 1018 } |
1018 | 1019 |
1019 } // namespace media | 1020 } // namespace media |
OLD | NEW |