Commit graph

67 commits

Author SHA1 Message Date
Tommi
96c1a9b9e2 Clean up decoders when stopping video receive stream.
This updates VideoReceiveStream2::Stop() to symmetrically tear down
state that's built up in VideoReceiveStream2::Start().

Bug: webrtc:11993, webrtc:14486
Change-Id: I41f4feea5584e5baaeed2143432136f8b9761321
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/272537
Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38244}
2022-09-29 12:03:13 +00:00
Jared Siskin
3f659b1b3c Continue looking for frames after padding packets
In H264, reordered packets can cause a frame following padding to become stuck in the packet buffer.
A minimal example:
_, P, 1  - padding packet p and frame 1. Frame 1 has not been returned because of missing packet 0
0, P, 1  - when packet 0 arrives, FindFrames will stop incrementing i when it sees padding packet P, and frame 1 will never be returned

Bug: webrtc:14216
Change-Id: I78b76df9709fa8593c5025d647e2b868af3749f2
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/266465
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Commit-Queue: Philip Eliasson <philipel@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37357}
2022-06-28 13:03:03 +00:00
philipel
90623e1a91 Check if packet in PacketBuffer was cleared before the frame was fully received.
Bug: none
Change-Id: Iaa5702a8da93462ba80f72821f075a6673eeb0e1
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/260324
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Commit-Queue: Philip Eliasson <philipel@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36694}
2022-04-28 13:48:54 +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
philipel
9599b3c582 Don't store RtpPacketInfo in the PacketBuffer.
Historically the PacketBuffer used a callback for assembled frames, and because of that RtpPacketInfos were piped through it even though they didn't have anything to do with the PacketBuffer.

With this CL RtpPacketInfos are stored in the RtpVideoStreamReceiver(2) instead.

Bug: webrtc:12579
Change-Id: Ia6285b59e135910eee7234b89b23425bb0fc0d2b
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/215320
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Commit-Queue: Philip Eliasson <philipel@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33980}
2021-05-11 10:37:46 +00:00
Johannes Kron
f7de74c58c Use Timestamp to represent packet receive timestamps
Before this CL, timestamps of received packets were rounded
to the nearest millisecond and stored as int64_t. Due to the
rounding it sometimes happened that timestamps later in the
pipeline that are not rounded seem to occur even before the
video frame was received.

Change-Id: I92d8f3540b23baae2d4a1dc6a7cb3f58bcdaad18
Bug: webrtc:12722
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/216398
Reviewed-by: Chen Xing <chxg@google.com>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Johannes Kron <kron@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33916}
2021-05-04 13:16:54 +00:00
philipel
dad500a728 Remove PacketBuffers internal mutex.
In RtpVideoStreamReceiver2 it can be protected by the `worker_task_checker_` instead.

Bug: webrtc:12579
Change-Id: I4f7d64f16172139eddc7a3e07d1dbbf338beaf2e
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/215224
Commit-Queue: Philip Eliasson <philipel@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33734}
2021-04-14 16:05:51 +00:00
philipel
ce423ce12d Track last packet receive times in RtpVideoStreamReceiver instead of the PacketBuffer.
Bug: webrtc:12579
Change-Id: I4adb8c6ada913127b9e65d97ddce0dc71ec6ccee
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/214784
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Philip Eliasson <philipel@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33713}
2021-04-13 18:24:45 +00:00
philipel
7c7885c016 Remove NTP timestamp from PacketBuffer::Packet.
Bug: webrtc:12579
Change-Id: I64ca0ddb6f5c20bef5e9503955e0e4b4c484a1e7
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/211662
Commit-Queue: Philip Eliasson <philipel@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33448}
2021-03-12 15:19:35 +00:00
Eldar Rello
2127aaa64e Add new fmtp parameter for H.264
Bug: webrtc:11769, webrtc:8423, webrtc:11376
Change-Id: Ia8f22ff90f817ba46ca03de1e43d3088c05023cd
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/178904
Commit-Queue: Eldar Rello <elrello@microsoft.com>
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31878}
2020-08-07 10:32:41 +00:00
philipel
9465978a3b Remove framemarking RTP extension.
BUG=webrtc:11637

