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