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_MEDIA_MEDIA_STREAM_VIDEO_SOURCE_H_ | 5 #ifndef CONTENT_RENDERER_MEDIA_MEDIA_STREAM_VIDEO_SOURCE_H_ |
6 #define CONTENT_RENDERER_MEDIA_MEDIA_STREAM_VIDEO_SOURCE_H_ | 6 #define CONTENT_RENDERER_MEDIA_MEDIA_STREAM_VIDEO_SOURCE_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 | 75 |
76 protected: | 76 protected: |
77 virtual void DoStopSource() OVERRIDE; | 77 virtual void DoStopSource() OVERRIDE; |
78 | 78 |
79 // Sets ready state and notifies the ready state to all registered tracks. | 79 // Sets ready state and notifies the ready state to all registered tracks. |
80 virtual void SetReadyState(blink::WebMediaStreamSource::ReadyState state); | 80 virtual void SetReadyState(blink::WebMediaStreamSource::ReadyState state); |
81 | 81 |
82 // Delivers |frame| to registered tracks according to their constraints. | 82 // Delivers |frame| to registered tracks according to their constraints. |
83 // Note: current implementation assumes |frame| be contiguous layout of image | 83 // Note: current implementation assumes |frame| be contiguous layout of image |
84 // planes and I420. | 84 // planes and I420. |
85 // |format| contains extra information like the frame rate of this source. | 85 virtual void DeliverVideoFrame(const scoped_refptr<media::VideoFrame>& frame); |
86 virtual void DeliverVideoFrame(const scoped_refptr<media::VideoFrame>& frame, | |
87 const media::VideoCaptureFormat& format); | |
88 | 86 |
89 // An implementation must fetch the formats that can currently be used by | 87 // An implementation must fetch the formats that can currently be used by |
90 // the source and call OnSupportedFormats when done. | 88 // the source and call OnSupportedFormats when done. |
91 // |max_requested_height| and |max_requested_width| is the max height and | 89 // |max_requested_height| and |max_requested_width| is the max height and |
92 // width set as a mandatory constraint if set when calling | 90 // width set as a mandatory constraint if set when calling |
93 // MediaStreamVideoSource::AddTrack. If max height and max width is not set | 91 // MediaStreamVideoSource::AddTrack. If max height and max width is not set |
94 // |max_requested_height| and |max_requested_width| are 0. | 92 // |max_requested_height| and |max_requested_width| are 0. |
95 virtual void GetCurrentSupportedFormats(int max_requested_width, | 93 virtual void GetCurrentSupportedFormats(int max_requested_width, |
96 int max_requested_height) = 0; | 94 int max_requested_height) = 0; |
97 void OnSupportedFormats(const media::VideoCaptureFormats& formats); | 95 void OnSupportedFormats(const media::VideoCaptureFormats& formats); |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
165 | 163 |
166 // Tracks that currently are receiving video frames. | 164 // Tracks that currently are receiving video frames. |
167 std::vector<MediaStreamVideoTrack*> tracks_; | 165 std::vector<MediaStreamVideoTrack*> tracks_; |
168 | 166 |
169 DISALLOW_COPY_AND_ASSIGN(MediaStreamVideoSource); | 167 DISALLOW_COPY_AND_ASSIGN(MediaStreamVideoSource); |
170 }; | 168 }; |
171 | 169 |
172 } // namespace content | 170 } // namespace content |
173 | 171 |
174 #endif // CONTENT_RENDERER_MEDIA_MEDIA_STREAM_VIDEO_SOURCE_H_ | 172 #endif // CONTENT_RENDERER_MEDIA_MEDIA_STREAM_VIDEO_SOURCE_H_ |
OLD | NEW |