Bug 1265427 - nsDOMCameraControl needs an mOwnedStream to be consistent towards its VideoStreamTrack r=me

MozReview-Commit-ID: HfKPa4H7FyH

--HG--
extra : rebase_source : f40927672b9808d86a88e502a14ca68fafdb7497
This commit is contained in:
Andreas Pehrson 2016-04-19 17:12:24 +02:00
parent cb1c20b3c3
commit d72257eb98
3 changed files with 12 additions and 2 deletions

View File

@ -29,7 +29,7 @@ FakeMediaStreamGraph::DispatchToMainThreadAfterStreamStateUpdate(already_AddRefe
}
CameraPreviewMediaStream::CameraPreviewMediaStream(DOMMediaStream* aWrapper)
: MediaStream(aWrapper)
: ProcessedMediaStream(aWrapper)
, mMutex("mozilla::camera::CameraPreviewMediaStream")
, mInvalidatePending(0)
, mDiscardedFrames(0)
@ -130,6 +130,13 @@ CameraPreviewMediaStream::Invalidate()
}
}
void
CameraPreviewMediaStream::ProcessInput(GraphTime aFrom, GraphTime aTo,
uint32_t aFlags)
{
return;
}
void
CameraPreviewMediaStream::RateLimit(bool aLimit)
{

View File

@ -35,7 +35,7 @@ protected:
* A camera preview requests no delay and no buffering stream,
* but the SourceMediaStream does not support it.
*/
class CameraPreviewMediaStream : public MediaStream
class CameraPreviewMediaStream : public ProcessedMediaStream
{
typedef mozilla::layers::Image Image;
@ -56,6 +56,8 @@ public:
void Invalidate();
void ProcessInput(GraphTime aFrom, GraphTime aTo, uint32_t aFlags) override;
// Call these on any thread.
void SetCurrentFrame(const gfx::IntSize& aIntrinsicSize, Image* aImage);
void ClearCurrentFrame();

View File

@ -262,6 +262,7 @@ nsDOMCameraControl::nsDOMCameraControl(uint32_t aCameraId,
{
DOM_CAMERA_LOGT("%s:%d : this=%p\n", __func__, __LINE__, this);
mInput = new CameraPreviewMediaStream(this);
mOwnedStream = mInput;
BindToOwner(aWindow);