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); |
}; |