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 "media/cast/sender/audio_encoder.h" | 5 #include "media/cast/sender/audio_encoder.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 EXPECT_LE(rtp_lower_bound_, encoded_frame->rtp_timestamp); | 58 EXPECT_LE(rtp_lower_bound_, encoded_frame->rtp_timestamp); |
59 rtp_lower_bound_ = encoded_frame->rtp_timestamp; | 59 rtp_lower_bound_ = encoded_frame->rtp_timestamp; |
60 EXPECT_EQ(RtpTimeDelta(), (encoded_frame->rtp_timestamp - RtpTimeTicks()) % | 60 EXPECT_EQ(RtpTimeDelta(), (encoded_frame->rtp_timestamp - RtpTimeTicks()) % |
61 RtpTimeDelta::FromTicks(samples_per_frame_)); | 61 RtpTimeDelta::FromTicks(samples_per_frame_)); |
62 EXPECT_TRUE(!encoded_frame->data.empty()); | 62 EXPECT_TRUE(!encoded_frame->data.empty()); |
63 | 63 |
64 EXPECT_LE(lower_bound_, encoded_frame->reference_time); | 64 EXPECT_LE(lower_bound_, encoded_frame->reference_time); |
65 lower_bound_ = encoded_frame->reference_time; | 65 lower_bound_ = encoded_frame->reference_time; |
66 EXPECT_GT(upper_bound_, encoded_frame->reference_time); | 66 EXPECT_GT(upper_bound_, encoded_frame->reference_time); |
67 | 67 |
68 EXPECT_LE(0.0, encoded_frame->deadline_utilization); | 68 EXPECT_LE(0.0, encoded_frame->encoder_utilization); |
69 EXPECT_EQ(-1.0, encoded_frame->lossy_utilization); | 69 EXPECT_EQ(-1.0, encoded_frame->lossy_utilization); |
70 | 70 |
71 ++frames_received_; | 71 ++frames_received_; |
72 } | 72 } |
73 | 73 |
74 private: | 74 private: |
75 int frames_received_; | 75 int frames_received_; |
76 RtpTimeTicks rtp_lower_bound_; | 76 RtpTimeTicks rtp_lower_bound_; |
77 int samples_per_frame_; | 77 int samples_per_frame_; |
78 base::TimeTicks lower_bound_; | 78 base::TimeTicks lower_bound_; |
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
247 TestScenario(kManyCalls_Mixed2, arraysize(kManyCalls_Mixed2)), | 247 TestScenario(kManyCalls_Mixed2, arraysize(kManyCalls_Mixed2)), |
248 TestScenario(kManyCalls_Mixed3, arraysize(kManyCalls_Mixed3)), | 248 TestScenario(kManyCalls_Mixed3, arraysize(kManyCalls_Mixed3)), |
249 TestScenario(kManyCalls_Mixed4, arraysize(kManyCalls_Mixed4)), | 249 TestScenario(kManyCalls_Mixed4, arraysize(kManyCalls_Mixed4)), |
250 TestScenario(kManyCalls_Mixed5, arraysize(kManyCalls_Mixed5)), | 250 TestScenario(kManyCalls_Mixed5, arraysize(kManyCalls_Mixed5)), |
251 TestScenario(kOneBigUnderrun, arraysize(kOneBigUnderrun)), | 251 TestScenario(kOneBigUnderrun, arraysize(kOneBigUnderrun)), |
252 TestScenario(kTwoBigUnderruns, arraysize(kTwoBigUnderruns)), | 252 TestScenario(kTwoBigUnderruns, arraysize(kTwoBigUnderruns)), |
253 TestScenario(kMixedUnderruns, arraysize(kMixedUnderruns)))); | 253 TestScenario(kMixedUnderruns, arraysize(kMixedUnderruns)))); |
254 | 254 |
255 } // namespace cast | 255 } // namespace cast |
256 } // namespace media | 256 } // namespace media |
OLD | NEW |