2014-02-14 14:41:07 -08:00
|
|
|
/* 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 http://mozilla.org/MPL/2.0/. */
|
|
|
|
|
|
|
|
#ifndef DOM_CAMERA_DOMCAMERACONTROLLISTENER_H
|
|
|
|
#define DOM_CAMERA_DOMCAMERACONTROLLISTENER_H
|
|
|
|
|
|
|
|
#include "nsProxyRelease.h"
|
|
|
|
#include "CameraControlListener.h"
|
|
|
|
|
|
|
|
namespace mozilla {
|
|
|
|
|
|
|
|
class nsDOMCameraControl;
|
|
|
|
class CameraPreviewMediaStream;
|
|
|
|
|
|
|
|
class DOMCameraControlListener : public CameraControlListener
|
|
|
|
{
|
2014-02-19 20:18:52 -08:00
|
|
|
public:
|
|
|
|
DOMCameraControlListener(nsDOMCameraControl* aDOMCameraControl, CameraPreviewMediaStream* aStream);
|
|
|
|
|
|
|
|
virtual void OnAutoFocusComplete(bool aAutoFocusSucceeded) MOZ_OVERRIDE;
|
2014-04-09 08:12:25 -07:00
|
|
|
virtual void OnAutoFocusMoving(bool aIsMoving) MOZ_OVERRIDE;
|
2014-04-09 08:52:10 -07:00
|
|
|
virtual void OnFacesDetected(const nsTArray<ICameraControl::Face>& aFaces) MOZ_OVERRIDE;
|
2014-02-19 20:18:52 -08:00
|
|
|
virtual void OnTakePictureComplete(uint8_t* aData, uint32_t aLength, const nsAString& aMimeType) MOZ_OVERRIDE;
|
|
|
|
|
|
|
|
virtual void OnHardwareStateChange(HardwareState aState) MOZ_OVERRIDE;
|
|
|
|
virtual void OnPreviewStateChange(PreviewState aState) MOZ_OVERRIDE;
|
|
|
|
virtual void OnRecorderStateChange(RecorderState aState, int32_t aStatus, int32_t aTrackNum) MOZ_OVERRIDE;
|
|
|
|
virtual void OnConfigurationChange(const CameraListenerConfiguration& aConfiguration) MOZ_OVERRIDE;
|
|
|
|
virtual void OnShutter() MOZ_OVERRIDE;
|
2014-07-02 16:55:00 -07:00
|
|
|
virtual void OnRateLimitPreview(bool aLimit) MOZ_OVERRIDE;
|
2014-02-19 20:18:52 -08:00
|
|
|
virtual bool OnNewPreviewFrame(layers::Image* aImage, uint32_t aWidth, uint32_t aHeight) MOZ_OVERRIDE;
|
2014-04-25 13:28:15 -07:00
|
|
|
virtual void OnUserError(UserContext aContext, nsresult aError) MOZ_OVERRIDE;
|
2014-02-19 20:18:52 -08:00
|
|
|
|
2014-02-14 14:41:07 -08:00
|
|
|
protected:
|
2014-02-19 20:18:52 -08:00
|
|
|
virtual ~DOMCameraControlListener();
|
|
|
|
|
2014-02-14 14:41:07 -08:00
|
|
|
nsMainThreadPtrHandle<nsDOMCameraControl> mDOMCameraControl;
|
|
|
|
CameraPreviewMediaStream* mStream;
|
|
|
|
|
|
|
|
class DOMCallback;
|
|
|
|
|
|
|
|
private:
|
|
|
|
DOMCameraControlListener(const DOMCameraControlListener&) MOZ_DELETE;
|
|
|
|
DOMCameraControlListener& operator=(const DOMCameraControlListener&) MOZ_DELETE;
|
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace mozilla
|
|
|
|
|
|
|
|
#endif // DOM_CAMERA_DOMCAMERACONTROLLISTENER_H
|