Commit graph

79 commits

Author SHA1 Message Date
Evan Shrubsole
9146d765e2 Cleaup WebRTC-AddRttToPlayoutDelay field trial
Field trial is not used in any rollouts and should be removed.

R=mhoro@webrtc.org

Bug: webrtc:13264
Change-Id: Ib896dcdec81db7c3f4e68a8dda266d96dfdc6aed
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/234865
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Reviewed-by: Michael Horowitz <mhoro@webrtc.org>
Commit-Queue: Evan Shrubsole <eshr@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35195}
2021-10-13 17:01:14 +00:00
Johannes Kron
23bfff3383 Change default parameters for the low-latency video pipeline
min_pacing:8ms, to avoid the situation where bursts of frames are sent
to the decoder at once due to network jitter. The bursts of frames
caused the queues further down in the processing to be full and
therefore drop all frames.

max_decode_queue_size:8, in the event that too many frames have piled
up, do as before and send all frames to the decoder to avoid building
up any latency.

These setting only affect the low-latency video pipeline that is enabled
by setting the playout RTP header extension to min=0ms, max>0ms.

Bug: chromium:1138888
Change-Id: I8154bf3efe7450b770da8387f8fb6b23f6be26bd
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/233220
Commit-Queue: Johannes Kron <kron@webrtc.org>
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35119}
2021-09-29 09:53:17 +00:00
Johannes Kron
2ddc39e2b9 Add max pre-decode queue size threshold for pacing
When pacing is enabled for the low latency rendering path,
frames are sent to the decoder in regular intervals. In case of a
jitter, these frames intervals could add up to create a large latency.
Hence, disable frame pacing if the pre-decode queue grows beyond the
threshold. The threshold for when to disable frame pacing is set
through a field trial. The default value is high enough so that
the behavior is not changed unless the field trial is specified.

Bug: chromium:1237402
Change-Id: I901fd579f68da286eca3d654118f60d3c55e21ce
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/228241
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Commit-Queue: Johannes Kron <kron@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34705}
2021-08-10 17:01:53 +00:00
Artem Titov
dcd7fc7ea8 Use backticks not vertical bars to denote variables in comments for /modules/video_coding
Bug: webrtc:12338
Change-Id: Ia8a9adea291d594e4f59a6a1203a7bfb0758adac
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/227165
Commit-Queue: Artem Titov <titovartem@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34684}
2021-08-09 15:26:22 +00:00
Rezaul Barbhuiya
82c2248511 Calculate pacing delay based on decode start time
Schedule the frames to be decoded based on the pacing delay from the
last decode scheduled time. In the current implementation, multiple
threads and different functions in same thread can call
MaxWaitingTime(), thereby increasing the wait time each time the
function is called. Instead of returning the wait time for a future
frame based on the number of times the function is called, return the
wait time only for the next frame to be decoded. Threads can call the
function repeatedly to check the waiting time for next frame and wake
up and then go back to waiting if an encoded frame is not available.

Change-Id: I00886c1619599f94bde5d5eb87405572e435bd73
Bug: chromium:1237402
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/226502
Reviewed-by: Johannes Kron <kron@webrtc.org>
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Commit-Queue: Johannes Kron <kron@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34660}
2021-08-06 11:25:17 +00:00
philipel
9aa9b8dbbe Prepare to replace VideoLayerFrameId with int64_t.
Bug: webrtc:12206
Change-Id: I10bfdefbc95a79e0595956c1a0e688051da6d2b9
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/207180
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Reviewed-by: Niels Moller <nisse@webrtc.org>
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Commit-Queue: Philip Eliasson <philipel@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33265}
2021-02-15 14:42:02 +00:00
philipel
f109193fba Remove VideoLayerFrameId::spatial_layer, use EncodedImage::SpatialIndex instead.
Next step is to replace VideoLayerFrameId with int64_t.

