Commit graph

22 commits

Author SHA1 Message Date
Mirko Bonadei
c84f661b10 Stop using Googletest legacy APIs.
Googletest recently started replacing the term Test Case by Test Suite.
From now on, the preferred API is TestSuite*; the older TestCase* API
will be slowly deprecated.

This CL moves WebRTC to the new set of APIs.

More info in [1].

This CL has been generated with this script:

declare -A items
items[TYPED_TEST_CASE]=TYPED_TEST_SUITE
items[TYPED_TEST_CASE_P]=TYPED_TEST_SUITE_P
items[REGISTER_TYPED_TEST_CASE_P]=REGISTER_TYPED_TEST_SUITE_P
items[INSTANTIATE_TYPED_TEST_CASE_P]=INSTANTIATE_TYPED_TEST_SUITE_P
items[INSTANTIATE_TEST_CASE_P]=INSTANTIATE_TEST_SUITE_P
for i in "${!items[@]}"
do
  git ls-files | xargs sed -i "s/\b$i\b/${items[$i]}/g"
done
git cl format

[1] - https://github.com/google/googletest/blob/master/googletest/docs/primer.md#beware-of-the-nomenclature

Bug: None
Change-Id: I5ae191e3046caf347aeee01554d5743548ab0e3f
Reviewed-on: https://webrtc-review.googlesource.com/c/118701
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#26494}
2019-01-31 13:23:33 +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
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
philipel
8b6995b3d4 Avoid creating frames with packets of different timestamps.
Bug: None
Change-Id: Ieca71f844d546c2e97b95131153913f138842acd
Reviewed-on: https://webrtc-review.googlesource.com/c/116680
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Commit-Queue: Philip Eliasson <philipel@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#26176}
2019-01-09 12:19:05 +00:00
Niels Möller
48a79465ec Convert all webrtc code to not access EncodedImage::_size directly.
Read using capacity() method, write using set_buffer() method. This is
a preparation for making the member private, and renaming it to
capacity_.

Bug: webrtc:9378
Change-Id: I2f96679d052a83fe81be40301bd9863c87074640
Reviewed-on: https://webrtc-review.googlesource.com/c/113520
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#25934}
2018-12-07 16:19:34 +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
Artem Titarenko
97e35ce05d Revert "Disabled TestPacketBuffer.SeqNumWrapOneFrame test due to clang update"
This reverts commit 03c592a1e9.

Reason for revert: Problem with clang should be solved now

Original change's description:
> Disabled TestPacketBuffer.SeqNumWrapOneFrame test due to clang update
> 
> Until further investigation.
> Clang update: chromium:880827
> 
> Bug: chromium:887464
> Change-Id: Id1fe85a013920e6ae8c6ac69efb0a0502b9dd6fe
> Reviewed-on: https://webrtc-review.googlesource.com/101561
> Commit-Queue: Artem Titarenko <artit@webrtc.org>
> Reviewed-by: Artem Titarenko <artit@webrtc.org>
> Reviewed-by: Patrik Höglund <phoglund@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#24795}

TBR=phoglund@webrtc.org,artit@webrtc.org

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

Bug: chromium:887464
Change-Id: Id4d1722b289d9f56ae2aebf576f28f3b02a4c942
Reviewed-on: https://webrtc-review.googlesource.com/c/108583
Reviewed-by: Artem Titarenko <artit@webrtc.org>
Reviewed-by: Patrik Höglund <phoglund@webrtc.org>
Commit-Queue: Artem Titarenko <artit@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#25428}
2018-10-30 12:26:48 +00:00
Johannes Kron
957c62e0d6 Use timestamp instead of seq_num to distinguish between packets.
In the case a frame_object is kept for some time before it is deleted,
it may happend that a new frame is received with overlapping sequence
numbers. If the old frame_object is removed while receiving the new
frame there used to be a crash.

Bug: webrtc:9629
Change-Id: I270a8caa2b58b73c000542aa504c0ebe277d49c4
Reviewed-on: https://webrtc-review.googlesource.com/102683
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Commit-Queue: Johannes Kron <kron@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#24914}
2018-10-01 19:56:16 +00:00
Artem Titarenko
03c592a1e9 Disabled TestPacketBuffer.SeqNumWrapOneFrame test due to clang update
Until further investigation.
Clang update: chromium:880827

Bug: chromium:887464
Change-Id: Id1fe85a013920e6ae8c6ac69efb0a0502b9dd6fe
Reviewed-on: https://webrtc-review.googlesource.com/101561
Commit-Queue: Artem Titarenko <artit@webrtc.org>
Reviewed-by: Artem Titarenko <artit@webrtc.org>
Reviewed-by: Patrik Höglund <phoglund@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#24795}
2018-09-24 11:12:37 +00:00
philipel
ef615ea7a3 Added is_last_packet_in_frame to match is_first_packet_in_frame.
Today we use |is_first_packet_in_frame| to know when a frame begins and the
|markerBit| to know when it ends, but the markerbit does not actually mark the
end of a frame, it marks the end of a picture.

