Niels Möller | 3a74239 | 2018-10-08 11:13:58 +0200 | [diff] [blame^] | 1 | /* |
| 2 | * Copyright 2018 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 | // This is EXPERIMENTAL interface for media transport. |
| 12 | // |
| 13 | // The goal is to refactor WebRTC code so that audio and video frames |
| 14 | // are sent / received through the media transport interface. This will |
| 15 | // enable different media transport implementations, including QUIC-based |
| 16 | // media transport. |
| 17 | |
| 18 | #include "api/media_transport_interface.h" |
| 19 | |
| 20 | namespace webrtc { |
| 21 | |
| 22 | MediaTransportEncodedAudioFrame::MediaTransportEncodedAudioFrame( |
| 23 | int sampling_rate_hz, |
| 24 | int starting_sample_index, |
| 25 | int samples_per_channel, |
| 26 | int sequence_number, |
| 27 | FrameType frame_type, |
| 28 | uint8_t payload_type, |
| 29 | std::vector<uint8_t> encoded_data) |
| 30 | : sampling_rate_hz_(sampling_rate_hz), |
| 31 | starting_sample_index_(starting_sample_index), |
| 32 | samples_per_channel_(samples_per_channel), |
| 33 | sequence_number_(sequence_number), |
| 34 | frame_type_(frame_type), |
| 35 | payload_type_(payload_type), |
| 36 | encoded_data_(std::move(encoded_data)) {} |
| 37 | |
| 38 | MediaTransportEncodedAudioFrame::~MediaTransportEncodedAudioFrame() = default; |
| 39 | |
| 40 | MediaTransportEncodedVideoFrame::MediaTransportEncodedVideoFrame( |
| 41 | int64_t frame_id, |
| 42 | std::vector<int64_t> referenced_frame_ids, |
| 43 | VideoCodecType codec_type, |
| 44 | const webrtc::EncodedImage& encoded_image) |
| 45 | : codec_type_(codec_type), |
| 46 | encoded_image_(encoded_image), |
| 47 | frame_id_(frame_id), |
| 48 | referenced_frame_ids_(std::move(referenced_frame_ids)) {} |
| 49 | |
| 50 | MediaTransportEncodedVideoFrame::~MediaTransportEncodedVideoFrame() = default; |
| 51 | |
| 52 | } // namespace webrtc |