| 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/numerics/safe_conversions.h" | 8 #include "base/numerics/safe_conversions.h" |
| 9 #include "content/public/renderer/renderer_ppapi_host.h" | 9 #include "content/public/renderer/renderer_ppapi_host.h" |
| 10 #include "content/renderer/pepper/ppb_image_data_impl.h" | 10 #include "content/renderer/pepper/ppb_image_data_impl.h" |
| (...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 204 frame->stride(media::VideoFrame::kUPlane), | 204 frame->stride(media::VideoFrame::kUPlane), |
| 205 src_v, | 205 src_v, |
| 206 frame->stride(media::VideoFrame::kVPlane), | 206 frame->stride(media::VideoFrame::kVPlane), |
| 207 bitmap_pixels, bitmap->rowBytes(), | 207 bitmap_pixels, bitmap->rowBytes(), |
| 208 dst_width, dst_height); | 208 dst_width, dst_height); |
| 209 | 209 |
| 210 ppapi::HostResource host_resource; | 210 ppapi::HostResource host_resource; |
| 211 host_resource.SetHostResource(pp_instance(), resource.get()); | 211 host_resource.SetHostResource(pp_instance(), resource.get()); |
| 212 | 212 |
| 213 // Convert a video timestamp to a PP_TimeTicks (a double, in seconds). | 213 // Convert a video timestamp to a PP_TimeTicks (a double, in seconds). |
| 214 PP_TimeTicks timestamp = frame->GetTimestamp().InSecondsF(); | 214 PP_TimeTicks timestamp = frame->timestamp().InSecondsF(); |
| 215 | 215 |
| 216 ppapi::proxy::SerializedHandle serialized_handle; | 216 ppapi::proxy::SerializedHandle serialized_handle; |
| 217 serialized_handle.set_shmem(image_handle, byte_count); | 217 serialized_handle.set_shmem(image_handle, byte_count); |
| 218 reply_context_.params.AppendHandle(serialized_handle); | 218 reply_context_.params.AppendHandle(serialized_handle); |
| 219 | 219 |
| 220 host()->SendReply(reply_context_, | 220 host()->SendReply(reply_context_, |
| 221 PpapiPluginMsg_VideoSource_GetFrameReply(host_resource, | 221 PpapiPluginMsg_VideoSource_GetFrameReply(host_resource, |
| 222 image_desc, | 222 image_desc, |
| 223 timestamp)); | 223 timestamp)); |
| 224 | 224 |
| (...skipping 15 matching lines...) Expand all Loading... |
| 240 | 240 |
| 241 void PepperVideoSourceHost::Close() { | 241 void PepperVideoSourceHost::Close() { |
| 242 if (source_handler_.get() && !stream_url_.empty()) | 242 if (source_handler_.get() && !stream_url_.empty()) |
| 243 source_handler_->Close(frame_receiver_.get()); | 243 source_handler_->Close(frame_receiver_.get()); |
| 244 | 244 |
| 245 source_handler_.reset(NULL); | 245 source_handler_.reset(NULL); |
| 246 stream_url_.clear(); | 246 stream_url_.clear(); |
| 247 } | 247 } |
| 248 | 248 |
| 249 } // namespace content | 249 } // namespace content |
| OLD | NEW |