OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2017 The WebRTC project authors. All Rights Reserved. | 2 * Copyright 2017 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 |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 | 71 |
72 // Handle types than can be converted into one of CodecSpecificInfo's hard
coded cases. | 72 // Handle types than can be converted into one of CodecSpecificInfo's hard
coded cases. |
73 CodecSpecificInfo codecSpecificInfo; | 73 CodecSpecificInfo codecSpecificInfo; |
74 if ([info isKindOfClass:[RTCCodecSpecificInfoH264 class]]) { | 74 if ([info isKindOfClass:[RTCCodecSpecificInfoH264 class]]) { |
75 codecSpecificInfo = [(RTCCodecSpecificInfoH264 *)info nativeCodecSpecifi
cInfo]; | 75 codecSpecificInfo = [(RTCCodecSpecificInfoH264 *)info nativeCodecSpecifi
cInfo]; |
76 } | 76 } |
77 | 77 |
78 std::unique_ptr<RTPFragmentationHeader> fragmentationHeader = | 78 std::unique_ptr<RTPFragmentationHeader> fragmentationHeader = |
79 [header createNativeFragmentationHeader]; | 79 [header createNativeFragmentationHeader]; |
80 EncodedImageCallback::Result res = | 80 EncodedImageCallback::Result res = |
81 callback->OnEncodedImage(encodedImage, &codecSpecificInfo, fragmentati
onHeader.release()); | 81 callback->OnEncodedImage(encodedImage, &codecSpecificInfo, fragmentati
onHeader.get()); |
82 return res.error == EncodedImageCallback::Result::OK; | 82 return res.error == EncodedImageCallback::Result::OK; |
83 }]; | 83 }]; |
84 | 84 |
85 return WEBRTC_VIDEO_CODEC_OK; | 85 return WEBRTC_VIDEO_CODEC_OK; |
86 } | 86 } |
87 | 87 |
88 int32_t Release() { return [encoder_ releaseEncoder]; } | 88 int32_t Release() { return [encoder_ releaseEncoder]; } |
89 | 89 |
90 int32_t Encode(const VideoFrame &frame, | 90 int32_t Encode(const VideoFrame &frame, |
91 const CodecSpecificInfo *codec_specific_info, | 91 const CodecSpecificInfo *codec_specific_info, |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
158 | 158 |
159 return supported_codecs_; | 159 return supported_codecs_; |
160 } | 160 } |
161 | 161 |
162 void ObjCVideoEncoderFactory::DestroyVideoEncoder(VideoEncoder *encoder) { | 162 void ObjCVideoEncoderFactory::DestroyVideoEncoder(VideoEncoder *encoder) { |
163 delete encoder; | 163 delete encoder; |
164 encoder = nullptr; | 164 encoder = nullptr; |
165 } | 165 } |
166 | 166 |
167 } // namespace webrtc | 167 } // namespace webrtc |
OLD | NEW |