| 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 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 66 // error should be signalled. | 66 // error should be signalled. |
| 67 typedef base::Callback<bool(TextTrack*, const BufferQueue&)> NewTextBuffersCB; | 67 typedef base::Callback<bool(TextTrack*, const BufferQueue&)> NewTextBuffersCB; |
| 68 | 68 |
| 69 // Signals the beginning of a new media segment. | 69 // Signals the beginning of a new media segment. |
| 70 typedef base::Callback<void()> NewMediaSegmentCB; | 70 typedef base::Callback<void()> NewMediaSegmentCB; |
| 71 | 71 |
| 72 // A new potentially encrypted stream has been parsed. | 72 // A new potentially encrypted stream has been parsed. |
| 73 // First parameter - The type of the initialization data associated with the | 73 // First parameter - The type of the initialization data associated with the |
| 74 // stream. | 74 // stream. |
| 75 // Second parameter - The initialization data associated with the stream. | 75 // Second parameter - The initialization data associated with the stream. |
| 76 // Third parameter - Number of bytes of the initialization data. | |
| 77 typedef base::Callback<void(const std::string&, | 76 typedef base::Callback<void(const std::string&, |
| 78 scoped_ptr<uint8[]>, int)> NeedKeyCB; | 77 const std::vector<uint8>&)> NeedKeyCB; |
| 79 | 78 |
| 80 // Initialize the parser with necessary callbacks. Must be called before any | 79 // Initialize the parser with necessary callbacks. Must be called before any |
| 81 // data is passed to Parse(). |init_cb| will be called once enough data has | 80 // data is passed to Parse(). |init_cb| will be called once enough data has |
| 82 // been parsed to determine the initial stream configurations, presentation | 81 // been parsed to determine the initial stream configurations, presentation |
| 83 // start time, and duration. | 82 // start time, and duration. |
| 84 virtual void Init(const InitCB& init_cb, | 83 virtual void Init(const InitCB& init_cb, |
| 85 const NewConfigCB& config_cb, | 84 const NewConfigCB& config_cb, |
| 86 const NewBuffersCB& new_buffers_cb, | 85 const NewBuffersCB& new_buffers_cb, |
| 87 const NewTextBuffersCB& text_cb, | 86 const NewTextBuffersCB& text_cb, |
| 88 const NeedKeyCB& need_key_cb, | 87 const NeedKeyCB& need_key_cb, |
| (...skipping 12 matching lines...) Expand all Loading... |
| 101 // Returns true if the parse succeeds. | 100 // Returns true if the parse succeeds. |
| 102 virtual bool Parse(const uint8* buf, int size) = 0; | 101 virtual bool Parse(const uint8* buf, int size) = 0; |
| 103 | 102 |
| 104 private: | 103 private: |
| 105 DISALLOW_COPY_AND_ASSIGN(StreamParser); | 104 DISALLOW_COPY_AND_ASSIGN(StreamParser); |
| 106 }; | 105 }; |
| 107 | 106 |
| 108 } // namespace media | 107 } // namespace media |
| 109 | 108 |
| 110 #endif // MEDIA_BASE_STREAM_PARSER_H_ | 109 #endif // MEDIA_BASE_STREAM_PARSER_H_ |
| OLD | NEW |