Commit graph

218 commits

Author SHA1 Message Date
Bjorn Terelius
733df738e3 Optimize execution time of RTPSender::UpdateDelayStatistics
Bug: webrtc:9439
Change-Id: I908e9ced10031c614678a89657d089cb9a66b9ce
Reviewed-on: https://webrtc-review.googlesource.com/92391
Commit-Queue: Björn Terelius <terelius@webrtc.org>
Reviewed-by: Åsa Persson <asapersson@webrtc.org>
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#24295}
2018-08-15 17:53:04 +00:00
Sebastian Jansson
9701e0ce2f Makes treatment of received reports of packets lost signed.
Bug: webrtc:9598
Change-Id: I0f6ffe348585b8ec69753089652812da516d33d8
Reviewed-on: https://webrtc-review.googlesource.com/93021
Reviewed-by: Björn Terelius <terelius@webrtc.org>
Reviewed-by: Magnus Flodman <mflodman@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#24291}
2018-08-15 14:27:23 +00:00
Danil Chapovalov
7d2df3f848 Inline one-line RtpPacket getters
inlining these accessors both reduce binary size and, likely, slightly improve performance.

Bug: None
Change-Id: I4d1f3285afb044946b9611ad36d5d093299c19a9
Reviewed-on: https://webrtc-review.googlesource.com/94146
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#24286}
2018-08-15 09:41:20 +00:00
Niels Möller
af17595879 Refactor RtpReceiverImpl, extracting CSRC book-keeping to its own class
Bug: webrtc:7135
Change-Id: I7ce9afe575241542e4e3f7e2e8459ee3257eec76
Reviewed-on: https://webrtc-review.googlesource.com/93466
Commit-Queue: Niels Moller <nisse@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#24271}
2018-08-13 11:59:08 +00:00
Niels Möller
d3b62cfb02 Delete unused method RtpReceiver::CSRCs.
This is a preparation for extracting CSRC book-keeping to its own
class.

Bug: webrtc:7135
Change-Id: Ic51ceb57ec53a43064a3d0392de8baa978a4e8cf
Reviewed-on: https://webrtc-review.googlesource.com/93463
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#24257}
2018-08-10 10:01:11 +00:00
Niels Möller
2ff1f2a342 Reland "Refactor RtpVideoStreamReceiver without RtpReceiver."
This is a reland of 0b9e01d605

Original change's description:
> Refactor RtpVideoStreamReceiver without RtpReceiver.
> 
> Bug: webrtc:7135
> Change-Id: Iabf3330e579b892efc160683f9f90efbf6ff9a40
> Reviewed-on: https://webrtc-review.googlesource.com/92398
> Commit-Queue: Niels Moller <nisse@webrtc.org>
> Reviewed-by: Erik Språng <sprang@webrtc.org>
> Reviewed-by: Magnus Jedvert <magjed@webrtc.org>
> Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#24232}

Bug: webrtc:7135
Change-Id: I707d4c5262e7b428bc7ceac2d886ff34c4a8d76a
Reviewed-on: https://webrtc-review.googlesource.com/93261
Reviewed-by: Erik Språng <sprang@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#24254}
2018-08-10 08:56:49 +00:00
Sami Kalliomäki
426a80ce08 Add extended header containing frame ID to the generic packetizer.
Also changes default value of frame ID in RTPVideoHeader to
kNoPictureId. Special care should be take so that picture ID will not
be set in RTPVideoHeader unless the client on the end supports
deserializing extended generic header.

Bug: webrtc:9582
Change-Id: Ib096373ed187f31e51d481193a2bda56de68f167
Reviewed-on: https://webrtc-review.googlesource.com/92084
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Commit-Queue: Sami Kalliomäki <sakal@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#24250}
2018-08-09 14:05:39 +00:00
philipel
29d8846df9 Remove RTPVideoHeader::vp9() accessors.
TBR=stefan@webrtc.org