Bug: webrtc:9361
Change-Id: Icc70e6075590cdc31e875a4eb9d489868adbb67c
Reviewed-on: https://webrtc-review.googlesource.com/100160
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Philip Eliasson <philipel@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#24722}
2018-09-13 11:07:10 +00:00
philipel
7d745e5a89 Reland "Remove RTPVideoHeader::h264() accessors."
Downstream projects have been updated, so this can now be relanded.
This is a revert (and rebase) of: https://webrtc-review.googlesource.com/c/src/+/88820

Bug: none
Change-Id: I424664ddef7aeebd3c6c94ae67c7f70a342dc9a4
Reviewed-on: https://webrtc-review.googlesource.com/92082
Reviewed-by: Niels Moller <nisse@webrtc.org>
Reviewed-by: Åsa Persson <asapersson@webrtc.org>
Commit-Queue: Philip Eliasson <philipel@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#24181}
2018-08-03 09:16:50 +00:00
JT Teh
5daeff9c1f Revert "Remove RTPVideoHeader::h264() accessors."
This reverts commit dfbced6504.

Reason for revert: Crashes when making a video call.

#9	0x00000001043dd8d8 in webrtc::RTPVideoHeaderH264& absl::variant_internal::TypedThrowBadVariantAccess<webrtc::RTPVideoHeaderH264&>() at /third_party/absl/types/internal/variant.h:315
#10	0x00000001043dd8ac in absl::variant_internal::VariantAccessResultImpl<2ul, absl::variant<webrtc::RTPVideoHeaderVP8, webrtc::RTPVideoHeaderVP9, webrtc::RTPVideoHeaderH264>&&&>::type absl::variant_internal::VariantCoreAccess::CheckedAccess<2ul, absl::variant<webrtc::RTPVideoHeaderVP8, webrtc::RTPVideoHeaderVP9, webrtc::RTPVideoHeaderH264>&>(absl::variant<webrtc::RTPVideoHeaderVP8, webrtc::RTPVideoHeaderVP9, webrtc::RTPVideoHeaderH264>&&&) at /third_party/absl/types/internal/variant.h:597
#11	0x00000001043db778 in webrtc::RTPVideoHeaderH264& absl::get<webrtc::RTPVideoHeaderH264, webrtc::RTPVideoHeaderVP8, webrtc::RTPVideoHeaderVP9, webrtc::RTPVideoHeaderH264>(absl::variant<webrtc::RTPVideoHeaderVP8, webrtc::RTPVideoHeaderVP9, webrtc::RTPVideoHeaderH264>&) at /third_party/absl/types/variant.h:299
#12	0x0000000104558bcc in webrtc::RtpPacketizer::Create(webrtc::VideoCodecType, unsigned long, unsigned long, webrtc::RTPVideoHeader const*, webrtc::FrameType) at webrtc/modules/rtp_rtcp/source/rtp_format.cc:30

Original change's description:
> Remove RTPVideoHeader::h264() accessors.
>
> Bug: none
> Change-Id: I043bcaf358575688b223bc3631506e148b47fd58
> Reviewed-on: https://webrtc-review.googlesource.com/88220
> Reviewed-by: Stefan Holmer <stefan@webrtc.org>
> Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
> Commit-Queue: Philip Eliasson <philipel@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#23971}

TBR=danilchap@webrtc.org,stefan@webrtc.org,philipel@webrtc.org

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

Bug: none
Change-Id: If99bcabdfe3cae7094f24e407bbe2f47233e46e3
Reviewed-on: https://webrtc-review.googlesource.com/88820
Commit-Queue: JT Teh <jtteh@webrtc.org>
Reviewed-by: Zeke Chin <tkchin@webrtc.org>
Reviewed-by: JT Teh <jtteh@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23993}
2018-07-16 21:36:12 +00:00
philipel
dfbced6504 Remove RTPVideoHeader::h264() accessors.
Bug: none
Change-Id: I043bcaf358575688b223bc3631506e148b47fd58
Reviewed-on: https://webrtc-review.googlesource.com/88220
Reviewed-by: Stefan Holmer <stefan@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Commit-Queue: Philip Eliasson <philipel@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23971}
2018-07-13 13:53:05 +00:00
philipel
5ab67a5d71 Add accessors to the types in the RTPVideoTypeHeader in RTPVideoHeader.
This CL is in preparation to change the RTPVideoTypeHeader into an absl::variant.

Bug: none
Change-Id: I1672d866df0395f3417d8e278cc67f017ab0ff98
Reviewed-on: https://webrtc-review.googlesource.com/87261
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Stefan Holmer <stefan@webrtc.org>
Commit-Queue: Philip Eliasson <philipel@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23856}
2018-07-05 14:29:07 +00:00
Danil Chapovalov
0040b66ad3 Replace rtc::Optional with absl::optional
This is a no-op change because rtc::Optional is an alias to absl::optional