Bug: webrtc:12206
Change-Id: I414f491e383acf7f8efd97f7bf93dc55a5194fbf
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/206804
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Reviewed-by: Niels Moller <nisse@webrtc.org>
Commit-Queue: Philip Eliasson <philipel@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33245}
2021-02-12 11:16:23 +00:00
Markus Handell
334b1fd321 VideoReceiveStream: eliminate task post in decode path.
VideoReceiveStream2 unnecessarily posts a decode complete call to
its own queue while already being executed on it. A popular use
case in downstream project has a large amount of decoders
in use so the cost of this is multiplied by the number of active
decoders.

Fix this by removing the unnecessary task post. To allow for this,
this change also changes the frame buffer to call out to it's
handler without any locks held.

Bug: webrtc:12297
Change-Id: Ib2e26445458228a44c53dad9d585d4025f2f2945
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/197420
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Markus Handell <handellm@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32845}
2020-12-16 11:25:41 +00:00
philipel
cb327d9162 Remove use of inter_layer_predicted in FrameBuffer2.
Now that RtpVp9RefFinder sets an additional reference on the frame instead of marking it as inter_layer_predicted it is no longer used.

Bug: webrtc:12206
Change-Id: I10e0930336eafc32dc86feb2f690cb131e55be2c
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/196740
Commit-Queue: Philip Eliasson <philipel@webrtc.org>
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Reviewed-by: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32814}
2020-12-10 14:18:09 +00:00
philipel
0cb7326b54 Stop using inter_layer_predicted flag for VP9.
Instead of signaling an inter layer dependency with the inter_layer_prediction flag we instead flatten the frame IDs so that an inter layer dependency can be signaled as a regular frame reference.

Bug: webrtc:12206, webrtc:12221
Change-Id: I0390fd3d0f5494cde59eece227db938dbc5d7992
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/196648
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Commit-Queue: Philip Eliasson <philipel@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32808}
2020-12-09 09:45:50 +00:00
philipel
a65d78517a Don't use VP9 specific concepts to combine spatial layer frames in FrameBuffer2.
The Dependency Descriptor use unique ids for every frame, meaning spatial layer frames will all have unique ids.

Bug: webrtc:10342
Change-Id: I241a8b3959e27bd918ae7a907ab5158fe9dcd7a5
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/194327
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Commit-Queue: Philip Eliasson <philipel@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32655}
2020-11-20 17:59:26 +00:00
philipel
ba56ea0b5d Removed superfluous check in FrameBuffer2.
Since inter_layer_predicted information is not propagated by the Dependency Descriptor this block non-VP9 super frames.

Bug: webrtc:10342
Change-Id: I90fbd368e92d168560a21ff79693f07071ea6cfb
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/194140
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Commit-Queue: Philip Eliasson <philipel@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32643}
2020-11-19 17:06:14 +00:00
Johannes Kron
111e981466 Signaling for low-latency renderer algorithm
This feature is active if and only if the RTP header extension
playout-delay is used with min playout delay=0 and max playout delay>0.

In this case, a maximum composition delay will be calculated and attached
to the video frame as a signal to use the low-latency renderer algorithm,
which is landed in a separate CL in Chromium.

The maximum composition delay is specified in number of frames and is
calculated based on the max playout delay.

The feature can be completetly disabled by specifying the field trial
WebRTC-LowLatencyRenderer/enabled:false/

