| 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 2707 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2718 TEST_P(ChunkDemuxerTest, IsParsingMediaSegmentMidMediaSegment) { | 2718 TEST_P(ChunkDemuxerTest, IsParsingMediaSegmentMidMediaSegment) { |
| 2719 ASSERT_TRUE(InitDemuxer(HAS_AUDIO | HAS_VIDEO)); | 2719 ASSERT_TRUE(InitDemuxer(HAS_AUDIO | HAS_VIDEO)); |
| 2720 | 2720 |
| 2721 scoped_ptr<Cluster> cluster = GenerateCluster(0, 2); | 2721 scoped_ptr<Cluster> cluster = GenerateCluster(0, 2); |
| 2722 // Append only part of the cluster data. | 2722 // Append only part of the cluster data. |
| 2723 AppendData(cluster->data(), cluster->size() - 13); | 2723 AppendData(cluster->data(), cluster->size() - 13); |
| 2724 | 2724 |
| 2725 // Confirm we're in the middle of parsing a media segment. | 2725 // Confirm we're in the middle of parsing a media segment. |
| 2726 ASSERT_TRUE(demuxer_->IsParsingMediaSegment(kSourceId)); | 2726 ASSERT_TRUE(demuxer_->IsParsingMediaSegment(kSourceId)); |
| 2727 | 2727 |
| 2728 demuxer_->Abort(kSourceId); | 2728 demuxer_->Abort(kSourceId, timestamp_offset_map_[kSourceId]); |
| 2729 // After Abort(), parsing should no longer be in the middle of a media | 2729 // After Abort(), parsing should no longer be in the middle of a media |
| 2730 // segment. | 2730 // segment. |
| 2731 ASSERT_FALSE(demuxer_->IsParsingMediaSegment(kSourceId)); | 2731 ASSERT_FALSE(demuxer_->IsParsingMediaSegment(kSourceId)); |
| 2732 } | 2732 } |
| 2733 | 2733 |
| 2734 TEST_P(ChunkDemuxerTest, WebMIsParsingMediaSegmentDetection) { | 2734 TEST_P(ChunkDemuxerTest, WebMIsParsingMediaSegmentDetection) { |
| 2735 // TODO(wolenetz): Also test 'unknown' sized clusters. | 2735 // TODO(wolenetz): Also test 'unknown' sized clusters. |
| 2736 // See http://crbug.com/335676. | 2736 // See http://crbug.com/335676. |
| 2737 const uint8 kBuffer[] = { | 2737 const uint8 kBuffer[] = { |
| 2738 0x1F, 0x43, 0xB6, 0x75, 0x83, // CLUSTER (size = 3) | 2738 0x1F, 0x43, 0xB6, 0x75, 0x83, // CLUSTER (size = 3) |
| (...skipping 474 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3213 // Verify that audio & video streams continue to return expected values. | 3213 // Verify that audio & video streams continue to return expected values. |
| 3214 CheckExpectedBuffers(audio_stream, "160 180"); | 3214 CheckExpectedBuffers(audio_stream, "160 180"); |
| 3215 CheckExpectedBuffers(video_stream, "180 210"); | 3215 CheckExpectedBuffers(video_stream, "180 210"); |
| 3216 } | 3216 } |
| 3217 | 3217 |
| 3218 // TODO(wolenetz): Enable testing of new frame processor based on this flag, | 3218 // TODO(wolenetz): Enable testing of new frame processor based on this flag, |
| 3219 // once the new processor has landed. See http://crbug.com/249422. | 3219 // once the new processor has landed. See http://crbug.com/249422. |
| 3220 INSTANTIATE_TEST_CASE_P(LegacyFrameProcessor, ChunkDemuxerTest, Values(true)); | 3220 INSTANTIATE_TEST_CASE_P(LegacyFrameProcessor, ChunkDemuxerTest, Values(true)); |
| 3221 | 3221 |
| 3222 } // namespace media | 3222 } // namespace media |
| OLD | NEW |