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 |
11 #ifndef WEBRTC_MODULES_AUDIO_PROCESSING_INCLUDE_AUDIO_PROCESSING_H_ | 11 #ifndef WEBRTC_MODULES_AUDIO_PROCESSING_INCLUDE_AUDIO_PROCESSING_H_ |
12 #define WEBRTC_MODULES_AUDIO_PROCESSING_INCLUDE_AUDIO_PROCESSING_H_ | 12 #define WEBRTC_MODULES_AUDIO_PROCESSING_INCLUDE_AUDIO_PROCESSING_H_ |
13 | 13 |
14 // MSVC++ requires this to be set before any other includes to get M_PI. | 14 // MSVC++ requires this to be set before any other includes to get M_PI. |
15 #define _USE_MATH_DEFINES | 15 #define _USE_MATH_DEFINES |
16 | 16 |
17 #include <math.h> | 17 #include <math.h> |
18 #include <stddef.h> // size_t | 18 #include <stddef.h> // size_t |
19 #include <stdio.h> // FILE | 19 #include <stdio.h> // FILE |
20 #include <vector> | 20 #include <vector> |
21 | 21 |
22 #include "webrtc/base/arraysize.h" | 22 #include "webrtc/base/arraysize.h" |
23 #include "webrtc/base/platform_file.h" | 23 #include "webrtc/base/platform_file.h" |
24 #include "webrtc/modules/audio_processing/beamformer/array_util.h" | 24 #include "webrtc/modules/audio_processing/beamformer/array_util.h" |
25 #include "webrtc/modules/audio_processing/include/config.h" | 25 #include "webrtc/modules/audio_processing/include/config.h" |
26 #include "webrtc/typedefs.h" | 26 #include "webrtc/typedefs.h" |
27 | 27 |
| 28 namespace rtc { |
| 29 class TaskQueue; |
| 30 } // namespace rtc |
| 31 |
28 namespace webrtc { | 32 namespace webrtc { |
29 | 33 |
30 struct AecCore; | 34 struct AecCore; |
31 | 35 |
32 class AudioFrame; | 36 class AudioFrame; |
33 | 37 |
34 class NonlinearBeamformer; | 38 class NonlinearBeamformer; |
35 | 39 |
36 class StreamConfig; | 40 class StreamConfig; |
37 class ProcessingConfig; | 41 class ProcessingConfig; |
(...skipping 411 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
449 | 453 |
450 // Starts recording debugging information to a file specified by |filename|, | 454 // Starts recording debugging information to a file specified by |filename|, |
451 // a NULL-terminated string. If there is an ongoing recording, the old file | 455 // a NULL-terminated string. If there is an ongoing recording, the old file |
452 // will be closed, and recording will continue in the newly specified file. | 456 // will be closed, and recording will continue in the newly specified file. |
453 // An already existing file will be overwritten without warning. A maximum | 457 // An already existing file will be overwritten without warning. A maximum |
454 // file size (in bytes) for the log can be specified. The logging is stopped | 458 // file size (in bytes) for the log can be specified. The logging is stopped |
455 // once the limit has been reached. If max_log_size_bytes is set to a value | 459 // once the limit has been reached. If max_log_size_bytes is set to a value |
456 // <= 0, no limit will be used. | 460 // <= 0, no limit will be used. |
457 static const size_t kMaxFilenameSize = 1024; | 461 static const size_t kMaxFilenameSize = 1024; |
458 virtual int StartDebugRecording(const char filename[kMaxFilenameSize], | 462 virtual int StartDebugRecording(const char filename[kMaxFilenameSize], |
459 int64_t max_log_size_bytes) = 0; | 463 int64_t max_log_size_bytes, |
| 464 rtc::TaskQueue* worker_queue) = 0; |
460 | 465 |
461 // Same as above but uses an existing file handle. Takes ownership | 466 // Same as above but uses an existing file handle. Takes ownership |
462 // of |handle| and closes it at StopDebugRecording(). | 467 // of |handle| and closes it at StopDebugRecording(). |
463 virtual int StartDebugRecording(FILE* handle, int64_t max_log_size_bytes) = 0; | 468 virtual int StartDebugRecording(FILE* handle, |
| 469 int64_t max_log_size_bytes, |
| 470 rtc::TaskQueue* worker_queue) = 0; |
464 | 471 |
465 // TODO(ivoc): Remove this function after Chrome stops using it. | 472 // TODO(ivoc): Remove this function after Chrome stops using it. |
466 virtual int StartDebugRecording(FILE* handle) = 0; | 473 virtual int StartDebugRecording(FILE* handle, |
| 474 rtc::TaskQueue* worker_queue) = 0; |
467 | 475 |
468 // Same as above but uses an existing PlatformFile handle. Takes ownership | 476 // Same as above but uses an existing PlatformFile handle. Takes ownership |
469 // of |handle| and closes it at StopDebugRecording(). | 477 // of |handle| and closes it at StopDebugRecording(). |
470 // TODO(xians): Make this interface pure virtual. | 478 // TODO(xians): Make this interface pure virtual. |
471 virtual int StartDebugRecordingForPlatformFile(rtc::PlatformFile handle) = 0; | 479 virtual int StartDebugRecordingForPlatformFile( |
| 480 rtc::PlatformFile handle, |
| 481 rtc::TaskQueue* worker_queue) = 0; |
472 | 482 |
473 // Stops recording debugging information, and closes the file. Recording | 483 // Stops recording debugging information, and closes the file. Recording |
474 // cannot be resumed in the same file (without overwriting it). | 484 // cannot be resumed in the same file (without overwriting it). |
475 virtual int StopDebugRecording() = 0; | 485 virtual int StopDebugRecording() = 0; |
476 | 486 |
477 // Use to send UMA histograms at end of a call. Note that all histogram | 487 // Use to send UMA histograms at end of a call. Note that all histogram |
478 // specific member variables are reset. | 488 // specific member variables are reset. |
479 virtual void UpdateHistogramsOnCallEnd() = 0; | 489 virtual void UpdateHistogramsOnCallEnd() = 0; |
480 | 490 |
481 // TODO(ivoc): Remove when the calling code no longer uses the old Statistics | 491 // TODO(ivoc): Remove when the calling code no longer uses the old Statistics |
(...skipping 589 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1071 // This does not impact the size of frames passed to |ProcessStream()|. | 1081 // This does not impact the size of frames passed to |ProcessStream()|. |
1072 virtual int set_frame_size_ms(int size) = 0; | 1082 virtual int set_frame_size_ms(int size) = 0; |
1073 virtual int frame_size_ms() const = 0; | 1083 virtual int frame_size_ms() const = 0; |
1074 | 1084 |
1075 protected: | 1085 protected: |
1076 virtual ~VoiceDetection() {} | 1086 virtual ~VoiceDetection() {} |
1077 }; | 1087 }; |
1078 } // namespace webrtc | 1088 } // namespace webrtc |
1079 | 1089 |
1080 #endif // WEBRTC_MODULES_AUDIO_PROCESSING_INCLUDE_AUDIO_PROCESSING_H_ | 1090 #endif // WEBRTC_MODULES_AUDIO_PROCESSING_INCLUDE_AUDIO_PROCESSING_H_ |
OLD | NEW |