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 "base/memory/weak_ptr.h" | 9 #include "base/memory/weak_ptr.h" |
10 #include "content/public/renderer/media_stream_video_sink.h" | 10 #include "content/public/renderer/media_stream_video_sink.h" |
(...skipping 19 matching lines...) Expand all Loading... |
30 PP_Resource resource, | 30 PP_Resource resource, |
31 const blink::WebMediaStreamTrack& track); | 31 const blink::WebMediaStreamTrack& track); |
32 | 32 |
33 // Output mode constructor. | 33 // Output mode constructor. |
34 // In output mode, this class passes video frames from the associated | 34 // In output mode, this class passes video frames from the associated |
35 // pepper plugin to a newly created blink::WebMediaStreamTrack. | 35 // pepper plugin to a newly created blink::WebMediaStreamTrack. |
36 PepperMediaStreamVideoTrackHost(RendererPpapiHost* host, | 36 PepperMediaStreamVideoTrackHost(RendererPpapiHost* host, |
37 PP_Instance instance, | 37 PP_Instance instance, |
38 PP_Resource resource); | 38 PP_Resource resource); |
39 | 39 |
40 virtual bool IsMediaStreamVideoTrackHost() OVERRIDE; | 40 virtual bool IsMediaStreamVideoTrackHost() override; |
41 | 41 |
42 blink::WebMediaStreamTrack track() { return track_; } | 42 blink::WebMediaStreamTrack track() { return track_; } |
43 | 43 |
44 private: | 44 private: |
45 | 45 |
46 virtual ~PepperMediaStreamVideoTrackHost(); | 46 virtual ~PepperMediaStreamVideoTrackHost(); |
47 | 47 |
48 void InitBuffers(); | 48 void InitBuffers(); |
49 | 49 |
50 // PepperMediaStreamTrackHostBase overrides: | 50 // PepperMediaStreamTrackHostBase overrides: |
51 virtual void OnClose() OVERRIDE; | 51 virtual void OnClose() override; |
52 virtual int32_t OnHostMsgEnqueueBuffer( | 52 virtual int32_t OnHostMsgEnqueueBuffer( |
53 ppapi::host::HostMessageContext* context, int32_t index) OVERRIDE; | 53 ppapi::host::HostMessageContext* context, int32_t index) override; |
54 | 54 |
55 // Sends frame with |index| to |track_|. | 55 // Sends frame with |index| to |track_|. |
56 int32_t SendFrameToTrack(int32_t index); | 56 int32_t SendFrameToTrack(int32_t index); |
57 | 57 |
58 void OnVideoFrame(const scoped_refptr<media::VideoFrame>& frame, | 58 void OnVideoFrame(const scoped_refptr<media::VideoFrame>& frame, |
59 const media::VideoCaptureFormat& format, | 59 const media::VideoCaptureFormat& format, |
60 const base::TimeTicks& estimated_capture_time); | 60 const base::TimeTicks& estimated_capture_time); |
61 | 61 |
62 // MediaStreamVideoSource overrides: | 62 // MediaStreamVideoSource overrides: |
63 virtual void GetCurrentSupportedFormats( | 63 virtual void GetCurrentSupportedFormats( |
64 int max_requested_width, | 64 int max_requested_width, |
65 int max_requested_height, | 65 int max_requested_height, |
66 double max_requested_frame_rate, | 66 double max_requested_frame_rate, |
67 const VideoCaptureDeviceFormatsCB& callback) OVERRIDE; | 67 const VideoCaptureDeviceFormatsCB& callback) override; |
68 | 68 |
69 virtual void StartSourceImpl( | 69 virtual void StartSourceImpl( |
70 const media::VideoCaptureFormat& format, | 70 const media::VideoCaptureFormat& format, |
71 const VideoCaptureDeliverFrameCB& frame_callback) OVERRIDE; | 71 const VideoCaptureDeliverFrameCB& frame_callback) override; |
72 | 72 |
73 virtual void StopSourceImpl() OVERRIDE; | 73 virtual void StopSourceImpl() override; |
74 | 74 |
75 // ResourceHost overrides: | 75 // ResourceHost overrides: |
76 virtual void DidConnectPendingHostToResource() OVERRIDE; | 76 virtual void DidConnectPendingHostToResource() override; |
77 | 77 |
78 // ResourceMessageHandler overrides: | 78 // ResourceMessageHandler overrides: |
79 virtual int32_t OnResourceMessageReceived( | 79 virtual int32_t OnResourceMessageReceived( |
80 const IPC::Message& msg, | 80 const IPC::Message& msg, |
81 ppapi::host::HostMessageContext* context) OVERRIDE; | 81 ppapi::host::HostMessageContext* context) override; |
82 | 82 |
83 // Message handlers: | 83 // Message handlers: |
84 int32_t OnHostMsgConfigure( | 84 int32_t OnHostMsgConfigure( |
85 ppapi::host::HostMessageContext* context, | 85 ppapi::host::HostMessageContext* context, |
86 const ppapi::MediaStreamVideoTrackShared::Attributes& attributes); | 86 const ppapi::MediaStreamVideoTrackShared::Attributes& attributes); |
87 | 87 |
88 void InitBlinkTrack(); | 88 void InitBlinkTrack(); |
89 void OnTrackStarted(MediaStreamSource* source, | 89 void OnTrackStarted(MediaStreamSource* source, |
90 MediaStreamRequestResult result, | 90 MediaStreamRequestResult result, |
91 const blink::WebString& result_name); | 91 const blink::WebString& result_name); |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
124 scoped_refptr<FrameDeliverer> frame_deliverer_; | 124 scoped_refptr<FrameDeliverer> frame_deliverer_; |
125 | 125 |
126 base::WeakPtrFactory<PepperMediaStreamVideoTrackHost> weak_factory_; | 126 base::WeakPtrFactory<PepperMediaStreamVideoTrackHost> weak_factory_; |
127 | 127 |
128 DISALLOW_COPY_AND_ASSIGN(PepperMediaStreamVideoTrackHost); | 128 DISALLOW_COPY_AND_ASSIGN(PepperMediaStreamVideoTrackHost); |
129 }; | 129 }; |
130 | 130 |
131 } // namespace content | 131 } // namespace content |
132 | 132 |
133 #endif // CONTENT_RENDERER_PEPPER_PEPPER_MEDIA_STREAM_VIDEO_TRACK_HOST_H_ | 133 #endif // CONTENT_RENDERER_PEPPER_PEPPER_MEDIA_STREAM_VIDEO_TRACK_HOST_H_ |
OLD | NEW |