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 24 matching lines...) Expand all Loading... |
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(int player_id, |
42 MediaPlayerManager* manager, | 42 MediaPlayerManager* manager, |
43 const RequestMediaResourcesCB& request_media_resources_cb, | 43 const RequestMediaResourcesCB& request_media_resources_cb, |
44 const ReleaseMediaResourcesCB& release_media_resources_cb, | 44 const ReleaseMediaResourcesCB& release_media_resources_cb, |
45 scoped_ptr<DemuxerAndroid> demuxer); | 45 scoped_ptr<DemuxerAndroid> demuxer, |
| 46 const GURL& frame_url); |
46 virtual ~MediaSourcePlayer(); | 47 virtual ~MediaSourcePlayer(); |
47 | 48 |
48 // MediaPlayerAndroid implementation. | 49 // MediaPlayerAndroid implementation. |
49 virtual void SetVideoSurface(gfx::ScopedJavaSurface surface) OVERRIDE; | 50 virtual void SetVideoSurface(gfx::ScopedJavaSurface surface) OVERRIDE; |
50 virtual void Start() OVERRIDE; | 51 virtual void Start() OVERRIDE; |
51 virtual void Pause(bool is_media_related_action ALLOW_UNUSED) OVERRIDE; | 52 virtual void Pause(bool is_media_related_action ALLOW_UNUSED) OVERRIDE; |
52 virtual void SeekTo(base::TimeDelta timestamp) OVERRIDE; | 53 virtual void SeekTo(base::TimeDelta timestamp) OVERRIDE; |
53 virtual void Release() OVERRIDE; | 54 virtual void Release() OVERRIDE; |
54 virtual void SetVolume(double volume) OVERRIDE; | 55 virtual void SetVolume(double volume) OVERRIDE; |
55 virtual int GetVideoWidth() OVERRIDE; | 56 virtual int GetVideoWidth() OVERRIDE; |
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
264 // NOTE: Weak pointers must be invalidated before all other member variables. | 265 // NOTE: Weak pointers must be invalidated before all other member variables. |
265 base::WeakPtrFactory<MediaSourcePlayer> weak_factory_; | 266 base::WeakPtrFactory<MediaSourcePlayer> weak_factory_; |
266 base::WeakPtr<MediaSourcePlayer> weak_this_; | 267 base::WeakPtr<MediaSourcePlayer> weak_this_; |
267 | 268 |
268 DISALLOW_COPY_AND_ASSIGN(MediaSourcePlayer); | 269 DISALLOW_COPY_AND_ASSIGN(MediaSourcePlayer); |
269 }; | 270 }; |
270 | 271 |
271 } // namespace media | 272 } // namespace media |
272 | 273 |
273 #endif // MEDIA_BASE_ANDROID_MEDIA_SOURCE_PLAYER_H_ | 274 #endif // MEDIA_BASE_ANDROID_MEDIA_SOURCE_PLAYER_H_ |
OLD | NEW |