| OLD | NEW |
| 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 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 68 return (width_+1)/2; | 68 return (width_+1)/2; |
| 69 } | 69 } |
| 70 | 70 |
| 71 // Returns the size in bytes of the input RGBA frames. | 71 // Returns the size in bytes of the input RGBA frames. |
| 72 int InputFrameSize() const { | 72 int InputFrameSize() const { |
| 73 return width_*height_*4; | 73 return width_*height_*4; |
| 74 } | 74 } |
| 75 | 75 |
| 76 // Writes the Y, U and V (in this order) planes to the file, thus adding a | 76 // Writes the Y, U and V (in this order) planes to the file, thus adding a |
| 77 // raw YUV frame to the file. | 77 // raw YUV frame to the file. |
| 78 bool AddYUVToFile(uint8* y_plane, int y_plane_size, | 78 bool AddYUVToFile(uint8_t* y_plane, |
| 79 uint8* u_plane, int u_plane_size, | 79 int y_plane_size, |
| 80 uint8* v_plane, int v_plane_size, | 80 uint8_t* u_plane, |
| 81 int u_plane_size, |
| 82 uint8_t* v_plane, |
| 83 int v_plane_size, |
| 81 FILE* output_file); | 84 FILE* output_file); |
| 82 | 85 |
| 83 // Adds the Y, U or V plane to the file. | 86 // Adds the Y, U or V plane to the file. |
| 84 bool AddYUVPlaneToFile(uint8* yuv_plane, int yuv_plane_size, FILE* file); | 87 bool AddYUVPlaneToFile(uint8_t* yuv_plane, int yuv_plane_size, FILE* file); |
| 85 | 88 |
| 86 // Reads a RGBA frame from input_file_name with input_frame_size size in bytes | 89 // Reads a RGBA frame from input_file_name with input_frame_size size in bytes |
| 87 // into the buffer. | 90 // into the buffer. |
| 88 bool ReadRGBAFrame(const char* input_file_name, int input_frame_size, | 91 bool ReadRGBAFrame(const char* input_file_name, int input_frame_size, |
| 89 unsigned char* buffer); | 92 unsigned char* buffer); |
| 90 | 93 |
| 91 // Finds the full path name of the file - concatenates the directory and file | 94 // Finds the full path name of the file - concatenates the directory and file |
| 92 // names. | 95 // names. |
| 93 std::string FindFullFileName(std::string dir_name, std::string file_name); | 96 std::string FindFullFileName(std::string dir_name, std::string file_name); |
| 94 | 97 |
| 95 // Checks if a file exists. | 98 // Checks if a file exists. |
| 96 bool FileExists(std::string file_name_to_check); | 99 bool FileExists(std::string file_name_to_check); |
| 97 | 100 |
| 98 // Returns the name of the file in the form frame_<number>, where <number> is | 101 // Returns the name of the file in the form frame_<number>, where <number> is |
| 99 // 4 zero padded (i.e. frame_0000, frame_0001, etc.). | 102 // 4 zero padded (i.e. frame_0000, frame_0001, etc.). |
| 100 std::string FormFrameName(int width, int number); | 103 std::string FormFrameName(int width, int number); |
| 101 }; | 104 }; |
| 102 | 105 |
| 103 } // namespace test | 106 } // namespace test |
| 104 } // namespace webrtc | 107 } // namespace webrtc |
| 105 | 108 |
| 106 #endif // WEBRTC_TOOLS_CONVERTER_CONVERTER_H_ | 109 #endif // WEBRTC_TOOLS_CONVERTER_CONVERTER_H_ |
| OLD | NEW |