Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(742)

Side by Side Diff: webrtc/sdk/objc/Framework/Classes/VideoToolbox/RTCVideoEncoderH264.mm

Issue 3012693002: ObjC: Add null checks to HW encoder compressionOutputCallback (Closed)
Patch Set: Created 3 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2015 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 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
141 return pixel_buffer; 141 return pixel_buffer;
142 } 142 }
143 143
144 // This is the callback function that VideoToolbox calls when encode is 144 // This is the callback function that VideoToolbox calls when encode is
145 // complete. From inspection this happens on its own queue. 145 // complete. From inspection this happens on its own queue.
146 void compressionOutputCallback(void *encoder, 146 void compressionOutputCallback(void *encoder,
147 void *params, 147 void *params,
148 OSStatus status, 148 OSStatus status,
149 VTEncodeInfoFlags infoFlags, 149 VTEncodeInfoFlags infoFlags,
150 CMSampleBufferRef sampleBuffer) { 150 CMSampleBufferRef sampleBuffer) {
151 RTC_CHECK(params);
151 std::unique_ptr<RTCFrameEncodeParams> encodeParams( 152 std::unique_ptr<RTCFrameEncodeParams> encodeParams(
152 reinterpret_cast<RTCFrameEncodeParams *>(params)); 153 reinterpret_cast<RTCFrameEncodeParams *>(params));
154 RTC_CHECK(encodeParams->encoder);
153 [encodeParams->encoder frameWasEncoded:status 155 [encodeParams->encoder frameWasEncoded:status
154 flags:infoFlags 156 flags:infoFlags
155 sampleBuffer:sampleBuffer 157 sampleBuffer:sampleBuffer
156 codecSpecificInfo:encodeParams->codecSpecificInfo 158 codecSpecificInfo:encodeParams->codecSpecificInfo
157 width:encodeParams->width 159 width:encodeParams->width
158 height:encodeParams->height 160 height:encodeParams->height
159 renderTimeMs:encodeParams->render_time_ms 161 renderTimeMs:encodeParams->render_time_ms
160 timestamp:encodeParams->timestamp 162 timestamp:encodeParams->timestamp
161 rotation:encodeParams->rotation]; 163 rotation:encodeParams->rotation];
162 } 164 }
(...skipping 535 matching lines...) Expand 10 before | Expand all | Expand 10 after
698 } 700 }
699 _bitrateAdjuster->Update(frame.buffer.length); 701 _bitrateAdjuster->Update(frame.buffer.length);
700 } 702 }
701 703
702 - (RTCVideoEncoderQpThresholds *)scalingSettings { 704 - (RTCVideoEncoderQpThresholds *)scalingSettings {
703 return [[RTCVideoEncoderQpThresholds alloc] initWithThresholdsLow:kLowH264QpTh reshold 705 return [[RTCVideoEncoderQpThresholds alloc] initWithThresholdsLow:kLowH264QpTh reshold
704 high:kHighH264QpT hreshold]; 706 high:kHighH264QpT hreshold];
705 } 707 }
706 708
707 @end 709 @end
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698