Bug 1287854 - Fix MediaEngineGonk build r=padenot

MozReview-Commit-ID: 5jmepGcWiIG

--HG--
extra : rebase_source : 55e0d6b33dd2670fb4ac40afca011c1d34b438f8
This commit is contained in:
Alexandre Lissy 2016-07-19 19:09:16 +02:00
Родитель faa2229a5e
Коммит d62c2c8293
2 изменённых файлов: 25 добавлений и 12 удалений

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

@ -104,7 +104,7 @@ MediaEngineGonkVideoSource::NotifyPull(MediaStreamGraph* aGraph,
}
size_t
MediaEngineGonkVideoSource::NumCapabilities()
MediaEngineGonkVideoSource::NumCapabilities() const
{
// TODO: Stop hardcoding. Use GetRecorderProfiles+GetProfileInfo (Bug 1128550)
//
@ -150,13 +150,16 @@ nsresult
MediaEngineGonkVideoSource::Allocate(const dom::MediaTrackConstraints& aConstraints,
const MediaEnginePrefs& aPrefs,
const nsString& aDeviceId,
const nsACString& aOrigin)
const nsACString& aOrigin,
BaseAllocationHandle** aOutHandle,
const char** aOutBadConstraint)
{
LOG((__FUNCTION__));
ReentrantMonitorAutoEnter sync(mCallbackMonitor);
if (mState == kReleased && mInitDone) {
ChooseCapability(aConstraints, aPrefs, aDeviceId);
NormalizedConstraints constraints(aConstraints);
ChooseCapability(constraints, aPrefs, aDeviceId);
NS_DispatchToMainThread(WrapRunnable(RefPtr<MediaEngineGonkVideoSource>(this),
&MediaEngineGonkVideoSource::AllocImpl));
mCallbackMonitor.Wait();
@ -165,13 +168,17 @@ MediaEngineGonkVideoSource::Allocate(const dom::MediaTrackConstraints& aConstrai
}
}
aOutHandle = nullptr;
return NS_OK;
}
nsresult
MediaEngineGonkVideoSource::Deallocate()
MediaEngineGonkVideoSource::Deallocate(BaseAllocationHandle* aHandle)
{
LOG((__FUNCTION__));
AssertIsOnOwningThread();
MOZ_ASSERT(!aHandle);
bool empty;
{
MonitorAutoLock lock(mMonitor);
@ -332,9 +339,11 @@ MediaEngineGonkVideoSource::Stop(SourceMediaStream* aSource, TrackID aID)
}
nsresult
MediaEngineGonkVideoSource::Restart(const dom::MediaTrackConstraints& aConstraints,
MediaEngineGonkVideoSource::Restart(BaseAllocationHandle* aHandle,
const dom::MediaTrackConstraints& aConstraints,
const MediaEnginePrefs& aPrefs,
const nsString& aDeviceId)
const nsString& aDeviceId,
const char** aOutBadConstraint)
{
return NS_OK;
}
@ -384,7 +393,7 @@ MediaEngineGonkVideoSource::Shutdown()
}
if (mState == kAllocated || mState == kStopped) {
Deallocate();
Deallocate(nullptr);
}
mState = kReleased;

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

@ -63,14 +63,18 @@ public:
nsresult Allocate(const dom::MediaTrackConstraints &aConstraints,
const MediaEnginePrefs &aPrefs,
const nsString& aDeviceId,
const nsACString& aOrigin) override;
nsresult Deallocate() override;
const nsACString& aOrigin,
BaseAllocationHandle** aOutHandle,
const char** aOutBadConstraint) override;
nsresult Deallocate(BaseAllocationHandle* aHandle) override;
nsresult Start(SourceMediaStream* aStream, TrackID aID,
const PrincipalHandle& aPrincipalHandle) override;
nsresult Stop(SourceMediaStream* aSource, TrackID aID) override;
nsresult Restart(const dom::MediaTrackConstraints& aConstraints,
nsresult Restart(BaseAllocationHandle* aHandle,
const dom::MediaTrackConstraints& aConstraints,
const MediaEnginePrefs &aPrefs,
const nsString& aDeviceId) override;
const nsString& aDeviceId,
const char** aOutBadConstraint) override;
void NotifyPull(MediaStreamGraph* aGraph,
SourceMediaStream* aSource,
TrackID aId,
@ -114,7 +118,7 @@ protected:
// Initialize the needed Video engine interfaces.
void Init();
void Shutdown();
size_t NumCapabilities() override;
size_t NumCapabilities() const override;
// Initialize the recording frame (MediaBuffer) callback and Gonk camera.
// MediaBuffer will transfers to MediaStreamGraph via AppendToTrack.
nsresult InitDirectMediaBuffer();