Commit graph

999 commits

Author SHA1 Message Date
Danil Chapovalov
4aae11dc46 Remove redundant fields in PacketBuffer
merge two vectors of the same size into single vector
Remove redundant size_ variable.
Remove redundant variables in the StoredPacket internal struct.
Remove frame_created flags since shortly after it is set, used flag is set to false

Bug: webrtc:10979
Change-Id: Ia37944362abda4e2a6c6741f436f95c45e0f7069
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/157174
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29535}
2019-10-18 10:05:10 +00:00
Danil Chapovalov
05269ecd0b Rename PacketBuffer tests to follow conventions
Rename file with tests to match code under test.
Rename fixture by moving 'Test' from prefix to suffix

Bug: None
Change-Id: I54c36d3b517bde7cdffa3a7e74528cc464ea7ad7
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/157301
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29532}
2019-10-18 09:05:06 +00:00
Niels Möller
f07003c2ec Avoid Realloc in LibvpxVp8Encoder
Instead, compute the needed buffer size for the encoded VP8 frame
prior to copying the data.

Bug: chromium:1012256
Change-Id: I3dda921f6d8f974731d2138bc5f6166cfdb9a321
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/157303
Commit-Queue: Niels Moller <nisse@webrtc.org>
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29531}
2019-10-18 08:36:23 +00:00
Mirko Bonadei
86d053c2db Use source_sets in component builds and static_library in release builds.
Static libraries don't guarantee that an exported symbol gets linked
into a shared library (and in order to support Chromium's component
build mode, WebRTC needs to be linked as a shared library).

Source sets always pass all the object files to the linker.

On the flip side, source_sets link more object files in release builds
and to avoid this, this CL introduces a the GN template "rtc_library" that
expands to static_library during release builds and to source_set during
component builds.

See: https://gn.googlesource.com/gn/+/master/docs/reference.md#func_source_set

Bug: webrtc:9419
Change-Id: I4667e820c2b3fcec417becbd2034acc13e4f04fe
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/157168
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Reviewed-by: Nico Weber <thakis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#29525}
2019-10-17 21:17:18 +00:00
Shyam Sadhwani
5b2df17422 Width and Height was not associated and provided to decoder for H264 streams which have Nalus before SPS
Summary:
There is an issue with WebRTC for handling of certain H.264 bitstreams where the packets forming the H.264 stream has non-zero packets before the packet containing SPS.

Typically a IDR (key frame) will have SPS/PPS (if present) or the IDR slice in the first packet.
But this is not required in all cases, for example when packetization-mode = 0, you can have each NALU in separate packet. And certain NALUs can exist before SPS, for example SEI, AUD.

The way WebRTC associates width/height to encoded frames is by tracking the dependency of IDR slices to SPS/PPS.
RTP packets containing SPS/PPS have correct width/height stored in them during parsing of SPS in RtpDepacketizerH264::ProcessStapAOrSingleNalu
IDR packets refer to SPS using ppsid, spsid and the width/height fields get transferred from packet containing SPS to IDR packet in H264SpsPpsTracker::CopyAndFixBitstream.

When packets are assembled into a single encoded H264 frame in PacketBuffer::FindFrames, the loop goes through all the packets/nalus in backward scan from last RTP packet of IDR to first one.
Hence the order of NALUs during this scan is : Last parts of IDR Slice -> Mid parts of IDR Slice RTP packet -> first IDR slice Packet (this should have correct width / height) -> RTP packet containing SPS/PPS (this should have correct width/height)
start_index points to the first RTP packet of the frame and its passed into RtpFrameObject's constructor. RtpFrameObject will use the width/height stored in first RTP packet.

This works fine as long as the first RTP packet has width/height, which will be the case if first RTP packet is IDR or SPS.
In H.264 first RTP packet may be AUD, SEI in those cases, RtpFrameObject will create IDR with width/height = 0 and this causes problem for Android hardware decoders.
On Android hardware decoders rely on correct width/height to initialize the hardware decoder.

Verified on real scenario that we have.
Simulated on AppRTCMobile on IOS Simulator
Added unit tests : ninja -C out/Default && ./out/Default/modules_unittests --gtest_filter=*FrameResolution*

