27 Commits

Author SHA1 Message Date
kwiberg@webrtc.org
00b8f6b364 Use base/scoped_ptr.h; system_wrappers/interface/scoped_ptr.h is going away
BUG=
R=andrew@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/36229004

Cr-Commit-Position: refs/heads/master@{#8517}
git-svn-id: http://webrtc.googlecode.com/svn/trunk@8517 4adac7df-926f-26a2-2b94-8c16560cd09d
2015-02-26 14:43:50 +00:00
pbos@webrtc.org
3e6e271ec3 Implement CpuOveruseMetrics as callbacks.
Adds avg_encode_ms and encode_usage_percent in WebRtcVideoEngine2 and
corresponding stats to VideoSendStream::Stats.

BUG=1667, 1788
R=asapersson@webrtc.org, mflodman@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/42429004

Cr-Commit-Position: refs/heads/master@{#8513}
git-svn-id: http://webrtc.googlecode.com/svn/trunk@8513 4adac7df-926f-26a2-2b94-8c16560cd09d
2015-02-26 12:20:24 +00:00
tommi@webrtc.org
7a57f8f101 Reland 8203 "Reducing locking in OveruseFrameDetect..."
The issue that was causing the thread checker to report error, turned out to be unrelated.

> Revert 8203 "Reducing locking in OveruseFrameDetector and increa..."
>
> Broke tests in Chrome for some reason:
>
> [ RUN      ] WebRtcAecDumpBrowserTest.CallWithAecDump
> [80131:1287:0129/074432:30561723987517:ERROR:vt_video_decode_accelerator.cc(132)] Failed to create VTDecompressionSession: codecOpenErr (-8973)
> [80129:1287:0129/074432:30562276677373:INFO:CONSOLE(64)] "Looking at video in element remote-view-1", source: http://127.0.0.1:61401/media/webrtc_test_utilities.js (64)
> [80129:1287:0129/074432:30562281435788:INFO:CONSOLE(64)] "Looking at video in element remote-view-2", source: http://127.0.0.1:61401/media/webrtc_test_utilities.js (64)
> [80129:1287:0129/074432:30562315329399:INFO:CONSOLE(800)] "Negotiating call...", source: http://127.0.0.1:61401/media/peerconnection-call.html (800)
> [80133:29187:0129/074432:30562402039578:FATAL:overuse_frame_detector.cc(388)] Check failed: processing_thread_.CalledOnValidThread().
> 0   libbase.dylib                       0x000000010dfd688f base::debug::StackTrace::StackTrace() + 47
> 1   libbase.dylib                       0x000000010dfd68e3 base::debug::StackTrace::StackTrace() + 35
> 2   libbase.dylib                       0x000000010e030076 logging::LogMessage::~LogMessage() + 70
> 3   libbase.dylib                       0x000000010e02f0c3 logging::LogMessage::~LogMessage() + 35
> 4   libcontent.dylib                    0x000000011d8c0cd5 webrtc::OveruseFrameDetector::TimeUntilNextProcess() + 245
> 5   libcontent.dylib                    0x000000011d31ddfd webrtc::ProcessThreadImpl::Process() + 525
> 6   libcontent.dylib                    0x000000011d31d836 webrtc::ProcessThreadImpl::Run(void*) + 38
> 7   libcontent.dylib                    0x000000011d10c390 webrtc::ThreadPosix::Run() + 288
> 8   libcontent.dylib                    0x000000011d10c076 webrtc::StartThread(void*) + 38
> 9   libsystem_pthread.dylib             0x00007fff8e667899 _pthread_body + 138
> 10  libsystem_pthread.dylib             0x00007fff8e66772a _pthread_struct_init + 0
> 11  libsystem_pthread.dylib             0x00007fff8e66bfc9 thread_start + 13
>
>
> > Reducing locking in OveruseFrameDetector and increasing constness.
> >
> > I also added a few TODOs there to see what we can do to reduce the chance of contention.
> > To catch regressions, I've started using the ThreadChecker class on the processing thread but it might also be a good idea to add similar checks for other known threads such as the thread we receive frames on.  I'm sure we can reduce locking even further.
> >
> > BUG=2822
> > R=asapersson@webrtc.org
> >
> > Review URL: https://webrtc-codereview.appspot.com/33129004
>
> TBR=tommi@webrtc.org
>
> Review URL: https://webrtc-codereview.appspot.com/34079004

TBR=tommi@webrtc.org
BUG=

Review URL: https://webrtc-codereview.appspot.com/35029004

Cr-Commit-Position: refs/heads/master@{#8287}
git-svn-id: http://webrtc.googlecode.com/svn/trunk@8287 4adac7df-926f-26a2-2b94-8c16560cd09d
2015-02-08 18:29:12 +00:00
tommi@webrtc.org
7a37bfc240 Revert 8203 "Reducing locking in OveruseFrameDetector and increa..."
Broke tests in Chrome for some reason:

[ RUN      ] WebRtcAecDumpBrowserTest.CallWithAecDump
[80131:1287:0129/074432:30561723987517:ERROR:vt_video_decode_accelerator.cc(132)] Failed to create VTDecompressionSession: codecOpenErr (-8973)
[80129:1287:0129/074432:30562276677373:INFO:CONSOLE(64)] "Looking at video in element remote-view-1", source: http://127.0.0.1:61401/media/webrtc_test_utilities.js (64)
[80129:1287:0129/074432:30562281435788:INFO:CONSOLE(64)] "Looking at video in element remote-view-2", source: http://127.0.0.1:61401/media/webrtc_test_utilities.js (64)
[80129:1287:0129/074432:30562315329399:INFO:CONSOLE(800)] "Negotiating call...", source: http://127.0.0.1:61401/media/peerconnection-call.html (800)
[80133:29187:0129/074432:30562402039578:FATAL:overuse_frame_detector.cc(388)] Check failed: processing_thread_.CalledOnValidThread().
0   libbase.dylib                       0x000000010dfd688f base::debug::StackTrace::StackTrace() + 47
1   libbase.dylib                       0x000000010dfd68e3 base::debug::StackTrace::StackTrace() + 35
2   libbase.dylib                       0x000000010e030076 logging::LogMessage::~LogMessage() + 70
3   libbase.dylib                       0x000000010e02f0c3 logging::LogMessage::~LogMessage() + 35
4   libcontent.dylib                    0x000000011d8c0cd5 webrtc::OveruseFrameDetector::TimeUntilNextProcess() + 245
5   libcontent.dylib                    0x000000011d31ddfd webrtc::ProcessThreadImpl::Process() + 525
6   libcontent.dylib                    0x000000011d31d836 webrtc::ProcessThreadImpl::Run(void*) + 38
7   libcontent.dylib                    0x000000011d10c390 webrtc::ThreadPosix::Run() + 288
8   libcontent.dylib                    0x000000011d10c076 webrtc::StartThread(void*) + 38
9   libsystem_pthread.dylib             0x00007fff8e667899 _pthread_body + 138
10  libsystem_pthread.dylib             0x00007fff8e66772a _pthread_struct_init + 0
11  libsystem_pthread.dylib             0x00007fff8e66bfc9 thread_start + 13


> Reducing locking in OveruseFrameDetector and increasing constness.
> 
> I also added a few TODOs there to see what we can do to reduce the chance of contention.
> To catch regressions, I've started using the ThreadChecker class on the processing thread but it might also be a good idea to add similar checks for other known threads such as the thread we receive frames on.  I'm sure we can reduce locking even further.
> 
> BUG=2822
> R=asapersson@webrtc.org
> 
> Review URL: https://webrtc-codereview.appspot.com/33129004

TBR=tommi@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/34079004

Cr-Commit-Position: refs/heads/master@{#8206}
git-svn-id: http://webrtc.googlecode.com/svn/trunk@8206 4adac7df-926f-26a2-2b94-8c16560cd09d
2015-01-29 16:09:07 +00:00
tommi@webrtc.org
18e758526d Reducing locking in OveruseFrameDetector and increasing constness.
I also added a few TODOs there to see what we can do to reduce the chance of contention.
To catch regressions, I've started using the ThreadChecker class on the processing thread but it might also be a good idea to add similar checks for other known threads such as the thread we receive frames on.  I'm sure we can reduce locking even further.

BUG=2822
R=asapersson@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/33129004

Cr-Commit-Position: refs/heads/master@{#8203}
git-svn-id: http://webrtc.googlecode.com/svn/trunk@8203 4adac7df-926f-26a2-2b94-8c16560cd09d
2015-01-29 12:35:19 +00:00
pkasting@chromium.org
0b1534c52e Use int64_t for milliseconds more often, primarily for TimeUntilNextProcess.
This fixes a variety of MSVC warnings about value truncations when implicitly
storing the 64-bit values we get back from e.g. TimeTicks in 32-bit objects, and
removes the need for a number of explicit casts.

This also moves a number of constants so they're declared right where they're used, which is easier to read and maintain, and makes some of them of integral type rather than using the "enum hack".

BUG=chromium:81439
TEST=none
R=tommi@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/33649004

git-svn-id: http://webrtc.googlecode.com/svn/trunk@7905 4adac7df-926f-26a2-2b94-8c16560cd09d
2014-12-15 22:09:40 +00:00
asapersson@webrtc.org
7f10513efc Remove unused code in overuse detector.
R=mflodman@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/31579004

git-svn-id: http://webrtc.googlecode.com/svn/trunk@7557 4adac7df-926f-26a2-2b94-8c16560cd09d
2014-10-29 10:05:21 +00:00
asapersson@webrtc.org
9aed002090 Add ability to include a larger time span (in addition to encode time) for measuring the processing time of a frame.
Controlled by setting enable_extended_processing_usage. Enabled by default.

R=mflodman@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/13289004

git-svn-id: http://webrtc.googlecode.com/svn/trunk@7460 4adac7df-926f-26a2-2b94-8c16560cd09d
2014-10-16 06:57:12 +00:00
asapersson@webrtc.org
23a4d8522e Decreased kMaxOverusesBeforeApplyRampupDelay (from 7 to 4).
Increased kStandardRampUpDelayMs (30 to 40s).

BUG=1577
R=mflodman@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/20129004

git-svn-id: http://webrtc.googlecode.com/svn/trunk@6886 4adac7df-926f-26a2-2b94-8c16560cd09d
2014-08-13 14:33:49 +00:00
minyue@webrtc.org
74aaf29a0f Raw packet loss rate reported by RTP_RTCP module may vary too drastically over time. This CL is to add a filter to the value in VoE before lending it to audio coding module.
The filter is an exponential filter borrowed from video coding module.

The method is written in a new class called PacketLossProtector (not sure if the name is nice), which can be used in the future for more sophisticated logic.

BUG=
R=henrika@webrtc.org, stefan@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/20809004

git-svn-id: http://webrtc.googlecode.com/svn/trunk@6709 4adac7df-926f-26a2-2b94-8c16560cd09d
2014-07-16 21:28:26 +00:00
asapersson@webrtc.org
d980307197 Add max limit of number for overuses. When limit is reached always apply the rampup delay.
BUG=1577
R=mflodman@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/13719004

git-svn-id: http://webrtc.googlecode.com/svn/trunk@6451 4adac7df-926f-26a2-2b94-8c16560cd09d
2014-06-16 14:27:19 +00:00
asapersson@webrtc.org
2881ab1e36 Increased kMaxRampUpDelayMs (120 to 240s).
Add support for triggering on encode rsd metric if its thresholds are configured. Added unit tests.

BUG=1577
R=mflodman@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/16649004

git-svn-id: http://webrtc.googlecode.com/svn/trunk@6410 4adac7df-926f-26a2-2b94-8c16560cd09d
2014-06-12 08:46:46 +00:00
asapersson@webrtc.org
734a532723 Add additional metric (relative standard deviation of encode time) for overuse detection.
This code is currently only for testing.

BUG=1577
R=stefan@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/19619004

git-svn-id: http://webrtc.googlecode.com/svn/trunk@6381 4adac7df-926f-26a2-2b94-8c16560cd09d
2014-06-10 06:35:22 +00:00
asapersson@webrtc.org
ab6bf4f54c Added api for getting cpu measures using a struct.
R=mflodman@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/12479004

git-svn-id: http://webrtc.googlecode.com/svn/trunk@6249 4adac7df-926f-26a2-2b94-8c16560cd09d
2014-05-27 07:43:15 +00:00
asapersson@webrtc.org
e41dbee8a6 Reduced kMaxSampleDiffMs (limit to 22fps).
BUG=1577
R=mflodman@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/12539004

git-svn-id: http://webrtc.googlecode.com/svn/trunk@6121 4adac7df-926f-26a2-2b94-8c16560cd09d
2014-05-13 13:45:13 +00:00
mflodman@webrtc.org
5574dacd1f Log Fixit for parts of video_engine folder.
BUG=3153
R=pbos@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/11179004

git-svn-id: http://webrtc.googlecode.com/svn/trunk@5853 4adac7df-926f-26a2-2b94-8c16560cd09d
2014-04-07 10:56:31 +00:00
asapersson@webrtc.org
ce12f1fd32 Add configuration for ability to use the encode usage measure for triggering overuse/underuse.
BUG=1577
R=mflodman@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/10509004

git-svn-id: http://webrtc.googlecode.com/svn/trunk@5767 4adac7df-926f-26a2-2b94-8c16560cd09d
2014-03-24 21:59:16 +00:00
asapersson@webrtc.org
8a8c3ef2ae Add ability to configure cpu overuse options via an API.
BUG=1577
R=mflodman@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/9299006

git-svn-id: http://webrtc.googlecode.com/svn/trunk@5736 4adac7df-926f-26a2-2b94-8c16560cd09d
2014-03-20 13:15:01 +00:00
asapersson@webrtc.org
b60346e951 Reset estimate if no frame has been seen for a certain time (to avoid large jitter if stop sending).
Add delay before start processing after a reset.

BUG=1577
R=mflodman@webrtc.org, stefan@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/8699006

git-svn-id: http://webrtc.googlecode.com/svn/trunk@5561 4adac7df-926f-26a2-2b94-8c16560cd09d
2014-02-17 19:02:15 +00:00
asapersson@webrtc.org
9e5b0342f6 Added a delay measurement, measures the time between an incoming captured frame until the frame is being processed. Measures the delay per second.
R=mflodman@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/4249004

git-svn-id: http://webrtc.googlecode.com/svn/trunk@5212 4adac7df-926f-26a2-2b94-8c16560cd09d
2013-12-04 13:47:44 +00:00
asapersson@webrtc.org
c7ff8f990a Added measure of encode time. Added encode time to the ViE CpuOveruseMeasure api.
R=mflodman@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/4099004

git-svn-id: http://webrtc.googlecode.com/svn/trunk@5178 4adac7df-926f-26a2-2b94-8c16560cd09d
2013-11-26 11:12:33 +00:00
asapersson@webrtc.org
b24d33565c Added ViE API for getting overuse measure.
R=mflodman@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/3129005

git-svn-id: http://webrtc.googlecode.com/svn/trunk@5141 4adac7df-926f-26a2-2b94-8c16560cd09d
2013-11-20 13:51:40 +00:00
asapersson@webrtc.org
e2af622edf - Reset capture deltas at resolution change.
- Applied smoothing of capture jitter.
- Adjusted thresholds.

R=stefan@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/2070005

git-svn-id: http://webrtc.googlecode.com/svn/trunk@4817 4adac7df-926f-26a2-2b94-8c16560cd09d
2013-09-23 20:05:39 +00:00
pbos@webrtc.org
a957570d62 Overuse detection based on capture-input jitter.
This is believed to be more reliable in real-world cases. The camera seems to fall behind sooner than the encoder starts taking too long time encoding, so this is believed to be an earlier trigger.

BUG=2325
R=asapersson@webrtc.org, mflodman@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/2140004

git-svn-id: http://webrtc.googlecode.com/svn/trunk@4648 4adac7df-926f-26a2-2b94-8c16560cd09d
2013-08-30 17:16:32 +00:00
mflodman@webrtc.org
d4412feeb0 Adding possibility to use encoding time when trigger underuse for frame based overuse detection.
BUG=
TEST=Added unittest.
R=asapersson@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/1885004

git-svn-id: http://webrtc.googlecode.com/svn/trunk@4452 4adac7df-926f-26a2-2b94-8c16560cd09d
2013-07-31 16:42:21 +00:00
mflodman@webrtc.org
6879c8adad Hooking up first simple CPU adaptation version.
BUG=
R=pbos@webrtc.org, stefan@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/1767004

git-svn-id: http://webrtc.googlecode.com/svn/trunk@4384 4adac7df-926f-26a2-2b94-8c16560cd09d
2013-07-23 11:35:00 +00:00
mflodman@webrtc.org
e6168f5f41 Adding a first simple version of overuse detection, but not hooked up.
BUG=
R=asapersson@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/1717004

git-svn-id: http://webrtc.googlecode.com/svn/trunk@4268 4adac7df-926f-26a2-2b94-8c16560cd09d
2013-06-26 11:23:01 +00:00