| 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 CONTENT_RENDERER_PEPPER_PEPPER_MEDIA_STREAM_TRACK_HOST_BASE_H_ |
| 6 #define CONTENT_RENDERER_PEPPER_PEPPER_MEDIA_STREAM_TRACK_HOST_BASE_H_ |
| 7 |
| 8 #include "base/compiler_specific.h" |
| 9 #include "content/common/content_export.h" |
| 10 #include "ppapi/host/resource_host.h" |
| 11 #include "ppapi/shared_impl/media_stream_track_base_shared.h" |
| 12 |
| 13 namespace content { |
| 14 |
| 15 class RendererPpapiHost; |
| 16 |
| 17 class PepperMediaStreamTrackHostBase |
| 18 : public ppapi::host::ResourceHost, |
| 19 public ppapi::MediaStreamTrackBaseShared { |
| 20 protected: |
| 21 PepperMediaStreamTrackHostBase(RendererPpapiHost* host, |
| 22 PP_Instance instance, |
| 23 PP_Resource resource); |
| 24 |
| 25 virtual ~PepperMediaStreamTrackHostBase(); |
| 26 |
| 27 bool InitFrames(int32_t number_of_frames, int32_t frame_size); |
| 28 |
| 29 virtual int32_t OnResourceMessageReceived( |
| 30 const IPC::Message& msg, |
| 31 ppapi::host::HostMessageContext* context) OVERRIDE; |
| 32 |
| 33 // Enqueue a frame into plugin's |frame_queue_|. |
| 34 void PluginEnqueueFrame(int32_t index); |
| 35 |
| 36 // Subclass should implement this method to get notification when the track is |
| 37 // being closed. |
| 38 virtual void OnClose() = 0; |
| 39 |
| 40 // Messages handlers: |
| 41 int32_t OnHostMsgEnqueueFrame(ppapi::host::HostMessageContext* context, |
| 42 int32_t index); |
| 43 int32_t OnHostMsgClose(ppapi::host::HostMessageContext* context); |
| 44 |
| 45 private: |
| 46 RendererPpapiHost* host_; |
| 47 |
| 48 DISALLOW_COPY_AND_ASSIGN(PepperMediaStreamTrackHostBase); |
| 49 }; |
| 50 |
| 51 } // namespace content |
| 52 |
| 53 #endif // CONTENT_RENDERER_PEPPER_PEPPER_MEDIA_STREAM_TRACK_HOST_BASE_H_ |
| OLD | NEW |