OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 <stdint.h> | 5 #include <stdint.h> |
6 | 6 |
7 #include <sstream> | 7 #include <sstream> |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 21 matching lines...) Expand all Loading... |
32 virtual ~TestEncodedAudioFrameReceiver() {} | 32 virtual ~TestEncodedAudioFrameReceiver() {} |
33 | 33 |
34 int frames_received() const { return frames_received_; } | 34 int frames_received() const { return frames_received_; } |
35 | 35 |
36 void SetCaptureTimeBounds(const base::TimeTicks& lower_bound, | 36 void SetCaptureTimeBounds(const base::TimeTicks& lower_bound, |
37 const base::TimeTicks& upper_bound) { | 37 const base::TimeTicks& upper_bound) { |
38 lower_bound_ = lower_bound; | 38 lower_bound_ = lower_bound; |
39 upper_bound_ = upper_bound; | 39 upper_bound_ = upper_bound; |
40 } | 40 } |
41 | 41 |
42 void FrameEncoded(scoped_ptr<EncodedFrame> encoded_frame) { | 42 void FrameEncoded(scoped_ptr<EncodedFrame> encoded_frame, |
| 43 int samples_skipped) { |
43 EXPECT_EQ(encoded_frame->dependency, EncodedFrame::KEY); | 44 EXPECT_EQ(encoded_frame->dependency, EncodedFrame::KEY); |
44 EXPECT_EQ(static_cast<uint8>(frames_received_ & 0xff), | 45 EXPECT_EQ(static_cast<uint8>(frames_received_ & 0xff), |
45 encoded_frame->frame_id); | 46 encoded_frame->frame_id); |
46 EXPECT_EQ(encoded_frame->frame_id, encoded_frame->referenced_frame_id); | 47 EXPECT_EQ(encoded_frame->frame_id, encoded_frame->referenced_frame_id); |
47 // RTP timestamps should be monotonically increasing and integer multiples | 48 // RTP timestamps should be monotonically increasing and integer multiples |
48 // of the fixed frame size. | 49 // of the fixed frame size. |
49 EXPECT_LE(rtp_lower_bound_, encoded_frame->rtp_timestamp); | 50 EXPECT_LE(rtp_lower_bound_, encoded_frame->rtp_timestamp); |
50 rtp_lower_bound_ = encoded_frame->rtp_timestamp; | 51 rtp_lower_bound_ = encoded_frame->rtp_timestamp; |
51 // Note: In audio_encoder.cc, 100 is the fixed audio frame rate. | 52 // Note: In audio_encoder.cc, 100 is the fixed audio frame rate. |
52 const int kSamplesPerFrame = kDefaultAudioSamplingRate / 100; | 53 const int kSamplesPerFrame = kDefaultAudioSamplingRate / 100; |
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
232 TestScenario(kManyCalls_Mixed2, arraysize(kManyCalls_Mixed2)), | 233 TestScenario(kManyCalls_Mixed2, arraysize(kManyCalls_Mixed2)), |
233 TestScenario(kManyCalls_Mixed3, arraysize(kManyCalls_Mixed3)), | 234 TestScenario(kManyCalls_Mixed3, arraysize(kManyCalls_Mixed3)), |
234 TestScenario(kManyCalls_Mixed4, arraysize(kManyCalls_Mixed4)), | 235 TestScenario(kManyCalls_Mixed4, arraysize(kManyCalls_Mixed4)), |
235 TestScenario(kManyCalls_Mixed5, arraysize(kManyCalls_Mixed5)), | 236 TestScenario(kManyCalls_Mixed5, arraysize(kManyCalls_Mixed5)), |
236 TestScenario(kOneBigUnderrun, arraysize(kOneBigUnderrun)), | 237 TestScenario(kOneBigUnderrun, arraysize(kOneBigUnderrun)), |
237 TestScenario(kTwoBigUnderruns, arraysize(kTwoBigUnderruns)), | 238 TestScenario(kTwoBigUnderruns, arraysize(kTwoBigUnderruns)), |
238 TestScenario(kMixedUnderruns, arraysize(kMixedUnderruns)))); | 239 TestScenario(kMixedUnderruns, arraysize(kMixedUnderruns)))); |
239 | 240 |
240 } // namespace cast | 241 } // namespace cast |
241 } // namespace media | 242 } // namespace media |
OLD | NEW |