Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(459)

Side by Side Diff: media/base/audio_splicer.h

Issue 1229123002: Log audio splice sanitizer warnings and errors to media-internals (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address xhwang@'s comments and fix the unit test Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | media/base/audio_splicer.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 #ifndef MEDIA_BASE_AUDIO_SPLICER_H_ 5 #ifndef MEDIA_BASE_AUDIO_SPLICER_H_
6 #define MEDIA_BASE_AUDIO_SPLICER_H_ 6 #define MEDIA_BASE_AUDIO_SPLICER_H_
7 7
8 #include "base/memory/ref_counted.h" 8 #include "base/memory/ref_counted.h"
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "base/time/time.h" 10 #include "base/time/time.h"
11 #include "media/audio/audio_parameters.h" 11 #include "media/audio/audio_parameters.h"
12 #include "media/base/buffers.h" 12 #include "media/base/buffers.h"
13 #include "media/base/media_export.h" 13 #include "media/base/media_export.h"
14 14
15 namespace media { 15 namespace media {
16 16
17 class AudioBuffer; 17 class AudioBuffer;
18 class AudioBus; 18 class AudioBus;
19 class AudioStreamSanitizer; 19 class AudioStreamSanitizer;
20 class MediaLog;
20 21
21 // Helper class that handles filling gaps and resolving overlaps. 22 // Helper class that handles filling gaps and resolving overlaps.
22 class MEDIA_EXPORT AudioSplicer { 23 class MEDIA_EXPORT AudioSplicer {
23 public: 24 public:
24 explicit AudioSplicer(int samples_per_second); 25 AudioSplicer(int samples_per_second,
26 const scoped_refptr<MediaLog>& media_log);
25 ~AudioSplicer(); 27 ~AudioSplicer();
26 28
27 enum { 29 enum {
28 // The number of ms to crossfade before trimming when buffers overlap. 30 // The number of ms to crossfade before trimming when buffers overlap.
29 kCrossfadeDurationInMilliseconds = 5, 31 kCrossfadeDurationInMilliseconds = 5,
30 32
31 // Largest gap or overlap allowed between buffers. Anything larger than 33 // Largest gap or overlap allowed between buffers. Anything larger than
32 // this will trigger an error. This is an arbitrary value, but the initial 34 // this will trigger an error. This is an arbitrary value, but the initial
33 // selection of 50ms roughly represents the duration of 2 compressed AAC or 35 // selection of 50ms roughly represents the duration of 2 compressed AAC or
34 // MP3 frames. 36 // MP3 frames.
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 // Whether all buffers which should go into |pre_splice_sanitizer_| have been 117 // Whether all buffers which should go into |pre_splice_sanitizer_| have been
116 // received. If true, buffers should now be put in |post_splice_sanitizer_|. 118 // received. If true, buffers should now be put in |post_splice_sanitizer_|.
117 bool have_all_pre_splice_buffers_; 119 bool have_all_pre_splice_buffers_;
118 120
119 DISALLOW_IMPLICIT_CONSTRUCTORS(AudioSplicer); 121 DISALLOW_IMPLICIT_CONSTRUCTORS(AudioSplicer);
120 }; 122 };
121 123
122 } // namespace media 124 } // namespace media
123 125
124 #endif 126 #endif
OLDNEW
« no previous file with comments | « no previous file | media/base/audio_splicer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698