Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(411)

Side by Side Diff: content/renderer/media/media_stream_video_source.h

Issue 242013002: Refactor video capturing code in the render process (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: comments and merged Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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 virtual void DeliverVideoFrame(const scoped_refptr<media::VideoFrame>& frame); 85 // |format| contains extra information like the frame rate of this source.
86 // |timestamp| is the time when the frame is generated. This field allows
87 // synchronization with other sources.
88 virtual void DeliverVideoFrame(const scoped_refptr<media::VideoFrame>& frame,
89 const media::VideoCaptureFormat& format,
90 const base::TimeTicks& timestamp);
86 91
87 // An implementation must fetch the formats that can currently be used by 92 // An implementation must fetch the formats that can currently be used by
88 // the source and call OnSupportedFormats when done. 93 // the source and call OnSupportedFormats when done.
89 // |max_requested_height| and |max_requested_width| is the max height and 94 // |max_requested_height| and |max_requested_width| is the max height and
90 // width set as a mandatory constraint if set when calling 95 // width set as a mandatory constraint if set when calling
91 // MediaStreamVideoSource::AddTrack. If max height and max width is not set 96 // MediaStreamVideoSource::AddTrack. If max height and max width is not set
92 // |max_requested_height| and |max_requested_width| are 0. 97 // |max_requested_height| and |max_requested_width| are 0.
93 virtual void GetCurrentSupportedFormats(int max_requested_width, 98 virtual void GetCurrentSupportedFormats(int max_requested_width,
94 int max_requested_height) = 0; 99 int max_requested_height) = 0;
95 void OnSupportedFormats(const media::VideoCaptureFormats& formats); 100 void OnSupportedFormats(const media::VideoCaptureFormats& formats);
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
163 168
164 // Tracks that currently are receiving video frames. 169 // Tracks that currently are receiving video frames.
165 std::vector<MediaStreamVideoTrack*> tracks_; 170 std::vector<MediaStreamVideoTrack*> tracks_;
166 171
167 DISALLOW_COPY_AND_ASSIGN(MediaStreamVideoSource); 172 DISALLOW_COPY_AND_ASSIGN(MediaStreamVideoSource);
168 }; 173 };
169 174
170 } // namespace content 175 } // namespace content
171 176
172 #endif // CONTENT_RENDERER_MEDIA_MEDIA_STREAM_VIDEO_SOURCE_H_ 177 #endif // CONTENT_RENDERER_MEDIA_MEDIA_STREAM_VIDEO_SOURCE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698