Chromium Code Reviews| 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 <map> | 9 #include <map> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 42 | 42 |
| 43 // Map of text track ID to the track configuration. | 43 // Map of text track ID to the track configuration. |
| 44 typedef std::map<TrackId, TextTrackConfig> TextTrackConfigMap; | 44 typedef std::map<TrackId, TextTrackConfig> TextTrackConfigMap; |
| 45 | 45 |
| 46 // Map of text track ID to decode-timestamp-ordered buffers for the track. | 46 // Map of text track ID to decode-timestamp-ordered buffers for the track. |
| 47 typedef std::map<TrackId, const BufferQueue> TextBufferQueueMap; | 47 typedef std::map<TrackId, const BufferQueue> TextBufferQueueMap; |
| 48 | 48 |
| 49 StreamParser(); | 49 StreamParser(); |
| 50 virtual ~StreamParser(); | 50 virtual ~StreamParser(); |
| 51 | 51 |
| 52 // Indicates completion of parser initialization. | 52 // success - True if initialization was successful, false otherwise. |
| 53 // First parameter - Indicates initialization success. Set to true if | 53 // duration - Stream duration. Only valid if |success| is true; |
| 54 // initialization was successful. False if an error | 54 // timeline_offset - Indicates the source Time associated with |
| 55 // occurred. | 55 // presentation timestamp 0. A null Time is returned if |
| 56 // Second parameter - Indicates the stream duration. Only contains a valid | 56 // no mapping to Time exists. Only contains a |
| 57 // value if the first parameter is true. | 57 // valid value if |success| is true. |
| 58 // Third parameter - Indicates the Time associated with | 58 // auto_update_timestamp_offset - |
| 59 // presentation timestamp 0 if such a mapping exists in | 59 // Indicates that timestampOffset should be updated based on the earliest |
| 60 // the bytestream. If no mapping exists this parameter | 60 // end timestamp (audio or video) provided during each NewBuffersCB. |
| 61 // contains null Time object. Only contains a valid | 61 // live_mode - True when the stream is a live stream. |
| 62 // value if the first parameter is true. | 62 typedef base::Callback<void(bool success, |
| 63 // Fourth parameters - Indicates that timestampOffset should be updated based | 63 base::TimeDelta duration, |
| 64 // on the earliest end timestamp (audio or video) provided | 64 base::Time timeline_offset, |
| 65 // during each NewBuffersCB. | 65 bool auto_update_timestamp_offset, |
| 66 typedef base::Callback<void(bool, base::TimeDelta, base::Time, bool)> InitCB; | 66 bool live_mode)> InitCB; |
|
Sergey Ulanov
2014/04/24 02:55:14
IMO it's better to add a struct (e.g. StreamParame
acolwell GONE FROM CHROMIUM
2014/04/24 16:59:36
Yeah. We should probably have a struct at this poi
| |
| 67 | 67 |
| 68 // Indicates when new stream configurations have been parsed. | 68 // Indicates when new stream configurations have been parsed. |
| 69 // First parameter - The new audio configuration. If the config is not valid | 69 // First parameter - The new audio configuration. If the config is not valid |
| 70 // then it means that there isn't an audio stream. | 70 // then it means that there isn't an audio stream. |
| 71 // Second parameter - The new video configuration. If the config is not valid | 71 // Second parameter - The new video configuration. If the config is not valid |
| 72 // then it means that there isn't an audio stream. | 72 // then it means that there isn't an audio stream. |
| 73 // Third parameter - The new text tracks configuration. If the map is empty, | 73 // Third parameter - The new text tracks configuration. If the map is empty, |
| 74 // then no text tracks were parsed from the stream. | 74 // then no text tracks were parsed from the stream. |
| 75 // Return value - True if the new configurations are accepted. | 75 // Return value - True if the new configurations are accepted. |
| 76 // False if the new configurations are not supported | 76 // False if the new configurations are not supported |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 144 // subtle issues with tie-breaking. See http://crbug.com/338484. | 144 // subtle issues with tie-breaking. See http://crbug.com/338484. |
| 145 MEDIA_EXPORT bool MergeBufferQueues( | 145 MEDIA_EXPORT bool MergeBufferQueues( |
| 146 const StreamParser::BufferQueue& audio_buffers, | 146 const StreamParser::BufferQueue& audio_buffers, |
| 147 const StreamParser::BufferQueue& video_buffers, | 147 const StreamParser::BufferQueue& video_buffers, |
| 148 const StreamParser::TextBufferQueueMap& text_buffers, | 148 const StreamParser::TextBufferQueueMap& text_buffers, |
| 149 StreamParser::BufferQueue* merged_buffers); | 149 StreamParser::BufferQueue* merged_buffers); |
| 150 | 150 |
| 151 } // namespace media | 151 } // namespace media |
| 152 | 152 |
| 153 #endif // MEDIA_BASE_STREAM_PARSER_H_ | 153 #endif // MEDIA_BASE_STREAM_PARSER_H_ |
| OLD | NEW |