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

Side by Side Diff: content/renderer/media/android/stream_texture_factory_impl.cc

Issue 1848923003: Revert of Make Android StreamTexture implement GLStreamTextureImage (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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 #include "content/renderer/media/android/stream_texture_factory_impl.h" 5 #include "content/renderer/media/android/stream_texture_factory_impl.h"
6 6
7 #include "base/macros.h" 7 #include "base/macros.h"
8 #include "cc/output/context_provider.h" 8 #include "cc/output/context_provider.h"
9 #include "content/common/gpu/client/context_provider_command_buffer.h" 9 #include "content/common/gpu/client/context_provider_command_buffer.h"
10 #include "content/common/gpu/client/gpu_channel_host.h" 10 #include "content/common/gpu/client/gpu_channel_host.h"
(...skipping 13 matching lines...) Expand all
24 ~StreamTextureProxyImpl() override; 24 ~StreamTextureProxyImpl() override;
25 25
26 // StreamTextureProxy implementation: 26 // StreamTextureProxy implementation:
27 void BindToLoop(int32_t stream_id, 27 void BindToLoop(int32_t stream_id,
28 cc::VideoFrameProvider::Client* client, 28 cc::VideoFrameProvider::Client* client,
29 scoped_refptr<base::SingleThreadTaskRunner> loop) override; 29 scoped_refptr<base::SingleThreadTaskRunner> loop) override;
30 void Release() override; 30 void Release() override;
31 31
32 // StreamTextureHost::Listener implementation: 32 // StreamTextureHost::Listener implementation:
33 void OnFrameAvailable() override; 33 void OnFrameAvailable() override;
34 void OnMatrixChanged(const float matrix[16]) override;
34 35
35 private: 36 private:
36 void BindOnThread(int32_t stream_id); 37 void BindOnThread(int32_t stream_id);
37 38
38 const scoped_ptr<StreamTextureHost> host_; 39 const scoped_ptr<StreamTextureHost> host_;
39 40
40 // Protects access to |client_| and |loop_|. 41 // Protects access to |client_| and |loop_|.
41 base::Lock lock_; 42 base::Lock lock_;
42 cc::VideoFrameProvider::Client* client_; 43 cc::VideoFrameProvider::Client* client_;
43 scoped_refptr<base::SingleThreadTaskRunner> loop_; 44 scoped_refptr<base::SingleThreadTaskRunner> loop_;
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 void StreamTextureProxyImpl::BindOnThread(int32_t stream_id) { 95 void StreamTextureProxyImpl::BindOnThread(int32_t stream_id) {
95 host_->BindToCurrentThread(stream_id, this); 96 host_->BindToCurrentThread(stream_id, this);
96 } 97 }
97 98
98 void StreamTextureProxyImpl::OnFrameAvailable() { 99 void StreamTextureProxyImpl::OnFrameAvailable() {
99 base::AutoLock lock(lock_); 100 base::AutoLock lock(lock_);
100 if (client_) 101 if (client_)
101 client_->DidReceiveFrame(); 102 client_->DidReceiveFrame();
102 } 103 }
103 104
105 void StreamTextureProxyImpl::OnMatrixChanged(const float matrix[16]) {
106 base::AutoLock lock(lock_);
107 if (client_)
108 client_->DidUpdateMatrix(matrix);
109 }
110
104 } // namespace 111 } // namespace
105 112
106 // static 113 // static
107 scoped_refptr<StreamTextureFactoryImpl> StreamTextureFactoryImpl::Create( 114 scoped_refptr<StreamTextureFactoryImpl> StreamTextureFactoryImpl::Create(
108 const scoped_refptr<ContextProviderCommandBuffer>& context_provider, 115 const scoped_refptr<ContextProviderCommandBuffer>& context_provider,
109 GpuChannelHost* channel) { 116 GpuChannelHost* channel) {
110 return new StreamTextureFactoryImpl(context_provider, channel); 117 return new StreamTextureFactoryImpl(context_provider, channel);
111 } 118 }
112 119
113 StreamTextureFactoryImpl::StreamTextureFactoryImpl( 120 StreamTextureFactoryImpl::StreamTextureFactoryImpl(
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
160 167
161 void StreamTextureFactoryImpl::AddObserver( 168 void StreamTextureFactoryImpl::AddObserver(
162 StreamTextureFactoryContextObserver* obs) { 169 StreamTextureFactoryContextObserver* obs) {
163 } 170 }
164 171
165 void StreamTextureFactoryImpl::RemoveObserver( 172 void StreamTextureFactoryImpl::RemoveObserver(
166 StreamTextureFactoryContextObserver* obs) { 173 StreamTextureFactoryContextObserver* obs) {
167 } 174 }
168 175
169 } // namespace content 176 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698