OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 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 | 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 | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
11 #ifndef WEBRTC_MODULES_VIDEO_CODING_CODECS_TEST_VIDEOPROCESSOR_INTEGRATIONTEST_H _ | 11 #ifndef WEBRTC_MODULES_VIDEO_CODING_CODECS_TEST_VIDEOPROCESSOR_INTEGRATIONTEST_H _ |
12 #define WEBRTC_MODULES_VIDEO_CODING_CODECS_TEST_VIDEOPROCESSOR_INTEGRATIONTEST_H _ | 12 #define WEBRTC_MODULES_VIDEO_CODING_CODECS_TEST_VIDEOPROCESSOR_INTEGRATIONTEST_H _ |
13 | 13 |
14 #include <math.h> | 14 #include <math.h> |
15 | 15 |
16 #include <limits> | 16 #include <limits> |
17 #include <memory> | 17 #include <memory> |
18 #include <string> | 18 #include <string> |
19 #include <utility> | 19 #include <utility> |
20 | 20 |
21 #if defined(WEBRTC_ANDROID) | 21 #if defined(WEBRTC_ANDROID) |
22 #include "webrtc/modules/video_coding/codecs/test/android_test_initializer.h" | 22 #include "webrtc/modules/video_coding/codecs/test/android_test_initializer.h" |
23 #include "webrtc/sdk/android/src/jni/androidmediadecoder_jni.h" | 23 #include "webrtc/sdk/android/src/jni/androidmediadecoder_jni.h" |
24 #include "webrtc/sdk/android/src/jni/androidmediaencoder_jni.h" | 24 #include "webrtc/sdk/android/src/jni/androidmediaencoder_jni.h" |
25 #elif defined(WEBRTC_IOS) | 25 #elif defined(WEBRTC_IOS) |
26 #include "webrtc/sdk/objc/Framework/Classes/VideoToolbox/decoder.h" | 26 #include "webrtc/modules/video_coding/codecs/test/objc_codec_h264_test.h" |
27 #include "webrtc/sdk/objc/Framework/Classes/VideoToolbox/encoder.h" | |
28 #endif | 27 #endif |
29 | 28 |
30 #include "webrtc/media/engine/webrtcvideodecoderfactory.h" | 29 #include "webrtc/media/engine/webrtcvideodecoderfactory.h" |
31 #include "webrtc/media/engine/webrtcvideoencoderfactory.h" | 30 #include "webrtc/media/engine/webrtcvideoencoderfactory.h" |
32 #include "webrtc/modules/video_coding/codecs/h264/include/h264.h" | 31 #include "webrtc/modules/video_coding/codecs/h264/include/h264.h" |
33 #include "webrtc/modules/video_coding/codecs/test/packet_manipulator.h" | 32 #include "webrtc/modules/video_coding/codecs/test/packet_manipulator.h" |
34 #include "webrtc/modules/video_coding/codecs/test/videoprocessor.h" | 33 #include "webrtc/modules/video_coding/codecs/test/videoprocessor.h" |
35 #include "webrtc/modules/video_coding/codecs/vp8/include/vp8.h" | 34 #include "webrtc/modules/video_coding/codecs/vp8/include/vp8.h" |
36 #include "webrtc/modules/video_coding/codecs/vp8/include/vp8_common_types.h" | 35 #include "webrtc/modules/video_coding/codecs/vp8/include/vp8_common_types.h" |
37 #include "webrtc/modules/video_coding/codecs/vp9/include/vp9.h" | 36 #include "webrtc/modules/video_coding/codecs/vp9/include/vp9.h" |
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
171 decoder_.reset( | 170 decoder_.reset( |
172 external_decoder_factory_->CreateVideoDecoder(kVideoCodecVP9)); | 171 external_decoder_factory_->CreateVideoDecoder(kVideoCodecVP9)); |
173 break; | 172 break; |
174 default: | 173 default: |
175 RTC_NOTREACHED(); | 174 RTC_NOTREACHED(); |
176 break; | 175 break; |
177 } | 176 } |
178 #elif defined(WEBRTC_IOS) | 177 #elif defined(WEBRTC_IOS) |
179 ASSERT_EQ(kVideoCodecH264, config_.codec_settings->codecType) | 178 ASSERT_EQ(kVideoCodecH264, config_.codec_settings->codecType) |
180 << "iOS HW codecs only support H264."; | 179 << "iOS HW codecs only support H264."; |
181 encoder_.reset(new H264VideoToolboxEncoder( | 180 std::unique_ptr<cricket::WebRtcVideoEncoderFactory> encoder_factory = |
182 cricket::VideoCodec(cricket::kH264CodecName))); | 181 CreateObjCEncoderFactory(); |
183 decoder_.reset(new H264VideoToolboxDecoder()); | 182 std::unique_ptr<cricket::WebRtcVideoDecoderFactory> decoder_factory = |
183 CreateObjCDecoderFactory(); | |
184 cricket::VideoCodec codecInfo = encoder_factory->supported_codecs().at(0); | |
brandtr
2017/08/07 08:01:57
Is there a benefit from using .at here, vs. the re
magjed_webrtc
2017/08/07 12:59:34
Not much, at() will check if the index is within b
| |
185 encoder_.reset(encoder_factory->CreateVideoEncoder(codecInfo)); | |
186 decoder_.reset(decoder_factory->CreateVideoDecoder(kVideoCodecH264)); | |
184 #else | 187 #else |
185 RTC_NOTREACHED() << "Only support HW codecs on Android and iOS."; | 188 RTC_NOTREACHED() << "Only support HW codecs on Android and iOS."; |
186 #endif | 189 #endif |
187 #endif // WEBRTC_VIDEOPROCESSOR_INTEGRATIONTEST_HW_CODECS_ENABLED | 190 #endif // WEBRTC_VIDEOPROCESSOR_INTEGRATIONTEST_HW_CODECS_ENABLED |
188 RTC_CHECK(encoder_) << "HW encoder not successfully created."; | 191 RTC_CHECK(encoder_) << "HW encoder not successfully created."; |
189 RTC_CHECK(decoder_) << "HW decoder not successfully created."; | 192 RTC_CHECK(decoder_) << "HW decoder not successfully created."; |
190 return; | 193 return; |
191 } | 194 } |
192 | 195 |
193 // SW codecs. | 196 // SW codecs. |
(...skipping 569 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
763 int start_frame_rate_; | 766 int start_frame_rate_; |
764 | 767 |
765 // Codec and network settings. | 768 // Codec and network settings. |
766 int num_temporal_layers_; | 769 int num_temporal_layers_; |
767 }; | 770 }; |
768 | 771 |
769 } // namespace test | 772 } // namespace test |
770 } // namespace webrtc | 773 } // namespace webrtc |
771 | 774 |
772 #endif // WEBRTC_MODULES_VIDEO_CODING_CODECS_TEST_VIDEOPROCESSOR_INTEGRATIONTES T_H_ | 775 #endif // WEBRTC_MODULES_VIDEO_CODING_CODECS_TEST_VIDEOPROCESSOR_INTEGRATIONTES T_H_ |
OLD | NEW |