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
|
|
|
|
2015-03-21 09:28:04 -07:00
|
|
|
virtual nsresult Set(uint32_t aKey, const nsAString& aValue) override { return NS_ERROR_NOT_IMPLEMENTED; }
|
|
|
|
virtual nsresult Get(uint32_t aKey, nsAString& aValue) override { return NS_ERROR_NOT_IMPLEMENTED; }
|
|
|
|
virtual nsresult Set(uint32_t aKey, double aValue) override { return NS_ERROR_NOT_IMPLEMENTED; }
|
|
|
|
virtual nsresult Get(uint32_t aKey, double& aValue) override { return NS_ERROR_NOT_IMPLEMENTED; }
|
|
|
|
virtual nsresult Set(uint32_t aKey, int32_t aValue) override { return NS_ERROR_NOT_IMPLEMENTED; }
|
|
|
|
virtual nsresult Get(uint32_t aKey, int32_t& aValue) override { return NS_ERROR_NOT_IMPLEMENTED; }
|
|
|
|
virtual nsresult Set(uint32_t aKey, int64_t aValue) override { return NS_ERROR_NOT_IMPLEMENTED; }
|
|
|
|
virtual nsresult Get(uint32_t aKey, int64_t& aValue) override { return NS_ERROR_NOT_IMPLEMENTED; }
|
|
|
|
virtual nsresult Set(uint32_t aKey, bool aValue) override { return NS_ERROR_NOT_IMPLEMENTED; }
|
|
|
|
virtual nsresult Get(uint32_t aKey, bool& aValue) override { return NS_ERROR_NOT_IMPLEMENTED; }
|
|
|
|
virtual nsresult Set(uint32_t aKey, const Size& aValue) override { return NS_ERROR_NOT_IMPLEMENTED; }
|
|
|
|
virtual nsresult Get(uint32_t aKey, Size& aValue) override { return NS_ERROR_NOT_IMPLEMENTED; }
|
|
|
|
virtual nsresult Set(uint32_t aKey, const nsTArray<Region>& aRegions) override { return NS_ERROR_NOT_IMPLEMENTED; }
|
|
|
|
virtual nsresult Get(uint32_t aKey, nsTArray<Region>& aRegions) override { return NS_ERROR_NOT_IMPLEMENTED; }
|
2014-02-14 14:41:07 -08:00
|
|
|
|
2015-03-21 09:28:04 -07:00
|
|
|
virtual nsresult SetLocation(const Position& aLocation) override { return NS_ERROR_NOT_IMPLEMENTED; }
|
2014-02-14 14:41:07 -08:00
|
|
|
|
2015-03-21 09:28:04 -07:00
|
|
|
virtual nsresult Get(uint32_t aKey, nsTArray<Size>& aSizes) override { return NS_ERROR_NOT_IMPLEMENTED; }
|
|
|
|
virtual nsresult Get(uint32_t aKey, nsTArray<nsString>& aValues) override { return NS_ERROR_NOT_IMPLEMENTED; }
|
|
|
|
virtual nsresult Get(uint32_t aKey, nsTArray<double>& aValues) override { return NS_ERROR_NOT_IMPLEMENTED; }
|
2014-02-14 14:41:07 -08:00
|
|
|
|
2015-03-21 09:28:04 -07:00
|
|
|
virtual nsresult GetRecorderProfiles(nsTArray<nsString>& aProfiles) override { return NS_ERROR_NOT_IMPLEMENTED; }
|
|
|
|
virtual RecorderProfile* GetProfileInfo(const nsAString& aProfile) override { return nullptr; }
|
2014-10-31 10:19:06 -07:00
|
|
|
|
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();
|
|
|
|
|
2015-03-21 09:28:04 -07:00
|
|
|
virtual nsresult StartPreviewImpl() override { return NS_ERROR_NOT_INITIALIZED; }
|
|
|
|
virtual nsresult StopPreviewImpl() override { return NS_ERROR_NOT_INITIALIZED; }
|
|
|
|
virtual nsresult AutoFocusImpl() override { return NS_ERROR_NOT_INITIALIZED; }
|
|
|
|
virtual nsresult StartFaceDetectionImpl() override { return NS_ERROR_NOT_INITIALIZED; }
|
|
|
|
virtual nsresult StopFaceDetectionImpl() override { return NS_ERROR_NOT_INITIALIZED; }
|
|
|
|
virtual nsresult TakePictureImpl() override { return NS_ERROR_NOT_INITIALIZED; }
|
2014-02-14 14:41:07 -08:00
|
|
|
virtual nsresult StartRecordingImpl(DeviceStorageFileDescriptor* aFileDescriptor,
|
2015-03-21 09:28:04 -07:00
|
|
|
const StartRecordingOptions* aOptions = nullptr) override
|
2014-04-25 13:28:15 -07:00
|
|
|
{ return NS_ERROR_NOT_INITIALIZED; }
|
2015-03-21 09:28:04 -07:00
|
|
|
virtual nsresult StopRecordingImpl() override { return NS_ERROR_NOT_INITIALIZED; }
|
|
|
|
virtual nsresult PushParametersImpl() override { return NS_ERROR_NOT_INITIALIZED; }
|
|
|
|
virtual nsresult PullParametersImpl() override { return NS_ERROR_NOT_INITIALIZED; }
|
2012-07-30 14:59:05 -07:00
|
|
|
|
|
|
|
private:
|
2015-01-06 15:35:02 -08:00
|
|
|
FallbackCameraControl(const FallbackCameraControl&) = delete;
|
|
|
|
FallbackCameraControl& operator=(const FallbackCameraControl&) = delete;
|
2012-07-30 14:59:05 -07:00
|
|
|
};
|