Commit graph

52 commits

Author SHA1 Message Date
Philipp Hancke
a204ad210d clean up misc TimeDelta use
follow-up from https://webrtc-review.googlesource.com/c/src/+/262810

* replace Time::Millis(0) and TimeDelta::Millis(0) with ::Zero()
* drop unnecessary webrtc namespace from some TimeDeltas
* make TimeDelta do the unit conversion for stats

BUG=webrtc:13756

Change-Id: Ic60625ae0fc7959a47a6be9f5051851feaf76373
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/265875
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37664}
2022-08-02 13:52:36 +00:00
Danil Chapovalov
03f8b8a241 In video replace non-owning pointer to rtc::TaskQueue with non-owning pointer to TaskQueueBase
rtc::TaskQueue is a simple wrapper over TaskQueueBase and adds no
extra features when task queue is used without passing ownership.

Reducing usage of the internal rtc::TaskQueue wrapper gives users more flexibility how TaskQueueBase* is stored.

Bug: webrtc:14169
Change-Id: If5c8827544c843502c7dfcef775ac558de79ec3a
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/268189
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37549}
2022-07-18 13:59:32 +00:00
Rasmus Brandt
c4d253c1ed Move VCMTiming into timing sub-folder
Bug: webrtc:14111
Change-Id: I9785b00012ea84f55789845a7e71fe26006d5067
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/263581
Reviewed-by: Artem Titov <titovartem@webrtc.org>
Commit-Queue: Rasmus Brandt <brandtr@webrtc.org>
Reviewed-by: Åsa Persson <asapersson@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37061}
2022-05-31 13:01:24 +00:00
Rasmus Brandt
10944e61ac Move JitterEstimator into timing sub-folder
Bug: webrtc:14111
Change-Id: Ic5c66f35e3cedac7a328fbb6613e5cdf13a8005e
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/263582
Commit-Queue: Rasmus Brandt <brandtr@webrtc.org>
Reviewed-by: Åsa Persson <asapersson@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37000}
2022-05-25 09:15:29 +00:00
Jonas Oreland
e62c2f2c77 WebRTC-DeprecateGlobalFieldTrialString/Enabled/ - part 12/inf
rename WebRtcKeyValueConfig to FieldTrialsView

Bug: webrtc:10335
Change-Id: If725bd498c4c3daf144bee638230fa089fdde833
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/256965
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Jonas Oreland <jonaso@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36365}
2022-03-29 10:14:00 +00:00
Jonas Oreland
e02f9eedb3 WebRTC-DeprecateGlobalFieldTrialString/Enabled/ - part 10/inf
This patch takes a stab at modules/video_coding,
but reaches only about half.

Bug: webrtc:10335
Change-Id: I0d47d0468b818145470c51ae4e8e75ff58d499ae
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/256112
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Jonas Oreland <jonaso@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36335}
2022-03-25 12:35:36 +00:00
Evan Shrubsole
92e89d7f77 [cleanup] Return struct from VCMTiming::GetTimings
Cleans callers having to initialize TimeDeltas.

Change-Id: Ib00a59bedf05fb82c9fde1d9fdd1e341e2132cb8
Bug: None
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/256360
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Commit-Queue: Evan Shrubsole <eshr@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36292}
2022-03-22 15:15:13 +00:00
Evan Shrubsole
d6cdf80072 Use Timestamp and TimeDelta in VCMTiming
* Switches TimestampExtrapolator to use Timestamp as well.

Bug: webrtc:13589
Change-Id: I042be5d693068553d2e8eb92fa532092d77bd7ef
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/249993
Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org>
Commit-Queue: Evan Shrubsole <eshr@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36112}
2022-03-02 15:07:25 +00:00
Evan Shrubsole
3d29efd279 Remove FrameBuffer::ReturnReason
This was a remenant leftover from a previous design, which was no longer
valid after the switch to TaskQueues. ReturnReason::kStopped was not
used at all, and so Timeout or FrameFound can be inferred from whether
the frame is null or not.

Bug: webrtc:13343, webrtc:13346
Change-Id: Ib0f847b1e1192e32ea11208e48f5a3892703521e
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/239651
Commit-Queue: Evan Shrubsole <eshr@webrtc.org>
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35490}
2021-12-07 14:16:17 +00:00
Evan Shrubsole
0b5656312b Test FrameBuffer::Clear and FrameBuffer::Stop
* Clearing while waiting for a frame should return a new frame
entering the buffer.
* Stopping while waiting for a frame should cancel the wait.