Bug: none
Change-Id: Ia2f728ea3377754a16a0b081e25c4479fe211b3e
Reviewed-on: https://webrtc-review.googlesource.com/93024
Commit-Queue: Philip Eliasson <philipel@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#24243}
2018-08-09 10:53:28 +00:00
Danil Chapovalov
527ff1eec2 Remove raw extensions accessors from rtp packet
These accessors were introduced in https://codereview.webrtc.org/2789773004
for dynamic size extensions.
They are now implemented without need of these raw functions

Bug: None
Change-Id: Id43f0bcbf951d60ebeece49556b093956c5ad2bf
Reviewed-on: https://webrtc-review.googlesource.com/92626
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#24242}
2018-08-09 10:43:37 +00:00
Niels Möller
98d7c52a7c Delete unused constants from rtp_rtcp_config.h
Bug: None
Change-Id: Iced341f0574e26ac3be3292870fb7d7522b75ce1
Reviewed-on: https://webrtc-review.googlesource.com/93280
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#24238}
2018-08-09 08:38:51 +00:00
Niels Moller
1788dcb506 Revert "Refactor RtpVideoStreamReceiver without RtpReceiver."
This reverts commit 0b9e01d605.

Reason for revert: Appears to breaks AV sync, failing perftests: 
CallPerfTest.PlaysOutAudioAndVideoInSyncWithVideoNtpDrift
CallPerfTest.PlaysOutAudioAndVideoInSyncWithAudioFasterThanVideoDrift
CallPerfTest.PlaysOutAudioAndVideoInSyncWithVideoFasterThanAudioDrift



Original change's description:
> Refactor RtpVideoStreamReceiver without RtpReceiver.
> 
> Bug: webrtc:7135
> Change-Id: Iabf3330e579b892efc160683f9f90efbf6ff9a40
> Reviewed-on: https://webrtc-review.googlesource.com/92398
> Commit-Queue: Niels Moller <nisse@webrtc.org>
> Reviewed-by: Erik Språng <sprang@webrtc.org>
> Reviewed-by: Magnus Jedvert <magjed@webrtc.org>
> Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#24232}

TBR=danilchap@webrtc.org,magjed@webrtc.org,nisse@webrtc.org,sprang@webrtc.org

Change-Id: I70a1dcb519c51937e35e04ac82b2ab495bec0a3d
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:7135
Reviewed-on: https://webrtc-review.googlesource.com/93260
Reviewed-by: Niels Moller <nisse@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#24235}
2018-08-09 06:19:14 +00:00
Qingsi Wang
b2db53998d Parse the number of packets lost in RTCP SR as a signed integer.
The cumulative number of packets lost in a RTCP sender report can be
negative if there are duplicates. This CL fixes a bug that the parser of
RTCP reports treats the field as an unsigned integer, and incorrectly
reports large packet losses when a negative loss is reported.