This CL generated by running script from modules with parameters
'pacing video_coding congestion_controller remote_bitrate_estimator':

find $@ -type f \( -name \*.h -o -name \*.cc \) \
-exec sed -i 's|rtc::Optional|absl::optional|g' {} \+ \
-exec sed -i 's|rtc::nullopt|absl::nullopt|g' {} \+ \
-exec sed -i 's|#include "api/optional.h"|#include "absl/types/optional.h"|' {} \+

find $@ -type f -name BUILD.gn \
-exec sed -r -i 's|"(../)*api:optional"|"//third_party/abseil-cpp/absl/types:optional"|' {} \+;

git cl format

Bug: webrtc:9078
Change-Id: I8ea501d7f1ee36e8d8cd3ed37e6b763c7fe29118
Reviewed-on: https://webrtc-review.googlesource.com/83900
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23640}
2018-06-18 10:24:48 +00:00
philipel
09133af36f Check number of nalus in packet before checking nalu types.
Bug: chromium:840536
Change-Id: Ia4dcf322ad6290691fd01b58fb02cd868714c92e
Reviewed-on: https://webrtc-review.googlesource.com/77121
Commit-Queue: Philip Eliasson <philipel@webrtc.org>
Reviewed-by: Stefan Holmer <stefan@webrtc.org>
Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23283}
2018-05-17 12:52:11 +00:00
Ilya Nikolaevskiy
d397a0d46e Add dropped frames metric on the receive side
Reported to UMA and logged for at the end of the call.

Bug: webrtc:8355
Change-Id: I4ef31bf9e55feaba9cf28be5cb4fcfae929c7179
Reviewed-on: https://webrtc-review.googlesource.com/53760
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Ilya Nikolaevskiy <ilnik@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22132}
2018-02-21 15:34:25 +00:00
philipel
bc5a40870c Fix off-by-one error when removing information about missing packet in PacketBuffer.
In the ClearTo function we risked removing one packet too many from the set of
|missing_packets_|, and in the case of H264 this would cause us to create incomplete
delta frames. This is turn disrupt the stream and a keyframe request has to be made.

Bug: webrtc:8536
Change-Id: Ie7ccd5f1631a4cf3bd463878d5b0fe746744ec23
Reviewed-on: https://webrtc-review.googlesource.com/30141
Commit-Queue: Philip Eliasson <philipel@webrtc.org>
Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21119}
2017-12-06 12:15:42 +00:00
Rasmus Brandt
88f080ae9a Move SPS/PPS/IDR requirement from RtpFrameObject to PacketBuffer.
BUG=webrtc:8423

Change-Id: I0f0d59461afead700c20c9a2ed9b2bc991590b4a
Reviewed-on: https://webrtc-review.googlesource.com/15101
Reviewed-by: Stefan Holmer <stefan@webrtc.org>
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Commit-Queue: Rasmus Brandt <brandtr@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#20559}
2017-11-06 12:04:46 +00:00
Rasmus Brandt
edf4ff7e0f Only treat H.264 frames containing SPS, PPS, and IDR as key frames.
This is protected behind a field trial, for controlled rollout.

TESTED=MediaCodec (Qualcomm + Exynos) and VideoToolbox senders.
BUG=webrtc:8423

Change-Id: Ibccefb3d374e4a44461d33e77eff754d8d752666
Reviewed-on: https://webrtc-review.googlesource.com/13863
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Reviewed-by: Sergey Silkin <ssilkin@webrtc.org>
Reviewed-by: Stefan Holmer <stefan@webrtc.org>
Commit-Queue: Rasmus Brandt <brandtr@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#20408}
2017-10-24 11:51:18 +00:00
Mirko Bonadei
92ea95e34a Fixing WebRTC after moving from src/webrtc to src/
In https://webrtc-review.googlesource.com/c/src/+/1560 we moved WebRTC
from src/webrtc to src/ (in order to preserve an healthy git history).
This CL takes care of fixing header guards, #include paths, etc...

NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
TBR=tommi@webrtc.org


Bug: chromium:611808
Change-Id: Iea91618212bee0af16aa3f05071eab8f93706578
Reviewed-on: https://webrtc-review.googlesource.com/1561
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Henrik Kjellander <kjellander@webrtc.org>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#19846}
2017-09-15 05:02:56 +00:00
Mirko Bonadei
bb547203bf Moving src/webrtc into src/.
In order to eliminate the WebRTC Subtree mirror in Chromium, 
WebRTC is moving the content of the src/webrtc directory up
to the src/ directory.

NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
TBR=tommi@webrtc.org

Bug: chromium:611808
Change-Id: Iac59c5b51b950f174119565bac87955a7994bc38
Reviewed-on: https://webrtc-review.googlesource.com/1560
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Henrik Kjellander <kjellander@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#19845}
2017-09-15 04:25:06 +00:00
Renamed from webrtc/modules/video_coding/video_packet_buffer_unittest.cc (Browse further)