Change-Id: I47f8e22473429c9762956444e27cfbafb201b208
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/176442
Commit-Queue: Philip Eliasson <philipel@webrtc.org>
Reviewed-by: Tommi <tommi@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31522}
2020-06-15 11:18:00 +00:00
Markus Handell
f70fbc8411 Introduces rtc_base/synchronization/mutex.h.
This change introduces a new non-reentrant mutex to WebRTC. It
enables eventual migration to Abseil's mutex.

The mutex types supportable by webrtc::Mutex are

- absl::Mutex
- CriticalSection (Windows only)
- pthread_mutex (POSIX only)

In addition to introducing the mutexes, the CL also changes
PacketBuffer to use the new mutex instead of rtc::CriticalSection.

The method of yielding from critical_section.cc was given a
mini-cleanup and YieldCurrentThread() was added to
rtc_base/synchronization/yield.h/cc.

Additionally, google_benchmark benchmarks for the mutexes were added
(test courtesy of danilchap@), and some results from a pthread/Abseil
shootout were added showing Abseil has the advantage in higher
contention.

Bug: webrtc:11567, webrtc:11634
Change-Id: Iaec324ccb32ec3851bf6db3fd290f5ea5dee4c81
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/176230
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Reviewed-by: Tommi <tommi@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31443}
2020-06-04 09:55:12 +00:00
Markus Handell
3eac111115 PacketBuffer: remove lock recursions.
This change removes lock recursions and adds thread annotations.

Bug: webrtc:11567
Change-Id: Ibc429571926693f4b3de78f97a5dc5501d93a4a3
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/176240
Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
Commit-Queue: Markus Handell <handellm@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31369}
2020-05-27 15:45:16 +00:00
Danil Chapovalov
f4306ebfea In PacketBuffer simplify stored buffer.
Bug: None
Change-Id: Iddcde9d2ab25d2fb7091c9ed8104138293fd9dee
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/168044
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30844}
2020-03-20 13:32:32 +00:00
Danil Chapovalov
810b4ca386 Move AssembleFrame from PacketBuffer to RtpVideoStreamReceiver
this is a step towards resolving own todo: making AssembleFrame part of
the VideoRtpDepacketizer interface and replacing codec check with a
call to a virtual function.
RtpVideoStreamReceiver has access to the VideoRtpDepacketizers,
PacketBuffer - hasn't.

Bug: None
Change-Id: I83df09975c092bdb71bab270ced356d79a50683d
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/168056
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30833}
2020-03-19 16:35:14 +00:00
Danil Chapovalov
e209fe6c68 Do not propagate generic descriptor on receiving frame
It was used only for the frame decryptor.
Decryptor needs only raw representation that it can recreate
in a way compatible with the new version of the descriptor.

This relands commit abf73de8ea.
with adjustments.

Change-Id: I935977179bef31d8e1023964b967658e9a7db92d
Bug: webrtc:10342
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/168489
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30532}
2020-02-17 14:52:03 +00:00
Danil Chapovalov
bc1750d52b Revert "Do not propagate generic descriptor on receiving frame"
This reverts commit abf73de8ea.

Reason for revert: breaks downstream tests

Original change's description:
> Do not propagate generic descriptor on receiving frame
> 
> It was used only for the frame decryptor.
> Decryptor needs only raw representation that it can recreate
> in a way compatible with the new version of the descriptor.
> 
> Bug: webrtc:10342
> Change-Id: Ie098235ebb87c6f5e2af42d0022d2365cd6bfa29
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/166163
> Reviewed-by: Philip Eliasson <philipel@webrtc.org>
> Reviewed-by: Erik Språng <sprang@webrtc.org>
> Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#30501}

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

