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

Unified Diff: ppapi/proxy/media_stream_track_resource_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: Update 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
« no previous file with comments | « ppapi/ppapi_shared.gypi ('k') | ppapi/proxy/media_stream_track_resource_base.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/proxy/media_stream_track_resource_base.h
diff --git a/ppapi/proxy/media_stream_track_resource_base.h b/ppapi/proxy/media_stream_track_resource_base.h
new file mode 100644
index 0000000000000000000000000000000000000000..f302780eac2c1786d7b47ea4cb9d28bef2a9bb41
--- /dev/null
+++ b/ppapi/proxy/media_stream_track_resource_base.h
@@ -0,0 +1,63 @@
+// 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 PPAPI_PROXY_MEDIA_STREAM_TRACK_RESOURCE_BASE_H_
+#define PPAPI_PROXY_MEDIA_STREAM_TRACK_RESOURCE_BASE_H_
+
+#include "ppapi/proxy/plugin_resource.h"
+#include "ppapi/proxy/ppapi_proxy_export.h"
+#include "ppapi/shared_impl/media_stream_frame_buffer.h"
+
+namespace ppapi {
+namespace proxy {
+
+class PPAPI_PROXY_EXPORT MediaStreamTrackResourceBase
+ : public PluginResource,
+ public MediaStreamFrameBuffer::Delegate {
+ protected:
+ MediaStreamTrackResourceBase(Connection connection,
+ PP_Instance instance,
+ int pending_renderer_id,
+ const std::string& id);
+
+ virtual ~MediaStreamTrackResourceBase();
+
+ std::string id() const { return id_; }
+
+ bool has_ended() const { return has_ended_; }
+
+ MediaStreamFrameBuffer* frame_buffer() { return &frame_buffer_; }
+
+ void CloseInternal();
+
+ // Sends a frame index to the corresponding PepperMediaStreamTrackHostBase
+ // via an IPC message. The host adds the frame index into its
+ // |frame_buffer_| for reading or writing. Also see |MediaStreamFrameBuffer|.
+ void SendEnqueueFrameMessageToHost(int32_t index);
+
+ // PluginResource overrides:
+ virtual void OnReplyReceived(const ResourceMessageReplyParams& params,
+ const IPC::Message& msg) OVERRIDE;
+
+ private:
+ // Message handlers:
+ void OnPluginMsgInitFrames(const ResourceMessageReplyParams& params,
+ int32_t number_of_frames,
+ int32_t frame_size);
+ void OnPluginMsgEnqueueFrame(const ResourceMessageReplyParams& params,
+ int32_t index);
+
+ MediaStreamFrameBuffer frame_buffer_;
+
+ std::string id_;
+
+ bool has_ended_;
+
+ DISALLOW_COPY_AND_ASSIGN(MediaStreamTrackResourceBase);
+};
+
+} // namespace proxy
+} // namespace ppapi
+
+#endif // PPAPI_PROXY_MEDIA_STREAM_TRACK_RESOURCE_BASE_H_
« no previous file with comments | « ppapi/ppapi_shared.gypi ('k') | ppapi/proxy/media_stream_track_resource_base.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698