Chromium Code Reviews| OLD | NEW |
|---|---|
| (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 | |
| 12 namespace ppapi { | |
| 13 namespace proxy { | |
| 14 | |
| 15 class PPAPI_PROXY_EXPORT MediaStreamTrackResourceBase | |
| 16 : public PluginResource, | |
| 17 public MediaStreamFrameBuffer::Delegate { | |
| 18 protected: | |
| 19 MediaStreamTrackResourceBase(Connection connection, | |
| 20 PP_Instance instance, | |
| 21 int pending_renderer_id, | |
| 22 const std::string& id); | |
| 23 | |
| 24 virtual ~MediaStreamTrackResourceBase(); | |
| 25 | |
| 26 std::string id() const { return id_; } | |
| 27 | |
| 28 bool has_ended() const { return has_ended_; } | |
| 29 | |
| 30 MediaStreamFrameBuffer* frame_buffer() { return &frame_buffer_; } | |
| 31 | |
| 32 void CloseInternal(); | |
| 33 | |
| 34 // Enqueue a frame into host's |frame_queue_|. | |
|
yzshen1
2014/01/10 21:05:17
nit: Maybe say something like "Notifies the host t
Peng
2014/01/10 22:46:58
That is better. Done
| |
| 35 void HostEnqueueFrame(int32_t index); | |
|
bbudge
2014/01/10 22:57:06
Consider renaming this to match the host method:
S
Peng
2014/01/13 19:10:15
Done.
| |
| 36 | |
| 37 // PluginResource overrides: | |
| 38 virtual void OnReplyReceived(const ResourceMessageReplyParams& params, | |
| 39 const IPC::Message& msg) OVERRIDE; | |
| 40 | |
| 41 private: | |
| 42 // Message handlers: | |
| 43 void OnPluginMsgInitFrames(const ResourceMessageReplyParams& params, | |
| 44 int32_t number_of_frames, | |
| 45 int32_t frame_size); | |
| 46 void OnPluginMsgEnqueueFrame(const ResourceMessageReplyParams& params, | |
| 47 int32_t index); | |
| 48 | |
| 49 MediaStreamFrameBuffer frame_buffer_; | |
| 50 | |
| 51 std::string id_; | |
| 52 | |
| 53 bool has_ended_; | |
| 54 | |
| 55 DISALLOW_COPY_AND_ASSIGN(MediaStreamTrackResourceBase); | |
| 56 }; | |
| 57 | |
| 58 } // namespace proxy | |
| 59 } // namespace ppapi | |
| 60 | |
| 61 #endif // PPAPI_PROXY_MEDIA_STREAM_TRACK_RESOURCE_BASE_H_ | |
| OLD | NEW |