Bug: webrtc:9601
Change-Id: I1109ac0741614d61bda743e13a390b7d3e147a9c
Reviewed-on: https://webrtc-review.googlesource.com/92942
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Sebastian Jansson <srte@webrtc.org>
Commit-Queue: Qingsi Wang <qingsi@google.com>
Cr-Commit-Position: refs/heads/master@{#24234}
2018-08-08 16:44:11 +00:00
Niels Möller
0b9e01d605 Refactor RtpVideoStreamReceiver without RtpReceiver.
Bug: webrtc:7135
Change-Id: Iabf3330e579b892efc160683f9f90efbf6ff9a40
Reviewed-on: https://webrtc-review.googlesource.com/92398
Commit-Queue: Niels Moller <nisse@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Reviewed-by: Magnus Jedvert <magjed@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#24232}
2018-08-08 15:21:55 +00:00
Sebastian Jansson
436d036b62 Limits reported cumulative packets lost to 0.
This ensures that we don't break clients that can't handle
negative values.

Bug: webrtc:9598
Change-Id: I33c3933982577752eceb738d7e0bd2a6825d2249
Reviewed-on: https://webrtc-review.googlesource.com/93020
Commit-Queue: Sebastian Jansson <srte@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Magnus Flodman <mflodman@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#24230}
2018-08-08 13:27:36 +00:00
Niels Möller
3ed46bd83b Delete RTPReceiverStrategy::OnNewPayloadTypeCreated and related code.
Bug: webrtc:7135
Change-Id: Ic20d98cbfb8154f5abbc2501cbcccb950148e732
Reviewed-on: https://webrtc-review.googlesource.com/92396
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Oskar Sundbom <ossu@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#24219}
2018-08-08 08:01:32 +00:00
Niels Möller
fd77b78821 Delete RtpReceiverImpl::CheckPayloadChanged.
Also delete related code in RtpReceiverAudio, RtpReceiverVideo and
RtpPayloadRegistry.

Only intended change in behavior is that packets with unknown payload
types are not discarded at this level of the stack. They are discarded
higher up, in Channel::ReceivePacket (audio) and
RtpVideoStreamReceiver::ReceivePacket (video).

Bug: webrtc:8995
Change-Id: I807997120bb40a95b0575c55db6e20a0cac651bf
Reviewed-on: https://webrtc-review.googlesource.com/92087
Commit-Queue: Niels Moller <nisse@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#24196}
2018-08-06 15:08:12 +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
Niels Möller
dc6e68b4a7 Delete class TelephoneEventHandler and related code.
Followup to https://webrtc-review.googlesource.com/91125.

Bug: webrtc:7135
Change-Id: I7011cc65ac756931d8134763da57ec1bc9c584d6
Reviewed-on: https://webrtc-review.googlesource.com/91163
Reviewed-by: Åsa Persson <asapersson@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#24174}
2018-08-02 15:02:23 +00:00
Niels Möller
ab4a530b87 Delete telephone-event handling from RTPReceiverAudio.
Bug: webrtc:7135
Change-Id: Ic8b96f44ba25ff9265570dd43d3c76ed0177abfb
Reviewed-on: https://webrtc-review.googlesource.com/91125
Reviewed-by: Oskar Sundbom <ossu@webrtc.org>
Reviewed-by: Åsa Persson <asapersson@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#24172}
2018-08-02 12:55:40 +00:00
philipel
f8d81d33ed Add members for the codec agnostic descriptor to RTPVideoHeader.
TBR=danilchap@webrtc.org

Bug: webrtc:9361, webrtc:9582
Change-Id: I0303fc89bafab59e68ec81979e0e4372e79a4f51
Reviewed-on: https://webrtc-review.googlesource.com/91866
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Commit-Queue: Philip Eliasson <philipel@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#24170}
2018-08-02 09:12:31 +00:00
Niels Möller
1bd66642c3 Set RtpReceiverAudio::telephone_event_forward_to_decoder_ true on construction.
All users call SetTelephoneEventForwardToDecoder(true). Setting the
flag to true on construction, enables deletion of those calls,
followed by deletion of the flag itself.

The unused getter method TelephoneEventForwardToDecoder() is deleted
right away.

Bug: webrtc:7135
Change-Id: I8c52c957b3f074be7ffc425b3588402d1e42b844
Reviewed-on: https://webrtc-review.googlesource.com/90402
Reviewed-by: Oskar Sundbom <ossu@webrtc.org>
Reviewed-by: Åsa Persson <asapersson@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#24141}
2018-07-30 12:24:49 +00:00
Niels Möller
a12c42a6b2 Delete root header file typedef.h.
Usage replaced with stdint.h, rtc_base/system/arch.h and
rtc_base/system/unused.h, as appropriate.

Bug: webrtc:6854
Change-Id: I97225465d14b969903d92979e2df3c3c05d35f18
Reviewed-on: https://webrtc-review.googlesource.com/90249
Reviewed-by: Niklas Enbom <niklas.enbom@webrtc.org>
Reviewed-by: Fredrik Solenberg <solenberg@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#24100}
2018-07-25 14:59:26 +00:00
Jiawei Ou
4206a0a849 Exposing video bitrate allocator into API
In order to have public video bitrate allocator factory, the video bitrate allocator has be part of
the api.

Bug: webrtc:9513
Change-Id: Ia2e5ab9eb988c710c1ac492afccc470a92544aa2
Reviewed-on: https://webrtc-review.googlesource.com/88083
Reviewed-by: Stefan Holmer <stefan@webrtc.org>
Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Jiawei Ou <ouj@fb.com>
Cr-Commit-Position: refs/heads/master@{#24073}
2018-07-23 21:23:21 +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
Danil Chapovalov
3643aef89c Revert "Fix buffer overflow in ulpfec recovery"
This reverts commit 865feabca9.

Reason for revert: didn't fix the overlow

Original change's description:
> Fix buffer overflow in ulpfec recovery
> 
> Bug: chromium:856823
> Change-Id: I21fe21789ed3efbf71b5d3e234740a50c7911f6c
> Reviewed-on: https://webrtc-review.googlesource.com/88228
> Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
> Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#23947}

TBR=danilchap@webrtc.org,brandtr@webrtc.org

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

Bug: chromium:856823
Change-Id: I095b93ffa1754e1923ab58a7fa61575b6e2fd83a
Reviewed-on: https://webrtc-review.googlesource.com/88720
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23982}
2018-07-16 12:31:57 +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
Kári Tristan Helgason
798ee75d23 Always disable RED when ULPFEC is disabled.
This prevents a lot of unnecessary processing taking place when we are
not using FEC.

This CL also removes the FieldTrial that was used to disable ulpfec, as it's no longer used.

Bug: webrtc:9514
Change-Id: I8285b933f71eea971f5932cd19833455a42c8639
Reviewed-on: https://webrtc-review.googlesource.com/87848
Reviewed-by: Stefan Holmer <stefan@webrtc.org>
Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
Commit-Queue: Kári Helgason <kthelgason@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23952}
2018-07-12 13:01:20 +00:00
Danil Chapovalov
865feabca9 Fix buffer overflow in ulpfec recovery
Bug: chromium:856823
Change-Id: I21fe21789ed3efbf71b5d3e234740a50c7911f6c
Reviewed-on: https://webrtc-review.googlesource.com/88228
Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23947}
2018-07-12 08:05:05 +00:00
philipel
1a4746a563 Change RTPVideoTypeHeader to absl::variant and move RTPVideoHeader into its own h/cc file.
Bug: none
Change-Id: If28f57c5ae250afbb47c5d20c9854e9a11182642
Reviewed-on: https://webrtc-review.googlesource.com/87561
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@{#23904}
2018-07-10 11:57:46 +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
philipel
011dc6427a Remove RTPTypeHeader union and use RTPVideoHeader directly.
Bug: none
Change-Id: I2abd7d1cfb423ca989158167eb0502b44bc3a04a
Reviewed-on: https://webrtc-review.googlesource.com/87103
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@{#23855}
2018-07-05 13:52:27 +00:00
Karl Wiberg
918f50c5d1 Use absl::make_unique and absl::WrapUnique directly
Instead of going through our wrappers in ptr_util.h.

This CL was generated by the following script:

  git grep -l ptr_util | xargs perl -pi -e 's,#include "rtc_base/ptr_util.h",#include "absl/memory/memory.h",'
  git grep -l MakeUnique | xargs perl -pi -e 's,\b(rtc::)?MakeUnique\b,absl::make_unique,g'
  git grep -l WrapUnique | xargs perl -pi -e 's,\b(rtc::)?WrapUnique\b,absl::WrapUnique,g'
  git checkout -- rtc_base/ptr_util{.h,_unittest.cc}
  git cl format

Followed by manually adding dependencies on
//third_party/abseil-cpp/absl/memory until `gn check` stopped
complaining.

Bug: webrtc:9473
Change-Id: I89ccd363f070479b8c431eb2c3d404a46eaacc1c
Reviewed-on: https://webrtc-review.googlesource.com/86600
Commit-Queue: Karl Wiberg <kwiberg@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23850}
2018-07-05 10:59:49 +00:00
philipel
cb96ad8f0e Add ParsedPayload::video_header() accessor.
Preparation CL to remove RTPTypeHeader.

Bug: none
Change-Id: I695acf20082b94744a2f6c7692f1b2128932cd79
Reviewed-on: https://webrtc-review.googlesource.com/86132
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@{#23835}
2018-07-04 09:31:21 +00:00
Danil Chapovalov
e40b437401 Discard frame self-dependency when parsing genric frame descriptor
Bug: chromium:859281
Change-Id: Ieb96f633a93f4f2e498bb1949339e239184bce9d
Reviewed-on: https://webrtc-review.googlesource.com/86545
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Reviewed-by: Alex Loiko <aleloi@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23817}
2018-07-03 10:28:05 +00:00
Danil Chapovalov
916ec7dadf Add Generic frame descritpor header extension
to list of extensions supported by RtpPacket.

Bug: webrtc:9361
Change-Id: Iabee824381be3776e17e95f32507058607fc0bc8
Reviewed-on: https://webrtc-review.googlesource.com/85346
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Reviewed-by: Alex Loiko <aleloi@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23788}
2018-06-29 15:02:44 +00:00
Danil Chapovalov
64b17c2aca Remove StreamStatistician::IsPacketInOrder
this function is now only used in combination with StreamStatistician::IsRetransmitOfOldPacket
but IsRetransmitOfOldPacket internally checks if packet is in_order, thus making extra check unnecessary

