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 #ifndef MEDIA_FORMATS_COMMON_STREAM_PARSER_TEST_BASE_H_ | 5 #ifndef MEDIA_FORMATS_COMMON_STREAM_PARSER_TEST_BASE_H_ |
6 #define MEDIA_FORMATS_COMMON_STREAM_PARSER_TEST_BASE_H_ | 6 #define MEDIA_FORMATS_COMMON_STREAM_PARSER_TEST_BASE_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 #include <stdint.h> | 9 #include <stdint.h> |
10 | 10 |
11 #include <memory> | 11 #include <memory> |
12 | 12 |
13 #include "base/macros.h" | 13 #include "base/macros.h" |
14 #include "media/base/audio_decoder_config.h" | 14 #include "media/base/audio_decoder_config.h" |
| 15 #include "media/base/media_log.h" |
15 #include "media/base/stream_parser.h" | 16 #include "media/base/stream_parser.h" |
16 #include "media/base/stream_parser_buffer.h" | 17 #include "media/base/stream_parser_buffer.h" |
17 #include "media/base/text_track_config.h" | 18 #include "media/base/text_track_config.h" |
18 #include "media/base/video_decoder_config.h" | 19 #include "media/base/video_decoder_config.h" |
19 | 20 |
20 namespace media { | 21 namespace media { |
21 | 22 |
22 // Test helper for verifying StreamParser behavior. | 23 // Test helper for verifying StreamParser behavior. |
23 class StreamParserTestBase { | 24 class StreamParserTestBase { |
24 public: | 25 public: |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 size_t length, | 59 size_t length, |
59 size_t piece_size); | 60 size_t piece_size); |
60 void OnInitDone(const StreamParser::InitParameters& params); | 61 void OnInitDone(const StreamParser::InitParameters& params); |
61 bool OnNewConfig(std::unique_ptr<MediaTracks> tracks, | 62 bool OnNewConfig(std::unique_ptr<MediaTracks> tracks, |
62 const StreamParser::TextTrackConfigMap& text_config); | 63 const StreamParser::TextTrackConfigMap& text_config); |
63 bool OnNewBuffers(const StreamParser::BufferQueueMap& buffer_queue_map); | 64 bool OnNewBuffers(const StreamParser::BufferQueueMap& buffer_queue_map); |
64 void OnKeyNeeded(EmeInitDataType type, const std::vector<uint8_t>& init_data); | 65 void OnKeyNeeded(EmeInitDataType type, const std::vector<uint8_t>& init_data); |
65 void OnNewSegment(); | 66 void OnNewSegment(); |
66 void OnEndOfSegment(); | 67 void OnEndOfSegment(); |
67 | 68 |
| 69 MediaLog media_log_; |
68 std::unique_ptr<StreamParser> parser_; | 70 std::unique_ptr<StreamParser> parser_; |
69 std::stringstream results_stream_; | 71 std::stringstream results_stream_; |
70 AudioDecoderConfig last_audio_config_; | 72 AudioDecoderConfig last_audio_config_; |
71 StreamParser::TrackId audio_track_id_; | 73 StreamParser::TrackId audio_track_id_; |
72 | 74 |
73 DISALLOW_COPY_AND_ASSIGN(StreamParserTestBase); | 75 DISALLOW_COPY_AND_ASSIGN(StreamParserTestBase); |
74 }; | 76 }; |
75 | 77 |
76 } // namespace media | 78 } // namespace media |
77 | 79 |
78 #endif // MEDIA_FORMATS_COMMON_STREAM_PARSER_TEST_BASE_H_ | 80 #endif // MEDIA_FORMATS_COMMON_STREAM_PARSER_TEST_BASE_H_ |
OLD | NEW |