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 #ifndef CONTENT_RENDERER_PEPPER_PEPPER_VIDEO_DESTINATION_HOST_H_ | 5 #ifndef CONTENT_RENDERER_PEPPER_PEPPER_VIDEO_DESTINATION_HOST_H_ |
6 #define CONTENT_RENDERER_PEPPER_PEPPER_VIDEO_DESTINATION_HOST_H_ | 6 #define CONTENT_RENDERER_PEPPER_PEPPER_VIDEO_DESTINATION_HOST_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
11 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
12 #include "base/memory/weak_ptr.h" | 12 #include "base/memory/weak_ptr.h" |
13 #include "content/common/content_export.h" | 13 #include "content/common/content_export.h" |
14 #include "content/renderer/media/webrtc/video_destination_handler.h" | 14 #include "content/renderer/media/webrtc/video_destination_handler.h" |
15 #include "ppapi/c/pp_time.h" | 15 #include "ppapi/c/pp_time.h" |
16 #include "ppapi/host/resource_host.h" | 16 #include "ppapi/host/resource_host.h" |
17 | 17 |
18 namespace content { | 18 namespace content { |
19 | 19 |
20 class RendererPpapiHost; | 20 class RendererPpapiHost; |
21 | 21 |
22 class CONTENT_EXPORT PepperVideoDestinationHost | 22 class CONTENT_EXPORT PepperVideoDestinationHost |
23 : public ppapi::host::ResourceHost { | 23 : public ppapi::host::ResourceHost { |
24 public: | 24 public: |
25 PepperVideoDestinationHost(RendererPpapiHost* host, | 25 PepperVideoDestinationHost(RendererPpapiHost* host, |
26 PP_Instance instance, | 26 PP_Instance instance, |
27 PP_Resource resource); | 27 PP_Resource resource); |
28 | 28 |
29 virtual ~PepperVideoDestinationHost(); | 29 ~PepperVideoDestinationHost() override; |
30 | 30 |
31 virtual int32_t OnResourceMessageReceived( | 31 int32_t OnResourceMessageReceived( |
32 const IPC::Message& msg, | 32 const IPC::Message& msg, |
33 ppapi::host::HostMessageContext* context) override; | 33 ppapi::host::HostMessageContext* context) override; |
34 | 34 |
35 private: | 35 private: |
36 int32_t OnHostMsgOpen(ppapi::host::HostMessageContext* context, | 36 int32_t OnHostMsgOpen(ppapi::host::HostMessageContext* context, |
37 const std::string& stream_url); | 37 const std::string& stream_url); |
38 int32_t OnHostMsgPutFrame(ppapi::host::HostMessageContext* context, | 38 int32_t OnHostMsgPutFrame(ppapi::host::HostMessageContext* context, |
39 const ppapi::HostResource& image_data_resource, | 39 const ppapi::HostResource& image_data_resource, |
40 PP_TimeTicks timestamp); | 40 PP_TimeTicks timestamp); |
41 int32_t OnHostMsgClose(ppapi::host::HostMessageContext* context); | 41 int32_t OnHostMsgClose(ppapi::host::HostMessageContext* context); |
42 | 42 |
43 RendererPpapiHost* renderer_ppapi_host_; | 43 RendererPpapiHost* renderer_ppapi_host_; |
44 | 44 |
45 VideoDestinationHandler::FrameWriterCallback frame_writer_; | 45 VideoDestinationHandler::FrameWriterCallback frame_writer_; |
46 | 46 |
47 base::WeakPtrFactory<PepperVideoDestinationHost> weak_factory_; | 47 base::WeakPtrFactory<PepperVideoDestinationHost> weak_factory_; |
48 | 48 |
49 DISALLOW_COPY_AND_ASSIGN(PepperVideoDestinationHost); | 49 DISALLOW_COPY_AND_ASSIGN(PepperVideoDestinationHost); |
50 }; | 50 }; |
51 | 51 |
52 } // namespace content | 52 } // namespace content |
53 | 53 |
54 #endif // CONTENT_RENDERER_PEPPER_PEPPER_VIDEO_DESTINATION_HOST_H_ | 54 #endif // CONTENT_RENDERER_PEPPER_PEPPER_VIDEO_DESTINATION_HOST_H_ |
OLD | NEW |