Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(17)

Side by Side Diff: Source/modules/mediasource/SourceBuffer.cpp

Issue 178763006: Enable round-tripping and updating of SourceBuffer timestamp offset (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 520 matching lines...) Expand 10 before | Expand all | Expand 10 after
531 // Step 2 doesn't apply since we run Step 1 synchronously here. 531 // Step 2 doesn't apply since we run Step 1 synchronously here.
532 size_t appendSize = m_pendingAppendData.size(); 532 size_t appendSize = m_pendingAppendData.size();
533 if (!appendSize) { 533 if (!appendSize) {
534 // Resize buffer for 0 byte appends so we always have a valid pointer. 534 // Resize buffer for 0 byte appends so we always have a valid pointer.
535 // We need to convey all appends, even 0 byte ones to |m_webSourceBuffer | 535 // We need to convey all appends, even 0 byte ones to |m_webSourceBuffer |
536 // so that it can clear its end of stream state if necessary. 536 // so that it can clear its end of stream state if necessary.
537 m_pendingAppendData.resize(1); 537 m_pendingAppendData.resize(1);
538 } 538 }
539 m_webSourceBuffer->append(m_pendingAppendData.data(), appendSize); 539 m_webSourceBuffer->append(m_pendingAppendData.data(), appendSize);
540 540
541 // Update our cached |m_timestampOffset| since the implementation may change
542 // it during append() processing.
543 m_timestampOffset = m_webSourceBuffer->getTimestampOffset();
acolwell GONE FROM CHROMIUM 2014/02/25 17:50:57 See my comments in the Chromium-side changes. I th
wolenetz 2014/02/25 20:33:32 Done.
544
541 // 3. Set the updating attribute to false. 545 // 3. Set the updating attribute to false.
542 m_updating = false; 546 m_updating = false;
543 m_pendingAppendData.clear(); 547 m_pendingAppendData.clear();
544 548
545 // 4. Queue a task to fire a simple event named update at this SourceBuffer object. 549 // 4. Queue a task to fire a simple event named update at this SourceBuffer object.
546 scheduleEvent(EventTypeNames::update); 550 scheduleEvent(EventTypeNames::update);
547 551
548 // 5. Queue a task to fire a simple event named updateend at this SourceBuff er object. 552 // 5. Queue a task to fire a simple event named updateend at this SourceBuff er object.
549 scheduleEvent(EventTypeNames::updateend); 553 scheduleEvent(EventTypeNames::updateend);
550 TRACE_EVENT_ASYNC_END0("media", "SourceBuffer::appendBuffer", this); 554 TRACE_EVENT_ASYNC_END0("media", "SourceBuffer::appendBuffer", this);
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
685 WTF_LOG(Media, "SourceBuffer::didStartLoading() %p", this); 689 WTF_LOG(Media, "SourceBuffer::didStartLoading() %p", this);
686 } 690 }
687 691
688 void SourceBuffer::didReceiveDataForClient(const char* data, unsigned dataLength ) 692 void SourceBuffer::didReceiveDataForClient(const char* data, unsigned dataLength )
689 { 693 {
690 WTF_LOG(Media, "SourceBuffer::didReceiveDataForClient(%d) %p", dataLength, t his); 694 WTF_LOG(Media, "SourceBuffer::didReceiveDataForClient(%d) %p", dataLength, t his);
691 ASSERT(m_updating); 695 ASSERT(m_updating);
692 ASSERT(m_loader); 696 ASSERT(m_loader);
693 697
694 m_webSourceBuffer->append(reinterpret_cast<const unsigned char*>(data), data Length); 698 m_webSourceBuffer->append(reinterpret_cast<const unsigned char*>(data), data Length);
699
700 // Update our cached |m_timestampOffset| since the implementation may change
701 // it during append() processing.
702 m_timestampOffset = m_webSourceBuffer->getTimestampOffset();
acolwell GONE FROM CHROMIUM 2014/02/25 17:50:57 ditto. Perhaps put the update logic in a updateTim
wolenetz 2014/02/25 20:33:32 Done.
695 } 703 }
696 704
697 void SourceBuffer::didFinishLoading() 705 void SourceBuffer::didFinishLoading()
698 { 706 {
699 WTF_LOG(Media, "SourceBuffer::didFinishLoading() %p", this); 707 WTF_LOG(Media, "SourceBuffer::didFinishLoading() %p", this);
700 appendStreamDone(true); 708 appendStreamDone(true);
701 } 709 }
702 710
703 void SourceBuffer::didFail(FileError::ErrorCode errorCode) 711 void SourceBuffer::didFail(FileError::ErrorCode errorCode)
704 { 712 {
705 WTF_LOG(Media, "SourceBuffer::didFail(%d) %p", errorCode, this); 713 WTF_LOG(Media, "SourceBuffer::didFail(%d) %p", errorCode, this);
706 appendStreamDone(false); 714 appendStreamDone(false);
707 } 715 }
708 716
709 void SourceBuffer::trace(Visitor* visitor) 717 void SourceBuffer::trace(Visitor* visitor)
710 { 718 {
711 visitor->trace(m_source); 719 visitor->trace(m_source);
712 } 720 }
713 721
714 } // namespace WebCore 722 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698