Bug: chromium:1138888
Change-Id: I05f461982d0632bd6e09e5d7ec1a8985dccdc61b
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/190141
Reviewed-by: Niels Moller <nisse@webrtc.org>
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Commit-Queue: Johannes Kron <kron@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32493}
2020-10-26 15:03:56 +00:00
philipel
6f148566dc Removed FrameBuffer::Start function.
Bug: webrtc:9106
Change-Id: I98cbc6d89b01e7c49b0595da5d5e446652418897
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/180581
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Commit-Queue: Philip Eliasson <philipel@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31809}
2020-07-30 11:15:56 +00:00
Markus Handell
6deec38ede Migrate modules/video_coding to webrtc::Mutex.
Bug: webrtc:11567
Change-Id: I8023fbe7595f7ba8ae7c7db3583fc2e560ec3df2
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/178803
Commit-Queue: Markus Handell <handellm@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31644}
2020-07-07 11:41:21 +00:00
Tommi
430951a0d4 Update call expectations in ReceiveStatisticsProxy, add thread checks
Bug: chromium:1084619
Change-Id: If9042d44ad99eacd431ee2a5e84486cfaf282d7e
Tbr: stefan@webrtc.org
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/175658
Reviewed-by: Tommi <tommi@webrtc.org>
Commit-Queue: Tommi <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31330}
2020-05-20 10:27:50 +00:00
philipel
cce86430d8 Removed spammy log message from the FrameBuffer.
Inserting old frames is not an error condition and should not print a warning, and given that it happens all the time it is also very spammy.

Bug: chromium:1066819
Change-Id: Iad2b5edc5e62822c02e2bb2a53d4318f957be3bd
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/173022
Commit-Queue: Philip Eliasson <philipel@webrtc.org>
Reviewed-by: Stefan Holmer <stefan@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31172}
2020-05-06 11:36:47 +00:00
Danil Chapovalov
5528402ef8 Use newer version of TimeDelta and TimeStamp factories in modules/
This change generated with following commands:
find modules -type f \( -name "*.h" -o -name "*.cc" \) | xargs sed -i -e "s/TimeDelta::Micros<\(.*\)>()/TimeDelta::Micros(\1)/g"
find modules -type f \( -name "*.h" -o -name "*.cc" \) | xargs sed -i -e "s/TimeDelta::Millis<\(.*\)>()/TimeDelta::Millis(\1)/g"
find modules -type f \( -name "*.h" -o -name "*.cc" \) | xargs sed -i -e "s/TimeDelta::Seconds<\(.*\)>()/TimeDelta::Seconds(\1)/g"
find modules -type f \( -name "*.h" -o -name "*.cc" \) | xargs sed -i -e "s/TimeDelta::us/TimeDelta::Micros/g"
find modules -type f \( -name "*.h" -o -name "*.cc" \) | xargs sed -i -e "s/TimeDelta::ms/TimeDelta::Millis/g"
find modules -type f \( -name "*.h" -o -name "*.cc" \) | xargs sed -i -e "s/TimeDelta::seconds/TimeDelta::Seconds/g"
find modules -type f \( -name "*.h" -o -name "*.cc" \) | xargs sed -i -e "s/Timestamp::Micros<\(.*\)>()/Timestamp::Micros(\1)/g"
find modules -type f \( -name "*.h" -o -name "*.cc" \) | xargs sed -i -e "s/Timestamp::Millis<\(.*\)>()/Timestamp::Millis(\1)/g"
find modules -type f \( -name "*.h" -o -name "*.cc" \) | xargs sed -i -e "s/Timestamp::Seconds<\(.*\)>()/Timestamp::Seconds(\1)/g"
find modules -type f \( -name "*.h" -o -name "*.cc" \) | xargs sed -i -e "s/Timestamp::us/Timestamp::Micros/g"
find modules -type f \( -name "*.h" -o -name "*.cc" \) | xargs sed -i -e "s/Timestamp::ms/Timestamp::Millis/g"
find modules -type f \( -name "*.h" -o -name "*.cc" \) | xargs sed -i -e "s/Timestamp::seconds/Timestamp::Seconds/g"
git cl format

Bug: None
Change-Id: I117d64a54950be040d996035c54bc0043310943a
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/168340
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30489}
2020-02-10 11:49:57 +00:00
philipel
190539717b Remove unused NextFrame function from FrameBuffer.
Also updated FrameBuffer unittests to use the GlobalSimulatedTimeController.

