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 "content/renderer/media/webmediaplayer_impl.h" | 5 #include "content/renderer/media/webmediaplayer_impl.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <limits> | 8 #include <limits> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 949 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
960 void WebMediaPlayerImpl::OnPipelineMetadata( | 960 void WebMediaPlayerImpl::OnPipelineMetadata( |
961 media::PipelineMetadata metadata) { | 961 media::PipelineMetadata metadata) { |
962 DVLOG(1) << __FUNCTION__; | 962 DVLOG(1) << __FUNCTION__; |
963 | 963 |
964 pipeline_metadata_ = metadata; | 964 pipeline_metadata_ = metadata; |
965 | 965 |
966 SetReadyState(WebMediaPlayer::ReadyStateHaveMetadata); | 966 SetReadyState(WebMediaPlayer::ReadyStateHaveMetadata); |
967 | 967 |
968 if (hasVideo()) { | 968 if (hasVideo()) { |
969 DCHECK(!video_weblayer_); | 969 DCHECK(!video_weblayer_); |
970 video_weblayer_.reset( | 970 scoped_refptr<cc::VideoLayer> layer = cc::VideoLayer::Create(compositor_); |
971 new WebLayerImpl(cc::VideoLayer::Create(compositor_))); | 971 |
| 972 if (pipeline_metadata_.video_rotation == media::VIDEO_ROTATION_90 || |
| 973 pipeline_metadata_.video_rotation == media::VIDEO_ROTATION_270) { |
| 974 gfx::Size size = pipeline_metadata_.natural_size; |
| 975 pipeline_metadata_.natural_size = gfx::Size(size.height(), size.width()); |
| 976 } |
| 977 |
| 978 layer->set_video_rotation(pipeline_metadata_.video_rotation); |
| 979 video_weblayer_.reset(new WebLayerImpl(layer)); |
972 video_weblayer_->setOpaque(opaque_); | 980 video_weblayer_->setOpaque(opaque_); |
973 client_->setWebLayer(video_weblayer_.get()); | 981 client_->setWebLayer(video_weblayer_.get()); |
974 } | 982 } |
975 | 983 |
976 // TODO(scherkus): This should be handled by HTMLMediaElement and controls | 984 // TODO(scherkus): This should be handled by HTMLMediaElement and controls |
977 // should know when to invalidate themselves http://crbug.com/337015 | 985 // should know when to invalidate themselves http://crbug.com/337015 |
978 InvalidateOnMainThread(); | 986 InvalidateOnMainThread(); |
979 } | 987 } |
980 | 988 |
981 void WebMediaPlayerImpl::OnPipelineBufferingStateChanged( | 989 void WebMediaPlayerImpl::OnPipelineBufferingStateChanged( |
(...skipping 376 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1358 compositor_task_runner_->PostTask(FROM_HERE, | 1366 compositor_task_runner_->PostTask(FROM_HERE, |
1359 base::Bind(&GetCurrentFrameAndSignal, | 1367 base::Bind(&GetCurrentFrameAndSignal, |
1360 base::Unretained(compositor_), | 1368 base::Unretained(compositor_), |
1361 &video_frame, | 1369 &video_frame, |
1362 &event)); | 1370 &event)); |
1363 event.Wait(); | 1371 event.Wait(); |
1364 return video_frame; | 1372 return video_frame; |
1365 } | 1373 } |
1366 | 1374 |
1367 } // namespace content | 1375 } // namespace content |
OLD | NEW |