2012-07-30 14:59:05 -07: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/. */
|
|
|
|
|
2012-09-04 18:01:56 -07:00
|
|
|
#include "CameraControlImpl.h"
|
2012-07-30 14:59:05 -07:00
|
|
|
|
|
|
|
using namespace mozilla;
|
2012-11-10 07:45:52 -08:00
|
|
|
using namespace mozilla::dom;
|
2012-07-30 14:59:05 -07:00
|
|
|
|
2012-10-23 15:30:28 -07:00
|
|
|
namespace mozilla {
|
2014-02-14 14:41:07 -08:00
|
|
|
class RecorderProfileManager;
|
|
|
|
|
|
|
|
namespace layers {
|
|
|
|
class GraphicBufferLocked;
|
|
|
|
}
|
2012-10-23 15:30:28 -07:00
|
|
|
}
|
|
|
|
|
2012-07-30 14:59:05 -07:00
|
|
|
/**
|
2014-02-14 14:41:07 -08:00
|
|
|
* Fallback camera control subclass. Can be used as a template for the
|
2012-07-30 14:59:05 -07:00
|
|
|
* definition of new camera support classes.
|
|
|
|
*/
|
2014-02-14 14:41:07 -08:00
|
|
|
class FallbackCameraControl : public CameraControlImpl
|
2012-07-30 14:59:05 -07:00
|
|
|
{
|
|
|
|
public:
|
2014-12-12 18:18:03 -08:00
|
|
|
explicit FallbackCameraControl() : CameraControlImpl() { }
|
2014-02-14 14:41:07 -08:00
|
|
|
|
2014-04-25 13:28:15 -07:00
|
|
|
virtual nsresult Set(uint32_t aKey, const nsAString& aValue) MOZ_OVERRIDE { return NS_ERROR_NOT_IMPLEMENTED; }
|
|
|
|
virtual nsresult Get(uint32_t aKey, nsAString& aValue) MOZ_OVERRIDE { return NS_ERROR_NOT_IMPLEMENTED; }
|
|
|
|
virtual nsresult Set(uint32_t aKey, double aValue) MOZ_OVERRIDE { return NS_ERROR_NOT_IMPLEMENTED; }
|
|
|
|
virtual nsresult Get(uint32_t aKey, double& aValue) MOZ_OVERRIDE { return NS_ERROR_NOT_IMPLEMENTED; }
|
|
|
|
virtual nsresult Set(uint32_t aKey, int32_t aValue) MOZ_OVERRIDE { return NS_ERROR_NOT_IMPLEMENTED; }
|
|
|
|
virtual nsresult Get(uint32_t aKey, int32_t& aValue) MOZ_OVERRIDE { return NS_ERROR_NOT_IMPLEMENTED; }
|
|
|
|
virtual nsresult Set(uint32_t aKey, int64_t aValue) MOZ_OVERRIDE { return NS_ERROR_NOT_IMPLEMENTED; }
|
|
|
|
virtual nsresult Get(uint32_t aKey, int64_t& aValue) MOZ_OVERRIDE { return NS_ERROR_NOT_IMPLEMENTED; }
|
2014-06-30 03:33:00 -07:00
|
|
|
virtual nsresult Set(uint32_t aKey, bool aValue) MOZ_OVERRIDE { return NS_ERROR_NOT_IMPLEMENTED; }
|
|
|
|
virtual nsresult Get(uint32_t aKey, bool& aValue) MOZ_OVERRIDE { return NS_ERROR_NOT_IMPLEMENTED; }
|
2014-04-25 13:28:15 -07:00
|
|
|
virtual nsresult Set(uint32_t aKey, const Size& aValue) MOZ_OVERRIDE { return NS_ERROR_NOT_IMPLEMENTED; }
|
|
|
|
virtual nsresult Get(uint32_t aKey, Size& aValue) MOZ_OVERRIDE { return NS_ERROR_NOT_IMPLEMENTED; }
|
|
|
|
virtual nsresult Set(uint32_t aKey, const nsTArray<Region>& aRegions) MOZ_OVERRIDE { return NS_ERROR_NOT_IMPLEMENTED; }
|
|
|
|
virtual nsresult Get(uint32_t aKey, nsTArray<Region>& aRegions) MOZ_OVERRIDE { return NS_ERROR_NOT_IMPLEMENTED; }
|
2014-02-14 14:41:07 -08:00
|
|
|
|
2014-04-25 13:28:15 -07:00
|
|
|
virtual nsresult SetLocation(const Position& aLocation) MOZ_OVERRIDE { return NS_ERROR_NOT_IMPLEMENTED; }
|
2014-02-14 14:41:07 -08:00
|
|
|
|
2014-04-25 13:28:15 -07:00
|
|
|
virtual nsresult Get(uint32_t aKey, nsTArray<Size>& aSizes) MOZ_OVERRIDE { return NS_ERROR_NOT_IMPLEMENTED; }
|
|
|
|
virtual nsresult Get(uint32_t aKey, nsTArray<nsString>& aValues) MOZ_OVERRIDE { return NS_ERROR_NOT_IMPLEMENTED; }
|
|
|
|
virtual nsresult Get(uint32_t aKey, nsTArray<double>& aValues) MOZ_OVERRIDE { return NS_ERROR_NOT_IMPLEMENTED; }
|
2014-02-14 14:41:07 -08:00
|
|
|
|
2014-10-31 10:19:06 -07:00
|
|
|
virtual nsresult GetRecorderProfiles(nsTArray<nsString>& aProfiles) MOZ_OVERRIDE { return NS_ERROR_NOT_IMPLEMENTED; }
|
|
|
|
virtual RecorderProfile* GetProfileInfo(const nsAString& aProfile) MOZ_OVERRIDE { return nullptr; }
|
|
|
|
|
2014-04-25 13:28:15 -07:00
|
|
|
nsresult PushParameters() { return NS_ERROR_NOT_INITIALIZED; }
|
|
|
|
nsresult PullParameters() { return NS_ERROR_NOT_INITIALIZED; }
|
2012-07-30 14:59:05 -07:00
|
|
|
|
|
|
|
protected:
|
2014-02-14 14:41:07 -08:00
|
|
|
~FallbackCameraControl();
|
|
|
|
|
2014-04-25 13:28:15 -07:00
|
|
|
virtual nsresult StartPreviewImpl() { return NS_ERROR_NOT_INITIALIZED; }
|
|
|
|
virtual nsresult StopPreviewImpl() { return NS_ERROR_NOT_INITIALIZED; }
|
|
|
|
virtual nsresult AutoFocusImpl() { return NS_ERROR_NOT_INITIALIZED; }
|
|
|
|
virtual nsresult StartFaceDetectionImpl() { return NS_ERROR_NOT_INITIALIZED; }
|
|
|
|
virtual nsresult StopFaceDetectionImpl() { return NS_ERROR_NOT_INITIALIZED; }
|
|
|
|
virtual nsresult TakePictureImpl() { return NS_ERROR_NOT_INITIALIZED; }
|
2014-02-14 14:41:07 -08:00
|
|
|
virtual nsresult StartRecordingImpl(DeviceStorageFileDescriptor* aFileDescriptor,
|
2014-04-15 12:46:40 -07:00
|
|
|
const StartRecordingOptions* aOptions = nullptr) MOZ_OVERRIDE
|
2014-04-25 13:28:15 -07:00
|
|
|
{ return NS_ERROR_NOT_INITIALIZED; }
|
|
|
|
virtual nsresult StopRecordingImpl() { return NS_ERROR_NOT_INITIALIZED; }
|
|
|
|
virtual nsresult PushParametersImpl() { return NS_ERROR_NOT_INITIALIZED; }
|
|
|
|
virtual nsresult PullParametersImpl() { return NS_ERROR_NOT_INITIALIZED; }
|
2012-07-30 14:59:05 -07:00
|
|
|
|
|
|
|
private:
|
2014-02-14 14:41:07 -08:00
|
|
|
FallbackCameraControl(const FallbackCameraControl&) MOZ_DELETE;
|
|
|
|
FallbackCameraControl& operator=(const FallbackCameraControl&) MOZ_DELETE;
|
2012-07-30 14:59:05 -07:00
|
|
|
};
|