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 963 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
974 | 974 |
975 switch (buffering_state) { | 975 switch (buffering_state) { |
976 case media::Pipeline::kHaveMetadata: | 976 case media::Pipeline::kHaveMetadata: |
977 // TODO(scherkus): Would be better to have a metadata changed callback | 977 // TODO(scherkus): Would be better to have a metadata changed callback |
978 // that contained the size information as well whether audio/video is | 978 // that contained the size information as well whether audio/video is |
979 // present. Doing so would let us remove more methods off Pipeline. | 979 // present. Doing so would let us remove more methods off Pipeline. |
980 natural_size_ = pipeline_.GetInitialNaturalSize(); | 980 natural_size_ = pipeline_.GetInitialNaturalSize(); |
981 | 981 |
982 SetReadyState(WebMediaPlayer::ReadyStateHaveMetadata); | 982 SetReadyState(WebMediaPlayer::ReadyStateHaveMetadata); |
983 | 983 |
984 if (hasVideo() && client_->needsWebLayerForVideo()) { | 984 if (hasVideo()) { |
985 DCHECK(!video_weblayer_); | 985 DCHECK(!video_weblayer_); |
986 video_weblayer_.reset( | 986 video_weblayer_.reset( |
987 new webkit::WebLayerImpl(cc::VideoLayer::Create(this))); | 987 new webkit::WebLayerImpl(cc::VideoLayer::Create(this))); |
988 client_->setWebLayer(video_weblayer_.get()); | 988 client_->setWebLayer(video_weblayer_.get()); |
989 } | 989 } |
990 break; | 990 break; |
991 case media::Pipeline::kPrerollCompleted: | 991 case media::Pipeline::kPrerollCompleted: |
992 // Only transition to ReadyStateHaveEnoughData if we don't have | 992 // Only transition to ReadyStateHaveEnoughData if we don't have |
993 // any pending seeks because the transition can cause Blink to | 993 // any pending seeks because the transition can cause Blink to |
994 // report that the most recent seek has completed. | 994 // report that the most recent seek has completed. |
(...skipping 328 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1323 | 1323 |
1324 if (web_cdm_) { | 1324 if (web_cdm_) { |
1325 decryptor_ready_cb.Run(web_cdm_->GetDecryptor()); | 1325 decryptor_ready_cb.Run(web_cdm_->GetDecryptor()); |
1326 return; | 1326 return; |
1327 } | 1327 } |
1328 | 1328 |
1329 decryptor_ready_cb_ = decryptor_ready_cb; | 1329 decryptor_ready_cb_ = decryptor_ready_cb; |
1330 } | 1330 } |
1331 | 1331 |
1332 } // namespace content | 1332 } // namespace content |
OLD | NEW |