In addition to making code simpler, removing this checks avoids
taking two extra CritSection on common code path of incoming rtp packet.

Bug: webrtc:8016
Change-Id: I050004e256b5698ce700e3416aa86b55f446a270
Reviewed-on: https://webrtc-review.googlesource.com/85361
Reviewed-by: Niels Moller <nisse@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Reviewed-by: Fredrik Solenberg <solenberg@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23762}
2018-06-28 08:44:40 +00:00
Taylor Brandstetter
84916937b7 Update packetsLost and jitter stats any time a packet is received.
Before this CL, the packetsLost and jitter stats (as returned by
GetStats, at the API level) were only being updated when an RTCP SR or
RR is generated. According to the stats spec, "local" stats like this
should be updated any time a packet is received.

This CL also fixes some minor issues with the calculation of packetsLost
(and fractionLost):
* Packets weren't being count as lost if lost over a sequence number
  rollover.
* Temporary periods of "negative" loss (caused by duplicate or out of
  order packets) weren't being accumulated into the cumulative loss
  counter. Example:
  Period 1: Received packets 1, 2, 4
    Loss over that period: 1 (expected 4 packets, got 3)
    Reported cumulative loss: 1
  Period 2: Received packets 3, 5
    Loss over that period: -1 (expected 1 packet, got 2)
    Reported cumulative loss: 1 (should be 0!)

