phoglund@webrtc.org | 07bf43c | 2012-12-18 15:40:53 +0000 | [diff] [blame] | 1 | /* |
| 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 Bonadei | 92ea95e | 2017-09-15 06:47:31 +0200 | [diff] [blame] | 11 | #include "modules/rtp_rtcp/source/rtp_receiver_strategy.h" |
phoglund@webrtc.org | 07bf43c | 2012-12-18 15:40:53 +0000 | [diff] [blame] | 12 | |
pbos@webrtc.org | 12dc1a3 | 2013-08-05 16:22:53 +0000 | [diff] [blame] | 13 | #include <stdlib.h> |
phoglund@webrtc.org | 07bf43c | 2012-12-18 15:40:53 +0000 | [diff] [blame] | 14 | |
| 15 | namespace webrtc { |
| 16 | |
phoglund@webrtc.org | a22a9bd | 2013-01-14 10:01:55 +0000 | [diff] [blame] | 17 | RTPReceiverStrategy::RTPReceiverStrategy(RtpData* data_callback) |
danilchap | 7c9426c | 2016-04-14 03:05:31 -0700 | [diff] [blame] | 18 | : data_callback_(data_callback) { |
phoglund@webrtc.org | 07bf43c | 2012-12-18 15:40:53 +0000 | [diff] [blame] | 19 | memset(&last_payload_, 0, sizeof(last_payload_)); |
| 20 | } |
| 21 | |
| 22 | void RTPReceiverStrategy::GetLastMediaSpecificPayload( |
wu@webrtc.org | 822fbd8 | 2013-08-15 23:38:54 +0000 | [diff] [blame] | 23 | PayloadUnion* payload) const { |
danilchap | 7c9426c | 2016-04-14 03:05:31 -0700 | [diff] [blame] | 24 | rtc::CritScope cs(&crit_sect_); |
phoglund@webrtc.org | 07bf43c | 2012-12-18 15:40:53 +0000 | [diff] [blame] | 25 | memcpy(payload, &last_payload_, sizeof(*payload)); |
| 26 | } |
| 27 | |
| 28 | void RTPReceiverStrategy::SetLastMediaSpecificPayload( |
wu@webrtc.org | 822fbd8 | 2013-08-15 23:38:54 +0000 | [diff] [blame] | 29 | const PayloadUnion& payload) { |
danilchap | 7c9426c | 2016-04-14 03:05:31 -0700 | [diff] [blame] | 30 | rtc::CritScope cs(&crit_sect_); |
phoglund@webrtc.org | 07bf43c | 2012-12-18 15:40:53 +0000 | [diff] [blame] | 31 | memcpy(&last_payload_, &payload, sizeof(last_payload_)); |
| 32 | } |
| 33 | |
wu@webrtc.org | 822fbd8 | 2013-08-15 23:38:54 +0000 | [diff] [blame] | 34 | void RTPReceiverStrategy::CheckPayloadChanged(int8_t payload_type, |
| 35 | PayloadUnion* specific_payload, |
wu@webrtc.org | 822fbd8 | 2013-08-15 23:38:54 +0000 | [diff] [blame] | 36 | bool* should_discard_changes) { |
pbos | d436298 | 2015-07-07 08:32:48 -0700 | [diff] [blame] | 37 | // Default: Keep changes. |
pbos@webrtc.org | f3e4cee | 2013-07-31 15:17:19 +0000 | [diff] [blame] | 38 | *should_discard_changes = false; |
pbos@webrtc.org | f3e4cee | 2013-07-31 15:17:19 +0000 | [diff] [blame] | 39 | } |
wu@webrtc.org | 822fbd8 | 2013-08-15 23:38:54 +0000 | [diff] [blame] | 40 | |
| 41 | int RTPReceiverStrategy::Energy(uint8_t array_of_energy[kRtpCsrcSize]) const { |
| 42 | return -1; |
| 43 | } |
| 44 | |
phoglund@webrtc.org | 07bf43c | 2012-12-18 15:40:53 +0000 | [diff] [blame] | 45 | } // namespace webrtc |