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 #ifndef MEDIA_BASE_STREAM_PARSER_H_ | 5 #ifndef MEDIA_BASE_STREAM_PARSER_H_ |
6 #define MEDIA_BASE_STREAM_PARSER_H_ | 6 #define MEDIA_BASE_STREAM_PARSER_H_ |
7 | 7 |
8 #include <deque> | 8 #include <deque> |
9 | 9 |
10 #include "base/callback_forward.h" | 10 #include "base/callback_forward.h" |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 // Called when a seek occurs. This flushes the current parser state | 79 // Called when a seek occurs. This flushes the current parser state |
80 // and puts the parser in a state where it can receive data for the new seek | 80 // and puts the parser in a state where it can receive data for the new seek |
81 // point. | 81 // point. |
82 virtual void Flush() = 0; | 82 virtual void Flush() = 0; |
83 | 83 |
84 // Called when there is new data to parse. | 84 // Called when there is new data to parse. |
85 // | 85 // |
86 // Returns true if the parse succeeds. | 86 // Returns true if the parse succeeds. |
87 virtual bool Parse(const uint8* buf, int size) = 0; | 87 virtual bool Parse(const uint8* buf, int size) = 0; |
88 | 88 |
| 89 // Gives the parser a time offset to apply to the buffers it parsers, |
| 90 // beginning at the next media segment. |
| 91 // First parameter - The time offset. |
| 92 virtual void SetTimestampOffset(base::TimeDelta offset) = 0; |
| 93 |
| 94 // Called to clear the offset set from a call SetTimestampOffset(). Does |
| 95 // nothing if SetTimestampOffset() was never called before. |
| 96 virtual void ClearTimestampOffset() = 0; |
| 97 |
89 private: | 98 private: |
90 DISALLOW_COPY_AND_ASSIGN(StreamParser); | 99 DISALLOW_COPY_AND_ASSIGN(StreamParser); |
91 }; | 100 }; |
92 | 101 |
93 } // namespace media | 102 } // namespace media |
94 | 103 |
95 #endif // MEDIA_BASE_STREAM_PARSER_H_ | 104 #endif // MEDIA_BASE_STREAM_PARSER_H_ |
OLD | NEW |