michael@0: /* michael@0: * Copyright (C) 2013-2014 Mozilla Foundation michael@0: * michael@0: * Licensed under the Apache License, Version 2.0 (the "License"); michael@0: * you may not use this file except in compliance with the License. michael@0: * You may obtain a copy of the License at michael@0: * michael@0: * http://www.apache.org/licenses/LICENSE-2.0 michael@0: * michael@0: * Unless required by applicable law or agreed to in writing, software michael@0: * distributed under the License is distributed on an "AS IS" BASIS, michael@0: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. michael@0: * See the License for the specific language governing permissions and michael@0: * limitations under the License. michael@0: */ michael@0: michael@0: #ifndef DOM_CAMERA_TESTGONKCAMERAHARDWARE_H michael@0: #define DOM_CAMERA_TESTGONKCAMERAHARDWARE_H michael@0: michael@0: #include "GonkCameraHwMgr.h" michael@0: michael@0: namespace android { michael@0: michael@0: class TestGonkCameraHardware : public android::GonkCameraHardware michael@0: { michael@0: public: michael@0: virtual int AutoFocus() MOZ_OVERRIDE; michael@0: virtual int StartFaceDetection() MOZ_OVERRIDE; michael@0: virtual int StopFaceDetection() MOZ_OVERRIDE; michael@0: virtual int TakePicture() MOZ_OVERRIDE; michael@0: virtual int StartPreview() MOZ_OVERRIDE; michael@0: virtual int PushParameters(const mozilla::GonkCameraParameters& aParams) MOZ_OVERRIDE; michael@0: virtual nsresult PullParameters(mozilla::GonkCameraParameters& aParams) MOZ_OVERRIDE; michael@0: virtual int StartRecording() MOZ_OVERRIDE; michael@0: virtual int StopRecording() MOZ_OVERRIDE; michael@0: virtual int SetListener(const sp& aListener) MOZ_OVERRIDE; michael@0: virtual int StoreMetaDataInBuffers(bool aEnabled) MOZ_OVERRIDE; michael@0: michael@0: virtual int michael@0: PushParameters(const CameraParameters& aParams) MOZ_OVERRIDE michael@0: { michael@0: return GonkCameraHardware::PushParameters(aParams); michael@0: } michael@0: michael@0: virtual void michael@0: PullParameters(CameraParameters& aParams) MOZ_OVERRIDE michael@0: { michael@0: GonkCameraHardware::PullParameters(aParams); michael@0: } michael@0: michael@0: TestGonkCameraHardware(mozilla::nsGonkCameraControl* aTarget, michael@0: uint32_t aCameraId, michael@0: const sp& aCamera); michael@0: virtual ~TestGonkCameraHardware(); michael@0: michael@0: virtual nsresult Init() MOZ_OVERRIDE; michael@0: michael@0: protected: michael@0: const nsCString TestCase(); michael@0: const nsCString GetExtraParameters(); michael@0: bool IsTestCaseInternal(const char* aTest, const char* aFile, int aLine); michael@0: int TestCaseError(int aDefaultError); michael@0: michael@0: int StartAutoFocusMoving(bool aIsMoving); michael@0: michael@0: private: michael@0: TestGonkCameraHardware(const TestGonkCameraHardware&) MOZ_DELETE; michael@0: TestGonkCameraHardware& operator=(const TestGonkCameraHardware&) MOZ_DELETE; michael@0: }; michael@0: michael@0: #define IsTestCase(test) IsTestCaseInternal((test), __FILE__, __LINE__) michael@0: michael@0: } // namespace android michael@0: michael@0: #endif // DOM_CAMERA_TESTGONKCAMERAHARDWARE_H