author Chris Pearce <>
Wed, 15 Jan 2014 16:13:54 +1300
changeset 180451 eb70f67d384a2de272246337052f7225ee84ed4e
parent 130629 d802d6faa08093addd7fd285a0fc97efc59f00fb
permissions -rw-r--r--
Bug 959440 - Various cleanups in MP4Reader. r=kinetik Change PlatformDecoderModule::Create*Decoder() to take an mp4_demuxer::{Audio,Video}DecoderConfig parameter, instead of enumerating all parameters. This means the platform decoders can have more data if need be, like the AACAudioConfig. Change MediaDataDecoder::Input() to take an nsAutoPtr<MP4Sample>&. The sample will be deleted by the caller (MP4Reader) if Input() returns DECODE_STATUS_OK, but if the MediaDataDecoder wants to assume responsibility of the lifecycle of the sample (say to enqueue it), it can forget() on the nsAutoPtr& passed in and assume responsibility. Call PlatformDecoderModule::Create() on the decode thread. This is a step towards making these classes decode-thread only. Add PlatformDecoderModule::Init(), which caches the pref's we need, since PlatformDecoderModule::Create() is no longer called on the main thread, we can no longer access them in there. Add Init() method to MediaDataDecoder interface. This is so that we can call MediaDataDecoder::Shutdown() to unblock the initialization of a decoder, if that init needs to block. Pass LayersBackend type to WMFVideoDecoder, so it knows whether to init DXVA.

This Source Code Form is subject to the terms of the Mozilla Public
License, v. 2.0. If a copy of the MPL was not distributed with this
file, You can obtain one at

nsIObserver topics for profile changing. Profile changing happens in phases
in the order given below. An observer may register separately for each phase
of the process depending on its needs.

  All async activity must be stopped in this phase. Typically,
  the application level observer will close all open windows.
  This is the last phase in which the subject's vetoChange()
  method may still be called.
  The next notification will be either
  profile-change-teardown-veto or profile-before-change.

  Called before the profile has changed. Use this notification
  to prepare for the profile going away. If a component is
  holding any state which needs to be flushed to a profile-relative
  location, it should be done here.

  Called after the profile has changed. Do the work to
  respond to having a new profile. Any change which
  affects others must be done in this phase.

  Called after the profile has changed. Use this notification
  to make changes that are dependent on what some other listener
  did during its profile-do-change. For example, to respond to
  new preferences.

  Called after all phases of a change have completed. Typically
  in this phase, an application level observer will open a new window.

Contexts for profile changes. These are passed as the someData param to the
observer's Observe() method.

  Going from no profile to a profile.
  The following topics happen in this context:

  The user is logging out and whatever data the observer stores
  for the current profile should be released from memory and
  saved to disk.
  The following topics happen in this context:

See for more details about the shutdown

NOTE: Long ago there was be a "shutdown-cleanse" version of shutdown which was
intended to clear profile data. This is no longer sent and observer code should
remove support for it.