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

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

Issue 1829193003: Request frame for new sinks from MediaStreamVideoTrack (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Propogate RequestFrame() calls. Created 4 years, 9 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
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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_CANVAS_CAPTURE_HANDLER_H_ 5 #ifndef CONTENT_RENDERER_MEDIA_CANVAS_CAPTURE_HANDLER_H_
6 #define CONTENT_RENDERER_MEDIA_CANVAS_CAPTURE_HANDLER_H_ 6 #define CONTENT_RENDERER_MEDIA_CANVAS_CAPTURE_HANDLER_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 10
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 // blink::WebCanvasCaptureHandler Implementation. 46 // blink::WebCanvasCaptureHandler Implementation.
47 void sendNewFrame(const SkImage* image) override; 47 void sendNewFrame(const SkImage* image) override;
48 bool needsNewFrame() const override; 48 bool needsNewFrame() const override;
49 49
50 // Functions called by media::VideoCapturerSource implementation. 50 // Functions called by media::VideoCapturerSource implementation.
51 void StartVideoCapture( 51 void StartVideoCapture(
52 const media::VideoCaptureParams& params, 52 const media::VideoCaptureParams& params,
53 const media::VideoCapturerSource::VideoCaptureDeliverFrameCB& 53 const media::VideoCapturerSource::VideoCaptureDeliverFrameCB&
54 new_frame_callback, 54 new_frame_callback,
55 const media::VideoCapturerSource::RunningCallback& running_callback); 55 const media::VideoCapturerSource::RunningCallback& running_callback);
56 void RequestLastFrame();
56 void StopVideoCapture(); 57 void StopVideoCapture();
57 blink::WebSize GetSourceSize() const { return size_; } 58 blink::WebSize GetSourceSize() const { return size_; }
58 59
59 private: 60 private:
60 // A VideoCapturerSource instance is created, which is responsible for handing 61 // A VideoCapturerSource instance is created, which is responsible for handing
61 // stop&start callbacks back to CanvasCaptureHandler. That VideoCapturerSource 62 // stop&start callbacks back to CanvasCaptureHandler. That VideoCapturerSource
62 // is then plugged into a MediaStreamTrack passed as |track|, and it is owned 63 // is then plugged into a MediaStreamTrack passed as |track|, and it is owned
63 // by the Blink side MediaStreamSource. 64 // by the Blink side MediaStreamSource.
64 CanvasCaptureHandler( 65 CanvasCaptureHandler(
65 const blink::WebSize& size, 66 const blink::WebSize& size,
(...skipping 13 matching lines...) Expand all
79 media::VideoCaptureFormat capture_format_; 80 media::VideoCaptureFormat capture_format_;
80 bool ask_for_new_frame_; 81 bool ask_for_new_frame_;
81 82
82 const blink::WebSize size_; 83 const blink::WebSize size_;
83 gfx::Size last_size; 84 gfx::Size last_size;
84 std::vector<uint8_t> temp_data_; 85 std::vector<uint8_t> temp_data_;
85 size_t row_bytes_; 86 size_t row_bytes_;
86 SkImageInfo image_info_; 87 SkImageInfo image_info_;
87 media::VideoFramePool frame_pool_; 88 media::VideoFramePool frame_pool_;
88 89
90 scoped_refptr<media::VideoFrame> last_frame_;
91 base::TimeTicks last_frame_estimated_capture_time_;
92
89 const scoped_refptr<base::SingleThreadTaskRunner> io_task_runner_; 93 const scoped_refptr<base::SingleThreadTaskRunner> io_task_runner_;
90 scoped_ptr<CanvasCaptureHandlerDelegate> delegate_; 94 scoped_ptr<CanvasCaptureHandlerDelegate> delegate_;
91 95
92 // Bound to Main Render thread. 96 // Bound to Main Render thread.
93 base::ThreadChecker main_render_thread_checker_; 97 base::ThreadChecker main_render_thread_checker_;
94 base::WeakPtrFactory<CanvasCaptureHandler> weak_ptr_factory_; 98 base::WeakPtrFactory<CanvasCaptureHandler> weak_ptr_factory_;
95 99
96 DISALLOW_COPY_AND_ASSIGN(CanvasCaptureHandler); 100 DISALLOW_COPY_AND_ASSIGN(CanvasCaptureHandler);
97 }; 101 };
98 102
99 } // namespace content 103 } // namespace content
100 104
101 #endif // CONTENT_RENDERER_MEDIA_CANVAS_CAPTURE_HANDLER_H_ 105 #endif // CONTENT_RENDERER_MEDIA_CANVAS_CAPTURE_HANDLER_H_
OLDNEW
« no previous file with comments | « no previous file | content/renderer/media/canvas_capture_handler.cc » ('j') | media/base/video_capturer_source.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698