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

Side by Side Diff: webrtc/media/base/testutils.cc

Issue 1728503002: Replace scoped_ptr with unique_ptr in webrtc/media/ (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@up1
Patch Set: Created 4 years, 10 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/media/base/rtpdump_unittest.cc ('k') | webrtc/media/base/videoadapter.h » ('j') | 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) 2004 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2004 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
11 #include "webrtc/media/base/testutils.h" 11 #include "webrtc/media/base/testutils.h"
12 12
13 #include <math.h> 13 #include <math.h>
14 #include <algorithm> 14 #include <algorithm>
15 #include <memory>
15 16
16 #include "webrtc/base/bytebuffer.h" 17 #include "webrtc/base/bytebuffer.h"
17 #include "webrtc/base/fileutils.h" 18 #include "webrtc/base/fileutils.h"
18 #include "webrtc/base/gunit.h" 19 #include "webrtc/base/gunit.h"
19 #include "webrtc/base/pathutils.h" 20 #include "webrtc/base/pathutils.h"
20 #include "webrtc/base/stream.h" 21 #include "webrtc/base/stream.h"
21 #include "webrtc/base/stringutils.h" 22 #include "webrtc/base/stringutils.h"
22 #include "webrtc/base/testutils.h" 23 #include "webrtc/base/testutils.h"
23 #include "webrtc/media/base/executablehelpers.h" 24 #include "webrtc/media/base/executablehelpers.h"
24 #include "webrtc/media/base/rtpdump.h" 25 #include "webrtc/media/base/rtpdump.h"
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after
258 } 259 }
259 260
260 // Loads the image with the specified prefix and size into |out|. 261 // Loads the image with the specified prefix and size into |out|.
261 bool LoadPlanarYuvTestImage(const std::string& prefix, 262 bool LoadPlanarYuvTestImage(const std::string& prefix,
262 int width, 263 int width,
263 int height, 264 int height,
264 uint8_t* out) { 265 uint8_t* out) {
265 std::stringstream ss; 266 std::stringstream ss;
266 ss << prefix << "." << width << "x" << height << "_P420.yuv"; 267 ss << prefix << "." << width << "x" << height << "_P420.yuv";
267 268
268 rtc::scoped_ptr<rtc::FileStream> stream( 269 std::unique_ptr<rtc::FileStream> stream(
269 rtc::Filesystem::OpenFile(rtc::Pathname( 270 rtc::Filesystem::OpenFile(rtc::Pathname(
270 GetTestFilePath(ss.str())), "rb")); 271 GetTestFilePath(ss.str())), "rb"));
271 if (!stream) { 272 if (!stream) {
272 return false; 273 return false;
273 } 274 }
274 275
275 rtc::StreamResult res = 276 rtc::StreamResult res =
276 stream->ReadAll(out, I420_SIZE(width, height), NULL, NULL); 277 stream->ReadAll(out, I420_SIZE(width, height), NULL, NULL);
277 return (res == rtc::SR_SUCCESS); 278 return (res == rtc::SR_SUCCESS);
278 } 279 }
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
359 std::vector<uint32_t> fid_ssrcs; 360 std::vector<uint32_t> fid_ssrcs;
360 fid_ssrcs.push_back(ssrcs[i]); 361 fid_ssrcs.push_back(ssrcs[i]);
361 fid_ssrcs.push_back(rtx_ssrcs[i]); 362 fid_ssrcs.push_back(rtx_ssrcs[i]);
362 cricket::SsrcGroup fid_group(cricket::kFidSsrcGroupSemantics, fid_ssrcs); 363 cricket::SsrcGroup fid_group(cricket::kFidSsrcGroupSemantics, fid_ssrcs);
363 sp.ssrc_groups.push_back(fid_group); 364 sp.ssrc_groups.push_back(fid_group);
364 } 365 }
365 return sp; 366 return sp;
366 } 367 }
367 368
368 } // namespace cricket 369 } // namespace cricket
OLDNEW
« no previous file with comments | « webrtc/media/base/rtpdump_unittest.cc ('k') | webrtc/media/base/videoadapter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698