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

Unified Diff: content/browser/renderer_host/media/video_capture_controller.cc

Issue 1125263005: MJPEG acceleration for V4L2 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 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/browser/renderer_host/media/video_capture_controller.cc
diff --git a/content/browser/renderer_host/media/video_capture_controller.cc b/content/browser/renderer_host/media/video_capture_controller.cc
index 23ee7074a2d73a365000d5369b39d28e50b2adc8..cfd6f7be3ceda0b0a1b6be5b18a4ba5b98d7a879 100644
--- a/content/browser/renderer_host/media/video_capture_controller.cc
+++ b/content/browser/renderer_host/media/video_capture_controller.cc
@@ -275,6 +275,61 @@ void VideoCaptureController::DoIncomingCapturedVideoFrameOnIOThread(
scoped_ptr<media::VideoCaptureDevice::Client::Buffer> buffer,
const scoped_refptr<VideoFrame>& frame,
const base::TimeTicks& timestamp) {
+
+ {
+ static int count = 0;
+ static base::TimeDelta total_time;
+ static base::TimeDelta min_delta = base::TimeDelta::Max();
+ static base::TimeDelta max_delta;
+ static base::TimeDelta v[30];
+ count++;
+ base::TimeDelta delta = base::TimeTicks::Now() - timestamp;
+ total_time += delta;
+ if (delta > max_delta)
+ max_delta = delta;
+ if (delta < min_delta)
+ min_delta = delta;
+ v[(count-1) % 30] = delta;
+ if (count % 30 == 0) {
+ LOG(ERROR) << "count=" << count
+ << ", latency=" << delta.InMillisecondsF()
+ << ", avg=" << total_time.InMillisecondsF() / count
+ << ", min=" << min_delta.InMillisecondsF()
+ << ", max=" << max_delta.InMillisecondsF();
+
+ LOG(ERROR) << v[0].InMillisecondsF() << " "
+ << v[1].InMillisecondsF() << " "
+ << v[2].InMillisecondsF() << " "
+ << v[3].InMillisecondsF() << " "
+ << v[4].InMillisecondsF() << " "
+ << v[5].InMillisecondsF() << " "
+ << v[6].InMillisecondsF() << " "
+ << v[7].InMillisecondsF() << " "
+ << v[8].InMillisecondsF() << " "
+ << v[9].InMillisecondsF() << " "
+ << v[10].InMillisecondsF() << " "
+ << v[11].InMillisecondsF() << " "
+ << v[12].InMillisecondsF() << " "
+ << v[13].InMillisecondsF() << " "
+ << v[14].InMillisecondsF() << " "
+ << v[15].InMillisecondsF() << " "
+ << v[16].InMillisecondsF() << " "
+ << v[17].InMillisecondsF() << " "
+ << v[18].InMillisecondsF() << " "
+ << v[19].InMillisecondsF() << " "
+ << v[20].InMillisecondsF() << " "
+ << v[21].InMillisecondsF() << " "
+ << v[22].InMillisecondsF() << " "
+ << v[23].InMillisecondsF() << " "
+ << v[24].InMillisecondsF() << " "
+ << v[25].InMillisecondsF() << " "
+ << v[26].InMillisecondsF() << " "
+ << v[27].InMillisecondsF() << " "
+ << v[28].InMillisecondsF() << " "
+ << v[29].InMillisecondsF();
+ }
+ }
+
DCHECK_CURRENTLY_ON(BrowserThread::IO);
const int buffer_id = buffer->id();
DCHECK_NE(buffer_id, VideoCaptureBufferPool::kInvalidId);

Powered by Google App Engine
This is Rietveld 408576698