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

Unified Diff: Source/modules/mediasource/SourceBuffer.cpp

Issue 552943002: MSE: Start letting SourceBuffer begin to do initialization segment received algorithm (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebased. Addressed philipj@'s PS5 comments. Created 6 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/modules/mediasource/SourceBuffer.h ('k') | Source/modules/mediasource/SourceBufferList.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/modules/mediasource/SourceBuffer.cpp
diff --git a/Source/modules/mediasource/SourceBuffer.cpp b/Source/modules/mediasource/SourceBuffer.cpp
index 86621ab64ed545f3423561e9bd94a96d08d2736b..0abbbfbb68a32b9e7b235ded3d48d37da6f9c4ed 100644
--- a/Source/modules/mediasource/SourceBuffer.cpp
+++ b/Source/modules/mediasource/SourceBuffer.cpp
@@ -89,6 +89,7 @@ SourceBuffer::SourceBuffer(PassOwnPtr<WebSourceBuffer> webSourceBuffer, MediaSou
, m_timestampOffset(0)
, m_appendWindowStart(0)
, m_appendWindowEnd(std::numeric_limits<double>::infinity())
+ , m_firstInitializationSegmentReceived(false)
, m_pendingAppendDataOffset(0)
, m_appendBufferAsyncPartRunner(this, &SourceBuffer::appendBufferAsyncPart)
, m_pendingRemoveStart(-1)
@@ -100,6 +101,7 @@ SourceBuffer::SourceBuffer(PassOwnPtr<WebSourceBuffer> webSourceBuffer, MediaSou
{
ASSERT(m_webSourceBuffer);
ASSERT(m_source);
+ m_webSourceBuffer->setClient(this);
}
SourceBuffer::~SourceBuffer()
@@ -111,6 +113,7 @@ SourceBuffer::~SourceBuffer()
ASSERT(isRemoved());
ASSERT(!m_loader);
ASSERT(!m_stream);
+ ASSERT(!m_webSourceBuffer);
#endif
}
@@ -419,6 +422,29 @@ void SourceBuffer::removedFromMediaSource()
m_asyncEventQueue = 0;
}
+void SourceBuffer::initializationSegmentReceived()
+{
+ ASSERT(m_source);
+ ASSERT(m_updating);
+
+ // https://dvcs.w3.org/hg/html-media/raw-file/tip/media-source/media-source.html#sourcebuffer-init-segment-received
+ // FIXME: Make steps 1-7 synchronous with this call.
+ // FIXME: Augment the interface to this method to implement compliant steps 4-7 here.
+ // Step 3 (if the first initialization segment received flag is true) is
+ // implemented by caller.
+
+ if (!m_firstInitializationSegmentReceived) {
+ // 5. If active track flag equals true, then run the following steps:
+ // 5.1. Add this SourceBuffer to activeSourceBuffers.
+ // 5.2. Queue a task to fire a simple event named addsourcebuffer at
+ // activesourcebuffers.
+ m_source->setSourceBufferActive(this);
+
+ // 6. Set first initialization segment received flag to true.
+ m_firstInitializationSegmentReceived = true;
+ }
+}
+
bool SourceBuffer::hasPendingActivity() const
{
return m_source;
« no previous file with comments | « Source/modules/mediasource/SourceBuffer.h ('k') | Source/modules/mediasource/SourceBufferList.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698