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

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

Issue 128683003: [PPAPI] Implement media stream video track API (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@video_track_impl_cl
Patch Set: Fix review issue Created 6 years, 11 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_media_stream_track_host_base.h
diff --git a/content/renderer/pepper/pepper_media_stream_track_host_base.h b/content/renderer/pepper/pepper_media_stream_track_host_base.h
new file mode 100644
index 0000000000000000000000000000000000000000..2e78d0595b3436655033f7aa1af94450ceb6e2d1
--- /dev/null
+++ b/content/renderer/pepper/pepper_media_stream_track_host_base.h
@@ -0,0 +1,59 @@
+// Copyright (c) 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CONTENT_RENDERER_PEPPER_PEPPER_MEDIA_STREAM_TRACK_HOST_BASE_H_
+#define CONTENT_RENDERER_PEPPER_PEPPER_MEDIA_STREAM_TRACK_HOST_BASE_H_
+
+#include "base/compiler_specific.h"
+#include "content/common/content_export.h"
+#include "ppapi/host/resource_host.h"
+#include "ppapi/shared_impl/media_stream_frame_buffer.h"
+
+namespace content {
+
+class RendererPpapiHost;
+
+class PepperMediaStreamTrackHostBase
+ : public ppapi::host::ResourceHost,
+ public ppapi::MediaStreamFrameBuffer::Delegate {
+ protected:
+ PepperMediaStreamTrackHostBase(RendererPpapiHost* host,
+ PP_Instance instance,
+ PP_Resource resource);
+ virtual ~PepperMediaStreamTrackHostBase();
+
+ bool InitFrames(int32_t number_of_frames, int32_t frame_size);
+
+ ppapi::MediaStreamFrameBuffer* frame_buffer() { return &frame_buffer_; }
+
+ // Sends a frame index to a paired MediaStreamTrackResourceBase via an IPC
+ // message, and then the resource will add the frame index into its
+ // |frame_buffer_| for reading or writing. Also see |MediaStreamFrameBuffer|.
bbudge 2014/01/10 22:57:06 Consider: // Sends a frame index to the correspond
Peng 2014/01/13 19:10:15 Done.
+ void PluginEnqueueFrame(int32_t index);
bbudge 2014/01/10 22:57:06 Consider renaming this to SendEnqueueFrameMessageT
Peng 2014/01/13 19:10:15 Done.
+
+ // Subclass should implement this method to get notification when the track is
+ // being closed.
bbudge 2014/01/10 22:57:06 Consider: // Subclasses must implement this method
Peng 2014/01/13 19:10:15 Done.
+ virtual void OnClose() = 0;
+
+ private:
+ // ResourceMessageHandler overrides:
+ virtual int32_t OnResourceMessageReceived(
+ const IPC::Message& msg,
+ ppapi::host::HostMessageContext* context) OVERRIDE;
+
+ // Message handlers:
+ int32_t OnHostMsgEnqueueFrame(ppapi::host::HostMessageContext* context,
+ int32_t index);
+ int32_t OnHostMsgClose(ppapi::host::HostMessageContext* context);
+
+ RendererPpapiHost* host_;
+
+ ppapi::MediaStreamFrameBuffer frame_buffer_;
+
+ DISALLOW_COPY_AND_ASSIGN(PepperMediaStreamTrackHostBase);
+};
+
+} // namespace content
+
+#endif // CONTENT_RENDERER_PEPPER_PEPPER_MEDIA_STREAM_TRACK_HOST_BASE_H_

Powered by Google App Engine
This is Rietveld 408576698