Commit graph

1014 commits

Author SHA1 Message Date
Artem Titov
5831ddad65 Introduce IVF file reader
Bug: webrtc:10138
Change-Id: I97d332942f4e645527330159efefb1cb1d8034a0
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/160008
Commit-Queue: Artem Titov <titovartem@webrtc.org>
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29844}
2019-11-20 13:20:56 +00:00
Danil Chapovalov
aa3f5da8dc Fork VCMPacket for PacketBuffer into own struct
it is easier to reduce and eliminate it when it is not bound to legacy video code

Bug: webrtc:10979
Change-Id: I517e298501b3358a914a23ddce40fcb3075d672d
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/159707
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29821}
2019-11-18 15:48:07 +00:00
Danil Chapovalov
3527a4fe55 In PacketBuffer split logic for detecting frame boundaries and assembling frame.
Bug: webrtc:11042
Change-Id: If1695067054b332569f4839aa6762af33173b769
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/159283
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29799}
2019-11-14 13:32:06 +00:00
Åsa Persson
e644a03195 Add field trial for rampup in quality based on available bandwidth.
Bug: none
Change-Id: I32e1ea6fb2f2e20fc631e09b02c8f3a11b6c9fac
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/158888
Reviewed-by: Niels Moller <nisse@webrtc.org>
Reviewed-by: Sergey Silkin <ssilkin@webrtc.org>
Commit-Queue: Åsa Persson <asapersson@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29751}
2019-11-11 10:13:28 +00:00
Sergey Silkin
df8fd28d0b Add output_path to VideoCodecTestFixture::Config.
This lets test to set output path explicitly.

Bug: none
Change-Id: I756484775f4c7f44cd1bb904c89d9215ffa48fe1
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/158798
Commit-Queue: Sergey Silkin <ssilkin@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29702}
2019-11-06 08:48:52 +00:00
Rasmus Brandt
2b9317ad76 Stop checking VP8BaseHeavyTl3RateAllocation field trial on every frame.
- Centralize field trial string reading to RateControlSettings
- Cache RateControlSettings at all production code use sites

Bug: None
Change-Id: I0dbce9cc97fea0bc780982e7ef270b417a8c15bf
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/158664
Commit-Queue: Rasmus Brandt <brandtr@webrtc.org>
Reviewed-by: Elad Alon <eladalon@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29680}
2019-11-04 13:50:59 +00:00
Danil Chapovalov
09860e0bc3 Split out counting unique rtp timestamps from packet_buffer
Bug: None
Change-Id: Ia6fd05f284e8304cf56ab9ddf944fb222a4c9573
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/158676
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29656}
2019-10-30 15:27:48 +00:00
Danil Chapovalov
fbec2ec292 Detach H264 sps pps tracker from VCMPacket
Bug: webrtc:10979
Change-Id: I6ec5db570c3957dd068109accad88d2f62304163
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/158523
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29639}
2019-10-29 09:52:38 +00:00
Erik Språng
3eae7e4e3c Add exponential backoff of retransmissions for a given packet
Bug: webrtc:8624
Change-Id: I8900c54935bf1da11ac74665426b0d198bd6d814
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/30900
Reviewed-by: Sergey Silkin <ssilkin@webrtc.org>
Commit-Queue: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29625}
2019-10-28 10:06:23 +00:00
Danil Chapovalov
1dac707ecb Cleanup PacketBuffer tests to use immediate result
delete traces of the OnAssembledFrame callback
relax some expectation to better match test purpose,
in particular avoid verifying every test buffer is not cleared on new packet.
switch comparisons from EXPECT_EQ(constant, value) to more natural EXPECT_EQ(value, constant)

Bug: None
Change-Id: I81e2c9d0133221435cb2bb02c9190d9f32abd548
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/158140
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29610}
2019-10-25 09:35:47 +00:00
Sergey Silkin
b2290f4e13 Revert "Reset end-of-frame flag in non-VCL packet."
This reverts commit c98ff2eff0.

Reason for revert: breaks decoding of H264 RTP streams where M bit is set in AUD packets.

Original change's description:
> Reset end-of-frame flag in non-VCL packet.
> 
> Bug: chromium:999807
> Change-Id: I28309d2fda16842e620e499cb9e77ec771827b8c
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/157160
> Reviewed-by: Philip Eliasson <philipel@webrtc.org>
> Commit-Queue: Sergey Silkin <ssilkin@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#29560}

TBR=philipel@webrtc.org,ssilkin@webrtc.org,philipel@chromium.org

# Not skipping CQ checks because original CL landed > 1 day ago.

Bug: chromium:999807
Change-Id: I8d6bcf4c00197b00d279b9e53a11652d3e61171b
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/158204
Reviewed-by: Sergey Silkin <ssilkin@webrtc.org>
Reviewed-by: Johannes Kron <kron@webrtc.org>
Commit-Queue: Sergey Silkin <ssilkin@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29600}
2019-10-24 12:12:26 +00:00
Danil Chapovalov
ce1ffcdc06 change PacketBuffer to return it's result rather that use callback
Bug: None
Change-Id: I8cc05dd46e811d6db37af520d2106af21c671def
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/157893
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29589}
2019-10-23 16:50:57 +00:00
Ilya Nikolaevskiy
5f2fc41fb5 VP9 decoder: replace DCHECK with error message
Bug: chromium:1016160
Change-Id: I0ef0db2b254829e7c0dff24b7a8da3a4056547ac
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/157890
Reviewed-by: Niels Moller <nisse@webrtc.org>
Commit-Queue: Ilya Nikolaevskiy <ilnik@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29567}
2019-10-22 09:54:19 +00:00
Sergey Silkin
c98ff2eff0 Reset end-of-frame flag in non-VCL packet.
Bug: chromium:999807
Change-Id: I28309d2fda16842e620e499cb9e77ec771827b8c
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/157160
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Commit-Queue: Sergey Silkin <ssilkin@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29560}
2019-10-21 13:54:31 +00:00
Mirko Bonadei
3663ed3ad6 Move rtc_base/ignore_wundef.h to its own target.
Since rtc_base/ignore_wundef.h doesn't have any dependency, it is easy to
move it to its own target and allow its dependant to avoid to take a
dependency rtc_base:on rtc_base_approved.

Bug: webrtc:9419
Change-Id: I17f205b0cb2b21cad388b04e60082df9398dffdf
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/157428
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29548}
2019-10-19 10:50:36 +00:00
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