OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "remoting/client/frame_consumer_proxy.h" | 5 #include "remoting/client/frame_consumer_proxy.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/location.h" | 8 #include "base/location.h" |
9 #include "base/single_thread_task_runner.h" | 9 #include "base/single_thread_task_runner.h" |
10 #include "third_party/webrtc/modules/desktop_capture/desktop_frame.h" | 10 #include "third_party/webrtc/modules/desktop_capture/desktop_frame.h" |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
50 if (!task_runner_->BelongsToCurrentThread()) { | 50 if (!task_runner_->BelongsToCurrentThread()) { |
51 task_runner_->PostTask(FROM_HERE, base::Bind( | 51 task_runner_->PostTask(FROM_HERE, base::Bind( |
52 &FrameConsumerProxy::SetSourceSize, this, source_size, source_dpi)); | 52 &FrameConsumerProxy::SetSourceSize, this, source_size, source_dpi)); |
53 return; | 53 return; |
54 } | 54 } |
55 | 55 |
56 if (frame_consumer_.get()) | 56 if (frame_consumer_.get()) |
57 frame_consumer_->SetSourceSize(source_size, source_dpi); | 57 frame_consumer_->SetSourceSize(source_size, source_dpi); |
58 } | 58 } |
59 | 59 |
60 FrameConsumer::PixelFormat FrameConsumerProxy::GetPixelFormat() { | |
61 return pixel_format_; | |
Sergey Ulanov
2013/09/27 21:51:13
This value is set on a different thread. It's not
Lambros
2013/09/28 00:22:18
Done.
| |
62 } | |
63 | |
60 void FrameConsumerProxy::Attach( | 64 void FrameConsumerProxy::Attach( |
61 const base::WeakPtr<FrameConsumer>& frame_consumer) { | 65 const base::WeakPtr<FrameConsumer>& frame_consumer) { |
62 DCHECK(task_runner_->BelongsToCurrentThread()); | 66 DCHECK(task_runner_->BelongsToCurrentThread()); |
63 DCHECK(frame_consumer_.get() == NULL); | 67 DCHECK(frame_consumer_.get() == NULL); |
64 frame_consumer_ = frame_consumer; | 68 frame_consumer_ = frame_consumer; |
69 | |
70 pixel_format_ = frame_consumer_->GetPixelFormat(); | |
65 } | 71 } |
66 | 72 |
67 FrameConsumerProxy::~FrameConsumerProxy() { | 73 FrameConsumerProxy::~FrameConsumerProxy() { |
68 } | 74 } |
69 | 75 |
70 } // namespace remoting | 76 } // namespace remoting |
OLD | NEW |