Change-Id: I6634df06ee75aa8cdfda614994ab11f7a5845c70
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:10342
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/168488
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30502}
2020-02-11 16:54:07 +00:00
Danil Chapovalov
abf73de8ea Do not propagate generic descriptor on receiving frame
It was used only for the frame decryptor.
Decryptor needs only raw representation that it can recreate
in a way compatible with the new version of the descriptor.

Bug: webrtc:10342
Change-Id: Ie098235ebb87c6f5e2af42d0022d2365cd6bfa29
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/166163
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30501}
2020-02-11 16:12:16 +00:00
Danil Chapovalov
97ffbefdab Pass and store PacketBuffer::Packet by unique_ptr
to avoid expensive move of the Packet and prepare PacketBuffer
to return list of packets as a frame.

Bug: None
Change-Id: I19f0452c52238228bbe28284ebb197491eb2bf4e
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/167063
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30404}
2020-01-29 11:48:55 +00:00
Danil Chapovalov
d06588a758 Change Av1 depacketizer to implement VideoRtpDepacketizer interface
Bug: webrtc:11152
Change-Id: I322115263f60439bee36277157a0acef9bd28e3e
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/165343
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30260}
2020-01-15 10:16:03 +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
Danil Chapovalov
c9e532a7eb Fix PacketBuffer::LastReceivedKeyframePacketMs
to return time of the last receieved packet of a key frame rather than
last received first packet of a key frame.

To match VideoReceiveStream expectation and prevent requesting
a new key frame if a large key frame is currently on the way.

Bug: None
Change-Id: I443a60872a3580d324f050080a9868f7b90d71a2
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/161730
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30084}
2019-12-13 11:36:24 +00:00
Danil Chapovalov
e3c4884b76 in PacketBuffer::Packet pass payload using smart buffer
Together with RtpDepacketizer refactoring that would reduce
number of memcpy while handling an rtp packet

Bug: webrtc:11152
Change-Id: I6f4e09c93af5e2a9314967a15eac8ced57ec712e
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/161087
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29985}
2019-12-03 14:55:54 +00:00
Danil Chapovalov
0682ca9a83 Use AV1 packetizer/depacketizer for AV1 bitstreams
Bug: webrtc:11042
Change-Id: Ibf45a99d8016dccbe109d946ac967efa927312e4
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/161011
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29953}
2019-11-28 18:01:10 +00:00
Danil Chapovalov
aa3f5da8dc Fork VCMPacket for PacketBuffer into own struct
it is easier to reduce and eliminate it when it is not bound to legacy video code

Bug: webrtc:10979
Change-Id: I517e298501b3358a914a23ddce40fcb3075d672d
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/159707
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29821}
2019-11-18 15:48:07 +00:00
Danil Chapovalov
3527a4fe55 In PacketBuffer split logic for detecting frame boundaries and assembling frame.
Bug: webrtc:11042
Change-Id: If1695067054b332569f4839aa6762af33173b769
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/159283
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29799}
2019-11-14 13:32:06 +00:00
Danil Chapovalov
09860e0bc3 Split out counting unique rtp timestamps from packet_buffer
Bug: None
Change-Id: Ia6fd05f284e8304cf56ab9ddf944fb222a4c9573
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/158676
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29656}
2019-10-30 15:27:48 +00:00
Danil Chapovalov
ce1ffcdc06 change PacketBuffer to return it's result rather that use callback
Bug: None
Change-Id: I8cc05dd46e811d6db37af520d2106af21c671def
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/157893
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29589}
2019-10-23 16:50:57 +00:00
Danil Chapovalov
4aae11dc46 Remove redundant fields in PacketBuffer
merge two vectors of the same size into single vector
Remove redundant size_ variable.
Remove redundant variables in the StoredPacket internal struct.
Remove frame_created flags since shortly after it is set, used flag is set to false

