Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1894)

Unified Diff: content/renderer/pepper/pepper_video_source_host.h

Issue 14968002: Glue code to connect PPAPI proxy to MediaStream sources and destinations. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix casts. Use base::Time for timestamp calculation.x Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/renderer/pepper/pepper_video_source_host.h
diff --git a/content/renderer/pepper/pepper_video_source_host.h b/content/renderer/pepper/pepper_video_source_host.h
index c2a873f80e136498222f55164f4a64d91c6402aa..2b7131ec9139815e764e2e87619ce32154b38871 100644
--- a/content/renderer/pepper/pepper_video_source_host.h
+++ b/content/renderer/pepper/pepper_video_source_host.h
@@ -6,16 +6,21 @@
#define CONTENT_RENDERER_PEPPER_PEPPER_VIDEO_SOURCE_HOST_H_
#include "base/compiler_specific.h"
+#include "base/memory/scoped_ptr.h"
#include "base/memory/weak_ptr.h"
#include "content/common/content_export.h"
+#include "content/renderer/media/video_source_handler.h"
#include "ppapi/c/pp_time.h"
+#include "ppapi/host/host_message_context.h"
#include "ppapi/host/resource_host.h"
namespace content {
class RendererPpapiHost;
-class CONTENT_EXPORT PepperVideoSourceHost : public ppapi::host::ResourceHost {
+class CONTENT_EXPORT PepperVideoSourceHost
+ : public ppapi::host::ResourceHost,
+ public content::FrameReaderInterface {
public:
PepperVideoSourceHost(RendererPpapiHost* host,
PP_Instance instance,
@@ -23,6 +28,9 @@ class CONTENT_EXPORT PepperVideoSourceHost : public ppapi::host::ResourceHost {
virtual ~PepperVideoSourceHost();
+ // content::FrameReaderInterface implementation.
+ virtual bool GotFrame(cricket::VideoFrame* frame) OVERRIDE;
+
virtual int32_t OnResourceMessageReceived(
const IPC::Message& msg,
ppapi::host::HostMessageContext* context) OVERRIDE;
@@ -33,11 +41,26 @@ class CONTENT_EXPORT PepperVideoSourceHost : public ppapi::host::ResourceHost {
int32_t OnHostMsgGetFrame(ppapi::host::HostMessageContext* context);
int32_t OnHostMsgClose(ppapi::host::HostMessageContext* context);
+ void OnGotFrame(scoped_ptr<cricket::VideoFrame> frame);
+
+ int32_t ConvertFrame(ppapi::HostResource* image_data_resource,
+ PP_TimeTicks* timestamp);
+ void SendFrame(const ppapi::HostResource& image_data_resource,
+ PP_TimeTicks timestamp,
+ int32_t result);
+ void Close();
+
RendererPpapiHost* renderer_ppapi_host_;
base::WeakPtrFactory<PepperVideoSourceHost> weak_factory_;
- PP_TimeTicks last_timestamp_;
+ ppapi::host::ReplyMessageContext reply_context_;
+ base::MessageLoopProxy* main_message_loop_proxy_;
yzshen1 2013/05/06 20:40:18 shall we use scoped_refptr<>?
bbudge 2013/05/06 20:52:01 Done. I copied this from content/renderer/pepper/p
yzshen1 2013/05/06 22:02:45 Yeah. It makes sense to me to also change it. (in
+
+ scoped_ptr<content::VideoSourceHandler> source_handler_;
+ std::string stream_url_;
+ scoped_ptr<cricket::VideoFrame> last_frame_;
+ bool get_frame_pending_;
DISALLOW_COPY_AND_ASSIGN(PepperVideoSourceHost);
};

Powered by Google App Engine
This is Rietveld 408576698