| 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 1584 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1595 | 1595 |
| 1596 chunk_demuxer_ = new ChunkDemuxer( | 1596 chunk_demuxer_ = new ChunkDemuxer( |
| 1597 BIND_TO_RENDER_LOOP(&WebMediaPlayerImpl::OnDemuxerOpened), | 1597 BIND_TO_RENDER_LOOP(&WebMediaPlayerImpl::OnDemuxerOpened), |
| 1598 encrypted_media_init_data_cb, media_log_); | 1598 encrypted_media_init_data_cb, media_log_); |
| 1599 demuxer_.reset(chunk_demuxer_); | 1599 demuxer_.reset(chunk_demuxer_); |
| 1600 } | 1600 } |
| 1601 | 1601 |
| 1602 // TODO(sandersd): FileSystem objects may also be non-static, but due to our | 1602 // TODO(sandersd): FileSystem objects may also be non-static, but due to our |
| 1603 // caching layer such situations are broken already. http://crbug.com/593159 | 1603 // caching layer such situations are broken already. http://crbug.com/593159 |
| 1604 bool is_static = !chunk_demuxer_; | 1604 bool is_static = !chunk_demuxer_; |
| 1605 bool is_streaming = data_source_ && data_source_->IsStreaming(); |
| 1606 UMA_HISTOGRAM_BOOLEAN("Media.IsStreaming", is_streaming); |
| 1605 | 1607 |
| 1606 // ... and we're ready to go! | 1608 // ... and we're ready to go! |
| 1609 // TODO(sandersd): On Android, defer Start() if the tab is not visible. |
| 1607 seeking_ = true; | 1610 seeking_ = true; |
| 1608 | |
| 1609 // TODO(sandersd): On Android, defer Start() if the tab is not visible. | |
| 1610 bool is_streaming = data_source_ && data_source_->IsStreaming(); | |
| 1611 pipeline_controller_.Start(demuxer_.get(), this, is_streaming, is_static); | 1611 pipeline_controller_.Start(demuxer_.get(), this, is_streaming, is_static); |
| 1612 } | 1612 } |
| 1613 | 1613 |
| 1614 void WebMediaPlayerImpl::SetNetworkState(WebMediaPlayer::NetworkState state) { | 1614 void WebMediaPlayerImpl::SetNetworkState(WebMediaPlayer::NetworkState state) { |
| 1615 DVLOG(1) << __func__ << "(" << state << ")"; | 1615 DVLOG(1) << __func__ << "(" << state << ")"; |
| 1616 DCHECK(main_task_runner_->BelongsToCurrentThread()); | 1616 DCHECK(main_task_runner_->BelongsToCurrentThread()); |
| 1617 network_state_ = state; | 1617 network_state_ = state; |
| 1618 // Always notify to ensure client has the latest value. | 1618 // Always notify to ensure client has the latest value. |
| 1619 client_->networkStateChanged(); | 1619 client_->networkStateChanged(); |
| 1620 } | 1620 } |
| (...skipping 334 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1955 pipeline_metadata_.natural_size, | 1955 pipeline_metadata_.natural_size, |
| 1956 base::Bind(&GetCurrentTimeInternal, this))); | 1956 base::Bind(&GetCurrentTimeInternal, this))); |
| 1957 watch_time_reporter_->OnVolumeChange(volume_); | 1957 watch_time_reporter_->OnVolumeChange(volume_); |
| 1958 if (delegate_ && delegate_->IsHidden()) | 1958 if (delegate_ && delegate_->IsHidden()) |
| 1959 watch_time_reporter_->OnHidden(); | 1959 watch_time_reporter_->OnHidden(); |
| 1960 else | 1960 else |
| 1961 watch_time_reporter_->OnShown(); | 1961 watch_time_reporter_->OnShown(); |
| 1962 } | 1962 } |
| 1963 | 1963 |
| 1964 } // namespace media | 1964 } // namespace media |
| OLD | NEW |