OLD | NEW |
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 #include <algorithm> | 5 #include <algorithm> |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/message_loop/message_loop.h" | 8 #include "base/message_loop/message_loop.h" |
9 #include "base/strings/string_number_conversions.h" | 9 #include "base/strings/string_number_conversions.h" |
10 #include "base/strings/string_split.h" | 10 #include "base/strings/string_split.h" |
(...skipping 558 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
569 | 569 |
570 for (size_t j = 0; j < track_blocks.size(); ++j) | 570 for (size_t j = 0; j < track_blocks.size(); ++j) |
571 block_queue.push(track_blocks[j]); | 571 block_queue.push(track_blocks[j]); |
572 } | 572 } |
573 | 573 |
574 AppendCluster(kSourceId, GenerateCluster(block_queue, false)); | 574 AppendCluster(kSourceId, GenerateCluster(block_queue, false)); |
575 } | 575 } |
576 | 576 |
577 void AppendData(const std::string& source_id, | 577 void AppendData(const std::string& source_id, |
578 const uint8* data, size_t length) { | 578 const uint8* data, size_t length) { |
579 EXPECT_CALL(host_, AddBufferedTimeRange(_, _)).Times(AnyNumber()); | 579 EXPECT_CALL(host_, OnBufferedTimeRangesChanged(_)).Times(AnyNumber()); |
580 | 580 |
581 demuxer_->AppendData(source_id, data, length, | 581 demuxer_->AppendData(source_id, data, length, |
582 append_window_start_for_next_append_, | 582 append_window_start_for_next_append_, |
583 append_window_end_for_next_append_, | 583 append_window_end_for_next_append_, |
584 ×tamp_offset_map_[source_id], | 584 ×tamp_offset_map_[source_id], |
585 init_segment_received_cb_); | 585 init_segment_received_cb_); |
586 } | 586 } |
587 | 587 |
588 void AppendDataInPieces(const uint8* data, size_t length) { | 588 void AppendDataInPieces(const uint8* data, size_t length) { |
589 AppendDataInPieces(data, length, 7); | 589 AppendDataInPieces(data, length, 7); |
(...skipping 3374 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3964 // audio size is 80 bytes, new data is 28 bytes, we need to remove just one 10 | 3964 // audio size is 80 bytes, new data is 28 bytes, we need to remove just one 10 |
3965 // byte block to stay under 100 bytes memory limit after append | 3965 // byte block to stay under 100 bytes memory limit after append |
3966 // 80 - 10 + 28 = 98). | 3966 // 80 - 10 + 28 = 98). |
3967 // For video stream 150 + 52 = 202. Video limit is 150 bytes. We need to | 3967 // For video stream 150 + 52 = 202. Video limit is 150 bytes. We need to |
3968 // remove at least 6 blocks to stay under limit. | 3968 // remove at least 6 blocks to stay under limit. |
3969 CheckExpectedBuffers(audio_stream, "40K 80K 120K 160K 200K 240K 280K"); | 3969 CheckExpectedBuffers(audio_stream, "40K 80K 120K 160K 200K 240K 280K"); |
3970 CheckExpectedBuffers(video_stream, "60K 70 80K 90 100K 110 120K 130 140K"); | 3970 CheckExpectedBuffers(video_stream, "60K 70 80K 90 100K 110 120K 130 140K"); |
3971 } | 3971 } |
3972 | 3972 |
3973 } // namespace media | 3973 } // namespace media |
OLD | NEW |