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

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

Issue 3004013002: Fix memory leak in VideoToolbox encoder. (Closed)
Patch Set: Code review 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 | « webrtc/sdk/objc/Framework/Classes/VideoToolbox/nalu_rewriter.cc ('k') | 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 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
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
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
OLDNEW
« no previous file with comments | « webrtc/sdk/objc/Framework/Classes/VideoToolbox/nalu_rewriter.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698