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

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

Issue 1351473006: WebmMuxer-MediaRecorderHandler: thread hopping and data ownership (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: miu@ proposal Created 5 years, 3 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/media_recorder_handler.h
diff --git a/content/renderer/media/media_recorder_handler.h b/content/renderer/media/media_recorder_handler.h
index a97843bba757f81ed06da8c691718b4bf3962300..50d688ae8595432f17a089bdd6eb9e7fc4ea2a69 100644
--- a/content/renderer/media/media_recorder_handler.h
+++ b/content/renderer/media/media_recorder_handler.h
@@ -8,7 +8,6 @@
#include "base/compiler_specific.h"
#include "base/memory/scoped_vector.h"
#include "base/memory/weak_ptr.h"
-#include "base/strings/string_piece.h"
#include "base/threading/thread_checker.h"
#include "content/common/content_export.h"
#include "third_party/WebKit/public/platform/WebMediaRecorderHandler.h"
@@ -28,22 +27,23 @@ namespace content {
class VideoTrackRecorder;
-// MediaRecorderHandler orchestrates the creation, lifetime mgmt and mapping
-// between:
+// MediaRecorderHandler orchestrates the creation, lifetime management and
+// mapping between:
// - MediaStreamTrack(s) providing data,
// - {Audio,Video}TrackRecorders encoding that data,
// - a WebmMuxer class multiplexing encoded data into a WebM container, and
// - a single recorder client receiving this contained data.
// All methods are called on the same thread as construction and destruction,
-// i.e. the Main Render thread.
-// TODO(mcasas): Implement audio recording.
+// 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:
MediaRecorderHandler();
~MediaRecorderHandler() override;
- // See above, these methods should override blink::WebMediaRecorderHandler.
+ // blink::WebMediaRecorderHandler.
bool canSupportMimeType(const blink::WebString& mimeType) override;
bool initialize(blink::WebMediaRecorderHandlerClient* client,
const blink::WebMediaStream& media_stream,
@@ -57,7 +57,11 @@ class CONTENT_EXPORT MediaRecorderHandler final
private:
friend class MediaRecorderHandlerTest;
- void WriteData(const base::StringPiece& data);
+ void OnEncodedVideo(const scoped_refptr<media::VideoFrame>& video_frame,
+ scoped_ptr<std::string> encoded_data,
+ base::TimeTicks timestamp,
+ bool is_key_frame);
+ void WriteData(scoped_ptr<std::string> data);
miu 2015/09/22 04:11:08 FWICT, there was no need to change the WriteData()
mcasas 2015/09/22 16:58:40 Acknowledged.
void OnVideoFrameForTesting(const scoped_refptr<media::VideoFrame>& frame,
const base::TimeTicks& timestamp);
« no previous file with comments | « no previous file | content/renderer/media/media_recorder_handler.cc » ('j') | content/renderer/media/media_recorder_handler.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698