OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2010 Google Inc. All rights reserved. | 2 * Copyright (C) 2010 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * | 7 * |
8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
(...skipping 25 matching lines...) Expand all Loading... |
36 | 36 |
37 // Abstract interface to the Chromium audio system. | 37 // Abstract interface to the Chromium audio system. |
38 class WebAudioDevice { | 38 class WebAudioDevice { |
39 public: | 39 public: |
40 class BLINK_PLATFORM_EXPORT RenderCallback { | 40 class BLINK_PLATFORM_EXPORT RenderCallback { |
41 public: | 41 public: |
42 // Note: |delay| and |delayTimestamp| arguments are high-precision | 42 // Note: |delay| and |delayTimestamp| arguments are high-precision |
43 // measurements of the state of the system in the recent past. To be clear, | 43 // measurements of the state of the system in the recent past. To be clear, |
44 // |delay| does *not* represent the point-in-time at which the first | 44 // |delay| does *not* represent the point-in-time at which the first |
45 // rendered sample will be played out. | 45 // rendered sample will be played out. |
46 virtual void render(const WebVector<float*>& sourceData, | 46 virtual void render(const WebVector<float*>& destinationData, |
47 const WebVector<float*>& destinationData, | |
48 size_t numberOfFrames, | 47 size_t numberOfFrames, |
49 double delay, // Output delay in seconds. | 48 double delay, // Output delay in seconds. |
50 double delayTimestamp, // System timestamp in seconds | 49 double delayTimestamp, // System timestamp in seconds |
51 // when |delay| was obtained. | 50 // when |delay| was obtained. |
52 size_t priorFramesSkipped); | 51 size_t priorFramesSkipped); |
53 | 52 |
54 protected: | 53 protected: |
55 virtual ~RenderCallback(); | 54 virtual ~RenderCallback(); |
56 }; | 55 }; |
57 | 56 |
58 virtual ~WebAudioDevice() {} | 57 virtual ~WebAudioDevice() {} |
59 | 58 |
60 virtual void start() = 0; | 59 virtual void start() = 0; |
61 virtual void stop() = 0; | 60 virtual void stop() = 0; |
62 virtual double sampleRate() = 0; | 61 virtual double sampleRate() = 0; |
63 }; | 62 }; |
64 | 63 |
65 } // namespace blink | 64 } // namespace blink |
66 | 65 |
67 #endif // WebAudioDevice_h | 66 #endif // WebAudioDevice_h |
OLD | NEW |