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 21 matching lines...) Expand all Loading... |
32 class AudioDecoderJob; | 32 class AudioDecoderJob; |
33 class VideoDecoderJob; | 33 class VideoDecoderJob; |
34 | 34 |
35 // This class handles media source extensions on Android. It uses Android | 35 // This class handles media source extensions on Android. It uses Android |
36 // MediaCodec to decode audio and video streams in two separate threads. | 36 // MediaCodec to decode audio and video streams in two separate threads. |
37 class MEDIA_EXPORT MediaSourcePlayer : public MediaPlayerAndroid, | 37 class MEDIA_EXPORT MediaSourcePlayer : public MediaPlayerAndroid, |
38 public DemuxerAndroidClient { | 38 public DemuxerAndroidClient { |
39 public: | 39 public: |
40 // Constructs a player with the given ID and demuxer. |manager| must outlive | 40 // Constructs a player with the given ID and demuxer. |manager| must outlive |
41 // the lifetime of this object. | 41 // the lifetime of this object. |
42 MediaSourcePlayer(int player_id, | 42 MediaSourcePlayer( |
43 MediaPlayerManager* manager, | 43 int player_id, |
44 const RequestMediaResourcesCB& request_media_resources_cb, | 44 MediaPlayerManager* manager, |
45 scoped_ptr<DemuxerAndroid> demuxer, | 45 const OnDecoderResourcesReleasedCB& on_decoder_resources_released_cb, |
46 const GURL& frame_url); | 46 scoped_ptr<DemuxerAndroid> demuxer, |
| 47 const GURL& frame_url); |
47 ~MediaSourcePlayer() override; | 48 ~MediaSourcePlayer() override; |
48 | 49 |
49 // MediaPlayerAndroid implementation. | 50 // MediaPlayerAndroid implementation. |
50 void SetVideoSurface(gfx::ScopedJavaSurface surface) override; | 51 void SetVideoSurface(gfx::ScopedJavaSurface surface) override; |
51 void Start() override; | 52 void Start() override; |
52 void Pause(bool is_media_related_action) override; | 53 void Pause(bool is_media_related_action) override; |
53 void SeekTo(base::TimeDelta timestamp) override; | 54 void SeekTo(base::TimeDelta timestamp) override; |
54 void Release() override; | 55 void Release() override; |
55 void SetVolume(double volume) override; | 56 void SetVolume(double volume) override; |
56 int GetVideoWidth() override; | 57 int GetVideoWidth() override; |
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
277 base::WeakPtr<MediaSourcePlayer> weak_this_; | 278 base::WeakPtr<MediaSourcePlayer> weak_this_; |
278 // NOTE: Weak pointers must be invalidated before all other member variables. | 279 // NOTE: Weak pointers must be invalidated before all other member variables. |
279 base::WeakPtrFactory<MediaSourcePlayer> weak_factory_; | 280 base::WeakPtrFactory<MediaSourcePlayer> weak_factory_; |
280 | 281 |
281 DISALLOW_COPY_AND_ASSIGN(MediaSourcePlayer); | 282 DISALLOW_COPY_AND_ASSIGN(MediaSourcePlayer); |
282 }; | 283 }; |
283 | 284 |
284 } // namespace media | 285 } // namespace media |
285 | 286 |
286 #endif // MEDIA_BASE_ANDROID_MEDIA_SOURCE_PLAYER_H_ | 287 #endif // MEDIA_BASE_ANDROID_MEDIA_SOURCE_PLAYER_H_ |
OLD | NEW |