Bug: webrtc:13343
Change-Id: Ife9abfa8b6ea56141c9f32ff37d3b2a2e62a44f0
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/236849
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Commit-Queue: Evan Shrubsole <eshr@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35314}
2021-11-05 09:53:14 +00:00
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
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
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
Johannes Kron
985905d42d Add fieldtrial to enable minimum pacing of video frames
If the RTP header extension playout-delay is used and set
to min=0, max>=0, frames are scheduled to be decoded as
soon as possible. There's a risk that too many frames are
sent to the decoder at once, which may cause problems
further down in the video pipeline.

This CL adds the fieldtrial WebRTC-ZeroPlayoutDelay with
the parameter min_pacing that determines the minimum
pacing interval between two frames scheduled for
decoding.

Bug: None
Change-Id: I471f7718761cfce9789b3aa8adea3e8a16ecb2fd
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/223742
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Commit-Queue: Johannes Kron <kron@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34387}
2021-06-29 19:37:42 +00:00
philipel
ca18809ee5 Move RtpFrameObject and EncodedFrame out of video_coding namespace.
Bug: webrtc:12579
Change-Id: Ib7ecd624eb5c54abb77fe08440a014aa1e963865
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/212860
Reviewed-by: Erik Språng <sprang@webrtc.org>
Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Commit-Queue: Philip Eliasson <philipel@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33542}
2021-03-23 14:22:47 +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
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
Niels Möller
d381eede92 Rename PlayoutDelay --> VideoPlayoutDelay, move to api/video/video_timing.h
We can then finally delete the top-level common_types.h, and the
corresponding build target webrtc_common.

Bug: webrtc:7660
Change-Id: I1c1096541477586d90774c7a3405b9d36edec14a
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/182800
Commit-Queue: Niels Moller <nisse@webrtc.org>
Reviewed-by: Sebastian Jansson <srte@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32044}
2020-09-07 08:37:14 +00:00
Danil Chapovalov
f2c0f15282 In media/ and modules/video_coding replace mock macros with unified MOCK_METHOD macro
Bug: webrtc:11564
Change-Id: I5c7f5dc99e62619403ed726c23201ab4fbd37cbe
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/175647
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31340}
2020-05-25 08:46:30 +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
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
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
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
Jonas Olsson
a4d873786f Format almost everything.
This CL was generated by running

git ls-files | grep -P "(\.h|\.cc)$" | grep -v 'sdk/' | grep -v 'rtc_base/ssl_' | \
grep -v 'fake_rtc_certificate_generator.h' | grep -v 'modules/audio_device/win/' | \
grep -v 'system_wrappers/source/clock.cc' | grep -v 'rtc_base/trace_event.h' | \
grep -v 'modules/audio_coding/codecs/ilbc/' | grep -v 'screen_capturer_mac.h' | \
grep -v 'spl_inl_mips.h' | grep -v 'data_size_unittest.cc' | grep -v 'timestamp_unittest.cc' \
| xargs clang-format -i ; git cl format

Most of these changes are clang-format grouping and reordering includes
differently.

Bug: webrtc:9340
Change-Id: Ic83ddbc169bfacd21883e381b5181c3dd4fe8a63
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/144051
Commit-Queue: Jonas Olsson <jonasolsson@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28505}
2019-07-08 13:45:15 +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
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
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
Niels Möller
7cca042dd4 Refactor FrameBuffer2 tests, without mocking the jitter estimator
Bug: webrtc:7408
Change-Id: Ibded415aefebb9b922ec88c8f5f7fb7ff23cf28d
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/134467
Commit-Queue: Niels Moller <nisse@webrtc.org>
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#27805}
2019-04-29 14:41:45 +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
Mirko Bonadei
6a489f22c7 Fully qualify googletest symbols.
Semi-automatically created with:

git grep -l " testing::" | xargs sed -i "s/ testing::/ ::testing::/g"
git grep -l "(testing::" | xargs sed -i "s/(testing::/(::testing::/g"
git cl format

After this, two .cc files failed to compile and I have fixed them
manually.

Bug: webrtc:10523
Change-Id: I4741d3bcedc831b6c5fdc04485678617eb4ce031
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/132018
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#27526}
2019-04-09 17:18:20 +00:00
Niels Möller
9b0b1e0063 Delete unused method VCMReceiveStatisticsCallback::OnReceiveRatesUpdated
Only interesting call deleted in cl
https://codereview.webrtc.org/2704183002.

Move call to QualitySample (used for bad call detection) to
OnRenderedFrame

Bug: webrtc:7408
Change-Id: I0e9ae2ed62fe19a282377cb840e38bd2aae8f3e6
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/128768
Reviewed-by: Erik Språng <sprang@webrtc.org>
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#27243}
2019-03-22 14:56:18 +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
Niels Möller
77536a2b81 Rename EncodedImage::_length --> size_, and make private.
Use size() accessor function. Also replace most nearby uses of _buffer
with data().