Landing with NOTRY because Android compile bots are broken for an
unrelated reason.
NOTRY=True

Bug: webrtc:8804
Change-Id: I840ba34de8957b1276f6bdaf93718f805629f5c8
Reviewed-on: https://webrtc-review.googlesource.com/50020
Commit-Queue: Taylor Brandstetter <deadbeef@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Oskar Sundbom <ossu@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23731}
2018-06-25 23:56:39 +00:00
Sergio Garcia Murillo
43800f95bf Generalize SimulcastEncoderAdapter, use for H264 & VP8.
* Move SimulcastEncoderAdapter out under modules/video_coding
* Move SimulcastRateAllocator back out to modules/video_coding/utility
* Move TemporalLayers and ScreenshareLayers to modules/video_coding/utility
* Move any VP8 specific code - such as temporal layer bitrate budgeting -
  under codec type dependent conditionals.
* Plumb the simulcast index for H264 in the codec specific and RTP format data structures.

TBR=sprang@webrtc.org,stefan@webrtc.org,titovartem@webrtc.org

Bug: webrtc:5840
Change-Id: I2d3b130622dd7ceec5528f3ab6c46f109e6bafb8
Reviewed-on: https://webrtc-review.googlesource.com/84743
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23715}
2018-06-21 15:57:43 +00:00
Mirko Bonadei
6f440ed5b5 Revert "Implement H264 simulcast support and generalize SimulcastEncoderAdapter use for H264 & VP8."
This reverts commit 07efe436c9.

Reason for revert: Breaks downstream project.

cricket::GetSimulcastConfig method signature has been updated.
I think you can get away with a default value for temporal_layers_supported (and then you can remove it after a few days when projects will be updated).


