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

Side by Side Diff: webrtc/tools/frame_editing/frame_editing_lib.cc

Issue 2765243002: Delete RawVideoType enum, use the VideoType enum instead. (Closed)
Patch Set: Define constant webrtc::kI420, for backwards compatibility. Created 3 years, 7 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/test/win/d3d_renderer.cc ('k') | webrtc/tools/frame_editing/frame_editing_unittest.cc » ('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) 2012 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2012 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 17 matching lines...) Expand all
28 return -10; 28 return -10;
29 } 29 }
30 30
31 FILE* in_fid = fopen(in_path.c_str() , "rb"); 31 FILE* in_fid = fopen(in_path.c_str() , "rb");
32 if (!in_fid) { 32 if (!in_fid) {
33 fprintf(stderr, "Could not read input file: %s.\n", in_path.c_str()); 33 fprintf(stderr, "Could not read input file: %s.\n", in_path.c_str());
34 return -11; 34 return -11;
35 } 35 }
36 36
37 // Frame size of I420. 37 // Frame size of I420.
38 size_t frame_length = CalcBufferSize(kI420, width, height); 38 size_t frame_length = CalcBufferSize(VideoType::kI420, width, height);
39 39
40 std::unique_ptr<uint8_t[]> temp_buffer(new uint8_t[frame_length]); 40 std::unique_ptr<uint8_t[]> temp_buffer(new uint8_t[frame_length]);
41 41
42 FILE* out_fid = fopen(out_path.c_str(), "wb"); 42 FILE* out_fid = fopen(out_path.c_str(), "wb");
43 43
44 if (!out_fid) { 44 if (!out_fid) {
45 fprintf(stderr, "Could not open output file: %s.\n", out_path.c_str()); 45 fprintf(stderr, "Could not open output file: %s.\n", out_path.c_str());
46 fclose(in_fid); 46 fclose(in_fid);
47 return -12; 47 return -12;
48 } 48 }
(...skipping 29 matching lines...) Expand all
78 if (num_bytes_read > 0 && num_bytes_read < frame_length) { 78 if (num_bytes_read > 0 && num_bytes_read < frame_length) {
79 printf("Frame to small! Last frame truncated.\n"); 79 printf("Frame to small! Last frame truncated.\n");
80 } 80 }
81 fclose(in_fid); 81 fclose(in_fid);
82 fclose(out_fid); 82 fclose(out_fid);
83 83
84 printf("Done editing!\n"); 84 printf("Done editing!\n");
85 return 0; 85 return 0;
86 } 86 }
87 } // namespace webrtc 87 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/test/win/d3d_renderer.cc ('k') | webrtc/tools/frame_editing/frame_editing_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698