niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 1 | /* |
pwestin@webrtc.org | f6bb77a | 2012-01-24 17:16:59 +0000 | [diff] [blame] | 2 | * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 3 | * |
| 4 | * Use of this source code is governed by a BSD-style license |
| 5 | * that can be found in the LICENSE file in the root of the source |
| 6 | * tree. An additional intellectual property rights grant can be found |
| 7 | * in the file PATENTS. All contributing project authors may |
| 8 | * be found in the AUTHORS file in the root of the source tree. |
| 9 | */ |
| 10 | |
Mirko Bonadei | 92ea95e | 2017-09-15 06:47:31 +0200 | [diff] [blame] | 11 | #ifndef MODULES_RTP_RTCP_SOURCE_RTP_RECEIVER_AUDIO_H_ |
| 12 | #define MODULES_RTP_RTCP_SOURCE_RTP_RECEIVER_AUDIO_H_ |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 13 | |
pwestin@webrtc.org | af6f15c | 2012-01-19 15:53:59 +0000 | [diff] [blame] | 14 | #include <set> |
| 15 | |
Mirko Bonadei | 92ea95e | 2017-09-15 06:47:31 +0200 | [diff] [blame] | 16 | #include "modules/rtp_rtcp/include/rtp_receiver.h" |
| 17 | #include "modules/rtp_rtcp/include/rtp_rtcp_defines.h" |
| 18 | #include "modules/rtp_rtcp/source/rtp_receiver_strategy.h" |
| 19 | #include "modules/rtp_rtcp/source/rtp_utility.h" |
| 20 | #include "rtc_base/onetimeevent.h" |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 21 | |
| 22 | namespace webrtc { |
phoglund@webrtc.org | a7303bd | 2013-02-05 15:12:39 +0000 | [diff] [blame] | 23 | |
phoglund@webrtc.org | 92bb417 | 2012-12-13 10:48:24 +0000 | [diff] [blame] | 24 | // Handles audio RTP packets. This class is thread-safe. |
Niels Möller | dc6e68b | 2018-08-02 15:13:29 +0200 | [diff] [blame] | 25 | class RTPReceiverAudio : public RTPReceiverStrategy { |
phoglund@webrtc.org | a7303bd | 2013-02-05 15:12:39 +0000 | [diff] [blame] | 26 | public: |
solenberg | 1d03139 | 2016-03-30 02:42:32 -0700 | [diff] [blame] | 27 | explicit RTPReceiverAudio(RtpData* data_callback); |
Danil Chapovalov | 2a5ce2b | 2018-02-07 09:38:31 +0100 | [diff] [blame] | 28 | ~RTPReceiverAudio() override; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 29 | |
kjellander@webrtc.org | 14665ff | 2015-03-04 12:58:35 +0000 | [diff] [blame] | 30 | int32_t ParseRtpPacket(WebRtcRTPHeader* rtp_header, |
| 31 | const PayloadUnion& specific_payload, |
kjellander@webrtc.org | 14665ff | 2015-03-04 12:58:35 +0000 | [diff] [blame] | 32 | const uint8_t* packet, |
| 33 | size_t payload_length, |
Niels Möller | bbf389c | 2017-09-26 14:05:05 +0200 | [diff] [blame] | 34 | int64_t timestamp_ms) override; |
phoglund@webrtc.org | 07bf43c | 2012-12-18 15:40:53 +0000 | [diff] [blame] | 35 | |
phoglund@webrtc.org | a7303bd | 2013-02-05 15:12:39 +0000 | [diff] [blame] | 36 | private: |
danilchap | 162abd3 | 2015-12-10 02:39:40 -0800 | [diff] [blame] | 37 | int32_t ParseAudioCodecSpecific(WebRtcRTPHeader* rtp_header, |
| 38 | const uint8_t* payload_data, |
| 39 | size_t payload_length, |
Niels Möller | 31791e7 | 2018-03-14 11:27:26 +0100 | [diff] [blame] | 40 | const AudioPayload& audio_specific); |
phoglund@webrtc.org | 92bb417 | 2012-12-13 10:48:24 +0000 | [diff] [blame] | 41 | |
skvlad | 98bb664 | 2016-04-07 15:36:45 -0700 | [diff] [blame] | 42 | ThreadUnsafeOneTimeEvent first_packet_received_; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 43 | }; |
phoglund@webrtc.org | a7303bd | 2013-02-05 15:12:39 +0000 | [diff] [blame] | 44 | } // namespace webrtc |
| 45 | |
Mirko Bonadei | 92ea95e | 2017-09-15 06:47:31 +0200 | [diff] [blame] | 46 | #endif // MODULES_RTP_RTCP_SOURCE_RTP_RECEIVER_AUDIO_H_ |