Emircan Uysaler | 0a37547 | 2017-12-11 12:21:02 +0530 | [diff] [blame^] | 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/stereocodecfactory.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/mediaconstants.h" |
| 19 | #include "media/engine/internaldecoderfactory.h" |
| 20 | #include "media/engine/internalencoderfactory.h" |
| 21 | #include "test/gtest.h" |
| 22 | |
| 23 | namespace webrtc { |
| 24 | |
| 25 | TEST(StereoDecoderFactory, CreateVideoDecoder) { |
| 26 | std::unique_ptr<VideoDecoderFactory> internal_factory( |
| 27 | new InternalDecoderFactory()); |
| 28 | StereoDecoderFactory factory(std::move(internal_factory)); |
| 29 | std::unique_ptr<VideoDecoder> decoder = |
| 30 | factory.CreateVideoDecoder(SdpVideoFormat( |
| 31 | cricket::kStereoCodecName, |
| 32 | {{cricket::kCodecParamAssociatedCodecName, cricket::kVp9CodecName}})); |
| 33 | EXPECT_TRUE(decoder); |
| 34 | } |
| 35 | |
| 36 | TEST(StereoEncoderFactory, CreateVideoEncoder) { |
| 37 | std::unique_ptr<VideoEncoderFactory> internal_factory( |
| 38 | new InternalEncoderFactory()); |
| 39 | StereoEncoderFactory factory(std::move(internal_factory)); |
| 40 | std::unique_ptr<VideoEncoder> encoder = |
| 41 | factory.CreateVideoEncoder(SdpVideoFormat( |
| 42 | cricket::kStereoCodecName, |
| 43 | {{cricket::kCodecParamAssociatedCodecName, cricket::kVp9CodecName}})); |
| 44 | EXPECT_TRUE(encoder); |
| 45 | } |
| 46 | |
| 47 | } // namespace webrtc |