| 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 #ifndef MEDIA_BASE_ANDROID_MEDIA_SOURCE_PLAYER_H_ | 5 #ifndef MEDIA_BASE_ANDROID_MEDIA_SOURCE_PLAYER_H_ |
| 6 #define MEDIA_BASE_ANDROID_MEDIA_SOURCE_PLAYER_H_ | 6 #define MEDIA_BASE_ANDROID_MEDIA_SOURCE_PLAYER_H_ |
| 7 | 7 |
| 8 #include <jni.h> | 8 #include <jni.h> |
| 9 #include <map> | 9 #include <map> |
| 10 #include <string> | 10 #include <string> |
| 11 #include <vector> | 11 #include <vector> |
| 12 | 12 |
| 13 #include "base/android/scoped_java_ref.h" | 13 #include "base/android/scoped_java_ref.h" |
| 14 #include "base/callback.h" | 14 #include "base/callback.h" |
| 15 #include "base/cancelable_callback.h" | 15 #include "base/cancelable_callback.h" |
| 16 #include "base/memory/scoped_ptr.h" | 16 #include "base/memory/scoped_ptr.h" |
| 17 #include "base/memory/weak_ptr.h" | 17 #include "base/memory/weak_ptr.h" |
| 18 #include "base/threading/thread.h" | 18 #include "base/threading/thread.h" |
| 19 #include "base/time/default_tick_clock.h" | 19 #include "base/time/default_tick_clock.h" |
| 20 #include "base/time/time.h" | 20 #include "base/time/time.h" |
| 21 #include "media/base/android/demuxer_android.h" | 21 #include "media/base/android/demuxer_android.h" |
| 22 #include "media/base/android/media_codec_bridge.h" | 22 #include "media/base/android/media_codec_bridge.h" |
| 23 #include "media/base/android/media_decoder_job.h" | 23 #include "media/base/android/media_decoder_job.h" |
| 24 #include "media/base/android/media_drm_bridge.h" | 24 #include "media/base/android/media_drm_bridge.h" |
| 25 #include "media/base/android/media_player_android.h" | 25 #include "media/base/android/media_player_android.h" |
| 26 #include "media/base/android/media_statistics.h" |
| 26 #include "media/base/media_export.h" | 27 #include "media/base/media_export.h" |
| 27 #include "media/base/time_delta_interpolator.h" | 28 #include "media/base/time_delta_interpolator.h" |
| 28 | 29 |
| 29 namespace media { | 30 namespace media { |
| 30 | 31 |
| 31 class AudioDecoderJob; | 32 class AudioDecoderJob; |
| 32 class VideoDecoderJob; | 33 class VideoDecoderJob; |
| 33 | 34 |
| 34 // This class handles media source extensions on Android. It uses Android | 35 // This class handles media source extensions on Android. It uses Android |
| 35 // MediaCodec to decode audio and video streams in two separate threads. | 36 // MediaCodec to decode audio and video streams in two separate threads. |
| (...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 261 // not added. | 262 // not added. |
| 262 bool is_waiting_for_audio_decoder_; | 263 bool is_waiting_for_audio_decoder_; |
| 263 bool is_waiting_for_video_decoder_; | 264 bool is_waiting_for_video_decoder_; |
| 264 | 265 |
| 265 // Test-only callback for hooking the completion of the next decode cycle. | 266 // Test-only callback for hooking the completion of the next decode cycle. |
| 266 base::Closure decode_callback_for_testing_; | 267 base::Closure decode_callback_for_testing_; |
| 267 | 268 |
| 268 // Whether audio or video decoder is in the process of prerolling. | 269 // Whether audio or video decoder is in the process of prerolling. |
| 269 bool prerolling_; | 270 bool prerolling_; |
| 270 | 271 |
| 272 // Gathers and reports playback quality statistics to UMA. |
| 273 // Use pointer to enable replacement of this object for tests. |
| 274 scoped_ptr<MediaStatistics> media_stat_; |
| 275 |
| 271 // Weak pointer passed to media decoder jobs for callbacks. | 276 // Weak pointer passed to media decoder jobs for callbacks. |
| 272 base::WeakPtr<MediaSourcePlayer> weak_this_; | 277 base::WeakPtr<MediaSourcePlayer> weak_this_; |
| 273 // NOTE: Weak pointers must be invalidated before all other member variables. | 278 // NOTE: Weak pointers must be invalidated before all other member variables. |
| 274 base::WeakPtrFactory<MediaSourcePlayer> weak_factory_; | 279 base::WeakPtrFactory<MediaSourcePlayer> weak_factory_; |
| 275 | 280 |
| 276 DISALLOW_COPY_AND_ASSIGN(MediaSourcePlayer); | 281 DISALLOW_COPY_AND_ASSIGN(MediaSourcePlayer); |
| 277 }; | 282 }; |
| 278 | 283 |
| 279 } // namespace media | 284 } // namespace media |
| 280 | 285 |
| 281 #endif // MEDIA_BASE_ANDROID_MEDIA_SOURCE_PLAYER_H_ | 286 #endif // MEDIA_BASE_ANDROID_MEDIA_SOURCE_PLAYER_H_ |
| OLD | NEW |