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

Side by Side Diff: webrtc/sdk/objc/Framework/Classes/VideoToolbox/nalu_rewriter.h

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
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 15 matching lines...) Expand all
26 namespace webrtc { 26 namespace webrtc {
27 27
28 // Converts a sample buffer emitted from the VideoToolbox encoder into a buffer 28 // Converts a sample buffer emitted from the VideoToolbox encoder into a buffer
29 // suitable for RTP. The sample buffer is in avcc format whereas the rtp buffer 29 // suitable for RTP. The sample buffer is in avcc format whereas the rtp buffer
30 // needs to be in Annex B format. Data is written directly to |annexb_buffer| 30 // needs to be in Annex B format. Data is written directly to |annexb_buffer|
31 // and a new RTPFragmentationHeader is returned in |out_header|. 31 // and a new RTPFragmentationHeader is returned in |out_header|.
32 bool H264CMSampleBufferToAnnexBBuffer( 32 bool H264CMSampleBufferToAnnexBBuffer(
33 CMSampleBufferRef avcc_sample_buffer, 33 CMSampleBufferRef avcc_sample_buffer,
34 bool is_keyframe, 34 bool is_keyframe,
35 rtc::Buffer* annexb_buffer, 35 rtc::Buffer* annexb_buffer,
36 webrtc::RTPFragmentationHeader** out_header); 36 std::unique_ptr<RTPFragmentationHeader> *out_header);
37 37
38 // Converts a buffer received from RTP into a sample buffer suitable for the 38 // Converts a buffer received from RTP into a sample buffer suitable for the
39 // VideoToolbox decoder. The RTP buffer is in annex b format whereas the sample 39 // VideoToolbox decoder. The RTP buffer is in annex b format whereas the sample
40 // buffer is in avcc format. 40 // buffer is in avcc format.
41 // If |is_keyframe| is true then |video_format| is ignored since the format will 41 // If |is_keyframe| is true then |video_format| is ignored since the format will
42 // be read from the buffer. Otherwise |video_format| must be provided. 42 // be read from the buffer. Otherwise |video_format| must be provided.
43 // Caller is responsible for releasing the created sample buffer. 43 // Caller is responsible for releasing the created sample buffer.
44 bool H264AnnexBBufferToCMSampleBuffer(const uint8_t* annexb_buffer, 44 bool H264AnnexBBufferToCMSampleBuffer(const uint8_t* annexb_buffer,
45 size_t annexb_buffer_size, 45 size_t annexb_buffer_size,
46 CMVideoFormatDescriptionRef video_format, 46 CMVideoFormatDescriptionRef video_format,
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 103
104 private: 104 private:
105 uint8_t* const start_; 105 uint8_t* const start_;
106 size_t offset_; 106 size_t offset_;
107 const size_t length_; 107 const size_t length_;
108 }; 108 };
109 109
110 } // namespace webrtc 110 } // namespace webrtc
111 111
112 #endif // WEBRTC_SDK_OBJC_FRAMEWORK_CLASSES_VIDEOTOOLBOX_NALU_REWRITER_H_ 112 #endif // WEBRTC_SDK_OBJC_FRAMEWORK_CLASSES_VIDEOTOOLBOX_NALU_REWRITER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698