Bug: webrtc:7408, webrtc:9378
Change-Id: I8ade27492f66cdd8950b38f5f4a268714dbc35fc
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/164536
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
Commit-Queue: Philip Eliasson <philipel@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30422}
2020-01-30 12:54:08 +00:00
Jonas Olsson
b2b2031457 Concatenate string literals at compile time.
This CL was generated by running:
git ls-files | grep ".cc" | xargs perl -i -ne 'BEGIN {undef $/}; s/("[\s\n]*<<[\s\n]*")/" "/g; print;'; git cl format

After that I manually edited modules/audio_processing/gain_controller2.cc to preserve its original
formatting.

This primary benefit of this change is a small reduction in binary size.

Bug: None
Change-Id: I689fa7ba9c717c314bb167e5d592c3c4e0871e29
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/165961
Reviewed-by: Alessio Bazzica <alessiob@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Commit-Queue: Jonas Olsson <jonasolsson@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30251}
2020-01-14 14:47:48 +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
Johannes Kron
0c141c591a Fix frames dropped statistics
The |frames_dropped| statistics contain not only frames that are dropped
but also frames that are in internal queues. This CL changes that so
that |frames_dropped| only contains frames that are dropped.

Bug: chromium:990317
Change-Id: If222568501b277a75bc514661c4f8f861b56aaed
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/150111
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Reviewed-by: Niels Moller <nisse@webrtc.org>
Commit-Queue: Johannes Kron <kron@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28968}
2019-08-27 07:43:01 +00:00
Johannes Kron
b88b44e7a4 Don't include duplicated and incomplete frames in stats.
The received frames statistics currently include also frames
that are dropped because they are duplicated, incomplete, or
the buffer being full. After this CL only frames that are
added to the decode queue are counted.

This CL is part of fixing the dropped frames statistics that
are currently also counting frames that are in the decode
queue.

Bug: chromium:990317
Change-Id: I7df31939ecb7b9e222086e1141a15420fa2819dc
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/150108
Commit-Queue: Johannes Kron <kron@webrtc.org>
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28939}
2019-08-22 11:59:37 +00:00
Johannes Kron
bfd343b9be Add totalDecodeTime to RTCInboundRTPStreamStats
Pull request to WebRTC stats specification:
https://github.com/w3c/webrtc-stats/pull/450

Bug: webrtc:10775
Change-Id: Id032cb324724329fee284ebc84595b9c39208ab8
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/144035
Commit-Queue: Ilya Nikolaevskiy <ilnik@webrtc.org>
Reviewed-by: 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@{#28440}
2019-07-02 08:28:06 +00:00
“Michael
d3a4ebe332 Control rtt_mult addition cap via experiment.
Bug: webrtc:10717
Change-Id: I68f7d8216e1a1611e692dd82ba96890cad98c7de
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/140284
Commit-Queue: Michael Horowitz <mhoro@webrtc.org>
Reviewed-by: Stefan Holmer <stefan@webrtc.org>
Reviewed-by: Åsa Persson <asapersson@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28191}
2019-06-07 09:43:26 +00:00
“Michael
e0f370471a Add cap to video jitter buffer size/latency in experiment branches only.
Bug: webrtc:10664
Change-Id: I03762c8b318f26f2689e89545aa8cc8e5b4a4329
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/138081
Commit-Queue: Michael Horowitz <mhoro@webrtc.org>
Reviewed-by: Stefan Holmer <stefan@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28155}
2019-06-04 15:50:27 +00:00
Sergey Silkin
2799e63bfb Add sizes of spatial layer frames to EncodedImage
WebRTC combines VP9 SVC spatial layer frames into superframe and passes
it to a decoder. The chromium HW VP9 decoder (wrapper) needs to know
location of each spatial layer frame in the frame buffer. To provide
decoder with such information this CL:
- Adds Set/SpatialLayerFrameSize methods to EncodedImage.
- Sets size of each spatial layer frame on superframe at assembly stage.

