blob: 1cde2f37d8c2886f38b4edcebd2cb5519cf929cb [file] [log] [blame]
Emircan Uysaler0a375472017-12-11 12:21:02 +05301/*
2 * Copyright (c) 2017 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
Steve Anton10542f22019-01-11 09:11:00 -080011#include "media/engine/multiplex_codec_factory.h"
Emircan Uysaler0a375472017-12-11 12:21:02 +053012
13#include <utility>
14
15#include "api/video_codecs/sdp_video_format.h"
16#include "api/video_codecs/video_decoder.h"
17#include "api/video_codecs/video_encoder.h"
Steve Anton10542f22019-01-11 09:11:00 -080018#include "media/base/media_constants.h"
19#include "media/engine/internal_decoder_factory.h"
20#include "media/engine/internal_encoder_factory.h"
Emircan Uysaler0a375472017-12-11 12:21:02 +053021#include "test/gtest.h"
22
23namespace webrtc {
24
Emircan Uysalerd7ae3c32018-01-25 13:01:09 -080025TEST(MultiplexDecoderFactory, CreateVideoDecoder) {
Emircan Uysaler0a375472017-12-11 12:21:02 +053026 std::unique_ptr<VideoDecoderFactory> internal_factory(
27 new InternalDecoderFactory());
Emircan Uysalerd7ae3c32018-01-25 13:01:09 -080028 MultiplexDecoderFactory factory(std::move(internal_factory));
Emircan Uysaler0a375472017-12-11 12:21:02 +053029 std::unique_ptr<VideoDecoder> decoder =
30 factory.CreateVideoDecoder(SdpVideoFormat(
Emircan Uysalerd7ae3c32018-01-25 13:01:09 -080031 cricket::kMultiplexCodecName,
Emircan Uysaler0a375472017-12-11 12:21:02 +053032 {{cricket::kCodecParamAssociatedCodecName, cricket::kVp9CodecName}}));
33 EXPECT_TRUE(decoder);
34}
35
Emircan Uysalerd7ae3c32018-01-25 13:01:09 -080036TEST(MultiplexEncoderFactory, CreateVideoEncoder) {
Emircan Uysaler0a375472017-12-11 12:21:02 +053037 std::unique_ptr<VideoEncoderFactory> internal_factory(
38 new InternalEncoderFactory());
Emircan Uysalerd7ae3c32018-01-25 13:01:09 -080039 MultiplexEncoderFactory factory(std::move(internal_factory));
Emircan Uysaler0a375472017-12-11 12:21:02 +053040 std::unique_ptr<VideoEncoder> encoder =
41 factory.CreateVideoEncoder(SdpVideoFormat(
Emircan Uysalerd7ae3c32018-01-25 13:01:09 -080042 cricket::kMultiplexCodecName,
Emircan Uysaler0a375472017-12-11 12:21:02 +053043 {{cricket::kCodecParamAssociatedCodecName, cricket::kVp9CodecName}}));
44 EXPECT_TRUE(encoder);
45}
46
47} // namespace webrtc