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

Side by Side Diff: content/browser/media/android/media_player_renderer.h

Issue 2282633002: Integrate Surface requests with MediaPlayerRenderer (Closed)
Patch Set: Fixed MojoRenderService constructor Created 4 years, 3 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
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 CONTENT_BROWSER_MEDIA_ANDROID_MEDIA_PLAYER_RENDERER_H_ 5 #ifndef CONTENT_BROWSER_MEDIA_ANDROID_MEDIA_PLAYER_RENDERER_H_
6 #define CONTENT_BROWSER_MEDIA_ANDROID_MEDIA_PLAYER_RENDERER_H_ 6 #define CONTENT_BROWSER_MEDIA_ANDROID_MEDIA_PLAYER_RENDERER_H_
7 7
8 #include <stdint.h>
9
8 #include "base/callback.h" 10 #include "base/callback.h"
9 #include "base/macros.h" 11 #include "base/macros.h"
10 #include "base/memory/weak_ptr.h" 12 #include "base/memory/weak_ptr.h"
11 #include "content/common/content_export.h" 13 #include "content/common/content_export.h"
12 #include "content/public/browser/render_frame_host.h" 14 #include "content/public/browser/render_frame_host.h"
13 #include "media/base/android/media_player_bridge.h" 15 #include "media/base/android/media_player_bridge.h"
14 #include "media/base/android/media_player_manager.h" 16 #include "media/base/android/media_player_manager.h"
15 #include "media/base/demuxer_stream_provider.h" 17 #include "media/base/demuxer_stream_provider.h"
16 #include "media/base/media_log.h" 18 #include "media/base/media_log.h"
17 #include "media/base/renderer.h" 19 #include "media/base/renderer.h"
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 const base::TimeDelta& current_time) override; 80 const base::TimeDelta& current_time) override;
79 void OnError(int player_id, int error) override; 81 void OnError(int player_id, int error) override;
80 void OnVideoSizeChanged(int player_id, int width, int height) override; 82 void OnVideoSizeChanged(int player_id, int width, int height) override;
81 void OnWaitingForDecryptionKey(int player_id) override; 83 void OnWaitingForDecryptionKey(int player_id) override;
82 media::MediaPlayerAndroid* GetFullscreenPlayer() override; 84 media::MediaPlayerAndroid* GetFullscreenPlayer() override;
83 media::MediaPlayerAndroid* GetPlayer(int player_id) override; 85 media::MediaPlayerAndroid* GetPlayer(int player_id) override;
84 bool RequestPlay(int player_id, 86 bool RequestPlay(int player_id,
85 base::TimeDelta duration, 87 base::TimeDelta duration,
86 bool has_audio) override; 88 bool has_audio) override;
87 89
90 uint64_t InitiateScopedSurfaceRequest();
91 void OnScopedSurfaceRequestCompleted(gl::ScopedJavaSurface surface);
92
88 private: 93 private:
89 // Used when creating |media_player_|. 94 // Used when creating |media_player_|.
90 void OnDecoderResourcesReleased(int player_id); 95 void OnDecoderResourcesReleased(int player_id);
91 96
92 RenderFrameHost* render_frame_host_; 97 RenderFrameHost* render_frame_host_;
93 media::RendererClient* renderer_client_; 98 media::RendererClient* renderer_client_;
94 99
95 std::unique_ptr<media::MediaPlayerBridge> media_player_; 100 std::unique_ptr<media::MediaPlayerBridge> media_player_;
96 101
97 // Current duration of the media. 102 // Current duration of the media.
98 base::TimeDelta duration_; 103 base::TimeDelta duration_;
99 104
100 // Indicates if a serious error has been encountered by the |media_player_|. 105 // Indicates if a serious error has been encountered by the |media_player_|.
101 bool has_error_; 106 bool has_error_;
102 107
103 gfx::Size video_size_; 108 gfx::Size video_size_;
104 109
110 uint64_t surface_request_id_;
111 bool is_waiting_for_surface_;
112
105 std::unique_ptr<media::MediaResourceGetter> media_resource_getter_; 113 std::unique_ptr<media::MediaResourceGetter> media_resource_getter_;
106 114
107 // NOTE: Weak pointers must be invalidated before all other member variables. 115 // NOTE: Weak pointers must be invalidated before all other member variables.
108 base::WeakPtrFactory<MediaPlayerRenderer> weak_factory_; 116 base::WeakPtrFactory<MediaPlayerRenderer> weak_factory_;
109 117
110 DISALLOW_COPY_AND_ASSIGN(MediaPlayerRenderer); 118 DISALLOW_COPY_AND_ASSIGN(MediaPlayerRenderer);
111 }; 119 };
112 120
113 } // namespace content 121 } // namespace content
114 122
115 #endif // CONTENT_BROWSER_MEDIA_ANDROID_MEDIA_PLAYER_RENDERER_H_ 123 #endif // CONTENT_BROWSER_MEDIA_ANDROID_MEDIA_PLAYER_RENDERER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698