| 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 <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "base/android/scoped_java_ref.h" | 10 #include "base/android/scoped_java_ref.h" |
| (...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 194 std::unique_ptr<DemuxerAndroid> demuxer, | 194 std::unique_ptr<DemuxerAndroid> demuxer, |
| 195 const GURL& frame_url, | 195 const GURL& frame_url, |
| 196 int media_session_id); | 196 int media_session_id); |
| 197 ~MediaCodecPlayer() override; | 197 ~MediaCodecPlayer() override; |
| 198 | 198 |
| 199 // A helper method that performs the media thread part of initialization. | 199 // A helper method that performs the media thread part of initialization. |
| 200 void Initialize(); | 200 void Initialize(); |
| 201 | 201 |
| 202 // MediaPlayerAndroid implementation. | 202 // MediaPlayerAndroid implementation. |
| 203 void DeleteOnCorrectThread() override; | 203 void DeleteOnCorrectThread() override; |
| 204 void SetVideoSurface(gfx::ScopedJavaSurface surface) override; | 204 void SetVideoSurface(gl::ScopedJavaSurface surface) override; |
| 205 void Start() override; | 205 void Start() override; |
| 206 void Pause(bool is_media_related_action) override; | 206 void Pause(bool is_media_related_action) override; |
| 207 void SeekTo(base::TimeDelta timestamp) override; | 207 void SeekTo(base::TimeDelta timestamp) override; |
| 208 void Release() override; | 208 void Release() override; |
| 209 bool HasVideo() const override; | 209 bool HasVideo() const override; |
| 210 bool HasAudio() const override; | 210 bool HasAudio() const override; |
| 211 int GetVideoWidth() override; | 211 int GetVideoWidth() override; |
| 212 int GetVideoHeight() override; | 212 int GetVideoHeight() override; |
| 213 base::TimeDelta GetCurrentTime() override; | 213 base::TimeDelta GetCurrentTime() override; |
| 214 base::TimeDelta GetDuration() override; | 214 base::TimeDelta GetDuration() override; |
| (...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 375 base::TimeDelta duration_; | 375 base::TimeDelta duration_; |
| 376 | 376 |
| 377 // base::TickClock used by |interpolator_|. | 377 // base::TickClock used by |interpolator_|. |
| 378 base::DefaultTickClock default_tick_clock_; | 378 base::DefaultTickClock default_tick_clock_; |
| 379 | 379 |
| 380 // Tracks the most recent media time update and provides interpolated values | 380 // Tracks the most recent media time update and provides interpolated values |
| 381 // as playback progresses. | 381 // as playback progresses. |
| 382 TimeDeltaInterpolator interpolator_; | 382 TimeDeltaInterpolator interpolator_; |
| 383 | 383 |
| 384 // Pending data to be picked up by the upcoming state. | 384 // Pending data to be picked up by the upcoming state. |
| 385 gfx::ScopedJavaSurface pending_surface_; | 385 gl::ScopedJavaSurface pending_surface_; |
| 386 bool pending_start_; | 386 bool pending_start_; |
| 387 base::TimeDelta pending_seek_; | 387 base::TimeDelta pending_seek_; |
| 388 | 388 |
| 389 // Data associated with a seek in progress. | 389 // Data associated with a seek in progress. |
| 390 std::unique_ptr<SeekInfo> seek_info_; | 390 std::unique_ptr<SeekInfo> seek_info_; |
| 391 | 391 |
| 392 // Configuration data for the manager, accessed on the UI thread. | 392 // Configuration data for the manager, accessed on the UI thread. |
| 393 MediaMetadata metadata_cache_; | 393 MediaMetadata metadata_cache_; |
| 394 | 394 |
| 395 // Cached current time, accessed on UI thread. | 395 // Cached current time, accessed on UI thread. |
| (...skipping 24 matching lines...) Expand all Loading... |
| 420 base::WeakPtr<MediaCodecPlayer> media_weak_this_; | 420 base::WeakPtr<MediaCodecPlayer> media_weak_this_; |
| 421 // NOTE: Weak pointers must be invalidated before all other member variables. | 421 // NOTE: Weak pointers must be invalidated before all other member variables. |
| 422 base::WeakPtrFactory<MediaCodecPlayer> media_weak_factory_; | 422 base::WeakPtrFactory<MediaCodecPlayer> media_weak_factory_; |
| 423 | 423 |
| 424 DISALLOW_COPY_AND_ASSIGN(MediaCodecPlayer); | 424 DISALLOW_COPY_AND_ASSIGN(MediaCodecPlayer); |
| 425 }; | 425 }; |
| 426 | 426 |
| 427 } // namespace media | 427 } // namespace media |
| 428 | 428 |
| 429 #endif // MEDIA_BASE_ANDROID_MEDIA_CODEC_PLAYER_H_ | 429 #endif // MEDIA_BASE_ANDROID_MEDIA_CODEC_PLAYER_H_ |
| OLD | NEW |