| OLD | NEW |
| 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 "base/callback.h" | 8 #include "base/callback.h" |
| 9 #include "base/macros.h" | 9 #include "base/macros.h" |
| 10 #include "base/memory/weak_ptr.h" | 10 #include "base/memory/weak_ptr.h" |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 89 // returns the token associated to the request. The token can then be used to | 89 // returns the token associated to the request. The token can then be used to |
| 90 // complete the request via the gpu::ScopedSurfaceRequestConduit. | 90 // complete the request via the gpu::ScopedSurfaceRequestConduit. |
| 91 // A completed request will call back to OnScopedSurfaceRequestCompleted(). | 91 // A completed request will call back to OnScopedSurfaceRequestCompleted(). |
| 92 // | 92 // |
| 93 // NOTE: If a request is already pending, calling this method again will | 93 // NOTE: If a request is already pending, calling this method again will |
| 94 // safely cancel the pending request before registering a new one. | 94 // safely cancel the pending request before registering a new one. |
| 95 base::UnguessableToken InitiateScopedSurfaceRequest(); | 95 base::UnguessableToken InitiateScopedSurfaceRequest(); |
| 96 void OnScopedSurfaceRequestCompleted(gl::ScopedJavaSurface surface); | 96 void OnScopedSurfaceRequestCompleted(gl::ScopedJavaSurface surface); |
| 97 | 97 |
| 98 private: | 98 private: |
| 99 void CreateMediaPlayer(const media::MediaUrlParams& params, |
| 100 const media::PipelineStatusCB& init_cb); |
| 101 |
| 99 // Used when creating |media_player_|. | 102 // Used when creating |media_player_|. |
| 100 void OnDecoderResourcesReleased(int player_id); | 103 void OnDecoderResourcesReleased(int player_id); |
| 101 | 104 |
| 102 // Cancels the pending request started by InitiateScopedSurfaceRequest(), if | 105 // Cancels the pending request started by InitiateScopedSurfaceRequest(), if |
| 103 // it exists. No-ops otherwise. | 106 // it exists. No-ops otherwise. |
| 104 void CancelScopedSurfaceRequest(); | 107 void CancelScopedSurfaceRequest(); |
| 105 | 108 |
| 106 RenderFrameHost* render_frame_host_; | 109 RenderFrameHost* render_frame_host_; |
| 107 media::RendererClient* renderer_client_; | 110 media::RendererClient* renderer_client_; |
| 108 | 111 |
| (...skipping 13 matching lines...) Expand all Loading... |
| 122 | 125 |
| 123 // NOTE: Weak pointers must be invalidated before all other member variables. | 126 // NOTE: Weak pointers must be invalidated before all other member variables. |
| 124 base::WeakPtrFactory<MediaPlayerRenderer> weak_factory_; | 127 base::WeakPtrFactory<MediaPlayerRenderer> weak_factory_; |
| 125 | 128 |
| 126 DISALLOW_COPY_AND_ASSIGN(MediaPlayerRenderer); | 129 DISALLOW_COPY_AND_ASSIGN(MediaPlayerRenderer); |
| 127 }; | 130 }; |
| 128 | 131 |
| 129 } // namespace content | 132 } // namespace content |
| 130 | 133 |
| 131 #endif // CONTENT_BROWSER_MEDIA_ANDROID_MEDIA_PLAYER_RENDERER_H_ | 134 #endif // CONTENT_BROWSER_MEDIA_ANDROID_MEDIA_PLAYER_RENDERER_H_ |
| OLD | NEW |