Bug: webrtc:10979
Change-Id: Ia37944362abda4e2a6c6741f436f95c45e0f7069
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/157174
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29535}
2019-10-18 10:05:10 +00:00
Shyam Sadhwani
5b2df17422 Width and Height was not associated and provided to decoder for H264 streams which have Nalus before SPS
Summary:
There is an issue with WebRTC for handling of certain H.264 bitstreams where the packets forming the H.264 stream has non-zero packets before the packet containing SPS.

Typically a IDR (key frame) will have SPS/PPS (if present) or the IDR slice in the first packet.
But this is not required in all cases, for example when packetization-mode = 0, you can have each NALU in separate packet. And certain NALUs can exist before SPS, for example SEI, AUD.

The way WebRTC associates width/height to encoded frames is by tracking the dependency of IDR slices to SPS/PPS.
RTP packets containing SPS/PPS have correct width/height stored in them during parsing of SPS in RtpDepacketizerH264::ProcessStapAOrSingleNalu
IDR packets refer to SPS using ppsid, spsid and the width/height fields get transferred from packet containing SPS to IDR packet in H264SpsPpsTracker::CopyAndFixBitstream.

When packets are assembled into a single encoded H264 frame in PacketBuffer::FindFrames, the loop goes through all the packets/nalus in backward scan from last RTP packet of IDR to first one.
Hence the order of NALUs during this scan is : Last parts of IDR Slice -> Mid parts of IDR Slice RTP packet -> first IDR slice Packet (this should have correct width / height) -> RTP packet containing SPS/PPS (this should have correct width/height)
start_index points to the first RTP packet of the frame and its passed into RtpFrameObject's constructor. RtpFrameObject will use the width/height stored in first RTP packet.

This works fine as long as the first RTP packet has width/height, which will be the case if first RTP packet is IDR or SPS.
In H.264 first RTP packet may be AUD, SEI in those cases, RtpFrameObject will create IDR with width/height = 0 and this causes problem for Android hardware decoders.
On Android hardware decoders rely on correct width/height to initialize the hardware decoder.

Verified on real scenario that we have.
Simulated on AppRTCMobile on IOS Simulator
Added unit tests : ninja -C out/Default && ./out/Default/modules_unittests --gtest_filter=*FrameResolution*