Bug: webrtc:9378
Change-Id: I1ac3459612f7c6151bd057d05448da1c4e1c6e3d
Reviewed-on: https://webrtc-review.googlesource.com/c/116783
Commit-Queue: Niels Moller <nisse@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#26273}
2019-01-16 07:40:47 +00:00
Sergey Silkin
61832dd018 Propagate spatial index to EncodedImage.
Set spatial index of assembled VP9 picture equal to spatial index of
its top spatial layer frame.

Bug: webrtc:10151
Change-Id: Iae40505864b14b01cc6787f8da99a9e3fe283956
Reviewed-on: https://webrtc-review.googlesource.com/c/115280
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Commit-Queue: Sergey Silkin <ssilkin@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#26075}
2018-12-20 15:21:22 +00:00
Ilya Nikolaevskiy
5546aef682 Vp9 flexible mode fixes
- Enable vp9 flexible mode in VideoEngine if 3 spatial layers are set.
- Enable flexible mode in loopback tools and quality tests.
- Reset first active spatial layer on keyframe in encoder.
- Ensure duplicate references are not set by the sender in video header.
- Set references manually for flexible mode in vp9 encoder.
- Delay new activated layers until next base layer frame.
- On receive side put each spatial layer as a separate frame to FrameBuffer
  and return several frames combined from FrameBuffer.

Bug: webrtc:10049,webrtc:9794,webrtc:9784
Change-Id: I01e69f134cc145deba666ccc92deb1d37a324ede
Reviewed-on: https://webrtc-review.googlesource.com/c/112289
Commit-Queue: Ilya Nikolaevskiy <ilnik@webrtc.org>
Reviewed-by: Sergey Silkin <ssilkin@webrtc.org>
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Reviewed-by: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#25895}
2018-12-04 15:36:28 +00:00
Niels Möller
648a7cefe1 Delete method EncodedFrame::GetBitstream, part 1
Only caller was the RtpFrameObject constructor, so it's
not needed in the interface.

To be able to delete downstream overrides, add a temporary
default implementation. Method will be completely deleted in part 2.

Bug: webrtc:9378
Change-Id: I9083b6284313b6ebce854c6f2cec4617953331d9
Reviewed-on: https://webrtc-review.googlesource.com/c/112128
Reviewed-by: Sebastian Jansson <srte@webrtc.org>
Reviewed-by: Åsa Persson <asapersson@webrtc.org>
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#25822}
2018-11-28 14:52:32 +00:00
Niels Möller
c572ff3c71 Add default constructor for rtc::Event
Bug: webrtc:9962
Change-Id: Icaa91e657e6881fcb1553f354c07866109a0ea68
Reviewed-on: https://webrtc-review.googlesource.com/c/109500
Commit-Queue: Niels Moller <nisse@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#25535}
2018-11-07 08:57:50 +00:00
philipel
6d2165036c Don't decode frames with an older timestamp than the last decoded timestamp.
This change prevents decoding corruption by not allowing keyframes with a
newer frame id but an older timestamp to be decoded. This does not handle
reordering well.

Bug: none
Change-Id: I4a67ca84ee86a782da74a10530c531d893d3bd3c
Reviewed-on: https://webrtc-review.googlesource.com/c/107304
Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
Commit-Queue: Philip Eliasson <philipel@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#25292}
2018-10-22 13:11:46 +00:00
Niels Möller
2377588c82 Add accessor methods for RTP timestamp of EncodedImage.
Intention is to make the member private, but downstream callers
must be updated to use the accessor methods first.

Bug: webrtc:9378
Change-Id: I3495bd8d545b7234fbea10abfd14f082caa420b6
Reviewed-on: https://webrtc-review.googlesource.com/82160
Reviewed-by: Magnus Jedvert <magjed@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Reviewed-by: Sebastian Jansson <srte@webrtc.org>
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#24352}
2018-08-21 09:15:51 +00:00
Björn Terelius
52f53d5419 Revert "Add Timestamp accessor methods to the EncodedImage class."
This reverts commit f34d467b03.

Reason for revert: Seems to break downstream project.

Original change's description:
> Add Timestamp accessor methods to the EncodedImage class.
> 
> Bug: webrtc:9378
> Change-Id: I59bf14f631f92f0f4e05f60d4af25641a23a53f9
> Reviewed-on: https://webrtc-review.googlesource.com/82100
> Reviewed-by: Stefan Holmer <stefan@webrtc.org>
> Reviewed-by: Philip Eliasson <philipel@webrtc.org>
> Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
> Commit-Queue: Niels Moller <nisse@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#23734}

