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

Side by Side Diff: third_party/WebKit/Source/modules/mediasource/VideoTrackSourceBuffer.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: Make Audio/VideoTrackSB finalizable again 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "modules/mediasource/VideoTrackSourceBuffer.h"
6
7 #include "core/html/track/VideoTrack.h"
8 #include "modules/mediasource/SourceBuffer.h"
9
10 namespace blink {
11
12 VideoTrackSourceBuffer::VideoTrackSourceBuffer(SourceBuffer* sourceBuffer)
13 : m_sourceBuffer(sourceBuffer)
14 {
15 }
16
17 VideoTrackSourceBuffer::~VideoTrackSourceBuffer()
18 {
19 }
20
21 const char* VideoTrackSourceBuffer::supplementName()
22 {
23 return "VideoTrackSourceBuffer";
24 }
25
26 VideoTrackSourceBuffer& VideoTrackSourceBuffer::from(VideoTrack& track)
27 {
28 VideoTrackSourceBuffer* supplement = static_cast<VideoTrackSourceBuffer*>(He apSupplement<VideoTrack>::from(track, supplementName()));
29 if (!supplement) {
30 supplement = new VideoTrackSourceBuffer(nullptr);
31 provideTo(track, supplementName(), supplement);
32 }
33 return *supplement;
34 }
35
36 // static
37 SourceBuffer* VideoTrackSourceBuffer::sourceBuffer(VideoTrack& track)
38 {
39 return VideoTrackSourceBuffer::from(track).m_sourceBuffer;
40 }
41
42
43 DEFINE_TRACE(VideoTrackSourceBuffer)
44 {
45 visitor->trace(m_sourceBuffer);
46 HeapSupplement<VideoTrack>::trace(visitor);
47 }
48
49 } // namespace blink
50
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698