Bug: webrtc:11025
Change-Id: Ie2273aae5e81fd62497e1add084876a3aa05af4d
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/156260
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Reviewed-by: Sergey Silkin <ssilkin@webrtc.org>
Commit-Queue: Shyam Sadhwani <shyamsadhwani@fb.com>
Cr-Commit-Position: refs/heads/master@{#29515}
2019-10-17 13:51:16 +00:00
Danil Chapovalov
eb90e6ffe3 Merge SendTask implementation for SingleThreadedTaskQueueForTesting and TaskQueueForTest
That allows to use SingleThreadedTaskQueueForTesting via TaskQueueBase interface
but still have access to test-only SendTask function.

Bug: webrtc:10933
Change-Id: I3cc397e55ea2f1ed9e5d885d6a2ccda412beb826
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/156002
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29480}
2019-10-15 09:17:36 +00:00
Elad Alon
c67a4d63dd Fix WebRTC-Video-MinVideoBitrate for VP9
Make sure the experiment-derived value is used for VP9.

Bug: webrtc:11024
Change-Id: I80b6d388486f2dec793bc8ca872babe6165dcfb2
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/156562
Commit-Queue: Elad Alon <eladalon@webrtc.org>
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29453}
2019-10-11 17:56:51 +00:00
Kuang-che Wu
f17976d019 Use single thread vp9 decoder for fuzzing
Single thread vp9 decoder is more fuzzer friendly.

Bug: chromium:1009073
Change-Id: I7f98680f1ce227126a62a1beccd8a283c9423aa6
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/156361
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Commit-Queue: Kuang-che Wu <kcwu@google.com>
Cr-Commit-Position: refs/heads/master@{#29435}
2019-10-10 13:49:40 +00:00
Kuang-che Wu
c466f080dd Cap vp9 fuzzer frame size to prevent OOM
Bug: chromium:1009073
Change-Id: I3583e6751249e42decb1f5d48afe10f0d8bd0a1a
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/156360
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Commit-Queue: Kuang-che Wu <kcwu@google.com>
Cr-Commit-Position: refs/heads/master@{#29433}
2019-10-10 13:29:40 +00:00
Ilya Nikolaevskiy
5963c7cf0a Count disabled due to low bw streams or layers as bw limited quality in GetStats
Bug: webrtc:11015
Change-Id: I65cd890706f765366d89ded8c21fa7507797fc23
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/155964
Commit-Queue: Ilya Nikolaevskiy <ilnik@webrtc.org>
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Reviewed-by: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29421}
2019-10-09 16:58:34 +00:00
Niels Möller
d9755eea22 Delete large up-front allocation in LibvpxVp8Encoder::InitEncode
No longer useful after cl
https://webrtc-review.googlesource.com/c/src/+/155163

Bug: chromium:1012256,webrtc:9378
Change-Id: I2ee000b72add0b34933b7954ad7c8bf0d69fc88e
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/156163
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29416}
2019-10-09 12:40:31 +00:00
Sergey Silkin
999afa9cb8 Fix cropping in H264 decoder wrapper.
FFmpeg applies cropping (if needed) by moving plane pointers and
by adjusting frame resolution. Wrap AVframe into WrapI420Buffer.

Bug: webrtc:10892
Change-Id: I9814518759c9fc37f2bb6e16248fc32017ca4f4e
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/155662
Reviewed-by: Åsa Persson <asapersson@webrtc.org>
Commit-Queue: Sergey Silkin <ssilkin@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29404}
2019-10-08 13:19:34 +00:00
Ilya Nikolaevskiy
e93b1fe8fd Improve bitstream dumping logic to handle multiple SLs correctly
Before this change all layers were glued together at the receive side
into a single IVF frame. This confuses most bitstream parsers.
Since this change all spatial layers would be written as separate frames
on the receive side also (on the send side it's already done that way).

Bug: none
Change-Id: I68543e4d4b336f87699ec3b4a113b8c93af0b7e4
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/156082
Reviewed-by: Sergey Silkin <ssilkin@webrtc.org>
Commit-Queue: Ilya Nikolaevskiy <ilnik@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29401}
2019-10-08 11:55:19 +00:00
Danil Chapovalov
7c06777ab0 Cleanup includes in modules/include/module_common_types.h
Add missing includes to files that were transactivly depending on removed includes.