Original change's description:
> Implement H264 simulcast support and generalize SimulcastEncoderAdapter use for H264 & VP8.
> 
> * Move SimulcastEncoderAdapter out under modules/video_coding
> * Move SimulcastRateAllocator back out to modules/video_coding/utility
> * Move TemporalLayers and ScreenshareLayers to modules/video_coding/utility
> * Move any VP8 specific code - such as temporal layer bitrate budgeting -
>   under codec type dependent conditionals.
> * Plumb the simulcast index for H264 in the codec specific and RTP format data structures.
> 
> Bug: webrtc:5840
> Change-Id: Ieced8a00e38f273c1a6cfd0f5431a87d07b8f44e
> Reviewed-on: https://webrtc-review.googlesource.com/64100
> Commit-Queue: Harald Alvestrand <hta@webrtc.org>
> Reviewed-by: Stefan Holmer <stefan@webrtc.org>
> Reviewed-by: Erik Språng <sprang@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#23705}

TBR=sprang@webrtc.org,stefan@webrtc.org,mflodman@webrtc.org,hta@webrtc.org,sergio.garcia.murillo@gmail.com,titovartem@webrtc.org,agouaillard@gmail.com

Change-Id: Ic9d3b1eeaf195bb5ec2063954421f5e77866d663
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:5840
Reviewed-on: https://webrtc-review.googlesource.com/84760
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23710}
2018-06-21 13:41:14 +00:00
Sergio Garcia Murillo
07efe436c9 Implement H264 simulcast support and generalize SimulcastEncoderAdapter use for H264 & VP8.
* Move SimulcastEncoderAdapter out under modules/video_coding
* Move SimulcastRateAllocator back out to modules/video_coding/utility
* Move TemporalLayers and ScreenshareLayers to modules/video_coding/utility
* Move any VP8 specific code - such as temporal layer bitrate budgeting -
  under codec type dependent conditionals.
* Plumb the simulcast index for H264 in the codec specific and RTP format data structures.

Bug: webrtc:5840
Change-Id: Ieced8a00e38f273c1a6cfd0f5431a87d07b8f44e
Reviewed-on: https://webrtc-review.googlesource.com/64100
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Stefan Holmer <stefan@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23705}
2018-06-21 12:23:03 +00:00
philipel
0a5fe77d23 Clean up in module_common_types.h by removing the unused struct RTPAudioHeader.
By removing it we can in turn (next CL) get rid of RTPTypeHeader, which is a
union that cause some problems.

Bug: none
Change-Id: I9246ecbfe2c8b7eda27497cccbc5f438958b64bf
Reviewed-on: https://webrtc-review.googlesource.com/83985
Reviewed-by: Stefan Holmer <stefan@webrtc.org>
Reviewed-by: Henrik Lundin <henrik.lundin@webrtc.org>
Commit-Queue: Philip Eliasson <philipel@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23666}
2018-06-19 16:44:19 +00:00
Danil Chapovalov
faf282700c Add Parsing/Building generic frame descriptor extension
Bug: webrtc:9361
Change-Id: I7e85826117348e2d4f4726e8d515bb1d4a289966
Reviewed-on: https://webrtc-review.googlesource.com/83622
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23662}
2018-06-19 14:51:27 +00:00
Yves Gerey
665174fdbb Reformat the WebRTC code base
Running clang-format with chromium's style guide.

The goal is n-fold:
 * providing consistency and readability (that's what code guidelines are for)
 * preventing noise with presubmit checks and git cl format
 * building on the previous point: making it easier to automatically fix format issues
 * you name it

Please consider using git-hyper-blame to ignore this commit.

Bug: webrtc:9340
Change-Id: I694567c4cdf8cee2860958cfe82bfaf25848bb87
Reviewed-on: https://webrtc-review.googlesource.com/81185
Reviewed-by: Patrik Höglund <phoglund@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23660}
2018-06-19 14:00:39 +00:00
Danil Chapovalov
9bf31584d1 Pass buffer with size when writing rtp header extension
Bug: chromium:826911
Change-Id: I617fecfee74745004067d892d6e31c94304f99ea
Reviewed-on: https://webrtc-review.googlesource.com/83945
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23641}
2018-06-18 13:04:33 +00:00
Ying Wang
6a9bd74481 Fix a downstream test failure.
In rare case the packets number may loop around and in the same FEC-protected group the packet sequence number became out of order.

