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> |
(...skipping 28 matching lines...) Expand all Loading... |
39 // Constructs a player with the given ID and demuxer. |manager| must outlive | 39 // Constructs a player with the given ID and demuxer. |manager| must outlive |
40 // the lifetime of this object. | 40 // the lifetime of this object. |
41 MediaSourcePlayer(int player_id, | 41 MediaSourcePlayer(int player_id, |
42 MediaPlayerManager* manager, | 42 MediaPlayerManager* manager, |
43 const RequestMediaResourcesCB& request_media_resources_cb, | 43 const RequestMediaResourcesCB& request_media_resources_cb, |
44 scoped_ptr<DemuxerAndroid> demuxer, | 44 scoped_ptr<DemuxerAndroid> demuxer, |
45 const GURL& frame_url); | 45 const GURL& frame_url); |
46 virtual ~MediaSourcePlayer(); | 46 virtual ~MediaSourcePlayer(); |
47 | 47 |
48 // MediaPlayerAndroid implementation. | 48 // MediaPlayerAndroid implementation. |
49 virtual void SetVideoSurface(gfx::ScopedJavaSurface surface) OVERRIDE; | 49 virtual void SetVideoSurface(gfx::ScopedJavaSurface surface) override; |
50 virtual void Start() OVERRIDE; | 50 virtual void Start() override; |
51 virtual void Pause(bool is_media_related_action ALLOW_UNUSED) OVERRIDE; | 51 virtual void Pause(bool is_media_related_action ALLOW_UNUSED) override; |
52 virtual void SeekTo(base::TimeDelta timestamp) OVERRIDE; | 52 virtual void SeekTo(base::TimeDelta timestamp) override; |
53 virtual void Release() OVERRIDE; | 53 virtual void Release() override; |
54 virtual void SetVolume(double volume) OVERRIDE; | 54 virtual void SetVolume(double volume) override; |
55 virtual int GetVideoWidth() OVERRIDE; | 55 virtual int GetVideoWidth() override; |
56 virtual int GetVideoHeight() OVERRIDE; | 56 virtual int GetVideoHeight() override; |
57 virtual base::TimeDelta GetCurrentTime() OVERRIDE; | 57 virtual base::TimeDelta GetCurrentTime() override; |
58 virtual base::TimeDelta GetDuration() OVERRIDE; | 58 virtual base::TimeDelta GetDuration() override; |
59 virtual bool IsPlaying() OVERRIDE; | 59 virtual bool IsPlaying() override; |
60 virtual bool CanPause() OVERRIDE; | 60 virtual bool CanPause() override; |
61 virtual bool CanSeekForward() OVERRIDE; | 61 virtual bool CanSeekForward() override; |
62 virtual bool CanSeekBackward() OVERRIDE; | 62 virtual bool CanSeekBackward() override; |
63 virtual bool IsPlayerReady() OVERRIDE; | 63 virtual bool IsPlayerReady() override; |
64 virtual void SetCdm(BrowserCdm* cdm) OVERRIDE; | 64 virtual void SetCdm(BrowserCdm* cdm) override; |
65 virtual bool IsSurfaceInUse() const OVERRIDE; | 65 virtual bool IsSurfaceInUse() const override; |
66 | 66 |
67 // DemuxerAndroidClient implementation. | 67 // DemuxerAndroidClient implementation. |
68 virtual void OnDemuxerConfigsAvailable(const DemuxerConfigs& params) OVERRIDE; | 68 virtual void OnDemuxerConfigsAvailable(const DemuxerConfigs& params) override; |
69 virtual void OnDemuxerDataAvailable(const DemuxerData& params) OVERRIDE; | 69 virtual void OnDemuxerDataAvailable(const DemuxerData& params) override; |
70 virtual void OnDemuxerSeekDone( | 70 virtual void OnDemuxerSeekDone( |
71 base::TimeDelta actual_browser_seek_time) OVERRIDE; | 71 base::TimeDelta actual_browser_seek_time) override; |
72 virtual void OnDemuxerDurationChanged(base::TimeDelta duration) OVERRIDE; | 72 virtual void OnDemuxerDurationChanged(base::TimeDelta duration) override; |
73 | 73 |
74 private: | 74 private: |
75 friend class MediaSourcePlayerTest; | 75 friend class MediaSourcePlayerTest; |
76 | 76 |
77 // Update the current timestamp. | 77 // Update the current timestamp. |
78 void UpdateTimestamps(base::TimeDelta current_presentation_timestamp, | 78 void UpdateTimestamps(base::TimeDelta current_presentation_timestamp, |
79 base::TimeDelta max_presentation_timestamp); | 79 base::TimeDelta max_presentation_timestamp); |
80 | 80 |
81 // Helper function for starting media playback. | 81 // Helper function for starting media playback. |
82 void StartInternal(); | 82 void StartInternal(); |
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
267 // NOTE: Weak pointers must be invalidated before all other member variables. | 267 // NOTE: Weak pointers must be invalidated before all other member variables. |
268 base::WeakPtrFactory<MediaSourcePlayer> weak_factory_; | 268 base::WeakPtrFactory<MediaSourcePlayer> weak_factory_; |
269 base::WeakPtr<MediaSourcePlayer> weak_this_; | 269 base::WeakPtr<MediaSourcePlayer> weak_this_; |
270 | 270 |
271 DISALLOW_COPY_AND_ASSIGN(MediaSourcePlayer); | 271 DISALLOW_COPY_AND_ASSIGN(MediaSourcePlayer); |
272 }; | 272 }; |
273 | 273 |
274 } // namespace media | 274 } // namespace media |
275 | 275 |
276 #endif // MEDIA_BASE_ANDROID_MEDIA_SOURCE_PLAYER_H_ | 276 #endif // MEDIA_BASE_ANDROID_MEDIA_SOURCE_PLAYER_H_ |
OLD | NEW |