| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 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 516 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 527 | 527 |
| 528 // 1. Run the segment parser loop algorithm. | 528 // 1. Run the segment parser loop algorithm. |
| 529 // Step 2 doesn't apply since we run Step 1 synchronously here. | 529 // Step 2 doesn't apply since we run Step 1 synchronously here. |
| 530 size_t appendSize = m_pendingAppendData.size(); | 530 size_t appendSize = m_pendingAppendData.size(); |
| 531 if (!appendSize) { | 531 if (!appendSize) { |
| 532 // Resize buffer for 0 byte appends so we always have a valid pointer. | 532 // Resize buffer for 0 byte appends so we always have a valid pointer. |
| 533 // We need to convey all appends, even 0 byte ones to |m_webSourceBuffer
| | 533 // We need to convey all appends, even 0 byte ones to |m_webSourceBuffer
| |
| 534 // so that it can clear its end of stream state if necessary. | 534 // so that it can clear its end of stream state if necessary. |
| 535 m_pendingAppendData.resize(1); | 535 m_pendingAppendData.resize(1); |
| 536 } | 536 } |
| 537 m_webSourceBuffer->append(m_pendingAppendData.data(), appendSize); | 537 m_webSourceBuffer->append(m_pendingAppendData.data(), appendSize, &m_timesta
mpOffset); |
| 538 | 538 |
| 539 // 3. Set the updating attribute to false. | 539 // 3. Set the updating attribute to false. |
| 540 m_updating = false; | 540 m_updating = false; |
| 541 m_pendingAppendData.clear(); | 541 m_pendingAppendData.clear(); |
| 542 | 542 |
| 543 // 4. Queue a task to fire a simple event named update at this SourceBuffer
object. | 543 // 4. Queue a task to fire a simple event named update at this SourceBuffer
object. |
| 544 scheduleEvent(EventTypeNames::update); | 544 scheduleEvent(EventTypeNames::update); |
| 545 | 545 |
| 546 // 5. Queue a task to fire a simple event named updateend at this SourceBuff
er object. | 546 // 5. Queue a task to fire a simple event named updateend at this SourceBuff
er object. |
| 547 scheduleEvent(EventTypeNames::updateend); | 547 scheduleEvent(EventTypeNames::updateend); |
| (...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 681 void SourceBuffer::didStartLoading() | 681 void SourceBuffer::didStartLoading() |
| 682 { | 682 { |
| 683 WTF_LOG(Media, "SourceBuffer::didStartLoading() %p", this); | 683 WTF_LOG(Media, "SourceBuffer::didStartLoading() %p", this); |
| 684 } | 684 } |
| 685 | 685 |
| 686 void SourceBuffer::didReceiveDataForClient(const char* data, unsigned dataLength
) | 686 void SourceBuffer::didReceiveDataForClient(const char* data, unsigned dataLength
) |
| 687 { | 687 { |
| 688 WTF_LOG(Media, "SourceBuffer::didReceiveDataForClient(%d) %p", dataLength, t
his); | 688 WTF_LOG(Media, "SourceBuffer::didReceiveDataForClient(%d) %p", dataLength, t
his); |
| 689 ASSERT(m_updating); | 689 ASSERT(m_updating); |
| 690 ASSERT(m_loader); | 690 ASSERT(m_loader); |
| 691 | 691 m_webSourceBuffer->append(reinterpret_cast<const unsigned char*>(data), data
Length, &m_timestampOffset); |
| 692 m_webSourceBuffer->append(reinterpret_cast<const unsigned char*>(data), data
Length); | |
| 693 } | 692 } |
| 694 | 693 |
| 695 void SourceBuffer::didFinishLoading() | 694 void SourceBuffer::didFinishLoading() |
| 696 { | 695 { |
| 697 WTF_LOG(Media, "SourceBuffer::didFinishLoading() %p", this); | 696 WTF_LOG(Media, "SourceBuffer::didFinishLoading() %p", this); |
| 698 appendStreamDone(true); | 697 appendStreamDone(true); |
| 699 } | 698 } |
| 700 | 699 |
| 701 void SourceBuffer::didFail(FileError::ErrorCode errorCode) | 700 void SourceBuffer::didFail(FileError::ErrorCode errorCode) |
| 702 { | 701 { |
| 703 WTF_LOG(Media, "SourceBuffer::didFail(%d) %p", errorCode, this); | 702 WTF_LOG(Media, "SourceBuffer::didFail(%d) %p", errorCode, this); |
| 704 appendStreamDone(false); | 703 appendStreamDone(false); |
| 705 } | 704 } |
| 706 | 705 |
| 707 void SourceBuffer::trace(Visitor* visitor) | 706 void SourceBuffer::trace(Visitor* visitor) |
| 708 { | 707 { |
| 709 visitor->trace(m_source); | 708 visitor->trace(m_source); |
| 710 } | 709 } |
| 711 | 710 |
| 712 } // namespace WebCore | 711 } // namespace WebCore |
| OLD | NEW |