blob: d35c4a4c033249f87a92157e31ba696e8bd27242 [file] [log] [blame]
Sebastian Jansson09408112018-04-24 14:41:22 +02001/*
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#include "test/direct_transport.h"
11#include "test/gtest.h"
12
13namespace webrtc {
14namespace test {
15TEST(DemuxerTest, Demuxing) {
16 constexpr uint8_t kVideoPayloadType = 100;
17 constexpr uint8_t kAudioPayloadType = 101;
18 constexpr size_t kPacketSize = 10;
19 Demuxer demuxer({{kVideoPayloadType, MediaType::VIDEO},
20 {kAudioPayloadType, MediaType::AUDIO}});
21
22 uint8_t data[kPacketSize];
23 memset(data, 0, kPacketSize);
24 data[1] = kVideoPayloadType;
25 EXPECT_EQ(demuxer.GetMediaType(data, kPacketSize), MediaType::VIDEO);
26 data[1] = kAudioPayloadType;
27 EXPECT_EQ(demuxer.GetMediaType(data, kPacketSize), MediaType::AUDIO);
28}
29} // namespace test
30} // namespace webrtc