mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 973790 - only call ClearCurrentFrame() when closing down the camera hardware, r=dhylands
This commit is contained in:
parent
9e32e131fd
commit
8b4193c3a5
@ -215,11 +215,18 @@ nsGonkCameraControl::SetConfigurationImpl(const Configuration& aConfig)
|
|||||||
MOZ_ASSERT(NS_GetCurrentThread() == mCameraThread);
|
MOZ_ASSERT(NS_GetCurrentThread() == mCameraThread);
|
||||||
|
|
||||||
// Stop any currently running preview
|
// Stop any currently running preview
|
||||||
StopPreviewImpl();
|
nsresult rv = PausePreview();
|
||||||
|
if (NS_FAILED(rv)) {
|
||||||
|
// warn, but plow ahead
|
||||||
|
NS_WARNING("PausePreview() in SetConfigurationImpl() failed");
|
||||||
|
}
|
||||||
|
|
||||||
DOM_CAMERA_LOGT("%s:%d\n", __func__, __LINE__);
|
DOM_CAMERA_LOGT("%s:%d\n", __func__, __LINE__);
|
||||||
nsresult rv = SetConfigurationInternal(aConfig);
|
rv = SetConfigurationInternal(aConfig);
|
||||||
NS_ENSURE_SUCCESS(rv, rv);
|
if (NS_WARN_IF(NS_FAILED(rv))) {
|
||||||
|
StopPreviewImpl();
|
||||||
|
return rv;
|
||||||
|
}
|
||||||
|
|
||||||
// Restart the preview
|
// Restart the preview
|
||||||
DOM_CAMERA_LOGT("%s:%d\n", __func__, __LINE__);
|
DOM_CAMERA_LOGT("%s:%d\n", __func__, __LINE__);
|
||||||
@ -506,11 +513,22 @@ nsGonkCameraControl::StopPreviewImpl()
|
|||||||
DOM_CAMERA_LOGI("Stopping preview (this=%p)\n", this);
|
DOM_CAMERA_LOGI("Stopping preview (this=%p)\n", this);
|
||||||
|
|
||||||
mCameraHw->StopPreview();
|
mCameraHw->StopPreview();
|
||||||
|
|
||||||
OnPreviewStateChange(CameraControlListener::kPreviewStopped);
|
OnPreviewStateChange(CameraControlListener::kPreviewStopped);
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
nsresult
|
||||||
|
nsGonkCameraControl::PausePreview()
|
||||||
|
{
|
||||||
|
RETURN_IF_NO_CAMERA_HW();
|
||||||
|
|
||||||
|
DOM_CAMERA_LOGI("Pausing preview (this=%p)\n", this);
|
||||||
|
|
||||||
|
mCameraHw->StopPreview();
|
||||||
|
OnPreviewStateChange(CameraControlListener::kPreviewPaused);
|
||||||
|
return NS_OK;
|
||||||
|
}
|
||||||
|
|
||||||
nsresult
|
nsresult
|
||||||
nsGonkCameraControl::AutoFocusImpl(bool aCancelExistingCall)
|
nsGonkCameraControl::AutoFocusImpl(bool aCancelExistingCall)
|
||||||
{
|
{
|
||||||
|
@ -116,6 +116,7 @@ protected:
|
|||||||
nsresult SetupRecording(int aFd, int aRotation, int64_t aMaxFileSizeBytes, int64_t aMaxVideoLengthMs);
|
nsresult SetupRecording(int aFd, int aRotation, int64_t aMaxFileSizeBytes, int64_t aMaxVideoLengthMs);
|
||||||
nsresult SetupVideoMode(const nsAString& aProfile);
|
nsresult SetupVideoMode(const nsAString& aProfile);
|
||||||
nsresult SetPreviewSize(const Size& aSize);
|
nsresult SetPreviewSize(const Size& aSize);
|
||||||
|
nsresult PausePreview();
|
||||||
|
|
||||||
friend class SetPictureSize;
|
friend class SetPictureSize;
|
||||||
friend class SetThumbnailSize;
|
friend class SetThumbnailSize;
|
||||||
|
Loading…
Reference in New Issue
Block a user