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