Bug: None
Change-Id: Id5923bb8dc3e1d8fbb664e460278ad3e5993be7e
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/155963
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29396}
2019-10-07 16:06:26 +00:00
Shyam Sadhwani
2b84dad18c Fixed issue with H264 packet buffer where it was not detecting presence of sps/pps for idr frames
This issue happens for default case sps_pps_idr_is_h264_keyframe_ is false

The way PacketBuffer::FindFrames works for H264 is it keeps on skipping the packets till it finds a packet which has last=1
This is checked here : if (sequence_buffer_[index].frame_end)
Inside this block there is a loop, to go back and scan all the packets till start of the frame.
Since the scan is backwards, the sequence of nalus in this scan is IDR -> PPS -> SPS.
Once IDR is detected if (h264_header->nalus[j].type == H264::NaluType::kIdr) , the code will has_h264_idr = true.
When it scans the previous packets, it skips those as has_h264_idr is true. These packets have the SPS / PPS and hence has_h264_sps / pps flags were never set to true.
This resulted in warning as no SPS/PPS has been found for IDR.

Test plan : verified loopback call on IOS simulator using H264 codec and the warning log "Received H.264-IDR frame..." is not present anymore

Bug: webrtc:11006
Change-Id: Icbe8a393e3679a8d621af6c76e4999fd60db04a0
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/155420
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Commit-Queue: Shyam Sadhwani <shyamsadhwani@fb.com>
Cr-Commit-Position: refs/heads/master@{#29386}
2019-10-04 14:56:05 +00:00
Niels Möller
b9bfe655d4 Delete VCMEncodedFrame::VerifyAndAllocate
And mark EncodedImage::Allocate as deprecated.

Bug: webrtc:9378
Change-Id: I03ce907fa6b87803ddb72f548f60a9bf1b7c317d
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/155163
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29383}
2019-10-04 14:16:49 +00:00
Erik Språng
f4e0c29ed1 SimulcastEncoderAdapter: support per layer fallback and single encoder proxying
This CL adds an optional second encoder factory to SimulcastEncoderAdapter,
that can be used to create software fallback adapter per simulcast layer.

It also adds logic to check if the encoder supports simulcast natively, if so
it only allocates a single instance and delegates the simulcast logic to that
encoder instead. This means we will be able to remove EncoderSimulcastProxy.

Bug: webrtc:11000
Change-Id: Ifd5f029cc281ee2cedf9d18efa5e7e460884d6ff
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/155171
Commit-Queue: Erik Språng <sprang@webrtc.org>
Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29364}
2019-10-01 17:31:44 +00:00
philipel
b3bb2040a1 Remove unused RtpFrameObject ctor.
Bug: webrtc:10979
Change-Id: I9ab8cbd3da4c753f0fa318c41b6e74ddd9679901
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/155172
Commit-Queue: Philip Eliasson <philipel@webrtc.org>
Reviewed-by: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29354}
2019-10-01 11:23:26 +00:00
Ilya Nikolaevskiy
002b6f4f23 Fixes for support of disabling lower spatial layers in VP9
1) Always allocate at least one spatial layer in svc rate allocator

2) Ensure tests reflect known existing failing scenario
(k-svc video with no external ref control).

3) Update log representation of bitrate allocation, as it looks very
confusing with lower layers disabled.

Was:
[
[],
[], [x, y, z]]
New:
[
[]
[]
[x,y,z]]

Bug: webrtc:10977
Change-Id: I248d9b44c8848710aa5a194a5c1b96df6a2734ac
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/154744
Reviewed-by: Niels Moller <nisse@webrtc.org>
Reviewed-by: Sergey Silkin <ssilkin@webrtc.org>
Commit-Queue: Ilya Nikolaevskiy <ilnik@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29345}
2019-09-30 13:20:12 +00:00
Niels Möller
2449d7aa78 Refactor legacy FrameBuffer to use EncodedImageBuffer::Realloc
Preparation for deleting VCMEncodedFrame::VerifyAndAllocate and
EncodedImage::Allocate.

