| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "ppapi/c/pp_errors.h" | 5 #include "ppapi/c/pp_errors.h" |
| 6 #include "ppapi/c/ppb_opengles2.h" | 6 #include "ppapi/c/ppb_opengles2.h" |
| 7 #include "ppapi/cpp/completion_callback.h" | 7 #include "ppapi/cpp/completion_callback.h" |
| 8 #include "ppapi/cpp/dev/var_resource_dev.h" | |
| 9 #include "ppapi/cpp/graphics_3d.h" | 8 #include "ppapi/cpp/graphics_3d.h" |
| 10 #include "ppapi/cpp/graphics_3d_client.h" | 9 #include "ppapi/cpp/graphics_3d_client.h" |
| 11 #include "ppapi/cpp/instance.h" | 10 #include "ppapi/cpp/instance.h" |
| 12 #include "ppapi/cpp/media_stream_video_track.h" | 11 #include "ppapi/cpp/media_stream_video_track.h" |
| 13 #include "ppapi/cpp/module.h" | 12 #include "ppapi/cpp/module.h" |
| 14 #include "ppapi/cpp/rect.h" | 13 #include "ppapi/cpp/rect.h" |
| 15 #include "ppapi/cpp/var.h" | 14 #include "ppapi/cpp/var.h" |
| 16 #include "ppapi/cpp/video_frame.h" | 15 #include "ppapi/cpp/video_frame.h" |
| 17 #include "ppapi/lib/gl/include/GLES2/gl2.h" | 16 #include "ppapi/lib/gl/include/GLES2/gl2.h" |
| 18 #include "ppapi/utility/completion_callback_factory.h" | 17 #include "ppapi/utility/completion_callback_factory.h" |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 125 } | 124 } |
| 126 | 125 |
| 127 void MediaStreamVideoDemoInstance::HandleMessage(const pp::Var& var_message) { | 126 void MediaStreamVideoDemoInstance::HandleMessage(const pp::Var& var_message) { |
| 128 if (!var_message.is_dictionary()) | 127 if (!var_message.is_dictionary()) |
| 129 return; | 128 return; |
| 130 pp::VarDictionary var_dictionary_message(var_message); | 129 pp::VarDictionary var_dictionary_message(var_message); |
| 131 pp::Var var_track = var_dictionary_message.Get("track"); | 130 pp::Var var_track = var_dictionary_message.Get("track"); |
| 132 if (!var_track.is_resource()) | 131 if (!var_track.is_resource()) |
| 133 return; | 132 return; |
| 134 | 133 |
| 135 pp::Resource resource_track = pp::VarResource_Dev(var_track).AsResource(); | 134 pp::Resource resource_track = var_track.AsResource(); |
| 136 | 135 |
| 137 video_track_ = pp::MediaStreamVideoTrack(resource_track); | 136 video_track_ = pp::MediaStreamVideoTrack(resource_track); |
| 138 | 137 |
| 139 video_track_.GetFrame(callback_factory_.NewCallbackWithOutput( | 138 video_track_.GetFrame(callback_factory_.NewCallbackWithOutput( |
| 140 &MediaStreamVideoDemoInstance::OnGetFrame)); | 139 &MediaStreamVideoDemoInstance::OnGetFrame)); |
| 141 } | 140 } |
| 142 | 141 |
| 143 void MediaStreamVideoDemoInstance::InitGL() { | 142 void MediaStreamVideoDemoInstance::InitGL() { |
| 144 PP_DCHECK(position_size_.width() && position_size_.height()); | 143 PP_DCHECK(position_size_.width() && position_size_.height()); |
| 145 is_painting_ = false; | 144 is_painting_ = false; |
| (...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 386 } | 385 } |
| 387 | 386 |
| 388 } // anonymous namespace | 387 } // anonymous namespace |
| 389 | 388 |
| 390 namespace pp { | 389 namespace pp { |
| 391 // Factory function for your specialization of the Module object. | 390 // Factory function for your specialization of the Module object. |
| 392 Module* CreateModule() { | 391 Module* CreateModule() { |
| 393 return new MediaStreamVideoModule(); | 392 return new MediaStreamVideoModule(); |
| 394 } | 393 } |
| 395 } // namespace pp | 394 } // namespace pp |
| OLD | NEW |