Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(299)

Side by Side Diff: media/base/android/media_source_player.h

Issue 1372203002: Throttle media decoding after excessive Android media server crashes (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: new infobar text per UI review Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « media/base/android/media_player_bridge.cc ('k') | media/base/android/media_source_player.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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_
OLDNEW
« no previous file with comments | « media/base/android/media_player_bridge.cc ('k') | media/base/android/media_source_player.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698