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

Side by Side Diff: content/renderer/media/media_recorder_handler.cc

Issue 1330873002: MediaRecorderHandler: connecting Blink factory method to content/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 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 #include "content/renderer/media/media_recorder_handler.h" 5 #include "content/renderer/media/media_recorder_handler.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/location.h" 8 #include "base/location.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "content/renderer/media/video_track_recorder.h" 10 #include "content/renderer/media/video_track_recorder.h"
(...skipping 11 matching lines...) Expand all
22 MediaRecorderHandler::~MediaRecorderHandler() { 22 MediaRecorderHandler::~MediaRecorderHandler() {
23 DCHECK(main_render_thread_checker_.CalledOnValidThread()); 23 DCHECK(main_render_thread_checker_.CalledOnValidThread());
24 // Send a |last_in_slice| to our |client_|. 24 // Send a |last_in_slice| to our |client_|.
25 if (client_) 25 if (client_)
26 client_->writeData(nullptr, 0u, true); 26 client_->writeData(nullptr, 0u, true);
27 } 27 }
28 28
29 bool MediaRecorderHandler::canSupportMimeType( 29 bool MediaRecorderHandler::canSupportMimeType(
30 const blink::WebString& mimeType) { 30 const blink::WebString& mimeType) {
31 DCHECK(main_render_thread_checker_.CalledOnValidThread()); 31 DCHECK(main_render_thread_checker_.CalledOnValidThread());
32 // TODO(mcasas): For the time being only "video/vp8" is supported. 32 // TODO(mcasas): For the time being only empty or "video/vp8" are supported.
33 return mimeType.utf8().compare("video/vp8") == 0; 33 return mimeType.isEmpty() || mimeType.utf8().compare("video/vp8") == 0;
34 } 34 }
35 35
36 bool MediaRecorderHandler::initialize( 36 bool MediaRecorderHandler::initialize(
37 blink::WebMediaRecorderHandlerClient* client, 37 blink::WebMediaRecorderHandlerClient* client,
38 const blink::WebMediaStream& media_stream, 38 const blink::WebMediaStream& media_stream,
39 const blink::WebString& mimeType) { 39 const blink::WebString& mimeType) {
40 DCHECK(main_render_thread_checker_.CalledOnValidThread()); 40 DCHECK(main_render_thread_checker_.CalledOnValidThread());
41 if (!canSupportMimeType(mimeType)) { 41 if (!canSupportMimeType(mimeType)) {
42 DLOG(ERROR) << "Can't support type " << mimeType.utf8(); 42 DLOG(ERROR) << "Can't support type " << mimeType.utf8();
43 return false; 43 return false;
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
122 } 122 }
123 123
124 void MediaRecorderHandler::OnVideoFrameForTesting( 124 void MediaRecorderHandler::OnVideoFrameForTesting(
125 const scoped_refptr<media::VideoFrame>& frame, 125 const scoped_refptr<media::VideoFrame>& frame,
126 const base::TimeTicks& timestamp) { 126 const base::TimeTicks& timestamp) {
127 for (auto* recorder : video_recorders_) 127 for (auto* recorder : video_recorders_)
128 recorder->OnVideoFrameForTesting(frame, timestamp); 128 recorder->OnVideoFrameForTesting(frame, timestamp);
129 } 129 }
130 130
131 } // namespace content 131 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698