Commit Graph

831 Commits

Author SHA1 Message Date
f122a85287 Delete webrtc::VideoFrame::CreateEmptyFrame.
BUG=webrtc:5682

Review-Url: https://codereview.webrtc.org/2378003002
Cr-Commit-Position: refs/heads/master@{#14512}
2016-10-05 06:27:37 +00:00
d227522f57 Change DCHECK in VCMDecodedFrameCallback back to just logging.
This DCHECK is triggered by org.webrtc.PeerConnectionTest#testTrackRemoval.

BUG=webrtc:6465

Review-Url: https://codereview.webrtc.org/2389703002
Cr-Commit-Position: refs/heads/master@{#14481}
2016-10-03 15:54:44 +00:00
470c0887b3 Fix modules_unittests on iOS.
Some of the module tests were failing on iOS, causing them to be ignored
on the trybots. Specifically this CL:
- Skips some tests that should not run on the simulator
- Fixes iOS file system test helpers
- Fixes failing nalu parser unittest

BUG=webrtc:4752
R=henrika@webrtc.org, peah@webrtc.org, sprang@webrtc.org
TBR=tkchin@webrtc.org

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

Cr-Commit-Position: refs/heads/master@{#14472}
2016-10-03 11:13:33 +00:00
ac9f876bc0 Sort #includes that got unsorted when gmock.h and gtest.h moved to webrtc/test/
gmock.h and gtest.h were moved (or rather, got wrappers so that we
could put some icky compatibility hacks in one place instead of 500)
in this CL: https://codereview.webrtc.org/2358993004/

NOPRESUBMIT=true
BUG=webrtc:6398

Review-Url: https://codereview.webrtc.org/2381013002
Cr-Commit-Position: refs/heads/master@{#14464}
2016-10-01 05:29:53 +00:00
3cdfcd88a1 Revert of Use sps and pps to determine decodability of H.264 frames. (patchset #4 id:60001 of https://codereview.webrtc.org/2341713002/ )
Reason for revert:
Broke browser_tests, e.g., WebRtcVideoQualityBrowserTests/WebRtcVideoQualityBrowserTest.MANUAL_TestVideoQualityH264

Original issue's description:
> Use sps and pps to determine decodability of H.264 frames.
>
> NOPRESUBMIT=true
> BUG=webrtc:6208
> R=philipel@webrtc.org
>
> Committed: https://crrev.com/17b02633666f2f5d7e78767ad5674c728d639c26
> Cr-Commit-Position: refs/heads/master@{#14458}

TBR=philipel@webrtc.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=webrtc:6208

Review-Url: https://codereview.webrtc.org/2381233004
Cr-Commit-Position: refs/heads/master@{#14460}
2016-09-30 16:06:43 +00:00
17b0263366 Use sps and pps to determine decodability of H.264 frames.
NOPRESUBMIT=true
BUG=webrtc:6208
R=philipel@webrtc.org

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

Cr-Commit-Position: refs/heads/master@{#14458}
2016-09-30 13:24:26 +00:00
55d932b331 Add logging statements to places where the frame might be dropped in WebRTC pipeline.
BUG=b/31645554

Review-Url: https://codereview.webrtc.org/2361803003
Cr-Commit-Position: refs/heads/master@{#14457}
2016-09-30 13:19:12 +00:00
115bd153c7 New helper function test::ReadI420Buffer, refactor FrameReader to use it.
This change reduces the number of places where we first fread a I420
frame into a uint8_t buffer, followed by a copy into a frame buffer
object.

BUG=None

Review-Url: https://codereview.webrtc.org/2362683002
Cr-Commit-Position: refs/heads/master@{#14456}
2016-09-30 11:14:11 +00:00
6f112cc136 Delete unused support for vp8 partitions.
This also makes it possible to drop the RTPFragmentationHeader from
the class VCMEncodedFrame.

BUG=None

Review-Url: https://codereview.webrtc.org/2380933003
Cr-Commit-Position: refs/heads/master@{#14455}
2016-09-30 10:43:07 +00:00
15e4ec334c Remove compat for iOS 7/8
BUG=None
R=magjed@webrtc.org, tkchin@webrtc.org

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

Cr-Commit-Position: refs/heads/master@{#14448}
2016-09-30 06:56:44 +00:00
Per
a48ddb7636 Add VideoSendStream::Stats::prefered_media_bitrate_bps
This cl move calculation of stats for prefered_media_bitrate_bps from webrtcvideoengine2.GetStats to SendStatisticsProxy::OnEncoderReconfigured.
This aligns better with how other send stats are reported and is needed as a prerequisite for moving video encoder configuration due to video resolution change
from WebRtcVideoEngine2 to ViEEncoder.

BUG=webrtc:6371
R=mflodman@webrtc.org, sprang@webrtc.org

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

Cr-Commit-Position: refs/heads/master@{#14431}
2016-09-29 09:49:01 +00:00
77eab70470 Enable the -Wundef warning for clang
NOPRESUBMIT=true
BUG=webrtc:6398

Review-Url: https://codereview.webrtc.org/2358993004
Cr-Commit-Position: refs/heads/master@{#14425}
2016-09-29 00:42:08 +00:00
478681e1e6 Move the QP scaling thresholds to the relevant encoders.
Also provide a new set of thresholds for the VideoToolbox encoder. The new thresholds were experimentally determined to work well on the iPhone 6S, and also adequately on the iPhone 5S.

BUG=webrtc:5678

Review-Url: https://codereview.webrtc.org/2309743002
Cr-Commit-Position: refs/heads/master@{#14420}
2016-09-28 15:17:51 +00:00
e75f204b06 Expose Ivf logging through the native API
BUG=webrtc:6300

Review-Url: https://codereview.webrtc.org/2303273002
Cr-Commit-Position: refs/heads/master@{#14419}
2016-09-28 13:19:53 +00:00
e5684c5387 Delete method webrtc::VideoFrame::allocated_size and enum PlaneType.
BUG=webrtc:5682

Review-Url: https://codereview.webrtc.org/2380623002
Cr-Commit-Position: refs/heads/master@{#14416}
2016-09-28 10:14:15 +00:00
e0b2f15417 Frame continuity is now tested as soon as a frame is inserted into the FrameBuffer.
Since we want to stop sending NACKS for frames not needed to keep the stream
decodable we must know which frames that are continuous or not.

BUG=webrtc:5514
R=danilchap@webrtc.org, stefan@webrtc.org

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

Cr-Commit-Position: refs/heads/master@{#14412}
2016-09-28 08:24:02 +00:00
4ecd9700ee GN: Fix incorrect include_dir for video_coding on iOS
When rtc_build_libyuv=false an incorrect code path
is surfaced in GN.

BUG=webrtc:6412
NOTRY=True
TESTED=gn gen out/foo --args='rtc_build_libyuv=false target_os="ios"'

Review-Url: https://codereview.webrtc.org/2375603002
Cr-Commit-Position: refs/heads/master@{#14392}
2016-09-27 08:11:24 +00:00
64ec8f826f Reland of Move MutableDataY{,U,V} methods to I420Buffer only. (patchset #1 id:1 of https://codereview.webrtc.org/2354223002/ )
Reason for revert:
Downstream application now fixed.

Original issue's description:
> Revert of Move MutableDataY{,U,V} methods to I420Buffer only. (patchset #14 id:260001 of https://codereview.webrtc.org/2278883002/ )
>
> Reason for revert:
> Broke downstream application.
>
> Original issue's description:
> > Move MutableDataY{,U,V} methods to I420Buffer only.
> >
> > Deleted from the VideoFrameBuffer base class.
> >
> > BUG=webrtc:5921
> >
> > Committed: https://crrev.com/5539ef6c03c273f39fadae41ace47fdc11ac6d60
> > Cr-Commit-Position: refs/heads/master@{#14317}
>
> TBR=perkj@webrtc.org,magjed@webrtc.org,pthatcher@webrtc.org,honghaiz@webrtc.org,stefan@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:5921
>
> Committed: https://crrev.com/776870a2599b8f43ad56987f9031690e3ccecde8
> Cr-Commit-Position: refs/heads/master@{#14325}

TBR=perkj@webrtc.org,magjed@webrtc.org,pthatcher@webrtc.org,honghaiz@webrtc.org,stefan@webrtc.org
# Not skipping CQ checks because original CL landed more than 1 days ago.
BUG=webrtc:5921

Review-Url: https://codereview.webrtc.org/2372483002
Cr-Commit-Position: refs/heads/master@{#14389}
2016-09-27 07:17:40 +00:00
44428a8aa6 iOS: Always build H264 HW encoder/decoder
This CL removes the use_objc_h264 flag. This means that the VideoToolbox
H264 encoder and decoder will always be built.

BUG=webrtc:4081
NOTRY=TRUE

Review-Url: https://codereview.webrtc.org/2366443003
Cr-Commit-Position: refs/heads/master@{#14372}
2016-09-23 14:01:44 +00:00
1490f7aa55 Add histogram for end-to-end delay:
"WebRTC.Video.EndToEndDelayInMs"

Make capture time in local timebase available for decoded VP9 video frames (propagate ntp_time_ms from EncodedImage to decoded VideoFrame).

BUG=webrtc:6409

Review-Url: https://codereview.webrtc.org/1905563002
Cr-Commit-Position: refs/heads/master@{#14367}
2016-09-23 09:09:59 +00:00
b62dbbe985 GN: Change rtc_source_set targets --> rtc_static_library
This changes most non-test related rtc_source_set targets to be
rtc_static_library instead. Targets without any .cc files are excluded.
This should bring back the build behavior we used to have with GYP
(i.e. same symbols exported in the libjingle_peerconnection.a file, which
are used by some downstream projects).

After doing an Android build with these changes:
$ nm --defined-only -g -C out/Release/lib.unstripped/libjingle_peerconnection_so.so | grep -i createpeerconnectionf
00077c51 T Java_org_webrtc_PeerConnectionFactory_nativeCreatePeerConnectionFactory
$ nm --defined-only -g -C out/Release/obj/webrtc/api/libjingle_peerconnection.a | grep -i createpeerconnectionf
00000001 T webrtc::CreatePeerConnectionFactory(rtc::Thread*, rtc::Thread*, rtc::Thread*, webrtc::AudioDeviceModule*, cricket::WebRtcVideoEncoderFactory*, cricket::WebRtcVideoDecoderFactory*)
00000001 T webrtc::CreatePeerConnectionFactory()

See https://chromium.googlesource.com/chromium/src/+/master/tools/gn/docs/cookbook.md#Note-on-static-libraries
for more details on this.

NOTICE: This should be further cleaned up in the future, to reduce
binary bloat and unnecessary linking time. Right now it's more
important to restore the desired build output though.

BUG=webrtc:6410, chromium:630755

Review-Url: https://codereview.webrtc.org/2361623004
Cr-Commit-Position: refs/heads/master@{#14364}
2016-09-23 07:38:58 +00:00
776870a259 Revert of Move MutableDataY{,U,V} methods to I420Buffer only. (patchset #14 id:260001 of https://codereview.webrtc.org/2278883002/ )
Reason for revert:
Broke downstream application.

Original issue's description:
> Move MutableDataY{,U,V} methods to I420Buffer only.
>
> Deleted from the VideoFrameBuffer base class.
>
> BUG=webrtc:5921
>
> Committed: https://crrev.com/5539ef6c03c273f39fadae41ace47fdc11ac6d60
> Cr-Commit-Position: refs/heads/master@{#14317}

TBR=perkj@webrtc.org,magjed@webrtc.org,pthatcher@webrtc.org,honghaiz@webrtc.org,stefan@webrtc.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=webrtc:5921

Review-Url: https://codereview.webrtc.org/2354223002
Cr-Commit-Position: refs/heads/master@{#14325}
2016-09-21 10:52:21 +00:00
1f39ba1cd9 Copy payload data when inserting packets into video_coding::PacketBuffer.
The payload pointed to by |dataPtr| is volatile and needs to be copied
to its own buffer.

BUG=webrtc:5514
R=brandtr@webrtc.org, stefan@webrtc.org

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

Cr-Commit-Position: refs/heads/master@{#14321}
2016-09-21 09:27:56 +00:00
5539ef6c03 Move MutableDataY{,U,V} methods to I420Buffer only.
Deleted from the VideoFrameBuffer base class.

BUG=webrtc:5921

Review-Url: https://codereview.webrtc.org/2278883002
Cr-Commit-Position: refs/heads/master@{#14317}
2016-09-21 08:27:38 +00:00
4a9abad208 GN: Enable rtc_common_config for more targets.
In the migration to GN templates, some targets got the whole
rtc_common_config removed, which can have unpredicted consequences
in terms of different code behavior due to defines not being set
as expected etc.
It's better to enable this config and only disable the warnings
that fails the build.

BUG=webrtc:6306,webrtc:6307,webrtc:6308
NOTRY=True

Review-Url: https://codereview.webrtc.org/2347263002
Cr-Commit-Position: refs/heads/master@{#14280}
2016-09-18 15:12:36 +00:00
d268d6ffbe Stash non layer-sync frames if we have not yet received an earlier frame for this layer.
In VP8 the assumption is that a non layer-sync frame depends on all previous
frames on temporal layers less or equal to this frames temporal layer.

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

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

Cr-Commit-Position: refs/heads/master@{#14229}
2016-09-15 11:43:30 +00:00
5a20ed36e6 Fix undefined reference to log2 on android
R=nisse@webrtc.org
TBR=sakal@webrtc.org, sprang@webrtc.org

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

Cr-Commit-Position: refs/heads/master@{#14225}
2016-09-15 08:56:30 +00:00
194f40a2e7 Refactor QualityScaler and MovingAverage
The MovingAverage class was very specific to the QualityScaler. This
commit generalizes the MovingAverage class to be useful in other
situations as well, and adapts the QualityScaler to use the new
MovingAverage.

BUG=webrtc:6304

Review-Url: https://codereview.webrtc.org/2310853002
Cr-Commit-Position: refs/heads/master@{#14207}
2016-09-14 09:15:02 +00:00
78ce619a0c Extract simulcast rate allocation outside of video encoder.
This is a first step to refactor this code.
I'm deprecating https://codereview.webrtc.org/1913073002 and
implementing this in smaller more isolated steps.

BUG=webrtc:5206
R=asapersson@webrtc.org, kjellander@webrtc.org, noahric@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#14186}
2016-09-12 14:04:56 +00:00
1d02d3e5e6 Remove RTC_LOGGED_* macro.
BUG=

Review-Url: https://codereview.webrtc.org/2326843003
Cr-Commit-Position: refs/heads/master@{#14174}
2016-09-10 05:40:34 +00:00
fac0ff022b Change SimulcastEncoderAdapter to allow a 0 for SetRates.
0 means "pause", so forcing it to the min bitrate means we'll never
allow pausing for internal source encoders.

BUG=

Review-Url: https://codereview.webrtc.org/2304603002
Cr-Commit-Position: refs/heads/master@{#14168}
2016-09-09 17:27:20 +00:00
a41c13e6a2 OWNERS: Make everyone able to change *.gn,*.gni files.
Project-wide change to make it possible for all team members
to do changes to GN files.

NOTRY=True
R=kwiberg@webrtc.org
TBR=henrika@webrtc.org

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

Cr-Commit-Position: refs/heads/master@{#14163}
2016-09-09 12:51:48 +00:00
463d3011ce Added ClearTo(seq_num) to RtpFrameReferenceFinder.
In order to be able to clear out any potentially stashed old frames from
the RtpFrameReferenceFinder we can now clear frames that contain packets
older than |seq_num|.

BUG=webrtc:5514

Review-Url: https://codereview.webrtc.org/2304723004
Cr-Commit-Position: refs/heads/master@{#14156}
2016-09-09 10:32:51 +00:00
c928453fd0 Significantly increased max_num_buffers_ of Vp9FrameBufferPool.
Changed from 10 to 68.

This is to avoid a flake where the limit is exceeded, see
crbug.com/638554. Our performance tests should flag performance
regressions, we shouldn't rely on crashing because the number of
referenced buffers is not tiny to detect this. However, if a really big
number of buffers (>68) are referenced without being dereferenced it is
likely that we have a bug and frames are leaking in which case we can
DCHECK-crash.

BUG=chromium:638554

Review-Url: https://codereview.webrtc.org/2280593002
Cr-Commit-Position: refs/heads/master@{#14084}
2016-09-06 08:38:34 +00:00
e9cc686293 GN Templates: Move common_inherited_config to the template.
Remove common_inherited_config from the targets and add it to the
template instead.

BUG=webrtc:6187
NOTRY=True

Review-Url: https://codereview.webrtc.org/2311843002
Cr-Commit-Position: refs/heads/master@{#14069}
2016-09-05 13:10:23 +00:00
7556282a6c FrameBuffer::NextFrame now return a ReturnReason and take an additional std::unique_ptr<FrameObject>* as output parameter.
In order to distinguish between a return caused by the FrameBuffer
being stopped and a return caused by a timeout we now return
a ReturnReason.

BUG=webrtc:5514
R=danilchap@webrtc.org, mflodman@webrtc.org

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

Cr-Commit-Position: refs/heads/master@{#14065}
2016-09-05 08:57:56 +00:00
7a2ce0b738 GN Templates: Move common_config to the template.
Remove common_config from the targets' config and add
it to the template instead.

BUG=webrtc:6187
NOTRY=True

Review-Url: https://codereview.webrtc.org/2300413002
Cr-Commit-Position: refs/heads/master@{#14063}
2016-09-05 08:35:48 +00:00
38a2132b02 GN: Introduce templates.
Defines the rtc_executable, rtc_source_set, rtc_test and
rtc_static_library templates.

These templates provide no functionality yet, but will enable common
configuration to be introduced, avoiding repetition in every target

Changes summary:
- Prepend rtc_ to test, source_set, executable and static_library targets
- Change "configs -= [" to "suppressed_configs += ["
- Include webrtc/build/webrtc.gni where it wasn't included yet
- Delete import("//testing/test.gni"), since rtc_test makes it unnecessary.

BUG=webrtc:6187
TBR=henrik.lundin@webrtc.org,tommi@webrtc.org
NOTRY=True

Review-Url: https://codereview.webrtc.org/2301053002
Cr-Commit-Position: refs/heads/master@{#14043}
2016-09-02 11:10:41 +00:00
cdbc96c856 Adding sprang as VCM owner.
BUG=webrtc:6291
R=stefan@webrtc.org

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

Cr-Commit-Position: refs/heads/master@{#14019}
2016-09-01 12:07:48 +00:00
275afc5d2e Add codec name to CodecSpecificInfo and get the codec name stats from there instead.
BUG=webrtc:5687

Review-Url: https://codereview.webrtc.org/2253563002
Cr-Commit-Position: refs/heads/master@{#14012}
2016-09-01 07:21:18 +00:00
36a06a94fb Increase QP threshold for H.264 encoder QP based scaling.
BUG=b/30743634

Review-Url: https://codereview.webrtc.org/2272893002
Cr-Commit-Position: refs/heads/master@{#13904}
2016-08-24 19:09:22 +00:00
d8dd190a08 GN: Fix test_support_unittests and MIPS compile issue.
Move the webrtc/test/test_support/metrics sources into
test_support[_unittests] targets.
This is essentially reverting https://webrtc-codereview.appspot.com/5789004
and moving these sources back to the right target.

Add missing foreman_cif.yuv resource needed for these tests.

For MIPS, a compile error was surfacing for logcat_trace_context.h when
flipping bot to GN, which was fixed.

BUG=webrtc:5949
NOTRY=True

Review-Url: https://codereview.webrtc.org/2267113002
Cr-Commit-Position: refs/heads/master@{#13860}
2016-08-23 11:52:19 +00:00
8177452698 iOS H264VideoToolBoxEncoder: Stop scaling native CVPixelBuffers
If the input to H264VideoToolBoxEncoder is a native CVPixelBuffer and
the quality scaler requests scaling, we fall back to a slow path where
the buffer is converted from NV12 to I420 on the CPU and then uploaded
to a native CVPixelBuffer again. It turns out this scaling is not needed
and that the H264VideoToolBoxEncoder can handle the scaling internally.

BUG=b/30939444

Review-Url: https://codereview.webrtc.org/2258103003
Cr-Commit-Position: refs/heads/master@{#13835}
2016-08-20 17:53:32 +00:00
e1b4d243e2 Skip AUD while extracting SPS and PPS on iOS.
H.264 frames may have AUD before SPS. This change detects AUD and try to extract SPS and PPS behind AUD.

BUG=webrtc:6173

Review-Url: https://codereview.webrtc.org/2209143002
Cr-Commit-Position: refs/heads/master@{#13765}
2016-08-16 01:56:23 +00:00
6c687e72a0 Make prior H264 QP adjustments iOS specific.
BUG=

Review-Url: https://codereview.webrtc.org/2248883002
Cr-Commit-Position: refs/heads/master@{#13764}
2016-08-15 23:38:02 +00:00
17deeb47ed PacketBuffer is now ref counted.
Since all FrameObjects have a reference to its PacketBuffer and since
the PacketBuffer can be thrown away at any moment the PacketBuffer
has to be ref counted in order to avoid FrameObjects dereferencing a potentially
destroyed object.

BUG=webrtc:5514
R=danilchap@webrtc.org, mflodman@webrtc.org, stefan@webrtc.org

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

Cr-Commit-Position: refs/heads/master@{#13725}
2016-08-11 13:09:40 +00:00
4c45234b81 Fix regression for h264 VideoToolbox entering background.
We need to check the pool to make sure that the encoder session is valid. Otherwise, it appears as if the encoder just does not output frames.

NOTRY=True
BUG=

Review-Url: https://codereview.webrtc.org/2226383002
Cr-Commit-Position: refs/heads/master@{#13698}
2016-08-09 20:02:03 +00:00
6a450105cd Adjust H264 QP thresholds.
NOTRY=True
BUG=

Review-Url: https://codereview.webrtc.org/2228683002
Cr-Commit-Position: refs/heads/master@{#13680}
2016-08-08 22:27:41 +00:00
6ce738da31 Disable encoder scaling on iPhone4S.
Scaling causes us to work the CPU too much, which very quickly degrades quality. This causes us to at least behave better on good networks.

NOTRY=True
BUG=

Review-Url: https://codereview.webrtc.org/2205763002
Cr-Commit-Position: refs/heads/master@{#13630}
2016-08-03 19:57:18 +00:00
4f6cd6ac59 Wire up VCMTiming in FrameBuffer2.
The VCMTiming class is now used to set the render time for frames.

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

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

Cr-Commit-Position: refs/heads/master@{#13621}
2016-08-03 08:59:47 +00:00