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

Side by Side Diff: ppapi/proxy/media_stream_track_resource_base.h

Issue 101463008: [NOT FOR REVIEW][PPAPI] Implement MediaStreamVideoTrack pepper API (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@lkgr
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 unified diff | Download patch
« no previous file with comments | « ppapi/proxy/interface_list.cc ('k') | ppapi/proxy/media_stream_track_resource_base.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2014 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.
4
5 #ifndef PPAPI_PROXY_MEDIA_STREAM_TRACK_RESOURCE_BASE_H_
6 #define PPAPI_PROXY_MEDIA_STREAM_TRACK_RESOURCE_BASE_H_
7
8 #include "ppapi/proxy/plugin_resource.h"
9 #include "ppapi/proxy/ppapi_proxy_export.h"
10 #include "ppapi/shared_impl/media_stream_frame_buffer.h"
11 #include "ppapi/thunk/ppb_media_stream_track_api.h"
12
13 namespace ppapi {
14 namespace proxy {
15
16 class PPAPI_PROXY_EXPORT MediaStreamTrackResourceBase
17 : public PluginResource,
18 public MediaStreamFrameBuffer::Delegate,
19 virtual public thunk::PPB_MediaStreamTrack_API {
20 protected:
21 MediaStreamTrackResourceBase(Connection connection,
22 PP_Instance instance,
23 int pending_renderer_id,
24 const std::string& id);
25
26 virtual ~MediaStreamTrackResourceBase();
27
28 std::string id() const { return id_; }
29
30 bool has_ended() const { return has_ended_; }
31
32 MediaStreamFrameBuffer* frame_buffer() { return &frame_buffer_; }
33
34 // Enqueue a frame into host's |frame_queue_|.
35 void HostEnqueueFrame(int32_t index);
36
37 // Resource overrides:
38 thunk::PPB_MediaStreamTrack_API* AsPPB_MediaStreamTrack_API() OVERRIDE;
39
40 // PluginResource overrides:
41 virtual void OnReplyReceived(const ResourceMessageReplyParams& params,
42 const IPC::Message& msg) OVERRIDE;
43
44 // PPB_MediaStreamTrack_API overrides:
45 virtual PP_Var GetId() OVERRIDE;
46 virtual PP_Bool HasEnded() OVERRIDE;
47 virtual void Close() OVERRIDE;
48
49 private:
50 // Message handlers:
51 void OnPluginMsgInitFrames(const ResourceMessageReplyParams& params,
52 int32_t number_of_frames,
53 int32_t frame_size);
54 void OnPluginMsgEnqueueFrame(const ResourceMessageReplyParams& params,
55 int32_t index);
56
57 MediaStreamFrameBuffer frame_buffer_;
58
59 std::string id_;
60
61 bool has_ended_;
62
63 DISALLOW_COPY_AND_ASSIGN(MediaStreamTrackResourceBase);
64 };
65
66 } // namespace proxy
67 } // namespace ppapi
68
69 #endif // PPAPI_PROXY_MEDIA_STREAM_TRACK_RESOURCE_BASE_H_
OLDNEW
« no previous file with comments | « ppapi/proxy/interface_list.cc ('k') | ppapi/proxy/media_stream_track_resource_base.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698