]> git.pld-linux.org Git - packages/webrtc.git/blob - webrtc-types.patch
- added types patch (fixes build with libyuv 1788)
[packages/webrtc.git] / webrtc-types.patch
1 --- webrtc-20121218svn2718/src/tools/frame_analyzer/video_quality_analysis.h.orig       2012-08-27 16:57:19.000000000 +0200
2 +++ webrtc-20121218svn2718/src/tools/frame_analyzer/video_quality_analysis.h    2021-06-28 22:10:14.646395156 +0200
3 @@ -54,7 +54,7 @@
4  // frames are exactly the same) will be 48. In the case of SSIM the max return
5  // value will be 1.
6  double CalculateMetrics(VideoAnalysisMetricsType video_metrics_type,
7 -                        const uint8* ref_frame,  const uint8* test_frame,
8 +                        const uint8_t* ref_frame,  const uint8_t* test_frame,
9                          int width, int height);
10  
11  // Function to print the result from the analysis.
12 @@ -82,11 +82,11 @@
13  
14  // Gets the next frame from an open I420 file.
15  bool GetNextI420Frame(FILE* input_file, int width, int height,
16 -                      uint8* result_frame);
17 +                      uint8_t* result_frame);
18  
19  // Extracts an I420 frame at position frame_number from the file.
20  bool ExtractFrameFromI420(const char* i420_file_name, int width, int height,
21 -                          int frame_number, uint8* result_frame);
22 +                          int frame_number, uint8_t* result_frame);
23  
24  
25  }  // namespace test
26 --- webrtc-20121218svn2718/src/tools/frame_analyzer/video_quality_analysis.cc.orig      2012-08-27 16:57:19.000000000 +0200
27 +++ webrtc-20121218svn2718/src/tools/frame_analyzer/video_quality_analysis.cc   2021-06-28 22:10:57.132831653 +0200
28 @@ -82,7 +82,7 @@
29  }
30  
31  bool GetNextI420Frame(FILE* input_file, int width, int height,
32 -                      uint8* result_frame) {
33 +                      uint8_t* result_frame) {
34    int frame_size = GetI420FrameSize(width, height);
35    bool errors = false;
36  
37 @@ -99,7 +99,7 @@
38  }
39  
40  bool ExtractFrameFromI420(const char* i420_file_name, int width, int height,
41 -                          int frame_number, uint8* result_frame) {
42 +                          int frame_number, uint8_t* result_frame) {
43    int frame_size = GetI420FrameSize(width, height);
44    int offset = frame_number * frame_size;  // Calculate offset for the frame.
45    bool errors = false;
46 @@ -126,7 +126,7 @@
47  }
48  
49  double CalculateMetrics(VideoAnalysisMetricsType video_metrics_type,
50 -                        const uint8* ref_frame,  const uint8* test_frame,
51 +                        const uint8_t* ref_frame,  const uint8_t* test_frame,
52                          int width, int height) {
53    if (!ref_frame || !test_frame)
54      return -1;
55 @@ -134,12 +134,12 @@
56      return -1;
57    int half_width = (width + 1) >> 1;
58    int half_height = (height + 1) >> 1;
59 -  const uint8* src_y_a = ref_frame;
60 -  const uint8* src_u_a = src_y_a + width * height;
61 -  const uint8* src_v_a = src_u_a + half_width * half_height;
62 -  const uint8* src_y_b = test_frame;
63 -  const uint8* src_u_b = src_y_b + width * height;
64 -  const uint8* src_v_b = src_u_b + half_width * half_height;
65 +  const uint8_t* src_y_a = ref_frame;
66 +  const uint8_t* src_u_a = src_y_a + width * height;
67 +  const uint8_t* src_v_a = src_u_a + half_width * half_height;
68 +  const uint8_t* src_y_b = test_frame;
69 +  const uint8_t* src_u_b = src_y_b + width * height;
70 +  const uint8_t* src_v_b = src_u_b + half_width * half_height;
71  
72    int stride_y = width;
73    int stride_uv = half_width;
74 @@ -180,8 +180,8 @@
75    char line[STATS_LINE_LENGTH];
76  
77    // Allocate buffers for test and reference frames.
78 -  uint8* test_frame = new uint8[size];
79 -  uint8* reference_frame = new uint8[size];
80 +  uint8_t* test_frame = new uint8_t[size];
81 +  uint8_t* reference_frame = new uint8_t[size];
82    int previous_frame_number = -1;
83  
84    // While there are entries in the stats file.
85 --- webrtc-20121218svn2718/src/tools/psnr_ssim_analyzer/psnr_ssim_analyzer.cc.orig      2012-08-27 16:57:19.000000000 +0200
86 +++ webrtc-20121218svn2718/src/tools/psnr_ssim_analyzer/psnr_ssim_analyzer.cc   2021-06-29 05:46:46.874665370 +0200
87 @@ -26,8 +26,8 @@
88    int size = webrtc::test::GetI420FrameSize(width, height);
89  
90    // Allocate buffers for test and reference frames.
91 -  uint8* test_frame = new uint8[size];
92 -  uint8* ref_frame = new uint8[size];
93 +  uint8_t* test_frame = new uint8_t[size];
94 +  uint8_t* ref_frame = new uint8_t[size];
95  
96    int frame_counter = 0;
97  
98 --- webrtc-20121218svn2718/src/tools/converter/converter.h.orig 2012-08-22 10:12:00.000000000 +0200
99 +++ webrtc-20121218svn2718/src/tools/converter/converter.h      2021-06-29 05:53:42.735745790 +0200
100 @@ -75,13 +75,13 @@
101  
102    // Writes the Y, U and V (in this order) planes to the file, thus adding a
103    // raw YUV frame to the file.
104 -  bool AddYUVToFile(uint8* y_plane, int y_plane_size,
105 -                    uint8* u_plane, int u_plane_size,
106 -                    uint8* v_plane, int v_plane_size,
107 +  bool AddYUVToFile(uint8_t* y_plane, int y_plane_size,
108 +                    uint8_t* u_plane, int u_plane_size,
109 +                    uint8_t* v_plane, int v_plane_size,
110                      FILE* output_file);
111  
112    // Adds the Y, U or V plane to the file.
113 -  bool AddYUVPlaneToFile(uint8* yuv_plane, int yuv_plane_size, FILE* file);
114 +  bool AddYUVPlaneToFile(uint8_t* yuv_plane, int yuv_plane_size, FILE* file);
115  
116    // Reads a RGBA frame from input_file_name with input_frame_size size in bytes
117    // into the buffer.
118 --- webrtc-20121218svn2718/src/tools/converter/converter.cc.orig        2012-08-22 10:12:00.000000000 +0200
119 +++ webrtc-20121218svn2718/src/tools/converter/converter.cc     2021-06-29 05:56:59.084682076 +0200
120 @@ -45,13 +45,13 @@
121    }
122  
123    int input_frame_size = InputFrameSize();
124 -  uint8* rgba_buffer = new uint8[input_frame_size];
125 +  uint8_t* rgba_buffer = new uint8_t[input_frame_size];
126    int y_plane_size = YPlaneSize();
127 -  uint8* dst_y = new uint8[y_plane_size];
128 +  uint8_t* dst_y = new uint8_t[y_plane_size];
129    int u_plane_size = UPlaneSize();
130 -  uint8* dst_u = new uint8[u_plane_size];
131 +  uint8_t* dst_u = new uint8_t[u_plane_size];
132    int v_plane_size = VPlaneSize();
133 -  uint8* dst_v = new uint8[v_plane_size];
134 +  uint8_t* dst_v = new uint8_t[v_plane_size];
135  
136    int counter = 0;  // Counter to form frame names.
137    bool success = false;  // Is conversion successful.
138 @@ -106,9 +106,9 @@
139    return success;
140  }
141  
142 -bool Converter::AddYUVToFile(uint8* y_plane, int y_plane_size,
143 -                             uint8* u_plane, int u_plane_size,
144 -                             uint8* v_plane, int v_plane_size,
145 +bool Converter::AddYUVToFile(uint8_t* y_plane, int y_plane_size,
146 +                             uint8_t* u_plane, int u_plane_size,
147 +                             uint8_t* v_plane, int v_plane_size,
148                               FILE* output_file) {
149    bool success = AddYUVPlaneToFile(y_plane, y_plane_size, output_file) &&
150                   AddYUVPlaneToFile(u_plane, u_plane_size, output_file) &&
151 @@ -116,7 +116,7 @@
152    return success;
153  }
154  
155 -bool Converter::AddYUVPlaneToFile(uint8* yuv_plane, int yuv_plane_size,
156 +bool Converter::AddYUVPlaneToFile(uint8_t* yuv_plane, int yuv_plane_size,
157                                    FILE* file) {
158    size_t bytes_written = fwrite(yuv_plane, 1, yuv_plane_size, file);
159  
This page took 0.304882 seconds and 3 git commands to generate.