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

Side by Side Diff: chrome/renderer/media/cast_rtp_stream.cc

Issue 1304393004: Change VideoCaptureDeliverFrameCB's signature (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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "chrome/renderer/media/cast_rtp_stream.h" 5 #include "chrome/renderer/media/cast_rtp_stream.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/callback_helpers.h" 10 #include "base/callback_helpers.h"
(...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after
265 RemoveFromVideoTrack(this, track_); 265 RemoveFromVideoTrack(this, track_);
266 } 266 }
267 267
268 // This static method is used to forward video frames to |frame_input|. 268 // This static method is used to forward video frames to |frame_input|.
269 static void OnVideoFrame( 269 static void OnVideoFrame(
270 // These parameters are already bound when callback is created. 270 // These parameters are already bound when callback is created.
271 const CastRtpStream::ErrorCallback& error_callback, 271 const CastRtpStream::ErrorCallback& error_callback,
272 const scoped_refptr<media::cast::VideoFrameInput> frame_input, 272 const scoped_refptr<media::cast::VideoFrameInput> frame_input,
273 // These parameters are passed for each frame. 273 // These parameters are passed for each frame.
274 const scoped_refptr<media::VideoFrame>& frame, 274 const scoped_refptr<media::VideoFrame>& frame,
275 const base::TimeTicks& estimated_capture_time) { 275 base::TimeTicks estimated_capture_time) {
276 const base::TimeTicks timestamp = estimated_capture_time.is_null() 276 const base::TimeTicks timestamp = estimated_capture_time.is_null()
277 ? base::TimeTicks::Now() 277 ? base::TimeTicks::Now()
278 : estimated_capture_time; 278 : estimated_capture_time;
279 279
280 // Used by chrome/browser/extension/api/cast_streaming/performance_test.cc 280 // Used by chrome/browser/extension/api/cast_streaming/performance_test.cc
281 TRACE_EVENT_INSTANT2( 281 TRACE_EVENT_INSTANT2(
282 "cast_perf_test", "MediaStreamVideoSink::OnVideoFrame", 282 "cast_perf_test", "MediaStreamVideoSink::OnVideoFrame",
283 TRACE_EVENT_SCOPE_THREAD, 283 TRACE_EVENT_SCOPE_THREAD,
284 "timestamp", timestamp.ToInternalValue(), 284 "timestamp", timestamp.ToInternalValue(),
285 "time_delta", frame->timestamp().ToInternalValue()); 285 "time_delta", frame->timestamp().ToInternalValue());
(...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after
575 DCHECK(content::RenderThread::Get()); 575 DCHECK(content::RenderThread::Get());
576 DVLOG(1) << "CastRtpStream::DidEncounterError(" << message << ") = " 576 DVLOG(1) << "CastRtpStream::DidEncounterError(" << message << ") = "
577 << (IsAudio() ? "audio" : "video"); 577 << (IsAudio() ? "audio" : "video");
578 // Save the WeakPtr first because the error callback might delete this object. 578 // Save the WeakPtr first because the error callback might delete this object.
579 base::WeakPtr<CastRtpStream> ptr = weak_factory_.GetWeakPtr(); 579 base::WeakPtr<CastRtpStream> ptr = weak_factory_.GetWeakPtr();
580 error_callback_.Run(message); 580 error_callback_.Run(message);
581 base::ThreadTaskRunnerHandle::Get()->PostTask( 581 base::ThreadTaskRunnerHandle::Get()->PostTask(
582 FROM_HERE, 582 FROM_HERE,
583 base::Bind(&CastRtpStream::Stop, ptr)); 583 base::Bind(&CastRtpStream::Stop, ptr));
584 } 584 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698