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

Side by Side Diff: content/renderer/media/android/stream_texture_factory.h

Issue 2282633002: Integrate Surface requests with MediaPlayerRenderer (Closed)
Patch Set: Switch token type to base::Nonce 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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_RENDERER_MEDIA_ANDROID_STREAM_TEXTURE_FACTORY_H_ 5 #ifndef CONTENT_RENDERER_MEDIA_ANDROID_STREAM_TEXTURE_FACTORY_H_
6 #define CONTENT_RENDERER_MEDIA_ANDROID_STREAM_TEXTURE_FACTORY_H_ 6 #define CONTENT_RENDERER_MEDIA_ANDROID_STREAM_TEXTURE_FACTORY_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <memory> 10 #include <memory>
11 11
12 #include "base/macros.h" 12 #include "base/macros.h"
13 #include "base/memory/ref_counted.h" 13 #include "base/memory/ref_counted.h"
14 #include "base/nonce.h"
14 #include "base/single_thread_task_runner.h" 15 #include "base/single_thread_task_runner.h"
15 #include "cc/layers/video_frame_provider.h" 16 #include "cc/layers/video_frame_provider.h"
16 #include "content/common/content_export.h" 17 #include "content/common/content_export.h"
17 #include "content/renderer/gpu/stream_texture_host_android.h" 18 #include "content/renderer/gpu/stream_texture_host_android.h"
18 #include "gpu/command_buffer/common/mailbox.h" 19 #include "gpu/command_buffer/common/mailbox.h"
19 #include "ui/gfx/geometry/size.h" 20 #include "ui/gfx/geometry/size.h"
20 21
21 namespace gpu { 22 namespace gpu {
22 namespace gles2 { 23 namespace gles2 {
23 class GLES2Interface; 24 class GLES2Interface;
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 80
80 // Create the StreamTextureProxy object. 81 // Create the StreamTextureProxy object.
81 StreamTextureProxy* CreateProxy(); 82 StreamTextureProxy* CreateProxy();
82 83
83 // Send an IPC message to the browser process to request a java surface 84 // Send an IPC message to the browser process to request a java surface
84 // object for the given stream_id. After the the surface is created, 85 // object for the given stream_id. After the the surface is created,
85 // it will be passed back to the WebMediaPlayerAndroid object identified by 86 // it will be passed back to the WebMediaPlayerAndroid object identified by
86 // the player_id. 87 // the player_id.
87 void EstablishPeer(int32_t stream_id, int player_id, int frame_id); 88 void EstablishPeer(int32_t stream_id, int player_id, int frame_id);
88 89
90 // Sends an IPC to the GPU process.
91 // Asks the StreamTexture to forward its SurfaceTexture to the
92 // ScopedSurfaceRequestManager, using the gpu::ScopedSurfaceRequestConduit.
93 void ForwardStreamTextureForSurfaceRequest(int32_t stream_id,
94 base::Nonce request_token);
95
89 // Creates a gpu::StreamTexture and returns its id. Sets |*texture_id| to the 96 // Creates a gpu::StreamTexture and returns its id. Sets |*texture_id| to the
90 // client-side id of the gpu::StreamTexture. The texture is produced into 97 // client-side id of the gpu::StreamTexture. The texture is produced into
91 // a mailbox so it can be shipped in a VideoFrame. 98 // a mailbox so it can be shipped in a VideoFrame.
92 unsigned CreateStreamTexture(unsigned texture_target, 99 unsigned CreateStreamTexture(unsigned texture_target,
93 unsigned* texture_id, 100 unsigned* texture_id,
94 gpu::Mailbox* texture_mailbox); 101 gpu::Mailbox* texture_mailbox);
95 102
96 // Set the streamTexture size for the given stream Id. 103 // Set the streamTexture size for the given stream Id.
97 void SetStreamTextureSize(int32_t texture_id, const gfx::Size& size); 104 void SetStreamTextureSize(int32_t texture_id, const gfx::Size& size);
98 105
99 gpu::gles2::GLES2Interface* ContextGL(); 106 gpu::gles2::GLES2Interface* ContextGL();
100 107
101 private: 108 private:
102 friend class base::RefCounted<StreamTextureFactory>; 109 friend class base::RefCounted<StreamTextureFactory>;
103 StreamTextureFactory( 110 StreamTextureFactory(
104 scoped_refptr<ContextProviderCommandBuffer> context_provider); 111 scoped_refptr<ContextProviderCommandBuffer> context_provider);
105 ~StreamTextureFactory(); 112 ~StreamTextureFactory();
106 113
107 scoped_refptr<ContextProviderCommandBuffer> context_provider_; 114 scoped_refptr<ContextProviderCommandBuffer> context_provider_;
108 scoped_refptr<gpu::GpuChannelHost> channel_; 115 scoped_refptr<gpu::GpuChannelHost> channel_;
109 116
110 DISALLOW_IMPLICIT_CONSTRUCTORS(StreamTextureFactory); 117 DISALLOW_IMPLICIT_CONSTRUCTORS(StreamTextureFactory);
111 }; 118 };
112 119
113 } // namespace content 120 } // namespace content
114 121
115 #endif // CONTENT_RENDERER_MEDIA_ANDROID_STREAM_TEXTURE_FACTORY_H_ 122 #endif // CONTENT_RENDERER_MEDIA_ANDROID_STREAM_TEXTURE_FACTORY_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698