Commit Graph

3269 Commits

Author SHA1 Message Date
ed3277bf14 Deprecate VideoDecoder::Reset() and remove calls.
Removes calls to decoder reset and instead drops delta frames and
requests keyframes until one arrives.

BUG=webrtc:5475
R=stefan@webrtc.org
TBR=mflodman@webrtc.org

Review URL: https://codereview.webrtc.org/1647163002 .

Cr-Commit-Position: refs/heads/master@{#11460}
2016-02-02 14:40:13 +00:00
c5a39c2591 H264: Thread-safe InitializeFFmpeg. Flag to control if InitializeFFmpeg should be called.
New flag: rtc_initialize_ffmpeg, default value = !build_with_chromium.

In WebRTC standalone we initialize FFmpeg by default, in Chromium we don't by default.
Chromium is an external project that also use FFmpeg. If both projects do FFmpeg initialization code things will break. The flag makes it possible for other external projects than chromium to decide whether or not WebRTC should initialize FFmpeg.

BUG=chromium:500605, chromium:468365, webrtc:5427

Review URL: https://codereview.webrtc.org/1639273002

Cr-Commit-Position: refs/heads/master@{#11456}
2016-02-02 10:30:57 +00:00
6f7557e9e2 Disable useless BWE tests.
TBR=kjellander@webrtc.org
BUG=webrtc:5468

Review URL: https://codereview.webrtc.org/1654113002

Cr-Commit-Position: refs/heads/master@{#11449}
2016-02-01 18:24:23 +00:00
e37a2d1802 Reland "Removing webrtc::AudioFrame::energy_."
Some WebRTC client had a problem with the change "Removing webrtc::AudioFrame::energy_". Now it is solved.

This reverts commit 2bdcfadc8abd418a30dd5cdf54ba45a429d3d9bf.

BUG=webrtc:3315

Review URL: https://codereview.webrtc.org/1638553003

Cr-Commit-Position: refs/heads/master@{#11448}
2016-02-01 18:02:45 +00:00
74451a5ea9 Prevent zero division in VCMJitterEstimator.
BUG=webrtc:5124
R=sprang@webrtc.org, stefan@webrtc.org

Review URL: https://codereview.webrtc.org/1652903002 .

Cr-Commit-Position: refs/heads/master@{#11445}
2016-02-01 15:31:17 +00:00
bba9dec4d5 Use separate rtp module lists for send and receive in PacketRouter.
This makes it possible to handle send and receive streams with the same SSRC, which is currently the case in some peer connection tests.

Also moves sending transport feedback to the pacer thread.

BUG=webrtc:5263

Review URL: https://codereview.webrtc.org/1628683002

Cr-Commit-Position: refs/heads/master@{#11443}
2016-02-01 12:40:04 +00:00
1f611fa58b Fixed minor issue: added missing semicolons to metric_recorder.cc
Review URL: https://codereview.webrtc.org/1649353002

Cr-Commit-Position: refs/heads/master@{#11442}
2016-02-01 11:09:19 +00:00
44efbece68 Converting picture_id to bitstring pushed from WithPictureId to Create function.
Added Parse and accessor functions.

BUG=webrtc:5260
R=åsapersson

Review URL: https://codereview.webrtc.org/1550293003

Cr-Commit-Position: refs/heads/master@{#11439}
2016-02-01 09:36:44 +00:00
3f70562bbb Fix WebRtc ninja x86 build using Visual Studio 2015 (set GYP_MSVS_VERSION=2015).
Visual Studio 2015 balks at the implicit truncation of values. Easily fixed with an explicit cast.

Fixed redefinition of CLOCKS_PER_SEC when using Visual Studio 2015 and the Windows 10 SDK. CLOCKS_PER_SEC is also defined in "<WIN10 SDK DIR>\include\10.0.10240.0\ucrt\time.h" and also has the value of 1000

Hiding snprintf definition if building with Visual Studio 2015

Fixed C4573 compiler complaint in audio_processing_impl_locking_unittest.cc.

BUG=webrtc:5183

Review URL: https://codereview.webrtc.org/1412653006

Cr-Commit-Position: refs/heads/master@{#11434}
2016-01-30 22:40:52 +00:00
de13882d94 rtcp::ExtenededReports packet class got Parse function
BUG=webrtc:5260
R=åsapersson

Review URL: https://codereview.webrtc.org/1557593002

Cr-Commit-Position: refs/heads/master@{#11428}
2016-01-29 19:26:20 +00:00
ff63ed2888 Format changes achieved by running
clang-format -i -style=Chromium

BUG=

Review URL: https://codereview.webrtc.org/1639283002

Cr-Commit-Position: refs/heads/master@{#11427}
2016-01-29 15:46:18 +00:00
5e8351b325 Prevent division-by-zero in VCMFecMethod.
Clamps frameRate to at least 1.0 to prevent a zero division.

BUG=webrtc:5124
R=stefan@webrtc.org

Review URL: https://codereview.webrtc.org/1642903002 .

Cr-Commit-Position: refs/heads/master@{#11421}
2016-01-28 22:55:45 +00:00
fb152707ed Replace const-reference with pointer in SendData.
This argument is never used as a reference and the pointer that's bound
to the const reference may be nullptr. This is undefined behavior and
barks under UBSan.

BUG=webrtc:5124
R=stefan@webrtc.org

Review URL: https://codereview.webrtc.org/1642863003 .

Cr-Commit-Position: refs/heads/master@{#11418}
2016-01-28 18:12:09 +00:00
533a4e4882 Switch critical section locks out for atomic operations
BUG=chromium:581029

Review URL: https://codereview.webrtc.org/1635563002

Cr-Commit-Position: refs/heads/master@{#11413}
2016-01-28 10:44:16 +00:00
691b8369ff Using buffered signal to calculate the level of echo cancellation.
The level of the error signal after linear echo cancellation was based on non-buffered signal while that of the near-end and far-end signal based on buffered signal. This discrepancy made the comparison of them unfair.

This CL is to make calculating the error level rely on the same buffering.

BUG=

Review URL: https://codereview.webrtc.org/1510873004

Cr-Commit-Position: refs/heads/master@{#11408}
2016-01-27 23:44:59 +00:00
f5dca48dc0 Add transport sequence number on the non-pacer path of the rtp sender.
BUG=4173
R=sprang@webrtc.org

Review URL: https://codereview.webrtc.org/1635093002 .

Cr-Commit-Position: refs/heads/master@{#11395}
2016-01-27 11:59:05 +00:00
d673b0fa5d [rtp_rtcp] Fix potentional time difference between rtp and rtcp packets.
SetRtpState function was updating only rtp_sender start timestamp.
Now it updates both rtp_sender and rtcp_sender start timestamps.

BUG=webrtc:5433
R=stefan@webrtc.org

Review URL: https://codereview.webrtc.org/1628323003 .

Cr-Commit-Position: refs/heads/master@{#11393}
2016-01-27 11:55:06 +00:00
bab934bffe H.264 video codec support using OpenH264 (http://www.openh264.org/) for encoding and FFmpeg (https://www.ffmpeg.org/) for decoding.
It works on all platforms except Android and iOS (FFmpeg limitation).

Implemented behind compile time flags, off by default.
The plan is to have it enabled in Chrome (see bug), but not in Chromium/webrtc by default.

Flags to turn it on:
- rtc_use_h264 = true
- ffmpeg_branding = "Chrome" (or other brand that includes H.264 decoder)

Tests using H264:
- video_loopback --codec=H264
- screenshare_loopback --codec=H264
- video_engine_tests (EndToEndTest.SendsAndReceivesH264)

NOTRY=True
BUG=500605, 468365
BUG=https://bugs.chromium.org/p/webrtc/issues/detail?id=5424

Review URL: https://codereview.webrtc.org/1306813009

Cr-Commit-Position: refs/heads/master@{#11390}
2016-01-27 09:36:07 +00:00
7fd881743c Fix type of local encoded length variable from uint32_t to size_t.
BUG=chromium:571594

Review URL: https://codereview.webrtc.org/1635083002

Cr-Commit-Position: refs/heads/master@{#11383}
2016-01-26 15:26:12 +00:00
59b2d3ebe7 Remove zero-divide in VCMContentMetricsProcessing.
Protects against zero-framerate in UpdateFrameRate.

BUG=webrtc:5124
R=stefan@webrtc.org

Review URL: https://codereview.webrtc.org/1636943003 .

Cr-Commit-Position: refs/heads/master@{#11382}
2016-01-26 15:18:56 +00:00
83277131b1 AudioCodingModuleImpl: Put CodecManager and Rent-A-Codec in a separate struct
This will make it easier for future CLs to make them optional.

BUG=webrtc:5028

Review URL: https://codereview.webrtc.org/1625363002

Cr-Commit-Position: refs/heads/master@{#11381}
2016-01-26 14:06:20 +00:00
d0c7bba4f4 [rtp_rtcp] Dlrr::SubBlock struct renamed to ReceiveTimeInfo
This structure is used outside Dlrr creating/parsing.
but RTCPReceiveTimeInfo structure doesn't follow naming style.

rtcp::ReceiveTimeInfo added to replace both Dlrr::SubBlock (when creating/parsing packets)
and RTCPReceiveTimeInfo (for other uses).

this CL is a split of https://codereview.webrtc.org/1557593002/

BUG=webrtc:5260
R=asapersson@webrtc.org, åsapersson

Review URL: https://codereview.webrtc.org/1631683002 .

Cr-Commit-Position: refs/heads/master@{#11380}
2016-01-26 13:12:57 +00:00
6a07f12e95 AudioCodingModuleImpl: Initialize encoder_stack_ to nullptr
This should have been done in commit 11340, but it was left out by
mistake.

BUG=webrtc:5028

Review URL: https://codereview.webrtc.org/1631443002

Cr-Commit-Position: refs/heads/master@{#11378}
2016-01-26 11:28:57 +00:00
2bdcfadc8a Revert of Removing webrtc::AudioFrame::energy_. (patchset #2 id:20001 of https://codereview.webrtc.org/1589953002/ )
Reason for revert:
The change breaks google3 tests for buzz/mediaengines/sae/audio_mixer.

Original issue's description:
> Remove webrtc::AudioFrame::energy_.
>
> BUG=webrtc:3315
>
> Committed: https://crrev.com/bacae81a1d91ae7b2a4bde37a66ab70513449989
> Cr-Commit-Position: refs/heads/master@{#11372}

TBR=kjellander@webrtc.org,henrik.lundin@webrtc.org,tommi@webrtc.org,minyue@webrtc.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=webrtc:3315

Review URL: https://codereview.webrtc.org/1634143002

Cr-Commit-Position: refs/heads/master@{#11377}
2016-01-26 10:29:54 +00:00
ffa3fdc8d6 Reallocate encoded buffer size if needed for VP8. Initially set to the input image size.
Issue may occur for very small input images (e.g. 4x4) when encoded image length > input image size.

BUG=chromium:571594

Review URL: https://codereview.webrtc.org/1626373002

Cr-Commit-Position: refs/heads/master@{#11376}
2016-01-26 09:56:35 +00:00
4fd6cda067 Add tracing to VCMGenericEncoder::Release.
This call can take time, especially on mobile HW encoders. Make sure it
shows up in tracing.

BUG=webrtc:5167
R=stefan@webrtc.org

Review URL: https://codereview.webrtc.org/1606413002 .

Cr-Commit-Position: refs/heads/master@{#11374}
2016-01-26 09:20:03 +00:00
86956ded42 Small cleanup in VP9EncoderImpl::GetEncodedLayerFrame.
BUG=

Review URL: https://codereview.webrtc.org/1616843004

Cr-Commit-Position: refs/heads/master@{#11373}
2016-01-26 09:05:28 +00:00
bacae81a1d Remove webrtc::AudioFrame::energy_.
BUG=webrtc:3315

Review URL: https://codereview.webrtc.org/1589953002

Cr-Commit-Position: refs/heads/master@{#11372}
2016-01-25 22:10:40 +00:00
85b22e2306 Remove vp8_factory.{cc,h}.
Removes use of global VP8EncoderFactory::use_simulcast_adapter which is
thread-unsafe. Also the code wasn't in use.

BUG=
R=stefan@webrtc.org

Review URL: https://codereview.webrtc.org/1598803005 .

Cr-Commit-Position: refs/heads/master@{#11370}
2016-01-25 16:58:08 +00:00
28ba92731d Switch to use new implementation in metrics.h.
Sparse macro replaced for all video histograms that have a constant name.

BUG=webrtc:5283

Review URL: https://codereview.webrtc.org/1616153005

Cr-Commit-Position: refs/heads/master@{#11368}
2016-01-25 13:58:27 +00:00
5ad935cb56 Remove mutable from rtc::CriticalSection members.
rtc::CriticalSection is now lockable from const methods and no longer
need to remain mutable.

BUG=
R=tommi@webrtc.org

Review URL: https://codereview.webrtc.org/1613643004

Cr-Commit-Position: refs/heads/master@{#11367}
2016-01-25 11:52:53 +00:00
7a83951b27 Fix a bug in webrtc::ByteReader
The specializations for 4-byte reading did not return correct
values. This has to do with the order of casting and shifting. Also
adding a test to expose the bug (and verify the other byte sizes).

Review URL: https://codereview.webrtc.org/1615653011

Cr-Commit-Position: refs/heads/master@{#11364}
2016-01-25 07:47:59 +00:00
f91e6d0438 Enable cpplint for webrtc/modules/bitrate_controller and fix all uncovered cpplint errors.
This CL enableds cpplint for webrtc/modules/bitrate_controller.

BUG=webrtc:5311
NOTRY=true

TESTED=Fixed issues reported by:
find webrtc/modules/bitrate_controller -type f -name *.cc -o -name *.h | xargs cpplint.py
followed by 'git cl presubmit'.

Review URL: https://codereview.webrtc.org/1620003003

Cr-Commit-Position: refs/heads/master@{#11363}
2016-01-25 07:05:26 +00:00
38b39d59d1 Temporary hack to avoid assert errors when time moves backwards.
Once we have eliminated all non-monotonic clocks, revert this change.

BUG=webrtc:5452

Review URL: https://codereview.webrtc.org/1618333002

Cr-Commit-Position: refs/heads/master@{#11361}
2016-01-22 21:36:39 +00:00
9846845da6 Calculate audio levels in AEC in time domain.
In AEC, audio levels are calculated in frequency domain. This makes the calculation dependent on FFT. We now make the calculation performed in time domain. The complexity is the same, but the dependence on FFT is removed.

BUG=

Review URL: https://codereview.webrtc.org/1542573002

Cr-Commit-Position: refs/heads/master@{#11357}
2016-01-22 13:46:47 +00:00
32e590ec13 class doesn't rely on structures in RTCPUtility to store data.
supports several fci items in same packet.
got accessors to read data

BUG=webrtc:5260
R=asapersson@webrtc.org, åsapersson

Review URL: https://codereview.webrtc.org/1544403002 .

Cr-Commit-Position: refs/heads/master@{#11354}
2016-01-22 10:05:10 +00:00
3fe2c6a161 VideoProcessorImpl using EncodedImage::GetBufferPaddingBytes.
BUG=https://bugs.chromium.org/p/webrtc/issues/detail?id=5424

Review URL: https://codereview.webrtc.org/1618853002

Cr-Commit-Position: refs/heads/master@{#11353}
2016-01-22 08:07:17 +00:00
fa156696dd Fix probing breakage with send-side BWE introduced by r11322.
BUG=chromium:580046, webrtc:4173

Review URL: https://codereview.webrtc.org/1615873002

Cr-Commit-Position: refs/heads/master@{#11344}
2016-01-21 16:55:08 +00:00
fea3dd83fc Fix a bug in InputAudioFile::Read
When the file was rewound, the remaining audio read was inserted at
the start of the destination array, not where the first reading
attempt ended.

R=ivoc@webrtc.org

Review URL: https://codereview.webrtc.org/1612053002

Cr-Commit-Position: refs/heads/master@{#11343}
2016-01-21 16:20:01 +00:00
32be07bc36 Remove RentACodec::GetEncoderStack
Callers can just remember the return value of
RentACodec::RentEncoderStack instead.

BUG=webrtc:5028

Review URL: https://codereview.webrtc.org/1612713002

Cr-Commit-Position: refs/heads/master@{#11340}
2016-01-21 15:10:04 +00:00
d664836efa Added EncodedImage::GetBufferPaddingBytes.
The FFmpeg video decoder requires up to 8 additional bytes to be allocated for its encoded image buffer input, due to optimized byte readers over-reading on some platforms.
We plan to use FFmpeg for a soon-to-land H.264 enc/dec.

This CL adds support for padding encoded image buffers based on codec type, and makes sure calls to VCMEncodedFrame::VerifyAndAllocate use the padding.

All padding constants are 0 but making H.264 pad with 8 bytes will be a one-line change.

Also, added -framework CoreFoundation to webrtc_h264_video_toolbox which was missing.

BUG=chromium:468365
BUG=https://bugs.chromium.org/p/webrtc/issues/detail?id=5424
NOTRY=True

Review URL: https://codereview.webrtc.org/1602523004

Cr-Commit-Position: refs/heads/master@{#11337}
2016-01-21 13:43:18 +00:00
429c345b02 Fixes a bug which incorrectly logs incoming RTCP as outgoing.
Adds logging to RTPSender and RTCPSender, pushing an event log pointer from Channel through ModuleRtpRtcpImpl to the Sender objects.

BUG=webrtc:4741

Review URL: https://codereview.webrtc.org/1571283002

Cr-Commit-Position: refs/heads/master@{#11336}
2016-01-21 13:42:10 +00:00
1f150b35f8 Add new NetEq resources to modules_unittests.isolate.
This should have been done in
https://codereview.webrtc.org/1515113002
but was not detected since the test doesn't run
on Android.

BUG=chromium:497757
NOTRY=True
TBR=minyue@webrtc.org

Review URL: https://codereview.webrtc.org/1613833003

Cr-Commit-Position: refs/heads/master@{#11334}
2016-01-21 12:42:25 +00:00
902c03e724 rtc_use_h264 flag (replacing use_third_party_h264 flag) for building OpenH264/FFmpeg, false by default but can be overridden in supplement.gypi and build_overrides/webrtc.gni.
BUG=468365
NOTRY=True

Review URL: https://codereview.webrtc.org/1601813005

Cr-Commit-Position: refs/heads/master@{#11333}
2016-01-21 11:34:47 +00:00
d9f641e341 Reallocate encoded buffer size if needed. Initially set to the input image size.
Issue may occur for very small input images (e.g. 4x4) when encoded image length > input image size.

BUG=chromium:578193

Review URL: https://codereview.webrtc.org/1603643006

Cr-Commit-Position: refs/heads/master@{#11329}
2016-01-21 09:11:43 +00:00
d8dccd57ea uses standard types instead of RTCPUtility type to store data.
got member read accessors, got Parse function.

BUG=webrtc:5260
R=åsapersson

Review URL: https://codereview.webrtc.org/1552773002

Cr-Commit-Position: refs/heads/master@{#11324}
2016-01-20 20:08:58 +00:00
72c08edced Reenables several NetEq unittests on android.
Several unittests were disabled on android, this CL will reenable them. One of
the tests was accidentally disabled on all platforms, and now no longer gives a
bitexact result.

BUG=webrtc:3343,webrtc:5349

Review URL: https://codereview.webrtc.org/1532903002

Cr-Commit-Position: refs/heads/master@{#11323}
2016-01-20 15:26:28 +00:00
32f81542c2 Support REMB in combination with send-side BWE.
BUG=webrtc:4173

Review URL: https://codereview.webrtc.org/1581113006

Cr-Commit-Position: refs/heads/master@{#11322}
2016-01-20 15:14:03 +00:00
a5dec16b42 Name SimulcastEncoderApdater on InitEncode.
Provides a better string (provides names of all implementations), but
also fixes a crash when accessing the ImplementationName() of
SimulcastEncoderAdapter where InitEncode has failed.

BUG=chromium:577932, webrtc:4897
R=stefan@webrtc.org

Review URL: https://codereview.webrtc.org/1599353003 .

Cr-Commit-Position: refs/heads/master@{#11321}
2016-01-20 14:54:02 +00:00
9090e0b147 Switch CriticalSectionWrapper->rtc::CriticalSection in modules/audio_coding.
This is a part of cleaning up CriticalSectionWrapper in general.

BUG=
R=henrik.lundin@webrtc.org

Review URL: https://codereview.webrtc.org/1610073003 .

Cr-Commit-Position: refs/heads/master@{#11319}
2016-01-20 12:39:45 +00:00