Bug: webrtc:9378
Change-Id: If7c16061962bbd58c3e7d5720189854e00a3d7bf
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/154570
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29339}
2019-09-30 09:48:26 +00:00
philipel
fc3587418d Use new RtpFrameObject ctor for unittests.
Bug: webrtc:10979
Change-Id: I63f501b3a4538d65a73aae226f2006de191dbbec
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/154565
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Reviewed-by: Niels Moller <nisse@webrtc.org>
Commit-Queue: Philip Eliasson <philipel@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29337}
2019-09-30 08:28:45 +00:00
Niels Möller
ff2e215bcd Change FrameBuffer::CombineAndDeleteFrames to allocate a new buffer
Modifying buffers passed in to the frame buffer breaks sharing. This
cl is also a preparation for deleting
VCMEncodedFrame::VerifyAndAllocate and EncodedImage::Allocate.

Bug: None
Change-Id: I4e14bc4708bbcbcd91af2d4b764cb9b8271ec090
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/154569
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29336}
2019-09-30 07:06:10 +00:00
Ilya Nikolaevskiy
bc8049ef0b Reland "VP9 encoder: handle disabled layers correctly"
Now vp9 screenshare would enable new layers as soon as requested and will force all spatial layers present on the next frame, even if they should be dropped because of frame-rate limiting.

This might cause frame-rate liming to be exceeded if layer is toggling on and off very often, but this situation is bad itself. E.g. in realtime video it will cause too many key-frames.

Now SvcRateAllocator and VP9EncoderImpl are aware that there may be some skipped layers before the first enabled. Key-frames and ss_info triggering logic is also updated.

(This is a reland without changes after updates to downstream projects)
Original-Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/153483

Bug: webrtc:10977
Change-Id: I02459c5982da2e0542a837514f5753c5f96401c6
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/154355
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Reviewed-by: Sergey Silkin <ssilkin@webrtc.org>
Commit-Queue: Ilya Nikolaevskiy <ilnik@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29330}
2019-09-27 09:28:38 +00:00
philipel
7acc4a4a3a Reset |reference_finder_| on codec switch.
In this CL:
 - Moved critical section out of RtpFrameReferenceFinder.
 - RtpFrameReferenceFinder can now assign picture ids with an offset.
 - RtpVideoStreamReceiver will now reset the |reference_finder_| in case
   of a codec switch.

Bug: webrtc:10795, webrtc:10828
Change-Id: I22631c121a465c434de24af5ce8be2a647fe3556
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/154353
Reviewed-by: Åsa Persson <asapersson@webrtc.org>
Commit-Queue: Philip Eliasson <philipel@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29317}
2019-09-26 11:05:59 +00:00
philipel
5dacece70c Removed unused _rotation_set variable from EncodedFrame.
Bug: none
Change-Id: I398417541fb66e58b0ad90c4b17c5d36eb61a004
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/154520
Reviewed-by: Niels Moller <nisse@webrtc.org>
Commit-Queue: Philip Eliasson <philipel@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29316}
2019-09-26 10:45:03 +00:00
philipel
85d5c197a8 Added RtpFrameObject ctor with no PacketBuffer pointer.
Bug: webrtc:10979
Change-Id: Ie6a2b56e7374d60d1f74d8c315216b27df22a19b
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/154426
Reviewed-by: Niels Moller <nisse@webrtc.org>
Commit-Queue: Philip Eliasson <philipel@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29314}
2019-09-26 08:55:00 +00:00
Ilya Nikolaevskiy
90d6efbd4e Revert "VP9 encoder: handle disabled layers correctly"
This reverts commit 88fe84b7fb.

Reason for revert: Downstream project isn't updated to the latest libvpx roll yet, thus some tests are broken.

Original change's description:
> VP9 encoder: handle disabled layers correctly
> 
> Now vp9 screenshare would enable new layers as soon as requested and will
> force all spatial layers present on the next frame, even if they should be
> dropped because of frame-rate limiting.
> 
> This might cause frame-rate liming to be exceeded if layer is toggling on
> and off very often, but this situation is bad itself. E.g. in realtime video
> it will cause too many key-frames.
> 
> Now SvcRateAllocator and VP9EncoderImpl are aware that there may be some skipped
> layers before the first enabled. Key-frames and ss_info triggering logic is also
> updated.
> 
> Bug: webrtc:10977
> Change-Id: Ie2555210c0368a1d3c51ddf6670d0052e6d679de
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/153483
> Commit-Queue: Ilya Nikolaevskiy <ilnik@webrtc.org>
> Reviewed-by: Sergey Silkin <ssilkin@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#29296}

