OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_CODEC_PLAYER_H_ | 5 #ifndef MEDIA_BASE_ANDROID_MEDIA_CODEC_PLAYER_H_ |
6 #define MEDIA_BASE_ANDROID_MEDIA_CODEC_PLAYER_H_ | 6 #define MEDIA_BASE_ANDROID_MEDIA_CODEC_PLAYER_H_ |
7 | 7 |
8 #include "base/android/scoped_java_ref.h" | 8 #include "base/android/scoped_java_ref.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "base/memory/weak_ptr.h" | 10 #include "base/memory/weak_ptr.h" |
11 #include "base/threading/thread.h" | 11 #include "base/threading/thread.h" |
12 #include "base/time/default_tick_clock.h" | 12 #include "base/time/default_tick_clock.h" |
13 #include "media/base/android/demuxer_android.h" | 13 #include "media/base/android/demuxer_android.h" |
14 #include "media/base/android/media_drm_bridge.h" | 14 #include "media/base/android/media_drm_bridge.h" |
15 #include "media/base/android/media_player_android.h" | 15 #include "media/base/android/media_player_android.h" |
| 16 #include "media/base/android/media_statistics.h" |
16 #include "media/base/demuxer_stream.h" | 17 #include "media/base/demuxer_stream.h" |
17 #include "media/base/media_export.h" | 18 #include "media/base/media_export.h" |
18 #include "media/base/time_delta_interpolator.h" | 19 #include "media/base/time_delta_interpolator.h" |
19 #include "ui/gfx/geometry/size.h" | 20 #include "ui/gfx/geometry/size.h" |
20 #include "ui/gl/android/scoped_java_surface.h" | 21 #include "ui/gl/android/scoped_java_surface.h" |
21 | 22 |
22 // The MediaCodecPlayer class implements the media player by using Android's | 23 // The MediaCodecPlayer class implements the media player by using Android's |
23 // MediaCodec. It differs from MediaSourcePlayer in that it removes most | 24 // MediaCodec. It differs from MediaSourcePlayer in that it removes most |
24 // processing away from the UI thread: it uses a dedicated Media thread to | 25 // processing away from the UI thread: it uses a dedicated Media thread to |
25 // receive the data and to handle the commands. | 26 // receive the data and to handle the commands. |
(...skipping 376 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
402 int cdm_registration_id_; | 403 int cdm_registration_id_; |
403 | 404 |
404 // The flag is set when the player receives the error from decoder that the | 405 // The flag is set when the player receives the error from decoder that the |
405 // decoder needs a new decryption key. Cleared on starting the playback. | 406 // decoder needs a new decryption key. Cleared on starting the playback. |
406 bool key_is_required_; | 407 bool key_is_required_; |
407 | 408 |
408 // The flag is set after the new encryption key is added to MediaDrm. Cleared | 409 // The flag is set after the new encryption key is added to MediaDrm. Cleared |
409 // on starting the playback. | 410 // on starting the playback. |
410 bool key_is_added_; | 411 bool key_is_added_; |
411 | 412 |
| 413 // Gathers and reports playback quality statistics to UMA. |
| 414 // Use pointer to enable replacement of this object for tests. |
| 415 scoped_ptr<MediaStatistics> media_stat_; |
| 416 |
412 base::WeakPtr<MediaCodecPlayer> media_weak_this_; | 417 base::WeakPtr<MediaCodecPlayer> media_weak_this_; |
413 // NOTE: Weak pointers must be invalidated before all other member variables. | 418 // NOTE: Weak pointers must be invalidated before all other member variables. |
414 base::WeakPtrFactory<MediaCodecPlayer> media_weak_factory_; | 419 base::WeakPtrFactory<MediaCodecPlayer> media_weak_factory_; |
415 | 420 |
416 DISALLOW_COPY_AND_ASSIGN(MediaCodecPlayer); | 421 DISALLOW_COPY_AND_ASSIGN(MediaCodecPlayer); |
417 }; | 422 }; |
418 | 423 |
419 } // namespace media | 424 } // namespace media |
420 | 425 |
421 #endif // MEDIA_BASE_ANDROID_MEDIA_CODEC_PLAYER_H_ | 426 #endif // MEDIA_BASE_ANDROID_MEDIA_CODEC_PLAYER_H_ |
OLD | NEW |