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 20 matching lines...) Expand all Loading... |
31 class AudioDecoderJob; | 31 class AudioDecoderJob; |
32 class VideoDecoderJob; | 32 class VideoDecoderJob; |
33 | 33 |
34 // This class handles media source extensions on Android. It uses Android | 34 // This class handles media source extensions on Android. It uses Android |
35 // MediaCodec to decode audio and video streams in two separate threads. | 35 // MediaCodec to decode audio and video streams in two separate threads. |
36 class MEDIA_EXPORT MediaSourcePlayer : public MediaPlayerAndroid, | 36 class MEDIA_EXPORT MediaSourcePlayer : public MediaPlayerAndroid, |
37 public DemuxerAndroidClient { | 37 public DemuxerAndroidClient { |
38 public: | 38 public: |
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( |
42 MediaPlayerManager* manager, | 42 int player_id, |
43 const RequestMediaResourcesCB& request_media_resources_cb, | 43 MediaPlayerManager* manager, |
44 scoped_ptr<DemuxerAndroid> demuxer, | 44 const OnPlayerReleasedCB& on_player_released_cb, |
45 const GURL& frame_url); | 45 scoped_ptr<DemuxerAndroid> demuxer, |
| 46 const GURL& frame_url); |
46 ~MediaSourcePlayer() override; | 47 ~MediaSourcePlayer() override; |
47 | 48 |
48 // MediaPlayerAndroid implementation. | 49 // MediaPlayerAndroid implementation. |
49 void SetVideoSurface(gfx::ScopedJavaSurface surface) override; | 50 void SetVideoSurface(gfx::ScopedJavaSurface surface) override; |
50 void Start() override; | 51 void Start() override; |
51 void Pause(bool is_media_related_action) override; | 52 void Pause(bool is_media_related_action) override; |
52 void SeekTo(base::TimeDelta timestamp) override; | 53 void SeekTo(base::TimeDelta timestamp) override; |
53 void Release() override; | 54 void Release() override; |
54 void SetVolume(double volume) override; | 55 void SetVolume(double volume) override; |
55 int GetVideoWidth() override; | 56 int GetVideoWidth() override; |
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
271 base::WeakPtr<MediaSourcePlayer> weak_this_; | 272 base::WeakPtr<MediaSourcePlayer> weak_this_; |
272 // NOTE: Weak pointers must be invalidated before all other member variables. | 273 // NOTE: Weak pointers must be invalidated before all other member variables. |
273 base::WeakPtrFactory<MediaSourcePlayer> weak_factory_; | 274 base::WeakPtrFactory<MediaSourcePlayer> weak_factory_; |
274 | 275 |
275 DISALLOW_COPY_AND_ASSIGN(MediaSourcePlayer); | 276 DISALLOW_COPY_AND_ASSIGN(MediaSourcePlayer); |
276 }; | 277 }; |
277 | 278 |
278 } // namespace media | 279 } // namespace media |
279 | 280 |
280 #endif // MEDIA_BASE_ANDROID_MEDIA_SOURCE_PLAYER_H_ | 281 #endif // MEDIA_BASE_ANDROID_MEDIA_SOURCE_PLAYER_H_ |
OLD | NEW |