webrtc/modules/rtp_rtcp/include/rtp_rtcp_defines.cc
Karl Wiberg 884e49f9d6 Convert PayloadUnion from a union to a class, step 3
Remove PayloadUnion's public member variables, so that the outside
world has to go through the accessors.

This is good code hygiene in general. For example, it makes it
possible to make the audio and video states Optional, so that exactly
one of them can be live at any one time.

BUG=webrtc:8159

Change-Id: Ie617b9038f961b329bd67b45478ff33d97148447
Reviewed-on: https://webrtc-review.googlesource.com/4428
Commit-Queue: Karl Wiberg <kwiberg@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#20064}
2017-10-02 08:53:30 +00:00

26 lines
982 B
C++

/*
* Copyright (c) 2017 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 "modules/rtp_rtcp/include/rtp_rtcp_defines.h"
namespace webrtc {
PayloadUnion::PayloadUnion(const AudioPayload& payload)
: audio_payload_(payload) {}
PayloadUnion::PayloadUnion(const VideoPayload& payload)
: video_payload_(payload) {}
PayloadUnion::PayloadUnion(const PayloadUnion&) = default;
PayloadUnion::PayloadUnion(PayloadUnion&&) = default;
PayloadUnion::~PayloadUnion() = default;
PayloadUnion& PayloadUnion::operator=(const PayloadUnion&) = default;
PayloadUnion& PayloadUnion::operator=(PayloadUnion&&) = default;
} // namespace webrtc