| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include <stdlib.h> | 5 #include <stdlib.h> |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <iostream> | 8 #include <iostream> |
| 9 #include <ostream> | 9 #include <ostream> |
| 10 #include <set> | 10 #include <set> |
| (...skipping 805 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 816 generator->GenerateBytes(p->name, sizeof(p->name)); | 816 generator->GenerateBytes(p->name, sizeof(p->name)); |
| 817 return true; | 817 return true; |
| 818 } | 818 } |
| 819 }; | 819 }; |
| 820 | 820 |
| 821 template <> | 821 template <> |
| 822 struct GenerateTraits<media::AudioParameters> { | 822 struct GenerateTraits<media::AudioParameters> { |
| 823 static bool Generate(media::AudioParameters *p, Generator* generator) { | 823 static bool Generate(media::AudioParameters *p, Generator* generator) { |
| 824 int format; | 824 int format; |
| 825 int channel_layout; | 825 int channel_layout; |
| 826 int channels; | |
| 827 int input_channels; | |
| 828 int sample_rate; | 826 int sample_rate; |
| 829 int bits_per_sample; | 827 int bits_per_sample; |
| 830 int frames_per_buffer; | 828 int frames_per_buffer; |
| 829 int channels; |
| 831 int effects; | 830 int effects; |
| 832 if (!GenerateParam(&format, generator)) | 831 if (!GenerateParam(&format, generator)) |
| 833 return false; | 832 return false; |
| 834 if (!GenerateParam(&channel_layout, generator)) | 833 if (!GenerateParam(&channel_layout, generator)) |
| 835 return false; | 834 return false; |
| 836 if (!GenerateParam(&channels, generator)) | |
| 837 return false; | |
| 838 if (!GenerateParam(&input_channels, generator)) | |
| 839 return false; | |
| 840 if (!GenerateParam(&sample_rate, generator)) | 835 if (!GenerateParam(&sample_rate, generator)) |
| 841 return false; | 836 return false; |
| 842 if (!GenerateParam(&bits_per_sample, generator)) | 837 if (!GenerateParam(&bits_per_sample, generator)) |
| 843 return false; | 838 return false; |
| 844 if (!GenerateParam(&frames_per_buffer, generator)) | 839 if (!GenerateParam(&frames_per_buffer, generator)) |
| 845 return false; | 840 return false; |
| 841 if (!GenerateParam(&channels, generator)) |
| 842 return false; |
| 846 if (!GenerateParam(&effects, generator)) | 843 if (!GenerateParam(&effects, generator)) |
| 847 return false; | 844 return false; |
| 848 media::AudioParameters params( | 845 media::AudioParameters params( |
| 849 static_cast<media::AudioParameters::Format>(format), | 846 static_cast<media::AudioParameters::Format>(format), |
| 850 static_cast<media::ChannelLayout>(channel_layout), | 847 static_cast<media::ChannelLayout>(channel_layout), |
| 851 channels, input_channels, sample_rate, | 848 channels, |
| 852 bits_per_sample, frames_per_buffer, effects); | 849 sample_rate, |
| 850 bits_per_sample, |
| 851 frames_per_buffer, |
| 852 effects); |
| 853 *p = params; | 853 *p = params; |
| 854 return true; | 854 return true; |
| 855 } | 855 } |
| 856 }; | 856 }; |
| 857 | 857 |
| 858 template <> | 858 template <> |
| 859 struct GenerateTraits<media::VideoCaptureFormat> { | 859 struct GenerateTraits<media::VideoCaptureFormat> { |
| 860 static bool Generate(media::VideoCaptureFormat *p, Generator* generator) { | 860 static bool Generate(media::VideoCaptureFormat *p, Generator* generator) { |
| 861 int frame_size_width; | 861 int frame_size_width; |
| 862 int frame_size_height; | 862 int frame_size_height; |
| (...skipping 472 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1335 return EXIT_FAILURE; | 1335 return EXIT_FAILURE; |
| 1336 | 1336 |
| 1337 return EXIT_SUCCESS; | 1337 return EXIT_SUCCESS; |
| 1338 } | 1338 } |
| 1339 | 1339 |
| 1340 } // namespace ipc_fuzzer | 1340 } // namespace ipc_fuzzer |
| 1341 | 1341 |
| 1342 int main(int argc, char** argv) { | 1342 int main(int argc, char** argv) { |
| 1343 return ipc_fuzzer::GenerateMain(argc, argv); | 1343 return ipc_fuzzer::GenerateMain(argc, argv); |
| 1344 } | 1344 } |
| OLD | NEW |