TBR=ilnik@webrtc.org,ssilkin@webrtc.org

Change-Id: If33886a5f8a0c3b33168dcadfe45c11a6f4387c1
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:10977
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/154354
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Commit-Queue: Ilya Nikolaevskiy <ilnik@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29299}
2019-09-25 09:06:59 +00:00
Ilya Nikolaevskiy
88fe84b7fb VP9 encoder: handle disabled layers correctly
Now vp9 screenshare would enable new layers as soon as requested and will
force all spatial layers present on the next frame, even if they should be
dropped because of frame-rate limiting.

This might cause frame-rate liming to be exceeded if layer is toggling on
and off very often, but this situation is bad itself. E.g. in realtime video
it will cause too many key-frames.

Now SvcRateAllocator and VP9EncoderImpl are aware that there may be some skipped
layers before the first enabled. Key-frames and ss_info triggering logic is also
updated.

Bug: webrtc:10977
Change-Id: Ie2555210c0368a1d3c51ddf6670d0052e6d679de
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/153483
Commit-Queue: Ilya Nikolaevskiy <ilnik@webrtc.org>
Reviewed-by: Sergey Silkin <ssilkin@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29296}
2019-09-25 08:42:19 +00:00
Johannes Kron
9d281028c7 Remove deprecated method
Bug: None
Change-Id: Ia390e05e3bb462e0e79bf3ff7fae6cba891e73ca
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/154262
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Commit-Queue: Johannes Kron <kron@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29285}
2019-09-24 14:52:20 +00:00
Mirko Bonadei
1b575417b3 Always pass arguments to INSTANTIATE_TEST_SUITE_P.
Passing an empty arg is working at the moment but it is not
guaranteed to continue to work in the future.

This CL has been generated with:
git grep -l "INSTANTIATE_TEST_SUITE_P(," | xargs sed -i \
    "s/INSTANTIATE_TEST_SUITE_P(,/INSTANTIATE_TEST_SUITE_P(All,/g"

Bug: None
Change-Id: Icd2fb9d9d29aed5d692a234124bd990d0f097db4
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/153890
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29282}
2019-09-24 08:56:24 +00:00
Niels Möller
834a554962 Include module_common_types.h only where needed
Bug: None
Change-Id: I73d493f8f186b429c7be808f4dfac0398f150931
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/153891
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29277}
2019-09-24 08:22:38 +00:00
Danil Chapovalov
f7457e55fe Store PacketBuffer by value instead of as reference counted object
Bug: None
Change-Id: I5a594972e8a8dad731c927a1a374301e549f5d71
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/153887
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Reviewed-by: Åsa Persson <asapersson@webrtc.org>
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29267}
2019-09-23 13:28:09 +00:00
philipel
0cff4fce55 Removed unused frame_size param from RtpFrameObject ctor.
Bug: webrtc:10979
Change-Id: Idde493dc7f5165e3ca173d5a38861b444b5904a4
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/153668
Commit-Queue: Philip Eliasson <philipel@webrtc.org>
Reviewed-by: Niels Moller <nisse@webrtc.org>
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29253}
2019-09-20 10:56:01 +00:00
philipel
b5e4785464 RtpFrameObject now takes an EncodedImageBuffer in its ctor.
Bug: webrtc:10979
Change-Id: Ibc8b4a524ca95b5faa8850a41df8f2f0136a2969
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/153666
Commit-Queue: Philip Eliasson <philipel@webrtc.org>
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Reviewed-by: Niels Moller <nisse@webrtc.org>
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29251}
2019-09-20 10:15:01 +00:00
philipel
f0be5b5380 Make GetBitstream non-virtual since it is no longer needed for testing.
Bug: webrtc:10979
Change-Id: Id313c7fddbec40b9f19dae95f736379b872e3082
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/153663
Reviewed-by: Niels Moller <nisse@webrtc.org>
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Commit-Queue: Philip Eliasson <philipel@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29242}
2019-09-19 14:04:09 +00:00
philipel
76161f7446 Move the call to GetBitstream out of the RtpFrameObject ctor.
Bug: webrtc:10979
Change-Id: I9159eb04d4a371e8ed8f932a989d6b884faa7be7
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/153661
Reviewed-by: Niels Moller <nisse@webrtc.org>
Commit-Queue: Philip Eliasson <philipel@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29237}
2019-09-19 12:08:04 +00:00
philipel
e607a06338 Removed unused include from PacketBuffer.
Bug: none
Change-Id: I502f634e85421e38a02cd31d8ae5446cbe32d138
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/153520
Commit-Queue: Philip Eliasson <philipel@webrtc.org>
Reviewed-by: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29223}
2019-09-18 15:35:59 +00:00
Mirko Bonadei
317a1f09ed Use std::make_unique instead of absl::make_unique.
WebRTC is now using C++14 so there is no need to use the Abseil version
of std::make_unique.