Bug: webrtc:10495
Change-Id: I68c3c0d668c67dfa1740e004059d860dd98f67f9
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/136922
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Commit-Queue: Sergey Silkin <ssilkin@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28032}
2019-05-23 07:16:42 +00:00
Stefan Holmer
4ed7e511f6 Revert "Add ability to cap the video jitter estimate to a max value."
This reverts commit a8ae407a48.

Reason for revert: This CL incorrectly affects non-experiment branch.  A new CL affecting only the experiment will be uploaded.

Original change's description:
> Add ability to cap the video jitter estimate to a max value.
>
> Bug: webrtc:10572
> Change-Id: I21112824dc02afa71db61bb8c2f02723e8b325b6
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/133963
> Commit-Queue: Michael Horowitz <mhoro@webrtc.org>
> Reviewed-by: Stefan Holmer <stefan@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#27744}

TBR=stefan@webrtc.org,mhoro@webrtc.org

Bug: webrtc:10572
Change-Id: I4af334168ca70ecfae7fd18fc7c852819a98d866
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/138063
Reviewed-by: Stefan Holmer <stefan@webrtc.org>
Reviewed-by: Michael Horowitz <mhoro@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Reviewed-by: Björn Terelius <terelius@webrtc.org>
Commit-Queue: Stefan Holmer <stefan@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28025}
2019-05-22 15:07:33 +00:00
philipel
cd936fdba5 Wait for keyframe after decoding error.
Bug: chromium:936715
Change-Id: I0a51c8fa0025cb0f8e9afcbe8d8e4a84c2709ecf
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/134960
Commit-Queue: Philip Eliasson <philipel@webrtc.org>
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#27827}
2019-05-02 12:52:55 +00:00
Niels Möller
d9c2d94620 Move ownership of VCMJitterEstimator to FrameBuffer
Bug: webrtc:7408
Change-Id: I8b33ead80abff1e84ae0b223e108266f71f03e2f
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/134180
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Reviewed-by: Åsa Persson <asapersson@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#27823}
2019-05-02 10:57:04 +00:00
“Michael
a8ae407a48 Add ability to cap the video jitter estimate to a max value.
Bug: webrtc:10572
Change-Id: I21112824dc02afa71db61bb8c2f02723e8b325b6
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/133963
Commit-Queue: Michael Horowitz <mhoro@webrtc.org>
Reviewed-by: Stefan Holmer <stefan@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#27744}
2019-04-24 16:03:15 +00:00
Ilya Nikolaevskiy
b4a70ed643 Fix potential crash in FrameBuffer::IsCompleteSuperFrame
According to crash reports, crash happens at the line with nothing but
|next_frame->second.frame->is_last_spatial_layer|.

Probably, |frames_| contains entries with empty frame unique_ptr.
This CL adds checks to not dereference those empty pointers.

Bug: chromium:955040
Change-Id: I3060f9e1af8bfc3c8a079c14107b5b4a82f5d015
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/133626
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Commit-Queue: Ilya Nikolaevskiy <ilnik@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#27706}
2019-04-23 10:05:11 +00:00
Sebastian Jansson
11d0d7b945 Reland "Running FrameBuffer on task queue."
This is a reland of 13943b7b7f

Original change's description:
> Running FrameBuffer on task queue.
> 
> This prepares for running WebRTC in simulated time where event::Wait
> based timing doesn't work.
> 
> Bug: webrtc:10365
> Change-Id: Ia0f9b1cc8e3c8c27a38e45b40487050a4699d8cf
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/129962
> Reviewed-by: Philip Eliasson <philipel@webrtc.org>
> Reviewed-by: Erik Språng <sprang@webrtc.org>
> Commit-Queue: Sebastian Jansson <srte@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#27422}

