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

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

Issue 2000003002: Initialize based on frame sizes in VideoTrackRecorder (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@mrgpu2
Patch Set: Retake. Created 4 years, 6 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_VIDEO_TRACK_RECORDER_H_ 5 #ifndef CONTENT_RENDERER_MEDIA_VIDEO_TRACK_RECORDER_H_
6 #define CONTENT_RENDERER_MEDIA_VIDEO_TRACK_RECORDER_H_ 6 #define CONTENT_RENDERER_MEDIA_VIDEO_TRACK_RECORDER_H_
7 7
8 #include <memory> 8 #include <memory>
9 9
10 #include "base/macros.h" 10 #include "base/macros.h"
11 #include "base/memory/ref_counted.h" 11 #include "base/memory/ref_counted.h"
12 #include "base/memory/weak_ptr.h"
13 #include "base/single_thread_task_runner.h"
12 #include "base/threading/thread_checker.h" 14 #include "base/threading/thread_checker.h"
13 #include "content/public/common/features.h" 15 #include "content/public/common/features.h"
14 #include "content/public/renderer/media_stream_video_sink.h" 16 #include "content/public/renderer/media_stream_video_sink.h"
15 #include "third_party/WebKit/public/platform/WebMediaStreamTrack.h" 17 #include "third_party/WebKit/public/platform/WebMediaStreamTrack.h"
16 18
17 namespace media { 19 namespace media {
18 class VideoFrame; 20 class VideoFrame;
19 } // namespace media 21 } // namespace media
20 22
21 namespace content { 23 namespace content {
(...skipping 27 matching lines...) Expand all
49 ~VideoTrackRecorder() override; 51 ~VideoTrackRecorder() override;
50 52
51 void Pause(); 53 void Pause();
52 void Resume(); 54 void Resume();
53 55
54 void OnVideoFrameForTesting(const scoped_refptr<media::VideoFrame>& frame, 56 void OnVideoFrameForTesting(const scoped_refptr<media::VideoFrame>& frame,
55 base::TimeTicks capture_time); 57 base::TimeTicks capture_time);
56 private: 58 private:
57 friend class VideoTrackRecorderTest; 59 friend class VideoTrackRecorderTest;
58 60
61 void InitializeEncoder(const scoped_refptr<media::VideoFrame>& frame,
62 base::TimeTicks capture_time);
63 void InitializeEncoderTask(const scoped_refptr<media::VideoFrame>& frame,
64 base::TimeTicks capture_time);
mcasas 2016/06/08 18:51:24 Shift four spaces right. s/InitializeEncoderTask/
emircan 2016/06/09 03:03:43 Done.
mcasas 2016/06/12 08:56:34 And this? However: irrelevant, after my other seri
65
59 // Used to check that we are destroyed on the same thread we were created. 66 // Used to check that we are destroyed on the same thread we were created.
60 base::ThreadChecker main_render_thread_checker_; 67 base::ThreadChecker main_render_thread_checker_;
61 68
69 // Used to post initialization on the same thread we were created.
70 const scoped_refptr<base::SingleThreadTaskRunner> main_task_runner_;
71
72 // Task runner where frame encode callbacks must happen.
73 scoped_refptr<base::SingleThreadTaskRunner> origin_task_runner_;
74
62 // We need to hold on to the Blink track to remove ourselves on dtor. 75 // We need to hold on to the Blink track to remove ourselves on dtor.
63 blink::WebMediaStreamTrack track_; 76 blink::WebMediaStreamTrack track_;
64 77
65 // Inner class to encode using whichever codec is configured. 78 // Inner class to encode using whichever codec is configured.
66 scoped_refptr<Encoder> encoder_; 79 scoped_refptr<Encoder> encoder_;
67 80
81 // Parameters that would be passed to the underlying |encoder_|.
82 const CodecId codec_;
83 const OnEncodedVideoCB on_encoded_video_callback_;
84 const int32_t bits_per_second_;
85
86 // Used to track the paused state during the initialization process.
87 bool paused_before_init_;
88
89 base::WeakPtrFactory<VideoTrackRecorder> weak_ptr_factory_;
90
68 DISALLOW_COPY_AND_ASSIGN(VideoTrackRecorder); 91 DISALLOW_COPY_AND_ASSIGN(VideoTrackRecorder);
69 }; 92 };
70 93
71 } // namespace content 94 } // namespace content
72 #endif // CONTENT_RENDERER_MEDIA_VIDEO_TRACK_RECORDER_H_ 95 #endif // CONTENT_RENDERER_MEDIA_VIDEO_TRACK_RECORDER_H_
OLDNEW
« no previous file with comments | « no previous file | content/renderer/media/video_track_recorder.cc » ('j') | content/renderer/media/video_track_recorder.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698