blob: 5d97a1f3a94a2a05ed26d2353279dc9114564075 [file] [log] [blame]
niklase@google.com470e71d2011-07-07 08:21:25 +00001/*
pwestin@webrtc.orgf6bb77a2012-01-24 17:16:59 +00002 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
niklase@google.com470e71d2011-07-07 08:21:25 +00003 *
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 Bonadei92ea95e2017-09-15 06:47:31 +020011#ifndef MODULES_RTP_RTCP_SOURCE_RTP_RECEIVER_AUDIO_H_
12#define MODULES_RTP_RTCP_SOURCE_RTP_RECEIVER_AUDIO_H_
niklase@google.com470e71d2011-07-07 08:21:25 +000013
pwestin@webrtc.orgaf6f15c2012-01-19 15:53:59 +000014#include <set>
15
Mirko Bonadei92ea95e2017-09-15 06:47:31 +020016#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.com470e71d2011-07-07 08:21:25 +000021
22namespace webrtc {
phoglund@webrtc.orga7303bd2013-02-05 15:12:39 +000023
phoglund@webrtc.org92bb4172012-12-13 10:48:24 +000024// Handles audio RTP packets. This class is thread-safe.
Niels Möllerdc6e68b2018-08-02 15:13:29 +020025class RTPReceiverAudio : public RTPReceiverStrategy {
phoglund@webrtc.orga7303bd2013-02-05 15:12:39 +000026 public:
solenberg1d031392016-03-30 02:42:32 -070027 explicit RTPReceiverAudio(RtpData* data_callback);
Danil Chapovalov2a5ce2b2018-02-07 09:38:31 +010028 ~RTPReceiverAudio() override;
niklase@google.com470e71d2011-07-07 08:21:25 +000029
kjellander@webrtc.org14665ff2015-03-04 12:58:35 +000030 int32_t ParseRtpPacket(WebRtcRTPHeader* rtp_header,
31 const PayloadUnion& specific_payload,
kjellander@webrtc.org14665ff2015-03-04 12:58:35 +000032 const uint8_t* packet,
33 size_t payload_length,
Niels Möllerbbf389c2017-09-26 14:05:05 +020034 int64_t timestamp_ms) override;
phoglund@webrtc.org07bf43c2012-12-18 15:40:53 +000035
phoglund@webrtc.orga7303bd2013-02-05 15:12:39 +000036 private:
danilchap162abd32015-12-10 02:39:40 -080037 int32_t ParseAudioCodecSpecific(WebRtcRTPHeader* rtp_header,
38 const uint8_t* payload_data,
39 size_t payload_length,
Niels Möller31791e72018-03-14 11:27:26 +010040 const AudioPayload& audio_specific);
phoglund@webrtc.org92bb4172012-12-13 10:48:24 +000041
skvlad98bb6642016-04-07 15:36:45 -070042 ThreadUnsafeOneTimeEvent first_packet_received_;
niklase@google.com470e71d2011-07-07 08:21:25 +000043};
phoglund@webrtc.orga7303bd2013-02-05 15:12:39 +000044} // namespace webrtc
45
Mirko Bonadei92ea95e2017-09-15 06:47:31 +020046#endif // MODULES_RTP_RTCP_SOURCE_RTP_RECEIVER_AUDIO_H_