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

Unified Diff: third_party/WebKit/Source/modules/mediasource/SourceBufferAudioTrack.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/SourceBufferAudioTrack.cpp
diff --git a/third_party/WebKit/Source/core/svg/SVGDiscardElement.h b/third_party/WebKit/Source/modules/mediasource/SourceBufferAudioTrack.cpp
similarity index 59%
copy from third_party/WebKit/Source/core/svg/SVGDiscardElement.h
copy to third_party/WebKit/Source/modules/mediasource/SourceBufferAudioTrack.cpp
index 76b61d8cc55381b4fcaddc4303bdc5e3aee7c0be..30ac4f9803a5aed7d999df2c387221556e5203ab 100644
--- a/third_party/WebKit/Source/core/svg/SVGDiscardElement.h
+++ b/third_party/WebKit/Source/modules/mediasource/SourceBufferAudioTrack.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/SourceBufferAudioTrack.h"
-#include "core/svg/animation/SVGSMILElement.h"
+#include "core/html/track/AudioTrack.h"
+#include "modules/mediasource/SourceBuffer.h"
namespace blink {
-class SVGDiscardElement final : public SVGSMILElement {
- DEFINE_WRAPPERTYPEINFO();
-public:
- DECLARE_NODE_FACTORY(SVGDiscardElement);
+SourceBufferAudioTrack::SourceBufferAudioTrack(SourceBuffer* sourceBuffer)
+ : m_sourceBuffer(sourceBuffer)
+{
+}
- bool isSVGDiscardElement() const override { return true; }
-private:
- explicit SVGDiscardElement(Document&);
+SourceBufferAudioTrack::~SourceBufferAudioTrack()
+{
+}
- void resetAnimatedType() override { }
- void clearAnimatedType() override { }
- void applyResultsToTarget() override { }
- bool hasValidAttributeType() override;
- bool hasValidAttributeName() override;
- void animationAttributeChanged() override { }
+const char* SourceBufferAudioTrack::supplementName()
+{
+ return "SourceBufferAudioTrack";
+}
- void startedActiveInterval() override { }
- void updateAnimation(float percent, unsigned repeat, SVGSMILElement* resultElement) override { }
-};
+SourceBufferAudioTrack& SourceBufferAudioTrack::from(AudioTrack& track)
+{
+ SourceBufferAudioTrack* supplement = static_cast<SourceBufferAudioTrack*>(HeapSupplement<AudioTrack>::from(track, supplementName()));
+ if (!supplement) {
+ supplement = new SourceBufferAudioTrack(nullptr);
+ provideTo(track, supplementName(), supplement);
+ }
+ return *supplement;
+}
+
+// static
+SourceBuffer* SourceBufferAudioTrack::sourceBuffer(AudioTrack& track)
+{
+ return SourceBufferAudioTrack::from(track).m_sourceBuffer;
+}
+
+
+DEFINE_TRACE(SourceBufferAudioTrack)
+{
+ visitor->trace(m_sourceBuffer);
+ HeapSupplement<AudioTrack>::trace(visitor);
+}
} // namespace blink
-#endif // SVGDiscardElement_h

Powered by Google App Engine
This is Rietveld 408576698