| 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 "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
| 9 #include "media/base/audio_decoder_config.h" | 9 #include "media/base/audio_decoder_config.h" |
| 10 #include "media/base/stream_parser.h" | 10 #include "media/base/stream_parser.h" |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 // size |length|. | 43 // size |length|. |
| 44 std::string ParseData(const uint8* data, size_t length); | 44 std::string ParseData(const uint8* data, size_t length); |
| 45 | 45 |
| 46 // The last AudioDecoderConfig handed to OnNewConfig(). | 46 // The last AudioDecoderConfig handed to OnNewConfig(). |
| 47 const AudioDecoderConfig& last_audio_config() const { | 47 const AudioDecoderConfig& last_audio_config() const { |
| 48 return last_audio_config_; | 48 return last_audio_config_; |
| 49 } | 49 } |
| 50 | 50 |
| 51 private: | 51 private: |
| 52 bool AppendDataInPieces(const uint8* data, size_t length, size_t piece_size); | 52 bool AppendDataInPieces(const uint8* data, size_t length, size_t piece_size); |
| 53 void OnInitDone(bool success, | 53 void OnInitDone(bool success, const StreamParser::StreamParameters& params); |
| 54 base::TimeDelta duration, | |
| 55 base::Time wallclock_timeline_offset, | |
| 56 bool auto_update_timestamp_offset); | |
| 57 bool OnNewConfig(const AudioDecoderConfig& audio_config, | 54 bool OnNewConfig(const AudioDecoderConfig& audio_config, |
| 58 const VideoDecoderConfig& video_config, | 55 const VideoDecoderConfig& video_config, |
| 59 const StreamParser::TextTrackConfigMap& text_config); | 56 const StreamParser::TextTrackConfigMap& text_config); |
| 60 bool OnNewBuffers(const StreamParser::BufferQueue& audio_buffers, | 57 bool OnNewBuffers(const StreamParser::BufferQueue& audio_buffers, |
| 61 const StreamParser::BufferQueue& video_buffers, | 58 const StreamParser::BufferQueue& video_buffers, |
| 62 const StreamParser::TextBufferQueueMap& text_map); | 59 const StreamParser::TextBufferQueueMap& text_map); |
| 63 void OnKeyNeeded(const std::string& type, | 60 void OnKeyNeeded(const std::string& type, |
| 64 const std::vector<uint8>& init_data); | 61 const std::vector<uint8>& init_data); |
| 65 void OnNewSegment(); | 62 void OnNewSegment(); |
| 66 void OnEndOfSegment(); | 63 void OnEndOfSegment(); |
| 67 | 64 |
| 68 scoped_ptr<StreamParser> parser_; | 65 scoped_ptr<StreamParser> parser_; |
| 69 std::stringstream results_stream_; | 66 std::stringstream results_stream_; |
| 70 AudioDecoderConfig last_audio_config_; | 67 AudioDecoderConfig last_audio_config_; |
| 71 | 68 |
| 72 DISALLOW_COPY_AND_ASSIGN(StreamParserTestBase); | 69 DISALLOW_COPY_AND_ASSIGN(StreamParserTestBase); |
| 73 }; | 70 }; |
| 74 | 71 |
| 75 } // namespace media | 72 } // namespace media |
| 76 | 73 |
| 77 #endif // MEDIA_FORMATS_COMMON_STREAM_PARSER_TEST_BASE_H_ | 74 #endif // MEDIA_FORMATS_COMMON_STREAM_PARSER_TEST_BASE_H_ |
| OLD | NEW |