Bug: chromium:850493
Change-Id: Ice82aafd537e0edc1dbdb8b934e11e7c42a4cf60
Reviewed-on: https://webrtc-review.googlesource.com/82802
Commit-Queue: Ying Wang <yinwa@webrtc.org>
Reviewed-by: Henrik Lundin <henrik.lundin@webrtc.org>
Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23633}
2018-06-15 13:30:26 +00:00
Danil Chapovalov
d264df587f Replace rtc::Optional with absl::optional in modules/rtp_rtcp
This is a no-op change because rtc::Optional is an alias to absl::optional

This CL generated using script:
#!/bin/bash
dir=modules/rtp_rtcp
find $dir -type f \( -name \*.h -o -name \*.cc \) \
-exec sed -i 's|rtc::Optional|absl::optional|' {} \+ \
-exec sed -i 's|rtc::nullopt|absl::nullopt|' {} \+ \
-exec sed -i 's|#include "api/optional.h"|#include "absl/types/optional.h"|' {} \+

find $dir -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: Ife720849709959046329c1c9faa3f31aa13274dc
Reviewed-on: https://webrtc-review.googlesource.com/83584
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23624}
2018-06-15 09:53:35 +00:00
Danil Chapovalov
fabb12e042 Introduce list of fields to put into codec agnostic descriptor
Bug: webrtc:9361
Change-Id: Iff44f289ffcecf7e4f997d5001958ab22124910f
Reviewed-on: https://webrtc-review.googlesource.com/81241
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23600}
2018-06-13 14:55:09 +00:00
Jonas Olsson
9633cff81a Remove "webrtc_rtp" traces.
They have been disabled by default for years, and should have been made redundant by the event logs.

Bug: webrtc:8982
Change-Id: I491923cbc93378d28f5166d24756b335619d9c12
Reviewed-on: https://webrtc-review.googlesource.com/82800
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Jonas Olsson <jonasolsson@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23598}
2018-06-13 14:46:24 +00:00
Niels Möller
a46bd4b9c7 Reland "Move class VideoCodec from common_types.h to its own api header file."
This is a reland of efc71e565e

Differs from the original cl by not widening the type of
VideoCodec::width and VideoCodec::height.

Original change's description:
> Move class VideoCodec from common_types.h to its own api header file.
>
> Bug: webrtc:7660
> Change-Id: I91f19bfc2565461328f30081f8383e136419aefb
> Reviewed-on: https://webrtc-review.googlesource.com/79881
> Commit-Queue: Niels Moller <nisse@webrtc.org>
> Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
> Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
> Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#23544}

Bug: webrtc:7660
Change-Id: I7cf74a85a61ea2b831e6f32b3b3e17514ebefec8
Reviewed-on: https://webrtc-review.googlesource.com/82140
Commit-Queue: Niels Moller <nisse@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23569}
2018-06-11 19:23:20 +00:00
Danil Chapovalov
350531e2a3 Revert "Move class VideoCodec from common_types.h to its own api header file."
This reverts commit efc71e565e.

Reason for revert: probably breaks downstream test

Original change's description:
> Move class VideoCodec from common_types.h to its own api header file.
> 
> Bug: webrtc:7660
> Change-Id: I91f19bfc2565461328f30081f8383e136419aefb
> Reviewed-on: https://webrtc-review.googlesource.com/79881
> Commit-Queue: Niels Moller <nisse@webrtc.org>
> Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
> Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
> Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#23544}

TBR=danilchap@webrtc.org,brandtr@webrtc.org,kwiberg@webrtc.org,nisse@webrtc.org

Change-Id: Id8bd37c79c2f8d09a4d88368765230103f1db2c8
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:7660
Reviewed-on: https://webrtc-review.googlesource.com/82101
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23547}
2018-06-08 11:04:23 +00:00