Index: third_party/WebKit/Source/modules/mediasource/SourceBufferVideoTrack.cpp |
diff --git a/third_party/WebKit/Source/core/svg/SVGDiscardElement.h b/third_party/WebKit/Source/modules/mediasource/SourceBufferVideoTrack.cpp |
similarity index 59% |
copy from third_party/WebKit/Source/core/svg/SVGDiscardElement.h |
copy to third_party/WebKit/Source/modules/mediasource/SourceBufferVideoTrack.cpp |
index 76b61d8cc55381b4fcaddc4303bdc5e3aee7c0be..2c5010fc3c548718c56876e8e907086c9a1fc036 100644 |
--- a/third_party/WebKit/Source/core/svg/SVGDiscardElement.h |
+++ b/third_party/WebKit/Source/modules/mediasource/SourceBufferVideoTrack.cpp |
@@ -1,5 +1,5 @@ |
/* |
- * Copyright (C) 2014 Samsung Electronics. All rights reserved. |
+ * Copyright (C) 2016 Google Inc. All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions are |
@@ -28,33 +28,49 @@ |
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
*/ |
-#ifndef SVGDiscardElement_h |
-#define SVGDiscardElement_h |
+#include "modules/mediasource/SourceBufferVideoTrack.h" |
-#include "core/svg/animation/SVGSMILElement.h" |
+#include "core/html/track/VideoTrack.h" |
+#include "modules/mediasource/SourceBuffer.h" |
namespace blink { |
-class SVGDiscardElement final : public SVGSMILElement { |
- DEFINE_WRAPPERTYPEINFO(); |
-public: |
- DECLARE_NODE_FACTORY(SVGDiscardElement); |
+SourceBufferVideoTrack::SourceBufferVideoTrack(SourceBuffer* sourceBuffer) |
+ : m_sourceBuffer(sourceBuffer) |
+{ |
+} |
- bool isSVGDiscardElement() const override { return true; } |
-private: |
- explicit SVGDiscardElement(Document&); |
+SourceBufferVideoTrack::~SourceBufferVideoTrack() |
+{ |
+} |
- void resetAnimatedType() override { } |
- void clearAnimatedType() override { } |
- void applyResultsToTarget() override { } |
- bool hasValidAttributeType() override; |
- bool hasValidAttributeName() override; |
- void animationAttributeChanged() override { } |
+const char* SourceBufferVideoTrack::supplementName() |
+{ |
+ return "SourceBufferVideoTrack"; |
+} |
- void startedActiveInterval() override { } |
- void updateAnimation(float percent, unsigned repeat, SVGSMILElement* resultElement) override { } |
-}; |
+SourceBufferVideoTrack& SourceBufferVideoTrack::from(VideoTrack& track) |
+{ |
+ SourceBufferVideoTrack* supplement = static_cast<SourceBufferVideoTrack*>(HeapSupplement<VideoTrack>::from(track, supplementName())); |
+ if (!supplement) { |
+ supplement = new SourceBufferVideoTrack(nullptr); |
+ provideTo(track, supplementName(), supplement); |
+ } |
+ return *supplement; |
+} |
+ |
+// static |
+SourceBuffer* SourceBufferVideoTrack::sourceBuffer(VideoTrack& track) |
+{ |
+ return SourceBufferVideoTrack::from(track).m_sourceBuffer; |
+} |
+ |
+ |
+DEFINE_TRACE(SourceBufferVideoTrack) |
+{ |
+ visitor->trace(m_sourceBuffer); |
+ HeapSupplement<VideoTrack>::trace(visitor); |
+} |
} // namespace blink |
-#endif // SVGDiscardElement_h |