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

Unified Diff: content/renderer/media/video_track_recorder.h

Issue 1886123002: [experimental] MR: add support for H264 recording (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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 side-by-side diff with in-line comments
Download patch
Index: content/renderer/media/video_track_recorder.h
diff --git a/content/renderer/media/video_track_recorder.h b/content/renderer/media/video_track_recorder.h
index 971257bf7263470b1014d5d23eb96de6f0522555..b9094f528ed7de509d06267d4a4d8de13af0c931 100644
--- a/content/renderer/media/video_track_recorder.h
+++ b/content/renderer/media/video_track_recorder.h
@@ -21,21 +21,28 @@ namespace content {
// VideoTrackRecorder is a MediaStreamVideoSink that encodes the video frames
// received from a Stream Video Track. The class is constructed and used on a
-// single thread, namely the main Render thread. It has an internal VpxEncoder
-// with its own threading subtleties, see the implementation file. This mirrors
-// the other MediaStreamVideo* classes that are constructed/configured on Main
+// single thread, namely the main Render thread. It has an internal Encoder with
+// its own threading subtleties, see the implementation file. This mirrors the
+// other MediaStreamVideo* classes that are constructed/configured on Main
// Render thread but that pass frames on Render IO thread.
class CONTENT_EXPORT VideoTrackRecorder
: NON_EXPORTED_BASE(public MediaStreamVideoSink) {
public:
+ enum class CodecId {
+ VP8,
+ VP9,
+ H264,
+ MAX = H264
+ };
+ class Encoder;
+
using OnEncodedVideoCB =
base::Callback<void(const scoped_refptr<media::VideoFrame>& video_frame,
std::unique_ptr<std::string> encoded_data,
base::TimeTicks capture_timestamp,
bool is_key_frame)>;
- // |use_vp9| forces using VP9, otherwise VP8 will be used by default.
- VideoTrackRecorder(bool use_vp9,
+ VideoTrackRecorder(CodecId codec,
const blink::WebMediaStreamTrack& track,
const OnEncodedVideoCB& on_encoded_video_cb,
int32_t bits_per_second);
@@ -55,9 +62,8 @@ class CONTENT_EXPORT VideoTrackRecorder
// We need to hold on to the Blink track to remove ourselves on dtor.
blink::WebMediaStreamTrack track_;
- // Forward declaration and member of an inner class to encode using VPx.
- class VpxEncoder;
- const scoped_refptr<VpxEncoder> encoder_;
+ // Forward declaration and member of an inner class to encode.
+ scoped_refptr<Encoder> encoder_;
DISALLOW_COPY_AND_ASSIGN(VideoTrackRecorder);
};
« no previous file with comments | « content/renderer/media/media_recorder_handler_unittest.cc ('k') | content/renderer/media/video_track_recorder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698