Bug: webrtc:10365
Change-Id: I412d3e0fe06c6dd57cdb42974f09e03f3a6ad038
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/131124
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Sebastian Jansson <srte@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#27572}
2019-04-11 15:41:28 +00:00
Ilya Nikolaevskiy
f87a7dfb42 Fix undefined behavior in FrameBuffer
Bug: none
Change-Id: I7ce6298a27dc9e79e5f5a85103b3f1dd7b4be71e
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/131953
Commit-Queue: Ilya Nikolaevskiy <ilnik@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#27527}
2019-04-09 18:12:32 +00:00
Sebastian Jansson
1c747f5717 Preparing VideoReceiveStream for move to TaskQueue.
Extracting the work that's thread dependent from the work that will
also be done when using task queue.

Bug: webrtc:10365
Change-Id: I648796fe016c966c731c9b7f85d2a871c1f2a349
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/131241
Reviewed-by: Erik Språng <sprang@webrtc.org>
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Commit-Queue: Sebastian Jansson <srte@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#27454}
2019-04-04 17:01:42 +00:00
Henrik Boström
c680c4a807 Revert "Running FrameBuffer on task queue."
This reverts commit 13943b7b7f.

Reason for revert: Breaks chromium import bots:
https://ci.chromium.org/p/chromium/builders/webrtc.fyi/WebRTC%20Chromium%20FYI%20Android%20Tests%20%28dbg%29%20%28K%20Nexus5%29

First failure:
https://ci.chromium.org/p/chromium/builders/webrtc.fyi/WebRTC%20Chromium%20FYI%20Android%20Tests%20%28dbg%29%20%28K%20Nexus5%29/2794

Original change's description:
> Running FrameBuffer on task queue.
> 
> This prepares for running WebRTC in simulated time where event::Wait
> based timing doesn't work.
> 
> Bug: webrtc:10365
> Change-Id: Ia0f9b1cc8e3c8c27a38e45b40487050a4699d8cf
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/129962
> Reviewed-by: Philip Eliasson <philipel@webrtc.org>
> Reviewed-by: Erik Språng <sprang@webrtc.org>
> Commit-Queue: Sebastian Jansson <srte@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#27422}

TBR=sprang@webrtc.org,philipel@webrtc.org,srte@webrtc.org

Change-Id: I198a91ec1707cc8752a7fe55caf0f172e1b8e60a
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:10365
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/131120
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Commit-Queue: Henrik Boström <hbos@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#27436}
2019-04-03 10:27:51 +00:00
Sebastian Jansson
13943b7b7f Running FrameBuffer on task queue.
This prepares for running WebRTC in simulated time where event::Wait
based timing doesn't work.

Bug: webrtc:10365
Change-Id: Ia0f9b1cc8e3c8c27a38e45b40487050a4699d8cf
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/129962
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Sebastian Jansson <srte@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#27422}
2019-04-02 18:34:59 +00:00
Niels Möller
9d8eaac4ee Delete unneeded direct includes of common_types.h
And delete corresponding dependencies on :webrtc_common. After this
change, common_types.h is included directly only from code in the
following directories:

api/
api/video/
api/video_codecs/
common_video/libyuv/include/
media/base/
modules/remote_bitrate_estimator/
modules/rtp_rtcp/source/
modules/video_coding/codecs/vp9/

There remains plenty of indirect dependencies on the types declared in
common_types.h, but the fewer direct dependencies should make it
easier to find the proper place for each type.

Bug: webrtc:5876
Change-Id: I93e8f214025ecb613c19fdec2015bd3f96c59aae
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/130501
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#27376}
2019-04-01 07:18:13 +00:00
Ilya Nikolaevskiy
48193b065a In FrameBuffer call stats callback's OnCompleteFrame once per superframe
Bug: webrtc:10461
Change-Id: Ib3b6aeb38cd68e73281f526f8d1a7d8a0b5b1cc6
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/128866
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Commit-Queue: Ilya Nikolaevskiy <ilnik@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#27295}
2019-03-26 15:36:36 +00:00
Philip Eliasson
1f850a6dc7 Reland "SeqNumUnwrapper::Unwrap now returns int64_t instead of uint64_t."
This reverts commit b5207b488b.

