rtp_receiver_strategy.cc revision a22a9bd9ca66e98f2d51ea082dec8481f2f39e6e
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
11#include "webrtc/modules/rtp_rtcp/source/rtp_receiver_strategy.h"
12
13#include <cstdlib>
14
15namespace webrtc {
16
17RTPReceiverStrategy::RTPReceiverStrategy(RtpData* data_callback)
18    : data_callback_(data_callback) {
19  memset(&last_payload_, 0, sizeof(last_payload_));
20}
21
22void RTPReceiverStrategy::GetLastMediaSpecificPayload(
23  ModuleRTPUtility::PayloadUnion* payload) const {
24  memcpy(payload, &last_payload_, sizeof(*payload));
25}
26
27void RTPReceiverStrategy::SetLastMediaSpecificPayload(
28  const ModuleRTPUtility::PayloadUnion& payload) {
29  memcpy(&last_payload_, &payload, sizeof(last_payload_));
30}
31
32}  // namespace webrtc
33