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

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

Issue 1407083006: Update MediaRecorderHandler to use AudioTrackRecorder (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: mcasas@'s comments Created 5 years, 1 month 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
« no previous file with comments | « no previous file | content/renderer/media/media_recorder_handler.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/media/media_recorder_handler.h
diff --git a/content/renderer/media/media_recorder_handler.h b/content/renderer/media/media_recorder_handler.h
index 0c4f3a99a24071a1591bf6cd1d68ffd00f39a120..bab331f47cb824ff8cfe1c262cf35b69201db66d 100644
--- a/content/renderer/media/media_recorder_handler.h
+++ b/content/renderer/media/media_recorder_handler.h
@@ -20,6 +20,8 @@ class WebString;
} // namespace blink
namespace media {
+class AudioBus;
+class AudioParameters;
class VideoFrame;
class WebmMuxer;
} // namespace media
@@ -27,6 +29,7 @@ class WebmMuxer;
namespace content {
class VideoTrackRecorder;
+class AudioTrackRecorder;
// MediaRecorderHandler orchestrates the creation, lifetime management and
// mapping between:
@@ -37,7 +40,6 @@ class VideoTrackRecorder;
// All methods are called on the same thread as construction and destruction,
// i.e. the Main Render thread. (Note that a BindToCurrentLoop is used to
// guarantee this, since VideoTrackRecorder sends back frames on IO thread.)
-// TODO(mcasas): http://crbug.com/528519 Implement audio recording.
class CONTENT_EXPORT MediaRecorderHandler final
: public NON_EXPORTED_BASE(blink::WebMediaRecorderHandler) {
public:
@@ -62,10 +64,16 @@ class CONTENT_EXPORT MediaRecorderHandler final
scoped_ptr<std::string> encoded_data,
base::TimeTicks timestamp,
bool is_key_frame);
+ void OnEncodedAudio(const media::AudioParameters& params,
+ scoped_ptr<std::string> encoded_data,
+ base::TimeTicks timestamp);
void WriteData(base::StringPiece data);
void OnVideoFrameForTesting(const scoped_refptr<media::VideoFrame>& frame,
const base::TimeTicks& timestamp);
+ void OnAudioBusForTesting(const media::AudioBus& audio_bus,
+ const base::TimeTicks& timestamp);
+ void SetAudioFormatForTesting(const media::AudioParameters& params);
// Bound to the main render thread.
base::ThreadChecker main_render_thread_checker_;
@@ -86,6 +94,7 @@ class CONTENT_EXPORT MediaRecorderHandler final
blink::WebMediaRecorderHandlerClient* client_;
ScopedVector<VideoTrackRecorder> video_recorders_;
+ ScopedVector<AudioTrackRecorder> audio_recorders_;
#if !defined(MEDIA_DISABLE_LIBWEBM)
// Worker class doing the actual Webm Muxing work.
« no previous file with comments | « no previous file | content/renderer/media/media_recorder_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698