| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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/base/android/media_source_player.h" | 5 #include "media/base/android/media_source_player.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 #include <limits> | 9 #include <limits> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 64 base::Bind(&MediaSourcePlayer::OnDemuxerConfigsChanged, | 64 base::Bind(&MediaSourcePlayer::OnDemuxerConfigsChanged, |
| 65 weak_factory_.GetWeakPtr()))); | 65 weak_factory_.GetWeakPtr()))); |
| 66 video_decoder_job_.reset(new VideoDecoderJob( | 66 video_decoder_job_.reset(new VideoDecoderJob( |
| 67 base::Bind(&DemuxerAndroid::RequestDemuxerData, | 67 base::Bind(&DemuxerAndroid::RequestDemuxerData, |
| 68 base::Unretained(demuxer_.get()), | 68 base::Unretained(demuxer_.get()), |
| 69 DemuxerStream::VIDEO), | 69 DemuxerStream::VIDEO), |
| 70 base::Bind(&MediaSourcePlayer::OnDemuxerConfigsChanged, | 70 base::Bind(&MediaSourcePlayer::OnDemuxerConfigsChanged, |
| 71 weak_factory_.GetWeakPtr()))); | 71 weak_factory_.GetWeakPtr()))); |
| 72 | 72 |
| 73 demuxer_->Initialize(this); | 73 demuxer_->Initialize(this); |
| 74 interpolator_.SetPlaybackRate(1.0); |
| 74 interpolator_.SetUpperBound(base::TimeDelta()); | 75 interpolator_.SetUpperBound(base::TimeDelta()); |
| 75 weak_this_ = weak_factory_.GetWeakPtr(); | 76 weak_this_ = weak_factory_.GetWeakPtr(); |
| 76 } | 77 } |
| 77 | 78 |
| 78 MediaSourcePlayer::~MediaSourcePlayer() { | 79 MediaSourcePlayer::~MediaSourcePlayer() { |
| 79 Release(); | 80 Release(); |
| 80 DCHECK_EQ(!cdm_, !cdm_registration_id_); | 81 DCHECK_EQ(!cdm_, !cdm_registration_id_); |
| 81 if (cdm_) { | 82 if (cdm_) { |
| 82 // Cancel previously registered callback (if any). | 83 // Cancel previously registered callback (if any). |
| 83 static_cast<MediaDrmBridge*>(cdm_.get()) | 84 static_cast<MediaDrmBridge*>(cdm_.get()) |
| (...skipping 773 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 857 is_waiting_for_key_ = false; | 858 is_waiting_for_key_ = false; |
| 858 key_added_while_decode_pending_ = false; | 859 key_added_while_decode_pending_ = false; |
| 859 | 860 |
| 860 // StartInternal() will trigger a prefetch, where in most cases we'll just | 861 // StartInternal() will trigger a prefetch, where in most cases we'll just |
| 861 // use previously received data. | 862 // use previously received data. |
| 862 if (playing_) | 863 if (playing_) |
| 863 StartInternal(); | 864 StartInternal(); |
| 864 } | 865 } |
| 865 | 866 |
| 866 } // namespace media | 867 } // namespace media |
| OLD | NEW |