| 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" |
| 15 #include "ppapi/cpp/var_resource.h" |
| 16 #include "ppapi/cpp/video_frame.h" | 16 #include "ppapi/cpp/video_frame.h" |
| 17 #include "ppapi/lib/gl/include/GLES2/gl2.h" | 17 #include "ppapi/lib/gl/include/GLES2/gl2.h" |
| 18 #include "ppapi/utility/completion_callback_factory.h" | 18 #include "ppapi/utility/completion_callback_factory.h" |
| 19 | 19 |
| 20 // When compiling natively on Windows, PostMessage can be #define-d to | 20 // When compiling natively on Windows, PostMessage can be #define-d to |
| 21 // something else. | 21 // something else. |
| 22 #ifdef PostMessage | 22 #ifdef PostMessage |
| 23 #undef PostMessage | 23 #undef PostMessage |
| 24 #endif | 24 #endif |
| 25 | 25 |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 125 } | 125 } |
| 126 | 126 |
| 127 void MediaStreamVideoDemoInstance::HandleMessage(const pp::Var& var_message) { | 127 void MediaStreamVideoDemoInstance::HandleMessage(const pp::Var& var_message) { |
| 128 if (!var_message.is_dictionary()) | 128 if (!var_message.is_dictionary()) |
| 129 return; | 129 return; |
| 130 pp::VarDictionary var_dictionary_message(var_message); | 130 pp::VarDictionary var_dictionary_message(var_message); |
| 131 pp::Var var_track = var_dictionary_message.Get("track"); | 131 pp::Var var_track = var_dictionary_message.Get("track"); |
| 132 if (!var_track.is_resource()) | 132 if (!var_track.is_resource()) |
| 133 return; | 133 return; |
| 134 | 134 |
| 135 pp::Resource resource_track = pp::VarResource_Dev(var_track).AsResource(); | 135 pp::Resource resource_track = pp::VarResource(var_track).AsResource(); |
| 136 | 136 |
| 137 video_track_ = pp::MediaStreamVideoTrack(resource_track); | 137 video_track_ = pp::MediaStreamVideoTrack(resource_track); |
| 138 | 138 |
| 139 video_track_.GetFrame(callback_factory_.NewCallbackWithOutput( | 139 video_track_.GetFrame(callback_factory_.NewCallbackWithOutput( |
| 140 &MediaStreamVideoDemoInstance::OnGetFrame)); | 140 &MediaStreamVideoDemoInstance::OnGetFrame)); |
| 141 } | 141 } |
| 142 | 142 |
| 143 void MediaStreamVideoDemoInstance::InitGL() { | 143 void MediaStreamVideoDemoInstance::InitGL() { |
| 144 PP_DCHECK(position_size_.width() && position_size_.height()); | 144 PP_DCHECK(position_size_.width() && position_size_.height()); |
| 145 is_painting_ = false; | 145 is_painting_ = false; |
| (...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 386 } | 386 } |
| 387 | 387 |
| 388 } // anonymous namespace | 388 } // anonymous namespace |
| 389 | 389 |
| 390 namespace pp { | 390 namespace pp { |
| 391 // Factory function for your specialization of the Module object. | 391 // Factory function for your specialization of the Module object. |
| 392 Module* CreateModule() { | 392 Module* CreateModule() { |
| 393 return new MediaStreamVideoModule(); | 393 return new MediaStreamVideoModule(); |
| 394 } | 394 } |
| 395 } // namespace pp | 395 } // namespace pp |
| OLD | NEW |