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 <stddef.h> | 5 #include <stddef.h> |
6 #include <stdint.h> | 6 #include <stdint.h> |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 class FrameProcessorTest : public testing::TestWithParam<bool> { | 61 class FrameProcessorTest : public testing::TestWithParam<bool> { |
62 protected: | 62 protected: |
63 FrameProcessorTest() | 63 FrameProcessorTest() |
64 : frame_processor_(new FrameProcessor( | 64 : frame_processor_(new FrameProcessor( |
65 base::Bind( | 65 base::Bind( |
66 &FrameProcessorTestCallbackHelper::OnPossibleDurationIncrease, | 66 &FrameProcessorTestCallbackHelper::OnPossibleDurationIncrease, |
67 base::Unretained(&callbacks_)), | 67 base::Unretained(&callbacks_)), |
68 new MediaLog())), | 68 new MediaLog())), |
69 append_window_end_(kInfiniteDuration), | 69 append_window_end_(kInfiniteDuration), |
70 frame_duration_(base::TimeDelta::FromMilliseconds(10)), | 70 frame_duration_(base::TimeDelta::FromMilliseconds(10)), |
71 audio_id_(FrameProcessor::kAudioTrackId), | 71 audio_id_(1), |
72 video_id_(FrameProcessor::kVideoTrackId) {} | 72 video_id_(2) {} |
73 | 73 |
74 enum StreamFlags { | 74 enum StreamFlags { |
75 HAS_AUDIO = 1 << 0, | 75 HAS_AUDIO = 1 << 0, |
76 HAS_VIDEO = 1 << 1 | 76 HAS_VIDEO = 1 << 1 |
77 }; | 77 }; |
78 | 78 |
79 void AddTestTracks(int stream_flags) { | 79 void AddTestTracks(int stream_flags) { |
80 const bool has_audio = (stream_flags & HAS_AUDIO) != 0; | 80 const bool has_audio = (stream_flags & HAS_AUDIO) != 0; |
81 const bool has_video = (stream_flags & HAS_VIDEO) != 0; | 81 const bool has_video = (stream_flags & HAS_VIDEO) != 0; |
82 ASSERT_TRUE(has_audio || has_video); | 82 ASSERT_TRUE(has_audio || has_video); |
(...skipping 816 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
899 StreamParserBuffer* last_read_parser_buffer = | 899 StreamParserBuffer* last_read_parser_buffer = |
900 static_cast<StreamParserBuffer*>(last_read_buffer_.get()); | 900 static_cast<StreamParserBuffer*>(last_read_buffer_.get()); |
901 ASSERT_EQ(base::TimeDelta::FromMilliseconds(0), | 901 ASSERT_EQ(base::TimeDelta::FromMilliseconds(0), |
902 last_read_parser_buffer->preroll_buffer()->duration()); | 902 last_read_parser_buffer->preroll_buffer()->duration()); |
903 } | 903 } |
904 | 904 |
905 INSTANTIATE_TEST_CASE_P(SequenceMode, FrameProcessorTest, Values(true)); | 905 INSTANTIATE_TEST_CASE_P(SequenceMode, FrameProcessorTest, Values(true)); |
906 INSTANTIATE_TEST_CASE_P(SegmentsMode, FrameProcessorTest, Values(false)); | 906 INSTANTIATE_TEST_CASE_P(SegmentsMode, FrameProcessorTest, Values(false)); |
907 | 907 |
908 } // namespace media | 908 } // namespace media |
OLD | NEW |