Bug: webrtc:11025
Change-Id: Ie2273aae5e81fd62497e1add084876a3aa05af4d
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/156260
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Reviewed-by: Sergey Silkin <ssilkin@webrtc.org>
Commit-Queue: Shyam Sadhwani <shyamsadhwani@fb.com>
Cr-Commit-Position: refs/heads/master@{#29515}
2019-10-17 13:51:16 +00:00
Shyam Sadhwani
2b84dad18c Fixed issue with H264 packet buffer where it was not detecting presence of sps/pps for idr frames
This issue happens for default case sps_pps_idr_is_h264_keyframe_ is false

The way PacketBuffer::FindFrames works for H264 is it keeps on skipping the packets till it finds a packet which has last=1
This is checked here : if (sequence_buffer_[index].frame_end)
Inside this block there is a loop, to go back and scan all the packets till start of the frame.
Since the scan is backwards, the sequence of nalus in this scan is IDR -> PPS -> SPS.
Once IDR is detected if (h264_header->nalus[j].type == H264::NaluType::kIdr) , the code will has_h264_idr = true.
When it scans the previous packets, it skips those as has_h264_idr is true. These packets have the SPS / PPS and hence has_h264_sps / pps flags were never set to true.
This resulted in warning as no SPS/PPS has been found for IDR.

Test plan : verified loopback call on IOS simulator using H264 codec and the warning log "Received H.264-IDR frame..." is not present anymore

Bug: webrtc:11006
Change-Id: Icbe8a393e3679a8d621af6c76e4999fd60db04a0
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/155420
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Commit-Queue: Shyam Sadhwani <shyamsadhwani@fb.com>
Cr-Commit-Position: refs/heads/master@{#29386}
2019-10-04 14:56:05 +00:00
philipel
85d5c197a8 Added RtpFrameObject ctor with no PacketBuffer pointer.
Bug: webrtc:10979
Change-Id: Ie6a2b56e7374d60d1f74d8c315216b27df22a19b
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/154426
Reviewed-by: Niels Moller <nisse@webrtc.org>
Commit-Queue: Philip Eliasson <philipel@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29314}
2019-09-26 08:55:00 +00:00
Danil Chapovalov
f7457e55fe Store PacketBuffer by value instead of as reference counted object
Bug: None
Change-Id: I5a594972e8a8dad731c927a1a374301e549f5d71
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/153887
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Reviewed-by: Åsa Persson <asapersson@webrtc.org>
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29267}
2019-09-23 13:28:09 +00:00
philipel
0cff4fce55 Removed unused frame_size param from RtpFrameObject ctor.
Bug: webrtc:10979
Change-Id: Idde493dc7f5165e3ca173d5a38861b444b5904a4
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/153668
Commit-Queue: Philip Eliasson <philipel@webrtc.org>
Reviewed-by: Niels Moller <nisse@webrtc.org>
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29253}
2019-09-20 10:56:01 +00:00
philipel
b5e4785464 RtpFrameObject now takes an EncodedImageBuffer in its ctor.
Bug: webrtc:10979
Change-Id: Ibc8b4a524ca95b5faa8850a41df8f2f0136a2969
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/153666
Commit-Queue: Philip Eliasson <philipel@webrtc.org>
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Reviewed-by: Niels Moller <nisse@webrtc.org>
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29251}
2019-09-20 10:15:01 +00:00
philipel
76161f7446 Move the call to GetBitstream out of the RtpFrameObject ctor.
Bug: webrtc:10979
Change-Id: I9159eb04d4a371e8ed8f932a989d6b884faa7be7
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/153661
Reviewed-by: Niels Moller <nisse@webrtc.org>
Commit-Queue: Philip Eliasson <philipel@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29237}
2019-09-19 12:08:04 +00:00
Johannes Kron
a370556270 Refactor to free up PacketBuffer as soon as possible
The packets belonging to a frame were kept in PacketBuffer
until the frame was decoded. This CL clears the dependencies
of an existing RtpFrameObject to PacketBuffer so that we can
free up PacketBuffer as soon as the RtpFrameObject is created.

Bug: none
Change-Id: Ic939be91815519ae1d1c67ada82006417b2d26a3
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/149818
Reviewed-by: Erik Språng <sprang@webrtc.org>
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Commit-Queue: Johannes Kron <kron@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28977}
2019-08-28 08:07:32 +00:00
Johannes Kron
bd3f30535c Request a new key frame if packet buffer is cleared
Bug: webrtc:10843
Change-Id: I1eab0891f3e68b7d504dc637790604a25c243856
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/147721
Commit-Queue: Johannes Kron <kron@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28735}
2019-08-01 14:35:54 +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
Chen Xing
f00bf42d1c Add plumbing of RtpPacketInfos to each VideoFrame as input for SourceTracker.
This change adds the plumbing of RtpPacketInfo from RtpVideoStreamReceiver::OnRtpPacket() to VideoReceiveStream::OnFrame() for video. It is a step towards replacing the non-spec compliant ContributingSources that updates itself at packet-receive time, with the spec-compliant SourceTracker that will update itself at frame-delivery-to-track time.

