예제 #1
0
MediaDecoderStateMachine*
MediaSourceDecoder::CreateStateMachine()
{
  MOZ_ASSERT(NS_IsMainThread());
  mDemuxer = new MediaSourceDemuxer();
  mReader = new MediaFormatReader(this, mDemuxer, GetVideoFrameContainer());
  return new MediaDecoderStateMachine(this, mReader);
}
예제 #2
0
MediaDecoderStateMachine* MP4Decoder::CreateStateMachine()
{
  mReader =
    new MediaFormatReader(this,
                          new MP4Demuxer(GetResource()),
                          GetVideoFrameContainer());

  return new MediaDecoderStateMachine(this, mReader);
}
예제 #3
0
MediaDecoderStateMachine* OggDecoder::CreateStateMachine()
{
  RefPtr<OggDemuxer> demuxer = new OggDemuxer(GetResource());
  RefPtr<MediaFormatReader> reader =
    new MediaFormatReader(this, demuxer, GetVideoFrameContainer());
  demuxer->SetChainingEvents(&reader->TimedMetadataProducer(),
                             &reader->MediaNotSeekableProducer());
  return new MediaDecoderStateMachine(this, reader);
}
예제 #4
0
double HTMLVideoElement::MozFrameDelay()
{
  MOZ_ASSERT(NS_IsMainThread(), "Should be on main thread.");
  VideoFrameContainer* container = GetVideoFrameContainer();
  // Hide negative delays. Frame timing tweaks in the compositor (e.g.
  // adding a bias value to prevent multiple dropped/duped frames when
  // frame times are aligned with composition times) may produce apparent
  // negative delay, but we shouldn't report that.
  return container ? std::max(0.0, container->GetFrameDelay()) : 0.0;
}
예제 #5
0
MediaDecoderStateMachine* ChannelMediaDecoder::CreateStateMachine()
{
  MOZ_ASSERT(NS_IsMainThread());
  MediaFormatReaderInit init;
  init.mVideoFrameContainer = GetVideoFrameContainer();
  init.mKnowsCompositor = GetCompositor();
  init.mCrashHelper = GetOwner()->CreateGMPCrashHelper();
  init.mFrameStats = mFrameStats;
  init.mResource = mResource;
  mReader = DecoderTraits::CreateReader(ContainerType(), init);
  return new MediaDecoderStateMachine(this, mReader);
}
double HTMLVideoElement::MozFrameDelay()
{
  MOZ_ASSERT(NS_IsMainThread(), "Should be on main thread.");
  VideoFrameContainer* container = GetVideoFrameContainer();
  return container ?  container->GetFrameDelay() : 0;
}
예제 #7
0
MediaDecoderStateMachine* WebMDecoder::CreateStateMachine()
{
  bool useFormatDecoder =
    Preferences::GetBool("media.format-reader.webm", true);
  RefPtr<MediaDecoderReader> reader = useFormatDecoder ?
      static_cast<MediaDecoderReader*>(new MediaFormatReader(this, new WebMDemuxer(GetResource()), GetVideoFrameContainer())) :
      new WebMReader(this);
  return new MediaDecoderStateMachine(this, reader);
}
예제 #8
0
MediaDecoderStateMachine* WebMDecoder::CreateStateMachine()
{
  RefPtr<MediaDecoderReader> reader =
    new MediaFormatReader(this, new WebMDemuxer(GetResource()), GetVideoFrameContainer());
  return new MediaDecoderStateMachine(this, reader);
}