OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2011 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
119 , m_client(client) | 119 , m_client(client) |
120 { | 120 { |
121 } | 121 } |
122 | 122 |
123 void WebVTTParser::getNewCues(Vector<RefPtr<TextTrackCue> >& outputCues) | 123 void WebVTTParser::getNewCues(Vector<RefPtr<TextTrackCue> >& outputCues) |
124 { | 124 { |
125 outputCues = m_cuelist; | 125 outputCues = m_cuelist; |
126 m_cuelist.clear(); | 126 m_cuelist.clear(); |
127 } | 127 } |
128 | 128 |
129 void WebVTTParser::getNewRegions(Vector<RefPtr<TextTrackRegion> >& outputRegions
) | 129 void WebVTTParser::getNewRegions(Vector<RefPtr<VTTRegion> >& outputRegions) |
130 { | 130 { |
131 outputRegions = m_regionList; | 131 outputRegions = m_regionList; |
132 m_regionList.clear(); | 132 m_regionList.clear(); |
133 } | 133 } |
134 | 134 |
135 void WebVTTParser::parseBytes(const char* data, unsigned length) | 135 void WebVTTParser::parseBytes(const char* data, unsigned length) |
136 { | 136 { |
137 String textData = m_decoder->decode(data, length); | 137 String textData = m_decoder->decode(data, length); |
138 | 138 |
139 // 4.8.10.13.3 WHATWG WebVTT Parser algorithm. | 139 // 4.8.10.13.3 WHATWG WebVTT Parser algorithm. |
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
369 m_currentStartTime = 0; | 369 m_currentStartTime = 0; |
370 m_currentEndTime = 0; | 370 m_currentEndTime = 0; |
371 m_currentContent.clear(); | 371 m_currentContent.clear(); |
372 } | 372 } |
373 | 373 |
374 void WebVTTParser::createNewRegion() | 374 void WebVTTParser::createNewRegion() |
375 { | 375 { |
376 if (!m_currentHeaderValue.length()) | 376 if (!m_currentHeaderValue.length()) |
377 return; | 377 return; |
378 | 378 |
379 RefPtr<TextTrackRegion> region = TextTrackRegion::create(); | 379 RefPtr<VTTRegion> region = VTTRegion::create(); |
380 region->setRegionSettings(m_currentHeaderValue); | 380 region->setRegionSettings(m_currentHeaderValue); |
381 | 381 |
382 // 15.5.10 If the text track list of regions regions contains a region | 382 // 15.5.10 If the text track list of regions regions contains a region |
383 // with the same region identifier value as region, remove that region. | 383 // with the same region identifier value as region, remove that region. |
384 for (size_t i = 0; i < m_regionList.size(); ++i) | 384 for (size_t i = 0; i < m_regionList.size(); ++i) |
385 if (m_regionList[i]->id() == region->id()) { | 385 if (m_regionList[i]->id() == region->id()) { |
386 m_regionList.remove(i); | 386 m_regionList.remove(i); |
387 break; | 387 break; |
388 } | 388 } |
389 | 389 |
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
561 unsigned oldPosition = *position; | 561 unsigned oldPosition = *position; |
562 while (*position < data.length() && data[*position] != '\r' && data[*positio
n] != '\n') | 562 while (*position < data.length() && data[*position] != '\r' && data[*positio
n] != '\n') |
563 (*position)++; | 563 (*position)++; |
564 String line = data.substring(oldPosition, *position - oldPosition); | 564 String line = data.substring(oldPosition, *position - oldPosition); |
565 skipLineTerminator(data, position); | 565 skipLineTerminator(data, position); |
566 return line; | 566 return line; |
567 } | 567 } |
568 | 568 |
569 } | 569 } |
570 | 570 |
OLD | NEW |