function createProcessedMediaStream(sourceStream, transform, signal) {
  // For this sample, we're only dealing with video tracks.
  /** @type {!MediaStreamTrack} */
  const sourceTrack = sourceStream.getVideoTracks()[0];

  const processedTrack =
      createProcessedMediaStreamTrack(sourceTrack, transform, signal);

  // Create a new MediaStream to hold our processed track.
  const processedStream = new MediaStream();
  processedStream.addTrack(processedTrack);

  return processedStream;
}
Wrapper around createProcessedMediaStreamTrack to apply transform to a
MediaStream.
@param {!MediaStream} sourceStream the video stream to be transformed. The
    first video track will be used.
@param {!FrameTransformFn} transform the transform to apply to the
    sourceStream.
@param {!AbortSignal} signal can be used to stop processing
@return {!MediaStream} holds a single video track of the transformed video
    frames