OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/pepper/pepper_video_source_host.h" | 5 #include "content/renderer/pepper/pepper_video_source_host.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/safe_numerics.h" | 8 #include "base/safe_numerics.h" |
9 #include "content/public/renderer/renderer_ppapi_host.h" | 9 #include "content/public/renderer/renderer_ppapi_host.h" |
10 #include "content/renderer/render_thread_impl.h" | 10 #include "content/renderer/render_thread_impl.h" |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 FROM_HERE, | 43 FROM_HERE, |
44 base::Bind(&FrameReceiver::OnGotFrame, | 44 base::Bind(&FrameReceiver::OnGotFrame, |
45 this, | 45 this, |
46 base::Passed(scoped_ptr<cricket::VideoFrame>(frame)))); | 46 base::Passed(scoped_ptr<cricket::VideoFrame>(frame)))); |
47 | 47 |
48 return true; | 48 return true; |
49 } | 49 } |
50 | 50 |
51 void PepperVideoSourceHost::FrameReceiver::OnGotFrame( | 51 void PepperVideoSourceHost::FrameReceiver::OnGotFrame( |
52 scoped_ptr<cricket::VideoFrame> frame) { | 52 scoped_ptr<cricket::VideoFrame> frame) { |
53 if (host_) { | 53 if (host_.get()) { |
54 // Take ownership of the new frame, and possibly delete any unsent one. | 54 // Take ownership of the new frame, and possibly delete any unsent one. |
55 host_->last_frame_.swap(frame); | 55 host_->last_frame_.swap(frame); |
56 | 56 |
57 if (host_->get_frame_pending_) | 57 if (host_->get_frame_pending_) |
58 host_->SendGetFrameReply(); | 58 host_->SendGetFrameReply(); |
59 } | 59 } |
60 } | 60 } |
61 | 61 |
62 PepperVideoSourceHost::PepperVideoSourceHost( | 62 PepperVideoSourceHost::PepperVideoSourceHost( |
63 RendererPpapiHost* host, | 63 RendererPpapiHost* host, |
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
244 | 244 |
245 void PepperVideoSourceHost::Close() { | 245 void PepperVideoSourceHost::Close() { |
246 if (source_handler_.get() && !stream_url_.empty()) | 246 if (source_handler_.get() && !stream_url_.empty()) |
247 source_handler_->Close(stream_url_, frame_receiver_.get()); | 247 source_handler_->Close(stream_url_, frame_receiver_.get()); |
248 | 248 |
249 source_handler_.reset(NULL); | 249 source_handler_.reset(NULL); |
250 stream_url_.clear(); | 250 stream_url_.clear(); |
251 } | 251 } |
252 | 252 |
253 } // namespace content | 253 } // namespace content |
OLD | NEW |