1 /*
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 
11 #include "media/engine/multiplex_codec_factory.h"
12 
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"
18 #include "media/base/media_constants.h"
19 #include "media/engine/internal_decoder_factory.h"
20 #include "media/engine/internal_encoder_factory.h"
21 #include "test/gtest.h"
22 
23 namespace webrtc {
24 
TEST(MultiplexDecoderFactory,CreateVideoDecoder)25 TEST(MultiplexDecoderFactory, CreateVideoDecoder) {
26   std::unique_ptr<VideoDecoderFactory> internal_factory(
27       new InternalDecoderFactory());
28   MultiplexDecoderFactory factory(std::move(internal_factory));
29   std::unique_ptr<VideoDecoder> decoder =
30       factory.CreateVideoDecoder(SdpVideoFormat(
31           cricket::kMultiplexCodecName,
32           {{cricket::kCodecParamAssociatedCodecName, cricket::kVp9CodecName}}));
33   EXPECT_TRUE(decoder);
34 }
35 
TEST(MultiplexEncoderFactory,CreateVideoEncoder)36 TEST(MultiplexEncoderFactory, CreateVideoEncoder) {
37   std::unique_ptr<VideoEncoderFactory> internal_factory(
38       new InternalEncoderFactory());
39   MultiplexEncoderFactory factory(std::move(internal_factory));
40   std::unique_ptr<VideoEncoder> encoder =
41       factory.CreateVideoEncoder(SdpVideoFormat(
42           cricket::kMultiplexCodecName,
43           {{cricket::kCodecParamAssociatedCodecName, cricket::kVp9CodecName}}));
44   EXPECT_TRUE(encoder);
45 }
46 
47 }  // namespace webrtc
48