Backed out changeset a3eabb355005 (bug 1360334) for build bustaget at dom/media/GraphDriver.cpp:200: cannot pass non-trivial object of type 'RefPtr<mozilla::GraphDriver>' to variadic function. r=backout on a CLOSED TREE

This commit is contained in:
Sebastian Hengst 2017-09-09 18:00:49 +02:00
Родитель 0bdbb7d2aa
Коммит 3a76476175
2 изменённых файлов: 9 добавлений и 36 удалений

Просмотреть файл

@ -35,8 +35,7 @@ GraphDriver::GraphDriver(MediaStreamGraphImpl* aGraphImpl)
mWaitState(WAITSTATE_RUNNING),
mCurrentTimeStamp(TimeStamp::Now()),
mPreviousDriver(nullptr),
mNextDriver(nullptr),
mScheduled(false)
mNextDriver(nullptr)
{ }
void GraphDriver::SetGraphTime(GraphDriver* aPreviousDriver,
@ -136,12 +135,6 @@ void GraphDriver::SetPreviousDriver(GraphDriver* aPreviousDriver)
mPreviousDriver = aPreviousDriver;
}
bool GraphDriver::Scheduled()
{
GraphImpl()->GetMonitor().AssertCurrentThreadOwns();
return mScheduled;
}
ThreadedDriver::ThreadedDriver(MediaStreamGraphImpl* aGraphImpl)
: GraphDriver(aGraphImpl)
{ }
@ -188,7 +181,7 @@ public:
LOG(LogLevel::Debug,
("Starting a new system driver for graph %p", mDriver->mGraphImpl));
RefPtr<GraphDriver> previousDriver;
GraphDriver* previousDriver = nullptr;
{
MonitorAutoLock mon(mDriver->mGraphImpl->GetMonitor());
previousDriver = mDriver->PreviousDriver();
@ -231,8 +224,7 @@ ThreadedDriver::Start()
// Note: mThread may be null during event->Run() if we pass to NewNamedThread! See AudioInitTask
nsresult rv = NS_NewNamedThread("MediaStreamGrph", getter_AddRefs(mThread));
if (NS_SUCCEEDED(rv)) {
rv = mThread->EventTarget()->Dispatch(event.forget(), NS_DISPATCH_NORMAL);
mScheduled = NS_SUCCEEDED(rv);
mThread->EventTarget()->Dispatch(event.forget(), NS_DISPATCH_NORMAL);
}
}
}
@ -804,8 +796,7 @@ AudioCallbackDriver::Start()
"to ensure it runs after previous shutdown."));
RefPtr<AsyncCubebTask> initEvent =
new AsyncCubebTask(AsAudioCallbackDriver(), AsyncCubebOperation::INIT);
nsresult rv = initEvent->Dispatch();
mScheduled = NS_SUCCEEDED(rv);
initEvent->Dispatch();
}
bool
@ -1078,25 +1069,13 @@ void
AudioCallbackDriver::StateCallback(cubeb_state aState)
{
LOG(LogLevel::Debug, ("AudioCallbackDriver State: %d", aState));
if (aState == CUBEB_STATE_ERROR) {
if (!mAudioStream) {
// If we don't have an audio stream here, this means that the stream
// initialization has failed. A fallback on a SystemCallDriver will happen at
// the callsite of `cubeb_stream_init`.
return;
}
MonitorAutoLock lock(GraphImpl()->GetMonitor());
if (NextDriver() && NextDriver()->Scheduled()) {
// We are switching to another driver that has already been scheduled
// to be initialized and started. There's nothing for us to do here.
return;
}
// If we don't have an audio stream here, this means that the stream
// initialization has failed. A fallback on a SystemCallDriver will happen at
// the callsite of `cubeb_stream_init`.
if (aState == CUBEB_STATE_ERROR && mAudioStream) {
// Fall back to a driver using a normal thread. If needed,
// the graph will try to re-open an audio stream later.
MonitorAutoLock lock(GraphImpl()->GetMonitor());
SystemClockDriver* nextDriver = new SystemClockDriver(GraphImpl());
SetNextDriver(nextDriver);
RemoveCallback();

Просмотреть файл

@ -150,9 +150,6 @@ public:
void SetNextDriver(GraphDriver* aNextDriver);
void SetPreviousDriver(GraphDriver* aPreviousDriver);
/* Return whether we have been scheduled to start. */
bool Scheduled();
/**
* If we are running a real time graph, get the current time stamp to schedule
* video frames. This has to be reimplemented by real time drivers.
@ -256,9 +253,6 @@ protected:
// driver at the end of this iteration.
// This must be accessed using the {Set,Get}NextDriver methods.
RefPtr<GraphDriver> mNextDriver;
// This is initially false, but set to true as soon the driver has been
// scheduled to start through GraphDriver::Start().
bool mScheduled;
virtual ~GraphDriver()
{ }
};