Bug: webrtc:10668
Change-Id: Ib97d430530c5a8487d3b129936c7c51e118889bd
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/139891
Reviewed-by: Stefan Holmer <stefan@webrtc.org>
Reviewed-by: Niels Moller <nisse@webrtc.org>
Commit-Queue: Chen Xing <chxg@google.com>
Cr-Commit-Position: refs/heads/master@{#28332}
2019-06-20 10:24:29 +00:00
Johnny Lee
bc7f41b231 ManageFrameH264 for temporal layers (PART 3/3)
Bug: webrtc:10579
Change-Id: Iec54f6b1231d34c2018f22841c3614ddd0b05612
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/86200
Commit-Queue: Sergey Silkin <ssilkin@webrtc.org>
Reviewed-by: Sergey Silkin <ssilkin@webrtc.org>
Reviewed-by: Stefan Holmer <stefan@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#27820}
2019-05-02 09:26:25 +00:00
Niels Möller
abbc50e9b2 Move frame_type member from RtpDepacketizer::ParsedPayload to RTPVideoHeader
The latter is also a member of the former. This cleanup is also
a preparation for dropping WebRtcRTPHeader::frameType (or deleting
WebRtcRTPHeader right away), now that it's a video-specific member.


Tbr: kwiberg@webrtc.org # Comment change in modules/include/
Bug: None
Change-Id: I5c1f3f981f0d750713fc9b9b145278150fe32b5d
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/133024
Commit-Queue: Niels Moller <nisse@webrtc.org>
Reviewed-by: Åsa Persson <asapersson@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#27740}
2019-04-24 13:13:04 +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
Niels Möller
8f7ce222e7 Make VideoFrameType an enum class, and move to separate file and target
Bug: webrtc:5876, webrtc:6883
Change-Id: I1435cfa9e8e54c4ba2978261048ff3fbb993ce0e
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/126225
Commit-Queue: Niels Moller <nisse@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#27239}
2019-03-22 12:44:51 +00:00
Elad Alon
b4643ad7ba Rename "OnReceivedFrame" to "OnAssembledFrame"
The new name fits better.

Bug: None
Change-Id: I1f201ff07915ed6c18efeefb7380e2b286742bb9
Reviewed-on: https://webrtc-review.googlesource.com/c/123800
Commit-Queue: Elad Alon <eladalon@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#26814}
2019-02-22 10:49:07 +00:00
Niels Möller
d5e02f0b92 Delete redundant members from VCMPacket.
The values are available as part of the RTPVideoHeader member.

Bug: None
Change-Id: I832fffc449929badec3796d7096c9cdc0d43d344
Reviewed-on: https://webrtc-review.googlesource.com/c/123234
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@{#26773}
2019-02-20 14:39:10 +00:00
Steve Anton
10542f21c8 (4) Rename files to snake_case: update BUILD.gn, include paths, header guards, and DEPS entries
Mechanically generated by running this command:

tools_webrtc/do-renames.sh update all-renames.txt && git cl format

Then manually updating:

tools_webrtc/sanitizers/tsan_suppressions_webrtc.cc

Bug: webrtc:10159
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Change-Id: I54824cd91dada8fc3ee3d098f971bc319d477833
Reviewed-on: https://webrtc-review.googlesource.com/c/115653
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#26226}
2019-01-11 17:11:39 +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
Ilya Nikolaevskiy
4348ce240a Calculate min and max receive timestamps for packets in a video frame
Bug: webrtc:10106
Change-Id: I1d3469abb1e7bb7c91a5912d7b781505526abaca
Reviewed-on: https://webrtc-review.googlesource.com/c/113507
Reviewed-by: Sebastian Jansson <srte@webrtc.org>
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Commit-Queue: Ilya Nikolaevskiy <ilnik@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#25935}
2018-12-07 16:22:34 +00:00
Yves Gerey
3e70781361 [Cleanup] Add missing #include. Remove useless ones. IWYU part 2.
This is a follow-up to
https://webrtc-review.googlesource.com/c/src/+/106280.
This time the whole code base is covered.
Some files may have not been fixed though, whenever the IWYU tool
was breaking the build.

Bug: webrtc:8311
Change-Id: I2c31f552a87e887d33931d46e87b6208b1e483ef
Reviewed-on: https://webrtc-review.googlesource.com/c/111965
Commit-Queue: Yves Gerey <yvesg@google.com>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#25830}
2018-11-28 18:25:07 +00:00