OLD | NEW |
---|---|
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CONTENT_RENDERER_PEPPER_PEPPER_MEDIA_STREAM_VIDEO_TRACK_HOST_H_ | 5 #ifndef CONTENT_RENDERER_PEPPER_PEPPER_MEDIA_STREAM_VIDEO_TRACK_HOST_H_ |
6 #define CONTENT_RENDERER_PEPPER_PEPPER_MEDIA_STREAM_VIDEO_TRACK_HOST_H_ | 6 #define CONTENT_RENDERER_PEPPER_PEPPER_MEDIA_STREAM_VIDEO_TRACK_HOST_H_ |
7 | 7 |
8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
9 #include "content/public/renderer/media_stream_video_sink.h" | 9 #include "content/public/renderer/media_stream_video_sink.h" |
10 #include "content/renderer/pepper/pepper_media_stream_track_host_base.h" | 10 #include "content/renderer/pepper/pepper_media_stream_track_host_base.h" |
11 #include "media/base/video_frame.h" | 11 #include "media/base/video_frame.h" |
12 #include "ppapi/c/ppb_video_frame.h" | |
13 #include "ppapi/shared_impl/media_stream_video_track_shared.h" | |
12 #include "third_party/WebKit/public/platform/WebMediaStreamTrack.h" | 14 #include "third_party/WebKit/public/platform/WebMediaStreamTrack.h" |
13 #include "ui/gfx/size.h" | 15 #include "ui/gfx/size.h" |
14 | 16 |
15 namespace content { | 17 namespace content { |
16 | 18 |
17 class PepperMediaStreamVideoTrackHost : public PepperMediaStreamTrackHostBase, | 19 class PepperMediaStreamVideoTrackHost : public PepperMediaStreamTrackHostBase, |
18 public MediaStreamVideoSink { | 20 public MediaStreamVideoSink { |
19 public: | 21 public: |
20 PepperMediaStreamVideoTrackHost(RendererPpapiHost* host, | 22 PepperMediaStreamVideoTrackHost(RendererPpapiHost* host, |
21 PP_Instance instance, | 23 PP_Instance instance, |
22 PP_Resource resource, | 24 PP_Resource resource, |
23 const blink::WebMediaStreamTrack& track); | 25 const blink::WebMediaStreamTrack& track); |
24 | 26 |
25 private: | 27 private: |
26 virtual ~PepperMediaStreamVideoTrackHost(); | 28 virtual ~PepperMediaStreamVideoTrackHost(); |
27 | 29 |
30 void InitBuffers(); | |
31 | |
28 // PepperMediaStreamTrackHostBase overrides: | 32 // PepperMediaStreamTrackHostBase overrides: |
29 virtual void OnClose() OVERRIDE; | 33 virtual void OnClose() OVERRIDE; |
30 | 34 |
31 // MediaStreamVideoSink overrides: | 35 // MediaStreamVideoSink overrides: |
32 virtual void OnVideoFrame( | 36 virtual void OnVideoFrame( |
33 const scoped_refptr<media::VideoFrame>& frame) OVERRIDE; | 37 const scoped_refptr<media::VideoFrame>& frame) OVERRIDE; |
34 | 38 |
35 // ResourceHost overrides: | 39 // ResourceHost overrides: |
36 virtual void DidConnectPendingHostToResource() OVERRIDE; | 40 virtual void DidConnectPendingHostToResource() OVERRIDE; |
37 | 41 |
42 // ResourceMessageHandler overrides: | |
43 virtual int32_t OnResourceMessageReceived( | |
44 const IPC::Message& msg, | |
45 ppapi::host::HostMessageContext* context) OVERRIDE; | |
46 | |
47 // Message handlers: | |
48 int32_t OnHostMsgConfigure( | |
49 ppapi::host::HostMessageContext* context, | |
50 const ppapi::MediaStreamVideoTrackShared::Attributes& attributes); | |
51 | |
38 blink::WebMediaStreamTrack track_; | 52 blink::WebMediaStreamTrack track_; |
39 | 53 |
40 // True if it has been added to |blink::WebMediaStreamTrack| as a sink. | 54 // True if it has been added to |blink::WebMediaStreamTrack| as a sink. |
41 bool connected_; | 55 bool connected_; |
42 | 56 |
57 // number of buffers | |
yzshen1
2014/02/13 19:23:26
Capital initial and trailing period please.
Peng
2014/02/13 21:28:34
Done.
| |
58 int32_t buffers_; | |
59 | |
43 // Frame size. | 60 // Frame size. |
44 gfx::Size frame_size_; | 61 gfx::Size frame_size_; |
45 | 62 |
46 // Frame format. | 63 // Plugin specified frame size. |
47 media::VideoFrame::Format frame_format_; | 64 gfx::Size plugin_frame_size_; |
65 | |
66 // Format of frames which are received from MediaStreamVideoSink. | |
67 PP_VideoFrame_Format frame_format_; | |
68 | |
69 // Plugin specified frame format. | |
70 PP_VideoFrame_Format plugin_frame_format_; | |
48 | 71 |
49 // The size of frame pixels in bytes. | 72 // The size of frame pixels in bytes. |
50 uint32_t frame_data_size_; | 73 uint32_t frame_data_size_; |
51 | 74 |
52 DISALLOW_COPY_AND_ASSIGN(PepperMediaStreamVideoTrackHost); | 75 DISALLOW_COPY_AND_ASSIGN(PepperMediaStreamVideoTrackHost); |
53 }; | 76 }; |
54 | 77 |
55 } // namespace content | 78 } // namespace content |
56 | 79 |
57 #endif // CONTENT_RENDERER_PEPPER_PEPPER_MEDIA_STREAM_VIDEO_TRACK_HOST_H_ | 80 #endif // CONTENT_RENDERER_PEPPER_PEPPER_MEDIA_STREAM_VIDEO_TRACK_HOST_H_ |
OLD | NEW |