blob: de58b615e6a5ef8e91a262c58af5ff32a81bb147 [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)
danilchap7c9426c2016-04-14 03:05:31 -070018 : data_callback_(data_callback) {
phoglund@webrtc.org07bf43c2012-12-18 15:40:53 +000019 memset(&last_payload_, 0, sizeof(last_payload_));
20}
21
22void RTPReceiverStrategy::GetLastMediaSpecificPayload(
wu@webrtc.org822fbd82013-08-15 23:38:54 +000023 PayloadUnion* payload) const {
danilchap7c9426c2016-04-14 03:05:31 -070024 rtc::CritScope cs(&crit_sect_);
phoglund@webrtc.org07bf43c2012-12-18 15:40:53 +000025 memcpy(payload, &last_payload_, sizeof(*payload));
26}
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_);
phoglund@webrtc.org07bf43c2012-12-18 15:40:53 +000031 memcpy(&last_payload_, &payload, sizeof(last_payload_));
32}
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