| Index: third_party/WebKit/Source/modules/mediasource/VideoTrackSourceBuffer.cpp
|
| diff --git a/third_party/WebKit/Source/modules/mediasource/VideoTrackSourceBuffer.cpp b/third_party/WebKit/Source/modules/mediasource/VideoTrackSourceBuffer.cpp
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..cc9492fffd4f1adddc61eb0ebfaf1b25c6e255df
|
| --- /dev/null
|
| +++ b/third_party/WebKit/Source/modules/mediasource/VideoTrackSourceBuffer.cpp
|
| @@ -0,0 +1,50 @@
|
| +// Copyright 2016 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +#include "modules/mediasource/VideoTrackSourceBuffer.h"
|
| +
|
| +#include "core/html/track/VideoTrack.h"
|
| +#include "modules/mediasource/SourceBuffer.h"
|
| +
|
| +namespace blink {
|
| +
|
| +VideoTrackSourceBuffer::VideoTrackSourceBuffer(SourceBuffer* sourceBuffer)
|
| + : m_sourceBuffer(sourceBuffer)
|
| +{
|
| +}
|
| +
|
| +VideoTrackSourceBuffer::~VideoTrackSourceBuffer()
|
| +{
|
| +}
|
| +
|
| +const char* VideoTrackSourceBuffer::supplementName()
|
| +{
|
| + return "VideoTrackSourceBuffer";
|
| +}
|
| +
|
| +VideoTrackSourceBuffer& VideoTrackSourceBuffer::from(VideoTrack& track)
|
| +{
|
| + VideoTrackSourceBuffer* supplement = static_cast<VideoTrackSourceBuffer*>(HeapSupplement<VideoTrack>::from(track, supplementName()));
|
| + if (!supplement) {
|
| + supplement = new VideoTrackSourceBuffer(nullptr);
|
| + provideTo(track, supplementName(), supplement);
|
| + }
|
| + return *supplement;
|
| +}
|
| +
|
| +// static
|
| +SourceBuffer* VideoTrackSourceBuffer::sourceBuffer(VideoTrack& track)
|
| +{
|
| + return VideoTrackSourceBuffer::from(track).m_sourceBuffer;
|
| +}
|
| +
|
| +
|
| +DEFINE_TRACE(VideoTrackSourceBuffer)
|
| +{
|
| + visitor->trace(m_sourceBuffer);
|
| + HeapSupplement<VideoTrack>::trace(visitor);
|
| +}
|
| +
|
| +} // namespace blink
|
| +
|
|
|