| 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 <limits> | 7 #include <limits> |
| 8 | 8 |
| 9 #include "base/android/jni_android.h" | 9 #include "base/android/jni_android.h" |
| 10 #include "base/android/jni_string.h" | 10 #include "base/android/jni_string.h" |
| 11 #include "base/barrier_closure.h" | 11 #include "base/barrier_closure.h" |
| 12 #include "base/basictypes.h" | |
| 13 #include "base/bind.h" | 12 #include "base/bind.h" |
| 14 #include "base/bind_helpers.h" | 13 #include "base/bind_helpers.h" |
| 15 #include "base/callback_helpers.h" | 14 #include "base/callback_helpers.h" |
| 16 #include "base/logging.h" | 15 #include "base/logging.h" |
| 17 #include "base/strings/string_number_conversions.h" | 16 #include "base/strings/string_number_conversions.h" |
| 18 #include "base/trace_event/trace_event.h" | 17 #include "base/trace_event/trace_event.h" |
| 19 #include "media/base/android/audio_decoder_job.h" | 18 #include "media/base/android/audio_decoder_job.h" |
| 20 #include "media/base/android/media_player_manager.h" | 19 #include "media/base/android/media_player_manager.h" |
| 21 #include "media/base/android/video_decoder_job.h" | 20 #include "media/base/android/video_decoder_job.h" |
| 22 #include "media/base/bind_to_current_loop.h" | 21 #include "media/base/bind_to_current_loop.h" |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 110 doing_browser_seek_ = true; | 109 doing_browser_seek_ = true; |
| 111 ScheduleSeekEventAndStopDecoding(GetCurrentTime()); | 110 ScheduleSeekEventAndStopDecoding(GetCurrentTime()); |
| 112 } | 111 } |
| 113 | 112 |
| 114 bool MediaSourcePlayer::Seekable() { | 113 bool MediaSourcePlayer::Seekable() { |
| 115 // If the duration TimeDelta, converted to milliseconds from microseconds, | 114 // If the duration TimeDelta, converted to milliseconds from microseconds, |
| 116 // is >= 2^31, then the media is assumed to be unbounded and unseekable. | 115 // is >= 2^31, then the media is assumed to be unbounded and unseekable. |
| 117 // 2^31 is the bound due to java player using 32-bit integer for time | 116 // 2^31 is the bound due to java player using 32-bit integer for time |
| 118 // values at millisecond resolution. | 117 // values at millisecond resolution. |
| 119 return duration_ < | 118 return duration_ < |
| 120 base::TimeDelta::FromMilliseconds(std::numeric_limits<int32>::max()); | 119 base::TimeDelta::FromMilliseconds(std::numeric_limits<int32_t>::max()); |
| 121 } | 120 } |
| 122 | 121 |
| 123 void MediaSourcePlayer::Start() { | 122 void MediaSourcePlayer::Start() { |
| 124 DVLOG(1) << __FUNCTION__; | 123 DVLOG(1) << __FUNCTION__; |
| 125 | 124 |
| 126 playing_ = true; | 125 playing_ = true; |
| 127 | 126 |
| 128 StartInternal(); | 127 StartInternal(); |
| 129 } | 128 } |
| 130 | 129 |
| (...skipping 714 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 845 is_waiting_for_key_ = false; | 844 is_waiting_for_key_ = false; |
| 846 key_added_while_decode_pending_ = false; | 845 key_added_while_decode_pending_ = false; |
| 847 | 846 |
| 848 // StartInternal() will trigger a prefetch, where in most cases we'll just | 847 // StartInternal() will trigger a prefetch, where in most cases we'll just |
| 849 // use previously received data. | 848 // use previously received data. |
| 850 if (playing_) | 849 if (playing_) |
| 851 StartInternal(); | 850 StartInternal(); |
| 852 } | 851 } |
| 853 | 852 |
| 854 } // namespace media | 853 } // namespace media |
| OLD | NEW |