blob: 6db24c9a021fd1d67096933815be1992d11147aa [file] [log] [blame]
phoglund@webrtc.org07bf43c2012-12-18 15:40:53 +00001/*
2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
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 Bonadei92ea95e2017-09-15 06:47:31 +020011#include "modules/rtp_rtcp/source/rtp_receiver_strategy.h"
phoglund@webrtc.org07bf43c2012-12-18 15:40:53 +000012
pbos@webrtc.org12dc1a32013-08-05 16:22:53 +000013#include <stdlib.h>
phoglund@webrtc.org07bf43c2012-12-18 15:40:53 +000014
15namespace webrtc {
16
phoglund@webrtc.orga22a9bd2013-01-14 10:01:55 +000017RTPReceiverStrategy::RTPReceiverStrategy(RtpData* data_callback)
Karl Wiberg83d3ec12017-09-28 19:54:38 +020018 : data_callback_(data_callback) {}
phoglund@webrtc.org07bf43c2012-12-18 15:40:53 +000019
20void RTPReceiverStrategy::GetLastMediaSpecificPayload(
wu@webrtc.org822fbd82013-08-15 23:38:54 +000021 PayloadUnion* payload) const {
danilchap7c9426c2016-04-14 03:05:31 -070022 rtc::CritScope cs(&crit_sect_);
Karl Wiberg83d3ec12017-09-28 19:54:38 +020023 if (last_payload_) {
24 *payload = *last_payload_;
25 }
phoglund@webrtc.org07bf43c2012-12-18 15:40:53 +000026}
27
28void RTPReceiverStrategy::SetLastMediaSpecificPayload(
wu@webrtc.org822fbd82013-08-15 23:38:54 +000029 const PayloadUnion& payload) {
danilchap7c9426c2016-04-14 03:05:31 -070030 rtc::CritScope cs(&crit_sect_);
Karl Wiberg83d3ec12017-09-28 19:54:38 +020031 last_payload_.emplace(payload);
phoglund@webrtc.org07bf43c2012-12-18 15:40:53 +000032}
33
wu@webrtc.org822fbd82013-08-15 23:38:54 +000034void RTPReceiverStrategy::CheckPayloadChanged(int8_t payload_type,
35 PayloadUnion* specific_payload,
wu@webrtc.org822fbd82013-08-15 23:38:54 +000036 bool* should_discard_changes) {
pbosd4362982015-07-07 08:32:48 -070037 // Default: Keep changes.
pbos@webrtc.orgf3e4cee2013-07-31 15:17:19 +000038 *should_discard_changes = false;
pbos@webrtc.orgf3e4cee2013-07-31 15:17:19 +000039}
wu@webrtc.org822fbd82013-08-15 23:38:54 +000040
41int RTPReceiverStrategy::Energy(uint8_t array_of_energy[kRtpCsrcSize]) const {
42 return -1;
43}
44
phoglund@webrtc.org07bf43c2012-12-18 15:40:53 +000045} // namespace webrtc