2012-12-18 15:40:53 +00:00
|
|
|
/*
|
|
|
|
|
* Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
|
|
|
|
|
*
|
|
|
|
|
* Use of this source code is governed by a BSD-style license
|
|
|
|
|
* that can be found in the LICENSE file in the root of the source
|
|
|
|
|
* tree. An additional intellectual property rights grant can be found
|
|
|
|
|
* in the file PATENTS. All contributing project authors may
|
|
|
|
|
* be found in the AUTHORS file in the root of the source tree.
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#include "webrtc/modules/rtp_rtcp/source/rtp_receiver_strategy.h"
|
|
|
|
|
|
2013-08-05 16:22:53 +00:00
|
|
|
#include <stdlib.h>
|
2012-12-18 15:40:53 +00:00
|
|
|
|
|
|
|
|
namespace webrtc {
|
|
|
|
|
|
2013-01-14 10:01:55 +00:00
|
|
|
RTPReceiverStrategy::RTPReceiverStrategy(RtpData* data_callback)
|
2016-04-14 03:05:31 -07:00
|
|
|
: data_callback_(data_callback) {
|
2012-12-18 15:40:53 +00:00
|
|
|
memset(&last_payload_, 0, sizeof(last_payload_));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void RTPReceiverStrategy::GetLastMediaSpecificPayload(
|
2013-08-15 23:38:54 +00:00
|
|
|
PayloadUnion* payload) const {
|
2016-04-14 03:05:31 -07:00
|
|
|
rtc::CritScope cs(&crit_sect_);
|
2012-12-18 15:40:53 +00:00
|
|
|
memcpy(payload, &last_payload_, sizeof(*payload));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void RTPReceiverStrategy::SetLastMediaSpecificPayload(
|
2013-08-15 23:38:54 +00:00
|
|
|
const PayloadUnion& payload) {
|
2016-04-14 03:05:31 -07:00
|
|
|
rtc::CritScope cs(&crit_sect_);
|
2012-12-18 15:40:53 +00:00
|
|
|
memcpy(&last_payload_, &payload, sizeof(last_payload_));
|
|
|
|
|
}
|
|
|
|
|
|
2013-08-15 23:38:54 +00:00
|
|
|
void RTPReceiverStrategy::CheckPayloadChanged(int8_t payload_type,
|
|
|
|
|
PayloadUnion* specific_payload,
|
|
|
|
|
bool* should_discard_changes) {
|
2015-07-07 08:32:48 -07:00
|
|
|
// Default: Keep changes.
|
2013-07-31 15:17:19 +00:00
|
|
|
*should_discard_changes = false;
|
|
|
|
|
}
|
2013-08-15 23:38:54 +00:00
|
|
|
|
|
|
|
|
int RTPReceiverStrategy::Energy(uint8_t array_of_energy[kRtpCsrcSize]) const {
|
|
|
|
|
return -1;
|
|
|
|
|
}
|
|
|
|
|
|
2012-12-18 15:40:53 +00:00
|
|
|
} // namespace webrtc
|