TBR=brandtr@webrtc.org,nisse@webrtc.org,stefan@webrtc.org,philipel@webrtc.org

Change-Id: I3aa0c0119426886bc583c918aae862eb7f4b6b63
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:9378
Reviewed-on: https://webrtc-review.googlesource.com/85600
Reviewed-by: Björn Terelius <terelius@webrtc.org>
Commit-Queue: Björn Terelius <terelius@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23739}
2018-06-26 11:52:45 +00:00
Niels Möller
f34d467b03 Add Timestamp accessor methods to the EncodedImage class.
Bug: webrtc:9378
Change-Id: I59bf14f631f92f0f4e05f60d4af25641a23a53f9
Reviewed-on: https://webrtc-review.googlesource.com/82100
Reviewed-by: Stefan Holmer <stefan@webrtc.org>
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23734}
2018-06-26 09:40:18 +00:00
philipel
798b28279e Don't update internal state of the FrameBuffer2 when an undecodable frame is inserted.
Bug: chromium:844313
Change-Id: I034bcb47092815695084e37c81150bafbfbc6b9c
Reviewed-on: https://webrtc-review.googlesource.com/79944
Commit-Queue: Philip Eliasson <philipel@webrtc.org>
Reviewed-by: Björn Terelius <terelius@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23577}
2018-06-12 09:26:09 +00:00
Stefan Holmer
812ceafb5a Ensure render time is zero when playout delay is zero so that minimal latency in the render pipeline is ensured.
Bug: webrtc:9135
Change-Id: Id9ae8ec59536808ba8923c73dd46abfe3fa6fe79
Reviewed-on: https://webrtc-review.googlesource.com/75600
Commit-Queue: Stefan Holmer <stefan@webrtc.org>
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23309}
2018-05-18 14:47:26 +00:00
philipel
0fa82a60e9 Moved FrameKey to api/video/encoded_frame.h and renamed it to VideoLayerFrameId.
Since we want the VideoStreamDecoder to callback with the last
continuous frame we need to move the FrameKey into the public API.

Bug: webrtc:8909
Change-Id: I39634145d848b8163778e31a1e0d04d91f9bbeb8
Reviewed-on: https://webrtc-review.googlesource.com/60864
Commit-Queue: Philip Eliasson <philipel@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Reviewed-by: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22495}
2018-03-19 15:13:11 +00:00
philipel
9771c5050d Clear the FrameBuffer if it's full and a keyframe is being inserted.
Bug: webrtc:7705, webrtc:8593, chromium:706599, chromium:807624
Change-Id: Ie4e3e217bc2930fe511f8b6ad3a36afed484ab5f
Reviewed-on: https://webrtc-review.googlesource.com/59321
Reviewed-by: Björn Terelius <terelius@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Philip Eliasson <philipel@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22304}
2018-03-06 09:11:11 +00:00
Ilya Nikolaevskiy
8c4fe16e4c Make Frame buffer not drop frames unnecessary
Now VCMTiming::MaxWaitingTime will not clip negative values. Thus frame
buffer will be able to distinguish between late frames and when waiting
cycle was simply interrupted by a new inserted frame right before the
waiting timer would expire.

Bug: webrtc:8917
Change-Id: I6b253f459fcb3a346064a103cc92ee332b074e1b
Reviewed-on: https://webrtc-review.googlesource.com/57741
Commit-Queue: Ilya Nikolaevskiy <ilnik@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22210}
2018-02-27 16:31:29 +00:00
philipel
e7c891f953 Renamed FrameObject to EncodedFrame.
The plan is to:
 1. Move FrameObject to api/video.
 2. Rename FrameObject to EncodedFrame.
 3. Move EncodedFrame out of the video_coding namespace.

This is the 2nd CL.

Bug: webrtc:8909
Change-Id: I5e76a0a3b306156b8bc1de67834b4adf14bebef9
Reviewed-on: https://webrtc-review.googlesource.com/56182
Commit-Queue: Philip Eliasson <philipel@webrtc.org>
Commit-Queue: Tommi <tommi@webrtc.org>
Reviewed-by: Niels Moller <nisse@webrtc.org>
Reviewed-by: Tommi <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22158}
2018-02-22 16:12:48 +00:00
Bjorn Terelius
a194e58e79 Move sequence_number_utils.h to rtc_base/
Bug: webrtc:8440
Change-Id: I36e70da6ce70b95db7d3fce8b0013bff5c795bfc
Reviewed-on: https://webrtc-review.googlesource.com/14860
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Reviewed-by: Åsa Persson <asapersson@webrtc.org>
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Commit-Queue: Björn Terelius <terelius@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#20429}
2017-10-25 12:33:57 +00:00