OLD | NEW |
---|---|
(Empty) | |
1 /* | |
2 * Copyright (c) 2015 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 | |
12 #include "webrtc/modules/video_coding/codecs/h264/include/h264.h" | |
13 | |
14 #if defined(WEBRTC_IOS) | |
15 #import <UIKit/UIKit.h> | |
16 #endif | |
17 | |
18 #if defined(WEBRTC_IOS) || defined(WEBRTC_MAC) | |
19 #include "webrtc/modules/video_coding/codecs/h264/h264_video_toolbox_decoder.h" | |
20 #include "webrtc/modules/video_coding/codecs/h264/h264_video_toolbox_encoder.h" | |
21 #endif | |
22 | |
23 namespace webrtc { | |
24 | |
25 H264Encoder* H264Encoder::Create() { | |
26 #if defined(WEBRTC_VIDEO_TOOLBOX_SUPPORTED) | |
27 #if defined(WEBRTC_IOS) | |
28 // Bail if we aren't actually running on an iOS8 device. | |
pbos-webrtc
2015/06/23 19:13:56
I do not believe we handle "return nullptr;" well
tkchin_webrtc
2015/06/24 23:21:14
Done.
| |
29 if ([[[UIDevice currentDevice] systemVersion] doubleValue] < 8.0) { | |
30 return nullptr; | |
31 } | |
32 #endif // WEBRTC_IOS | |
33 return new H264VideoToolboxEncoder(); | |
34 #else | |
35 return nullptr; | |
36 #endif // WEBRTC_VIDEO_TOOLBOX_SUPPORTED | |
37 } | |
38 | |
39 H264Decoder* H264Decoder::Create() { | |
40 #if defined(WEBRTC_VIDEO_TOOLBOX_SUPPORTED) | |
41 #if defined(WEBRTC_IOS) | |
42 // Bail if we aren't actually running on an iOS8 device. | |
43 if ([[[UIDevice currentDevice] systemVersion] doubleValue] < 8.0) { | |
44 return nullptr; | |
45 } | |
46 #endif | |
47 return new H264VideoToolboxDecoder(); | |
48 #else // WEBRTC_IOS | |
49 return nullptr; | |
50 #endif // WEBRTC_VIDEO_TOOLBOX_SUPPORTED | |
51 } | |
52 | |
53 } // namespace webrtc | |
OLD | NEW |