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

Unified Diff: third_party/WebKit/Source/modules/mediasource/SourceBufferVideoTrack.cpp

Issue 1658033002: Add SourceBuffer implementations of Audio/VideoTracks (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@pass-media-tracks-to-blink
Patch Set: rebase Created 4 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 side-by-side diff with in-line comments
Download patch
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

Powered by Google App Engine
This is Rietveld 408576698