OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef PPAPI_PROXY_VIDEO_SOURCE_RESOURCE_H_ |
| 6 #define PPAPI_PROXY_VIDEO_SOURCE_RESOURCE_H_ |
| 7 |
| 8 #include <string> |
| 9 |
| 10 #include "ppapi/c/pp_time.h" |
| 11 #include "ppapi/proxy/connection.h" |
| 12 #include "ppapi/proxy/plugin_resource.h" |
| 13 #include "ppapi/proxy/ppapi_proxy_export.h" |
| 14 #include "ppapi/shared_impl/var.h" |
| 15 #include "ppapi/thunk/ppb_video_source_private_api.h" |
| 16 |
| 17 struct PP_VideoFrame_Private; |
| 18 |
| 19 namespace ppapi { |
| 20 |
| 21 class TrackedCallback; |
| 22 |
| 23 namespace proxy { |
| 24 |
| 25 class PPAPI_PROXY_EXPORT VideoSourceResource |
| 26 : public PluginResource, |
| 27 public thunk::PPB_VideoSource_Private_API { |
| 28 public: |
| 29 VideoSourceResource(Connection connection, |
| 30 PP_Instance instance); |
| 31 virtual ~VideoSourceResource(); |
| 32 |
| 33 // Resource overrides. |
| 34 virtual thunk::PPB_VideoSource_Private_API* |
| 35 AsPPB_VideoSource_Private_API() OVERRIDE; |
| 36 |
| 37 // PPB_VideoSource_Private_API implementation. |
| 38 virtual int32_t Open( |
| 39 const PP_Var& stream_url, |
| 40 scoped_refptr<TrackedCallback> callback) OVERRIDE; |
| 41 virtual int32_t GetFrame( |
| 42 PP_VideoFrame_Private* frame, |
| 43 scoped_refptr<TrackedCallback> callback) OVERRIDE; |
| 44 virtual void Close() OVERRIDE; |
| 45 |
| 46 private: |
| 47 void OnPluginMsgOpenComplete( |
| 48 const ResourceMessageReplyParams& params); |
| 49 void OnPluginMsgGetFrameComplete( |
| 50 PP_VideoFrame_Private* frame, |
| 51 const ResourceMessageReplyParams& params, |
| 52 const HostResource& image_data, |
| 53 PP_TimeTicks timestamp); |
| 54 |
| 55 scoped_refptr<TrackedCallback> open_callback_; |
| 56 scoped_refptr<TrackedCallback> get_frame_callback_; |
| 57 bool is_open_; |
| 58 |
| 59 DISALLOW_COPY_AND_ASSIGN(VideoSourceResource); |
| 60 }; |
| 61 |
| 62 } // namespace proxy |
| 63 } // namespace ppapi |
| 64 |
| 65 #endif // PPAPI_PROXY_VIDEO_SOURCE_RESOURCE_H_ |
OLD | NEW |