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

Side by Side Diff: third_party/WebKit/Source/modules/mediasource/SourceBuffer.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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after
220 // 6. If the mode attribute equals "sequence", then set the group start time stamp to new timestamp offset. 220 // 6. If the mode attribute equals "sequence", then set the group start time stamp to new timestamp offset.
221 if (!m_webSourceBuffer->setTimestampOffset(offset)) { 221 if (!m_webSourceBuffer->setTimestampOffset(offset)) {
222 MediaSource::logAndThrowDOMException(exceptionState, InvalidStateError, "The timestamp offset may not be set while the SourceBuffer's append state is 'P ARSING_MEDIA_SEGMENT'."); 222 MediaSource::logAndThrowDOMException(exceptionState, InvalidStateError, "The timestamp offset may not be set while the SourceBuffer's append state is 'P ARSING_MEDIA_SEGMENT'.");
223 return; 223 return;
224 } 224 }
225 225
226 // 7. Update the attribute to new timestamp offset. 226 // 7. Update the attribute to new timestamp offset.
227 m_timestampOffset = offset; 227 m_timestampOffset = offset;
228 } 228 }
229 229
230 AudioTrackList& SourceBuffer::audioTracks()
231 {
232 ASSERT(RuntimeEnabledFeatures::audioVideoTracksEnabled());
233 return *m_audioTracks;
philipj_slow 2016/02/23 04:35:07 Has m_audioTracks actually been created, won't thi
servolk 2016/02/24 00:11:36 Yeah, that's right. I need to figure out a good pl
philipj_slow 2016/02/26 13:36:54 Until this works and doesn't crash, can you instea
philipj_slow 2016/03/10 13:13:48 Ping.
servolk 2016/03/11 02:00:57 How strongly do you feel about this? One reason I
servolk 2016/03/11 02:03:37 Oh, yes, and also these new collections are also a
philipj_slow 2016/03/24 06:47:48 OK, so if it's used for testing it surely shouldn'
234 }
235
236 VideoTrackList& SourceBuffer::videoTracks()
237 {
238 ASSERT(RuntimeEnabledFeatures::audioVideoTracksEnabled());
239 return *m_videoTracks;
240 }
241
230 double SourceBuffer::appendWindowStart() const 242 double SourceBuffer::appendWindowStart() const
231 { 243 {
232 return m_appendWindowStart; 244 return m_appendWindowStart;
233 } 245 }
234 246
235 void SourceBuffer::setAppendWindowStart(double start, ExceptionState& exceptionS tate) 247 void SourceBuffer::setAppendWindowStart(double start, ExceptionState& exceptionS tate)
236 { 248 {
237 WTF_LOG(Media, "SourceBuffer::setAppendWindowStart %p start=%f", this, start ); 249 WTF_LOG(Media, "SourceBuffer::setAppendWindowStart %p start=%f", this, start );
238 // Section 3.1 appendWindowStart attribute setter steps. 250 // Section 3.1 appendWindowStart attribute setter steps.
239 // https://dvcs.w3.org/hg/html-media/raw-file/tip/media-source/media-source. html#widl-SourceBuffer-appendWindowStart 251 // https://dvcs.w3.org/hg/html-media/raw-file/tip/media-source/media-source. html#widl-SourceBuffer-appendWindowStart
(...skipping 619 matching lines...) Expand 10 before | Expand all | Expand 10 after
859 // m_loader might be already released, in case appendStream has failed due 871 // m_loader might be already released, in case appendStream has failed due
860 // to evictCodedFrames failing in didReceiveDataForClient. In that case 872 // to evictCodedFrames failing in didReceiveDataForClient. In that case
861 // appendStreamDone will be invoked from there, no need to repeat it here. 873 // appendStreamDone will be invoked from there, no need to repeat it here.
862 if (m_loader) 874 if (m_loader)
863 appendStreamDone(false); 875 appendStreamDone(false);
864 } 876 }
865 877
866 DEFINE_TRACE(SourceBuffer) 878 DEFINE_TRACE(SourceBuffer)
867 { 879 {
868 visitor->trace(m_source); 880 visitor->trace(m_source);
881 visitor->trace(m_audioTracks);
882 visitor->trace(m_videoTracks);
869 visitor->trace(m_trackDefaults); 883 visitor->trace(m_trackDefaults);
870 visitor->trace(m_asyncEventQueue); 884 visitor->trace(m_asyncEventQueue);
871 visitor->trace(m_appendBufferAsyncPartRunner); 885 visitor->trace(m_appendBufferAsyncPartRunner);
872 visitor->trace(m_removeAsyncPartRunner); 886 visitor->trace(m_removeAsyncPartRunner);
873 visitor->trace(m_appendStreamAsyncPartRunner); 887 visitor->trace(m_appendStreamAsyncPartRunner);
874 visitor->trace(m_stream); 888 visitor->trace(m_stream);
875 RefCountedGarbageCollectedEventTargetWithInlineData<SourceBuffer>::trace(vis itor); 889 RefCountedGarbageCollectedEventTargetWithInlineData<SourceBuffer>::trace(vis itor);
876 ActiveDOMObject::trace(visitor); 890 ActiveDOMObject::trace(visitor);
877 } 891 }
878 892
879 } // namespace blink 893 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698