| Index: remoting/client/software_video_renderer.cc
|
| diff --git a/remoting/client/software_video_renderer.cc b/remoting/client/software_video_renderer.cc
|
| index 51782e05f476f4942a30408a7e52d0214cc0a80f..9c693ca58376cdac0fb9e4b32f71d4d7d91b025b 100644
|
| --- a/remoting/client/software_video_renderer.cc
|
| +++ b/remoting/client/software_video_renderer.cc
|
| @@ -13,7 +13,7 @@
|
| #include "base/logging.h"
|
| #include "base/single_thread_task_runner.h"
|
| #include "remoting/base/util.h"
|
| -#include "remoting/client/frame_consumer.h"
|
| +#include "remoting/client/frame_consumer_proxy.h"
|
| #include "remoting/codec/video_decoder.h"
|
| #include "remoting/codec/video_decoder_verbatim.h"
|
| #include "remoting/codec/video_decoder_vpx.h"
|
| @@ -80,7 +80,7 @@ class SoftwareVideoRenderer::Core {
|
| public:
|
| Core(scoped_refptr<base::SingleThreadTaskRunner> main_task_runner,
|
| scoped_refptr<base::SingleThreadTaskRunner> decode_task_runner,
|
| - scoped_refptr<FrameConsumerProxy> consumer);
|
| + scoped_ptr<FrameConsumerProxy> consumer);
|
| ~Core();
|
|
|
| void OnSessionConfig(const protocol::SessionConfig& config);
|
| @@ -104,7 +104,7 @@ class SoftwareVideoRenderer::Core {
|
|
|
| scoped_refptr<base::SingleThreadTaskRunner> main_task_runner_;
|
| scoped_refptr<base::SingleThreadTaskRunner> decode_task_runner_;
|
| - scoped_refptr<FrameConsumerProxy> consumer_;
|
| + scoped_ptr<FrameConsumerProxy> consumer_;
|
| scoped_ptr<VideoDecoder> decoder_;
|
|
|
| // Remote screen size in pixels.
|
| @@ -129,10 +129,10 @@ class SoftwareVideoRenderer::Core {
|
| SoftwareVideoRenderer::Core::Core(
|
| scoped_refptr<base::SingleThreadTaskRunner> main_task_runner,
|
| scoped_refptr<base::SingleThreadTaskRunner> decode_task_runner,
|
| - scoped_refptr<FrameConsumerProxy> consumer)
|
| + scoped_ptr<FrameConsumerProxy> consumer)
|
| : main_task_runner_(main_task_runner),
|
| decode_task_runner_(decode_task_runner),
|
| - consumer_(consumer),
|
| + consumer_(consumer.Pass()),
|
| paint_scheduled_(false),
|
| weak_factory_(this) {
|
| }
|
| @@ -242,7 +242,7 @@ void SoftwareVideoRenderer::Core::DoPaint() {
|
| if (!output_region.is_empty()) {
|
| buffers_.pop_front();
|
| consumer_->ApplyBuffer(view_size_, clip_area_, buffer, output_region,
|
| - *decoder_->GetImageShape());
|
| + decoder_->GetImageShape());
|
| }
|
| }
|
|
|
| @@ -315,12 +315,15 @@ void SoftwareVideoRenderer::Core::SetOutputSizeAndClip(
|
| SoftwareVideoRenderer::SoftwareVideoRenderer(
|
| scoped_refptr<base::SingleThreadTaskRunner> main_task_runner,
|
| scoped_refptr<base::SingleThreadTaskRunner> decode_task_runner,
|
| - scoped_refptr<FrameConsumerProxy> consumer)
|
| + FrameConsumer* frame_consumer)
|
| : decode_task_runner_(decode_task_runner),
|
| - core_(new Core(main_task_runner, decode_task_runner, consumer)),
|
| latest_event_timestamp_(0),
|
| + weak_frame_consumer_(frame_consumer),
|
| weak_factory_(this) {
|
| DCHECK(CalledOnValidThread());
|
| + core_ = make_scoped_ptr(new Core(main_task_runner, decode_task_runner,
|
| + make_scoped_ptr(new FrameConsumerProxy(
|
| + weak_frame_consumer_.GetWeakPtr()))));
|
| }
|
|
|
| SoftwareVideoRenderer::~SoftwareVideoRenderer() {
|
|
|