| Index: content/renderer/media/android/stream_texture_factory.cc
|
| diff --git a/content/renderer/media/android/stream_texture_factory.cc b/content/renderer/media/android/stream_texture_factory.cc
|
| index 2408fa1910bf94b8334850a9744e9a13b13b7994..d2053762c27c00573a355b63831229c7979ce594 100644
|
| --- a/content/renderer/media/android/stream_texture_factory.cc
|
| +++ b/content/renderer/media/android/stream_texture_factory.cc
|
| @@ -15,17 +15,15 @@
|
|
|
| namespace content {
|
|
|
| -StreamTextureProxy::StreamTextureProxy(StreamTextureHost* host)
|
| - : host_(host), client_(NULL) {}
|
| +StreamTextureProxy::StreamTextureProxy(StreamTextureHost* host) : host_(host) {}
|
|
|
| StreamTextureProxy::~StreamTextureProxy() {}
|
|
|
| void StreamTextureProxy::Release() {
|
| {
|
| - // Cannot call into |client_| anymore (from any thread) after returning
|
| - // from here.
|
| + // Cannot call |received_frame_cb_| after returning from here.
|
| base::AutoLock lock(lock_);
|
| - client_ = NULL;
|
| + received_frame_cb_.Reset();
|
| }
|
| // Release is analogous to the destructor, so there should be no more external
|
| // calls to this object in Release. Therefore there is no need to acquire the
|
| @@ -36,9 +34,9 @@ void StreamTextureProxy::Release() {
|
| }
|
| }
|
|
|
| -void StreamTextureProxy::BindToLoop(
|
| +void StreamTextureProxy::BindToTaskRunner(
|
| int32_t stream_id,
|
| - cc::VideoFrameProvider::Client* client,
|
| + const base::Closure& received_frame_cb,
|
| scoped_refptr<base::SingleThreadTaskRunner> loop) {
|
| DCHECK(loop.get());
|
|
|
| @@ -46,7 +44,7 @@ void StreamTextureProxy::BindToLoop(
|
| base::AutoLock lock(lock_);
|
| DCHECK(!loop_.get() || (loop.get() == loop_.get()));
|
| loop_ = loop;
|
| - client_ = client;
|
| + received_frame_cb_ = received_frame_cb;
|
| }
|
|
|
| if (loop->BelongsToCurrentThread()) {
|
| @@ -67,8 +65,8 @@ void StreamTextureProxy::BindOnThread(int32_t stream_id) {
|
|
|
| void StreamTextureProxy::OnFrameAvailable() {
|
| base::AutoLock lock(lock_);
|
| - if (client_)
|
| - client_->DidReceiveFrame();
|
| + if (!received_frame_cb_.is_null())
|
| + received_frame_cb_.Run();
|
| }
|
|
|
| // static
|
|
|