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)
|
2013-07-16 19:25:04 +00:00
|
|
|
: data_callback_(data_callback) {
|
2012-12-18 15:40:53 +00:00
|
|
|
memset(&last_payload_, 0, sizeof(last_payload_));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void RTPReceiverStrategy::GetLastMediaSpecificPayload(
|
2013-07-16 19:25:04 +00:00
|
|
|
ModuleRTPUtility::PayloadUnion* payload) const {
|
2012-12-18 15:40:53 +00:00
|
|
|
memcpy(payload, &last_payload_, sizeof(*payload));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void RTPReceiverStrategy::SetLastMediaSpecificPayload(
|
2013-07-16 19:25:04 +00:00
|
|
|
const ModuleRTPUtility::PayloadUnion& payload) {
|
2012-12-18 15:40:53 +00:00
|
|
|
memcpy(&last_payload_, &payload, sizeof(last_payload_));
|
|
|
|
|
}
|
|
|
|
|
|
2013-07-31 15:17:19 +00:00
|
|
|
void RTPReceiverStrategy::CheckPayloadChanged(
|
|
|
|
|
const int8_t payload_type,
|
|
|
|
|
ModuleRTPUtility::PayloadUnion* specific_payload,
|
|
|
|
|
bool* should_reset_statistics,
|
|
|
|
|
bool* should_discard_changes) {
|
|
|
|
|
// Default: Keep changes and don't reset statistics.
|
|
|
|
|
*should_discard_changes = false;
|
|
|
|
|
*should_reset_statistics = false;
|
|
|
|
|
}
|
2012-12-18 15:40:53 +00:00
|
|
|
} // namespace webrtc
|