| OLD | NEW |
| (Empty) | |
| 1 // Copyright (c) 2013 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_VIDEO_TRACK_HOST_H_ |
| 6 #define CONTENT_RENDERER_PEPPER_PEPPER_MEDIA_STREAM_VIDEO_TRACK_HOST_H_ |
| 7 |
| 8 #include "base/compiler_specific.h" |
| 9 #include "base/synchronization/lock.h" |
| 10 #include "content/common/content_export.h" |
| 11 #include "content/public/renderer/media_stream_video_sink.h" |
| 12 #include "content/renderer/pepper/pepper_io_stream_host.h" |
| 13 #include "media/base/video_frame.h" |
| 14 #include "ppapi/host/host_message_context.h" |
| 15 #include "ppapi/host/resource_host.h" |
| 16 #include "ppapi/shared_impl/io_stream_shared.h" |
| 17 #include "third_party/WebKit/public/platform/WebMediaStreamTrack.h" |
| 18 #include "ui/gfx/size.h" |
| 19 |
| 20 namespace content { |
| 21 |
| 22 class PepperMediaStreamVideoTrackHost : |
| 23 public PepperIOStreamHost, |
| 24 public MediaStreamVideoSink { |
| 25 public: |
| 26 PepperMediaStreamVideoTrackHost(RendererPpapiHost* host, |
| 27 PP_Instance instance, |
| 28 PP_Resource resource, |
| 29 const blink::WebMediaStreamTrack& track); |
| 30 |
| 31 virtual ~PepperMediaStreamVideoTrackHost(); |
| 32 |
| 33 virtual int32_t OnResourceMessageReceived( |
| 34 const IPC::Message& msg, |
| 35 ppapi::host::HostMessageContext* context) OVERRIDE; |
| 36 |
| 37 virtual void OnVideoFrame( |
| 38 const scoped_refptr<media::VideoFrame>& frame) OVERRIDE; |
| 39 |
| 40 protected: |
| 41 virtual void DidConnectPendingHostToResource() OVERRIDE; |
| 42 |
| 43 private: |
| 44 int32_t OnHostMsgStartCapture(ppapi::host::HostMessageContext* context); |
| 45 |
| 46 void AllocFrameBuffers(); |
| 47 |
| 48 blink::WebMediaStreamTrack track_; |
| 49 |
| 50 // frame buffer size in frames. |
| 51 uint32_t frame_buffer_size_; |
| 52 |
| 53 // frame size. |
| 54 gfx::Size frame_size_; |
| 55 |
| 56 // frame format. |
| 57 media::VideoFrame::Format frame_format_; |
| 58 |
| 59 // frame data size in bytes. |
| 60 uint32_t frame_data_size_; |
| 61 |
| 62 uint32_t slot_size_; |
| 63 |
| 64 DISALLOW_COPY_AND_ASSIGN(PepperMediaStreamVideoTrackHost); |
| 65 }; |
| 66 |
| 67 } // namespace content |
| 68 |
| 69 #endif // CONTENT_RENDERER_PEPPER_PEPPER_MEDIA_STREAM_VIDEO_TRACK_HOST_H_ |
| OLD | NEW |