2012-07-31 01:59:05 +04: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-05 05:01:56 +04:00
|
|
|
#include "CameraControlImpl.h"
|
2012-07-31 01:59:05 +04:00
|
|
|
|
|
|
|
using namespace mozilla;
|
2012-11-10 19:45:52 +04:00
|
|
|
using namespace mozilla::dom;
|
2012-07-31 01:59:05 +04:00
|
|
|
|
2012-10-24 02:30:28 +04:00
|
|
|
namespace mozilla {
|
2014-02-15 02:41:07 +04:00
|
|
|
class RecorderProfileManager;
|
|
|
|
|
|
|
|
namespace layers {
|
|
|
|
class GraphicBufferLocked;
|
2015-07-13 18:25:42 +03:00
|
|
|
} // namespace layers
|
|
|
|
} // namespace mozilla
|
2012-10-24 02:30:28 +04:00
|
|
|
|
2012-07-31 01:59:05 +04:00
|
|
|
/**
|
2014-02-15 02:41:07 +04:00
|
|
|
* Fallback camera control subclass. Can be used as a template for the
|
2012-07-31 01:59:05 +04:00
|
|
|
* definition of new camera support classes.
|
|
|
|
*/
|
2014-02-15 02:41:07 +04:00
|
|
|
class FallbackCameraControl : public CameraControlImpl
|
2012-07-31 01:59:05 +04:00
|
|
|
{
|
|
|
|
public:
|
2014-12-13 05:18:03 +03:00
|
|
|
explicit FallbackCameraControl() : CameraControlImpl() { }
|
2014-02-15 02:41:07 +04:00
|
|
|
|
2015-03-21 19:28:04 +03: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-15 02:41:07 +04:00
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual nsresult SetLocation(const Position& aLocation) override { return NS_ERROR_NOT_IMPLEMENTED; }
|
2014-02-15 02:41:07 +04:00
|
|
|
|
2015-03-21 19:28:04 +03: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-15 02:41:07 +04:00
|
|
|
|
2015-03-21 19:28:04 +03: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 20:19:06 +03:00
|
|
|
|
2014-04-26 00:28:15 +04:00
|
|
|
nsresult PushParameters() { return NS_ERROR_NOT_INITIALIZED; }
|
|
|
|
nsresult PullParameters() { return NS_ERROR_NOT_INITIALIZED; }
|
2012-07-31 01:59:05 +04:00
|
|
|
|
|
|
|
protected:
|
2014-02-15 02:41:07 +04:00
|
|
|
~FallbackCameraControl();
|
|
|
|
|
2015-03-21 19:28:04 +03: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-15 02:41:07 +04:00
|
|
|
virtual nsresult StartRecordingImpl(DeviceStorageFileDescriptor* aFileDescriptor,
|
2015-03-21 19:28:04 +03:00
|
|
|
const StartRecordingOptions* aOptions = nullptr) override
|
2014-04-26 00:28:15 +04:00
|
|
|
{ return NS_ERROR_NOT_INITIALIZED; }
|
2015-03-21 19:28:04 +03: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-31 01:59:05 +04:00
|
|
|
|
|
|
|
private:
|
2015-01-07 02:35:02 +03:00
|
|
|
FallbackCameraControl(const FallbackCameraControl&) = delete;
|
|
|
|
FallbackCameraControl& operator=(const FallbackCameraControl&) = delete;
|
2012-07-31 01:59:05 +04:00
|
|
|
};
|