This CL has been created with the following steps:

git grep -l absl::make_unique | sort | uniq > /tmp/make_unique.txt
git grep -l absl::WrapUnique | sort | uniq > /tmp/wrap_unique.txt
git grep -l "#include <memory>" | sort | uniq > /tmp/memory.txt

diff --new-line-format="" --unchanged-line-format="" \
  /tmp/make_unique.txt /tmp/wrap_unique.txt | sort | \
  uniq > /tmp/only_make_unique.txt
diff --new-line-format="" --unchanged-line-format="" \
  /tmp/only_make_unique.txt /tmp/memory.txt | \
  xargs grep -l "absl/memory" > /tmp/add-memory.txt

git grep -l "\babsl::make_unique\b" | \
  xargs sed -i "s/\babsl::make_unique\b/std::make_unique/g"

git checkout PRESUBMIT.py abseil-in-webrtc.md

cat /tmp/add-memory.txt | \
  xargs sed -i \
  's/#include "absl\/memory\/memory.h"/#include <memory>/g'
git cl format
# Manual fix order of the new inserted #include <memory>

cat /tmp/only_make_unique | xargs grep -l "#include <memory>" | \
  xargs sed -i '/#include "absl\/memory\/memory.h"/d'

git ls-files | grep BUILD.gn | \
  xargs sed -i '/\/\/third_party\/abseil-cpp\/absl\/memory/d'

python tools_webrtc/gn_check_autofix.py \
  -m tryserver.webrtc -b linux_rel

# Repead the gn_check_autofix step for other platforms

git ls-files | grep BUILD.gn | \
  xargs sed -i 's/absl\/memory:memory/absl\/memory/g'
git cl format

Bug: webrtc:10945
Change-Id: I3fe28ea80f4dd3ba3cf28effd151d5e1f19aff89
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/153221
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Alessio Bazzica <alessiob@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29209}
2019-09-17 15:47:29 +00:00
Niels Möller
a740142398 Refactor LossNotificationController to not use VCMPacket
Bug: None
Change-Id: I15e1b3405c6538dd22aaeb125751c158c069478a
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/152384
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29193}
2019-09-16 11:25:45 +00:00
Niels Möller
ca79dc6779 Delete VideoReceiver2::TriggerDecoderShutdown.
This method used to be wired down to VCMReceiver and to
VCMJitterBuffer::Stop, but has become a nop. Also delete some
obsoleted comments.

Bug: webrtc:7408
Change-Id: I4c1e67272b1ffda786cc0ff358fa38e594aff304
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/152620
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29167}
2019-09-12 13:44:13 +00:00
Ilya Nikolaevskiy
1af0f908c8 VP9 screenshare: use CONSTRAINED_FROM_ABOVE_DROP mode
This mode was added by libvpx team specificaly for this usecase: if a
layer is dropped, all lower layers have to be dropped also.

This ensures that higher layers always have higher framerate than the
lower layers and stream is RTP compatible.

This CL also renames full_superframe_drop_ to !layer_buffering, as it
closer reflects the purpose of that flag (in screenshare mode, no
buffering is needed, because the highest layer is always present in the
superframe, yet, it's not a full-superframe dropping mode).

Bug: webrtc:10257
Change-Id: I2589bfd2b9b63de0e410f277a716276234993843
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/151764
Reviewed-by: Sergey Silkin <ssilkin@webrtc.org>
Commit-Queue: Ilya Nikolaevskiy <ilnik@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29155}
2019-09-11 11:21:39 +00:00
Johannes Kron
7ddea57e94 Add field-trial parameter to enable tests simulating a slow decoder
This CL adds a field trial parameter WebRTC-SlowDownDecoder that is
used to simulate a slow decoder. The parameter specifies how many
extra ms it takes to decode each video frame. This must only be used
in manual testing.

