Confirmed users
770
edits
| Line 106: | Line 106: | ||
==OfflineMediaContext:== | ==OfflineMediaContext:== | ||
We introduce the “OfflineMediaContext” and modify the “MediaStream” here to enable the offline (as soon as possible) MediaStream processing. When developers are going to perform the offline MediaStream processing, they need to form a context which will hold and keep the relationship of all MediaStreams that are going to be processed together. | |||
<source lang="c++"> | <source lang="c++"> | ||
// typedef unsigned long long DOMTimeStamp; | // typedef unsigned long long DOMTimeStamp; | ||
interface OfflineMediaContext { | interface OfflineMediaContext { | ||
void | void start(DOMTimeStamp durationToStop); | ||
}; | }; | ||
// Add an optional argument into the constructor. | // Add an optional argument into the constructor. | ||
| Line 123: | Line 124: | ||
</source> | </source> | ||
*OfflineMediaContext is the holdplace of all MediaStreams which are going to be processed together in a non-realtime rate. | |||
*OfflineMediaContext is also the object who can trigger the non-realtime processing. | |||
*OfflineMediaContext should be instantiated first and then MediaStreams, which are going to be processed together in the same context, could be instantiated by passing the pre-instantiated OfflineMediaContext object into the constructor of MediaStreams. (See the modified MediaStream constructor below) | |||
*The native implementation of OfflineMediaContext holds a non-realtime MediaStreamGraph, which is just the same as the OfflineAudioContext in WebAudio specification. | |||
*The constructors are modified by adding an optional parameter, OfflineMediaContext. By this way, developers are able to associate a MediaStream to an OfflineMediaContext. | |||
*If the optional OfflineMediaContext is given, the native implementation of the MediaStream should be hooked to the non-realtime MSG hold by the given OfflineMediaContext in stead of the global realtime MSG. | |||
*If the optional OfflineMediaContext is given, we need to check whether the new created MediaStream is able to be processed in offline rate or not. If not, the constructor should throw an error and return a NULL. (Constructors are always allowed to throw.) | |||
<!-- | <!-- | ||