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

Side by Side Diff: third_party/WebKit/Source/core/html/HTMLMediaElement.h

Issue 1815033003: Add srcObject attribute of type MediaStream to HTMLMediaElement. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: philipj's comments Created 4 years, 8 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) 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc. All rights reserved. 2 * Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple 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 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 21 matching lines...) Expand all
32 #include "core/dom/ActiveDOMObject.h" 32 #include "core/dom/ActiveDOMObject.h"
33 #include "core/dom/ExceptionCode.h" 33 #include "core/dom/ExceptionCode.h"
34 #include "core/events/GenericEventQueue.h" 34 #include "core/events/GenericEventQueue.h"
35 #include "core/html/AutoplayExperimentHelper.h" 35 #include "core/html/AutoplayExperimentHelper.h"
36 #include "core/html/HTMLElement.h" 36 #include "core/html/HTMLElement.h"
37 #include "core/html/track/TextTrack.h" 37 #include "core/html/track/TextTrack.h"
38 #include "platform/Supplementable.h" 38 #include "platform/Supplementable.h"
39 #include "platform/audio/AudioSourceProvider.h" 39 #include "platform/audio/AudioSourceProvider.h"
40 #include "public/platform/WebAudioSourceProviderClient.h" 40 #include "public/platform/WebAudioSourceProviderClient.h"
41 #include "public/platform/WebMediaPlayerClient.h" 41 #include "public/platform/WebMediaPlayerClient.h"
42 #include "public/platform/WebMediaPlayerSource.h"
42 #include "public/platform/WebMimeRegistry.h" 43 #include "public/platform/WebMimeRegistry.h"
43 44
44 #if !ENABLE(OILPAN) 45 #if !ENABLE(OILPAN)
45 #include "wtf/WeakPtr.h" 46 #include "wtf/WeakPtr.h"
46 #endif 47 #endif
47 48
48 namespace blink { 49 namespace blink {
49 50
50 class AudioSourceProviderClient; 51 class AudioSourceProviderClient;
51 class AudioTrackList; 52 class AudioTrackList;
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 108
108 bool hasRemoteRoutes() const { return m_remoteRoutesAvailable; } 109 bool hasRemoteRoutes() const { return m_remoteRoutesAvailable; }
109 bool isPlayingRemotely() const { return m_playingRemotely; } 110 bool isPlayingRemotely() const { return m_playingRemotely; }
110 111
111 // error state 112 // error state
112 MediaError* error() const; 113 MediaError* error() const;
113 114
114 // network state 115 // network state
115 void setSrc(const AtomicString&); 116 void setSrc(const AtomicString&);
116 const KURL& currentSrc() const { return m_currentSrc; } 117 const KURL& currentSrc() const { return m_currentSrc; }
118 void setSrcObject(const WebMediaPlayerSource&);
119 const WebMediaPlayerSource& getSrcObject() const { return m_srcObject; }
117 120
118 enum NetworkState { NETWORK_EMPTY, NETWORK_IDLE, NETWORK_LOADING, NETWORK_NO _SOURCE }; 121 enum NetworkState { NETWORK_EMPTY, NETWORK_IDLE, NETWORK_LOADING, NETWORK_NO _SOURCE };
119 NetworkState getNetworkState() const; 122 NetworkState getNetworkState() const;
120 123
121 String preload() const; 124 String preload() const;
122 void setPreload(const AtomicString&); 125 void setPreload(const AtomicString&);
123 WebMediaPlayer::Preload preloadType() const; 126 WebMediaPlayer::Preload preloadType() const;
124 String effectivePreload() const; 127 String effectivePreload() const;
125 WebMediaPlayer::Preload effectivePreloadType() const; 128 WebMediaPlayer::Preload effectivePreloadType() const;
126 129
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after
359 void checkIfSeekNeeded(); 362 void checkIfSeekNeeded();
360 void addPlayedRange(double start, double end); 363 void addPlayedRange(double start, double end);
361 364
362 void scheduleEvent(const AtomicString& eventName); // FIXME: Rename to sched uleNamedEvent for clarity. 365 void scheduleEvent(const AtomicString& eventName); // FIXME: Rename to sched uleNamedEvent for clarity.
363 366
364 // loading 367 // loading
365 void invokeLoadAlgorithm(); 368 void invokeLoadAlgorithm();
366 void invokeResourceSelectionAlgorithm(); 369 void invokeResourceSelectionAlgorithm();
367 void loadInternal(); 370 void loadInternal();
368 void selectMediaResource(); 371 void selectMediaResource();
369 void loadResource(const KURL&, ContentType&); 372 void loadResource(const WebMediaPlayerSource&, ContentType&);
370 void startPlayerLoad(); 373 void startPlayerLoad();
371 void setPlayerPreload(); 374 void setPlayerPreload();
372 WebMediaPlayer::LoadType loadType() const; 375 WebMediaPlayer::LoadType loadType() const;
373 void scheduleNextSourceChild(); 376 void scheduleNextSourceChild();
377 void loadSourceFromObject();
378 void loadSourceFromAttribute();
374 void loadNextSourceChild(); 379 void loadNextSourceChild();
375 void clearMediaPlayer(); 380 void clearMediaPlayer();
376 void clearMediaPlayerAndAudioSourceProviderClientWithoutLocking(); 381 void clearMediaPlayerAndAudioSourceProviderClientWithoutLocking();
377 bool havePotentialSourceChild(); 382 bool havePotentialSourceChild();
378 void noneSupported(); 383 void noneSupported();
379 void mediaEngineError(MediaError*); 384 void mediaEngineError(MediaError*);
380 void cancelPendingEventsAndCallbacks(); 385 void cancelPendingEventsAndCallbacks();
381 void waitForSourceChange(); 386 void waitForSourceChange();
382 void setIgnorePreloadNone(); 387 void setIgnorePreloadNone();
383 388
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
480 UnthrottledTimer<HTMLMediaElement> m_audioTracksTimer; 485 UnthrottledTimer<HTMLMediaElement> m_audioTracksTimer;
481 Member<TimeRanges> m_playedTimeRanges; 486 Member<TimeRanges> m_playedTimeRanges;
482 Member<GenericEventQueue> m_asyncEventQueue; 487 Member<GenericEventQueue> m_asyncEventQueue;
483 488
484 double m_playbackRate; 489 double m_playbackRate;
485 double m_defaultPlaybackRate; 490 double m_defaultPlaybackRate;
486 NetworkState m_networkState; 491 NetworkState m_networkState;
487 ReadyState m_readyState; 492 ReadyState m_readyState;
488 ReadyState m_readyStateMaximum; 493 ReadyState m_readyStateMaximum;
489 KURL m_currentSrc; 494 KURL m_currentSrc;
495 WebMediaPlayerSource m_srcObject;
sof 2016/04/12 18:40:22 This value object contains a WebMediaStream, which
Guido Urdaneta 2016/04/12 21:38:55 I don't think there are any cycles, but I will rep
490 496
491 Member<MediaError> m_error; 497 Member<MediaError> m_error;
492 498
493 double m_volume; 499 double m_volume;
494 double m_lastSeekTime; 500 double m_lastSeekTime;
495 501
496 double m_previousProgressTime; 502 double m_previousProgressTime;
497 503
498 // Cached duration to suppress duplicate events if duration unchanged. 504 // Cached duration to suppress duplicate events if duration unchanged.
499 double m_duration; 505 double m_duration;
500 506
501 // The last time a timeupdate event was sent (wall clock). 507 // The last time a timeupdate event was sent (wall clock).
502 double m_lastTimeUpdateEventWallTime; 508 double m_lastTimeUpdateEventWallTime;
503 509
504 // The last time a timeupdate event was sent in movie time. 510 // The last time a timeupdate event was sent in movie time.
505 double m_lastTimeUpdateEventMovieTime; 511 double m_lastTimeUpdateEventMovieTime;
506 512
507 // The default playback start position. 513 // The default playback start position.
508 double m_defaultPlaybackStartPosition; 514 double m_defaultPlaybackStartPosition;
509 515
510 // Loading state. 516 // Loading state.
511 enum LoadState { WaitingForSource, LoadingFromSrcAttr, LoadingFromSourceElem ent }; 517 enum LoadState { WaitingForSource, LoadingFromSrcObject, LoadingFromSrcAttr, LoadingFromSourceElement };
512 LoadState m_loadState; 518 LoadState m_loadState;
513 Member<HTMLSourceElement> m_currentSourceNode; 519 Member<HTMLSourceElement> m_currentSourceNode;
514 Member<Node> m_nextChildNodeToConsider; 520 Member<Node> m_nextChildNodeToConsider;
515 521
516 // "Deferred loading" state (for preload=none). 522 // "Deferred loading" state (for preload=none).
517 enum DeferredLoadState { 523 enum DeferredLoadState {
518 // The load is not deferred. 524 // The load is not deferred.
519 NotDeferred, 525 NotDeferred,
520 // The load is deferred, and waiting for the task to set the 526 // The load is deferred, and waiting for the task to set the
521 // delaying-the-load-event flag (to false). 527 // delaying-the-load-event flag (to false).
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
660 inline bool isHTMLMediaElement(const HTMLElement& element) 666 inline bool isHTMLMediaElement(const HTMLElement& element)
661 { 667 {
662 return isHTMLAudioElement(element) || isHTMLVideoElement(element); 668 return isHTMLAudioElement(element) || isHTMLVideoElement(element);
663 } 669 }
664 670
665 DEFINE_HTMLELEMENT_TYPE_CASTS_WITH_FUNCTION(HTMLMediaElement); 671 DEFINE_HTMLELEMENT_TYPE_CASTS_WITH_FUNCTION(HTMLMediaElement);
666 672
667 } // namespace blink 673 } // namespace blink
668 674
669 #endif // HTMLMediaElement_h 675 #endif // HTMLMediaElement_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698