Reason for revert: DecodedFramesHistory has now been updated.

Original change's description:
> Revert "SeqNumUnwrapper::Unwrap now returns int64_t instead of uint64_t."
> 
> This reverts commit b0f968a761.
> 
> Reason for revert: Need to update DecodedFramesHistory to manage negative picture IDs.
> 
> Original change's description:
> > SeqNumUnwrapper::Unwrap now returns int64_t instead of uint64_t.
> > 
> > Bug: webrtc:10263
> > Change-Id: Idaeae6be01bd4eba0691226c958d70e114161ffd
> > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/127295
> > Commit-Queue: Philip Eliasson <philipel@webrtc.org>
> > Reviewed-by: Johannes Kron <kron@webrtc.org>
> > Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
> > Cr-Commit-Position: refs/heads/master@{#27129}
> 
> TBR=kwiberg@webrtc.org,eladalon@webrtc.org,terelius@webrtc.org,philipel@webrtc.org,kron@webrtc.org
> 
> Change-Id: I529bb0475bd21a80fa244278aff1fd912a85c169
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: webrtc:10263
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/127885
> Reviewed-by: Philip Eliasson <philipel@webrtc.org>
> Commit-Queue: Philip Eliasson <philipel@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#27135}

TBR=kwiberg@webrtc.org,eladalon@webrtc.org,terelius@webrtc.org,philipel@webrtc.org,kron@webrtc.org

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

Bug: webrtc:10263
Change-Id: Id59e377010b5070dd37a7ece8df79b23af43835a
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/128568
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Commit-Queue: Philip Eliasson <philipel@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#27191}
2019-03-19 17:02:27 +00:00
Philip Eliasson
b5207b488b Revert "SeqNumUnwrapper::Unwrap now returns int64_t instead of uint64_t."
This reverts commit b0f968a761.

Reason for revert: Need to update DecodedFramesHistory to manage negative picture IDs.

Original change's description:
> SeqNumUnwrapper::Unwrap now returns int64_t instead of uint64_t.
> 
> Bug: webrtc:10263
> Change-Id: Idaeae6be01bd4eba0691226c958d70e114161ffd
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/127295
> Commit-Queue: Philip Eliasson <philipel@webrtc.org>
> Reviewed-by: Johannes Kron <kron@webrtc.org>
> Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#27129}

TBR=kwiberg@webrtc.org,eladalon@webrtc.org,terelius@webrtc.org,philipel@webrtc.org,kron@webrtc.org

Change-Id: I529bb0475bd21a80fa244278aff1fd912a85c169
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:10263
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/127885
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Commit-Queue: Philip Eliasson <philipel@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#27135}
2019-03-14 18:14:33 +00:00
philipel
b0f968a761 SeqNumUnwrapper::Unwrap now returns int64_t instead of uint64_t.
Bug: webrtc:10263
Change-Id: Idaeae6be01bd4eba0691226c958d70e114161ffd
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/127295
Commit-Queue: Philip Eliasson <philipel@webrtc.org>
Reviewed-by: Johannes Kron <kron@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#27129}
2019-03-14 13:01:20 +00:00
Ruslan Burakov
493a650b1e Propagate base minimum delay from video jitter buffer to webrtc/api.
On api level two methods were added to api/media_stream_interface.cc on VideoSourceInterface,
GetLatency and SetLatency. Latency is measured in seconds, delay in milliseconds but both describes
the same concept.


Bug: webrtc:10287
Change-Id: Ib8dc62a4d73f63fab7e10b82c716096ee6199957
Reviewed-on: https://webrtc-review.googlesource.com/c/123482
Commit-Queue: Ruslan Burakov <kuddai@google.com>
Reviewed-by: Stefan Holmer <stefan@webrtc.org>
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Reviewed-by: Steve Anton <steveanton@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#26877}
2019-02-27 15:08:34 +00:00
Ilya Nikolaevskiy
fdfe1c96a3 Update jitter delay on per-superframe level from FrameBuffer
Current way with updates on each frame caused a bogus jitter estimate
and lots of dropped frames in unfiltered KSVC stream.

Bug: chromium:912122
Change-Id: I4a1af71a242af3f9b5f5a411b194331b2df24f68
Reviewed-on: https://webrtc-review.googlesource.com/c/117566
Commit-Queue: Ilya Nikolaevskiy <ilnik@webrtc.org>
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#26322}
2019-01-18 13:36:07 +00:00
Ilya Nikolaevskiy
173d198020 Revert "Ensure correct decoding for unfiltered KSVC streams"
This reverts commit cd7c21bfad.

Reason for revert: Regression in VP9 tests on perf bots

Original change's description:
> Ensure correct decoding for unfiltered KSVC streams
> 
> Set render timestamp for all frames in the superframe.
> 
> Bug: chromium:912122
> Change-Id: Ic9604620da9fb4176ad5c21b95df47fca8ddea31
> Reviewed-on: https://webrtc-review.googlesource.com/c/116985
> Commit-Queue: Ilya Nikolaevskiy <ilnik@webrtc.org>
> Reviewed-by: Philip Eliasson <philipel@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#26247}

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

Change-Id: I2d137d36d343bc0204ab80edb3cd55a3f89bbc33
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: chromium:912122
Reviewed-on: https://webrtc-review.googlesource.com/c/117564
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Commit-Queue: Ilya Nikolaevskiy <ilnik@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#26262}
2019-01-15 12:19:30 +00:00
Elad Alon
e4b5023f65 Avoid repeated semi-expensive field_trials read in frame_buffer2.cc
Bug: webrtc:10202
Change-Id: Ib8bfe7c1d62bc5091a8bfb2ce137ba749f9042e6
Reviewed-on: https://webrtc-review.googlesource.com/c/117361
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Commit-Queue: Elad Alon <eladalon@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#26261}
2019-01-15 12:12:01 +00:00
Ilya Nikolaevskiy
cd7c21bfad Ensure correct decoding for unfiltered KSVC streams
Set render timestamp for all frames in the superframe.

Bug: chromium:912122
Change-Id: Ic9604620da9fb4176ad5c21b95df47fca8ddea31
Reviewed-on: https://webrtc-review.googlesource.com/c/116985
Commit-Queue: Ilya Nikolaevskiy <ilnik@webrtc.org>
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#26247}
2019-01-14 16:06:38 +00:00
Ilya Nikolaevskiy
13717842df Introduce DecodedFramesHistory class and use it in FrameBuffer
This is a space efficient way to store more records about decoded frames,
which is needed for long term references.

Bug: webrtc:9710
Change-Id: I051d59d34a966d48db011142466d9cd15304b7d9
Reviewed-on: https://webrtc-review.googlesource.com/c/116792
Commit-Queue: Ilya Nikolaevskiy <ilnik@webrtc.org>
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#26240}
2019-01-14 13:09:39 +00:00
Niels Möller
9c843906ca Delete VCMEncodedFrame methods Buffer and MutableBuffer
Replaced by inherited method EncodedImage::data().

Bug: webrtc:9378
Change-Id: I4ec75148f578c72ffb407f9cbf6b4232cc9cfcf6
Reviewed-on: https://webrtc-review.googlesource.com/c/116962
Reviewed-by: Erik Språng <sprang@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#26212}
2019-01-11 10:10:12 +00:00
Ilya Nikolaevskiy
6551faf089 Refactor FrameBuffer to store decoded frames history separately
This will allow to increase the stored decoded frames history size and
optimize it to reduce memory consumption.

Bug: webrtc:9710
Change-Id: I82be0eb376c5d0b61ad5d754e6a37d606b4df29d
Reviewed-on: https://webrtc-review.googlesource.com/c/116686
Commit-Queue: Ilya Nikolaevskiy <ilnik@webrtc.org>
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#26200}
2019-01-10 15:11:15 +00:00