Bug: None
Change-Id: Iad4079100d67b95c224277aaeaf572e38068717f
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/151911
Commit-Queue: Johannes Kron <kron@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29153}
2019-09-11 11:08:59 +00:00
Marin Kišić
9a91161b9f Fixing way of printing logs because RTC_LOG() on Android has limit on printing 1024-60 characters in line.
Bug: webrtc:10885
Change-Id: I42c365555b682f3352644330167e2a4331ba0527
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/149180
Commit-Queue: Marin Kišić <kisicmar@webrtc.org>
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29151}
2019-09-11 10:44:07 +00:00
Niels Möller
2eecfc1f9a Trim dependencies in modules/video_coding/
And move jitter_buffer_common.h to the legacy build target.

Bug: None
Change-Id: I986649f2f0773cadfa7dd9c8b533af7ecf01f3a3
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/152382
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29150}
2019-09-11 09:31:10 +00:00
Niels Möller
45b01c7962 Delete some dead code in vcm::VideoReceiver and VCMReceiver
Bug: None
Change-Id: I9cb8bd57af697762a9fc76007e139695afaf1fa4
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/152381
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29134}
2019-09-10 12:40:58 +00:00
Niels Möller
fe407b7a1d Move code related to VideoCodingModule to its own build target
The new target, modules/video_coding:video_coding_legacy, is not
depended upon by any webrtc non-test code.

Bug: webrtc:7408
Change-Id: I94127e2b8b3b8f15917bfa38e602f8face91fcdb
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/152163
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29133}
2019-09-10 12:34:38 +00:00
Niels Möller
9509d95c48 Add empty build target modules/video_coding:video_coding_legacy
A followup cl will move VideoCodingModule and related code into this
target.

Bug: webrtc:7408
Change-Id: Iade572b597769456c9b8c76f584500e2bd9a58f0
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/152280
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29122}
2019-09-10 07:30:49 +00:00
Niels Möller
ee3d995091 New class VideoReceiver2, a trimmed-down vcm::VideoReceiver
The vcm::VideoReceiver class is used by both VideoReceiveStream and
the legacy api VideoCodingModule. They have different requirements,
since the latter uses the old jitterbuffer and runs the code on a
ProcessThread.

By making a copy and trimming it down to what's actually used by
VideoReceiveStream, we can drop the dependency on the old
jitterbuffer, without breaking the legacy api. This should also make
it easier to do follow-up refactorings to trim down the class further,
and ultimately remove it.

Bug: webrtc:7408
Change-Id: Iec8a167fe5d0425114b0b67a5b4c2fd5fc4fa150
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/151910
Commit-Queue: Niels Moller <nisse@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29108}
2019-09-09 11:23:54 +00:00
Ilya Nikolaevskiy
30323e2fb2 VP9 screenshare: fix incorrect assumptions on buffer contents
if higher layer is enabled, then disabled, then key-frame is issued, then
the layer is enabled again, the buffer would contain a picture from before
the key-frame and it might have a higher pid than the currently encoded one.
This would trigger the DCHECK. It's safe to remove the DCHECK completely, because
such occasions would cause unsigned overflow and cause the following check for
maximum allowed picture difference to fail and the wrong picture won't
be used as a temporal reference.

This error only caused failures in debug builds and couldn't lead to corruptions
because there're periodical key-frames generated and pid difference can never become so
big that negative value would overflow to something close to 0.

Bug: webrtc:10257
Change-Id: Ie3b3ed0e24421787e3b40a37987ccecb75d04635
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/151643
Reviewed-by: Sergey Silkin <ssilkin@webrtc.org>
Commit-Queue: Ilya Nikolaevskiy <ilnik@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29099}
2019-09-06 12:30:16 +00:00
Erik Språng
2b9dba3d9c Implement stable rate support in SimulcastRateAllocator
Bug: webrtc:10126
Change-Id: I2ea8d27b0bd6f7ffd1ebbba451bd1ce1f2eee3d9
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/151121
Reviewed-by: Florent Castelli <orphis@webrtc.org>
Commit-Queue: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29097}
2019-09-06 11:17:30 +00:00