dom/camera/TestGonkCameraHardware.h

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/dom/camera/TestGonkCameraHardware.h	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,75 @@
     1.4 +/*
     1.5 + * Copyright (C) 2013-2014 Mozilla Foundation
     1.6 + *
     1.7 + * Licensed under the Apache License, Version 2.0 (the "License");
     1.8 + * you may not use this file except in compliance with the License.
     1.9 + * You may obtain a copy of the License at
    1.10 + *
    1.11 + *      http://www.apache.org/licenses/LICENSE-2.0
    1.12 + *
    1.13 + * Unless required by applicable law or agreed to in writing, software
    1.14 + * distributed under the License is distributed on an "AS IS" BASIS,
    1.15 + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    1.16 + * See the License for the specific language governing permissions and
    1.17 + * limitations under the License.
    1.18 + */
    1.19 +
    1.20 +#ifndef DOM_CAMERA_TESTGONKCAMERAHARDWARE_H
    1.21 +#define DOM_CAMERA_TESTGONKCAMERAHARDWARE_H
    1.22 +
    1.23 +#include "GonkCameraHwMgr.h"
    1.24 +
    1.25 +namespace android {
    1.26 +
    1.27 +class TestGonkCameraHardware : public android::GonkCameraHardware
    1.28 +{
    1.29 +public:
    1.30 +  virtual int AutoFocus() MOZ_OVERRIDE;
    1.31 +  virtual int StartFaceDetection() MOZ_OVERRIDE;
    1.32 +  virtual int StopFaceDetection() MOZ_OVERRIDE;
    1.33 +  virtual int TakePicture() MOZ_OVERRIDE;
    1.34 +  virtual int StartPreview() MOZ_OVERRIDE;
    1.35 +  virtual int PushParameters(const mozilla::GonkCameraParameters& aParams) MOZ_OVERRIDE;
    1.36 +  virtual nsresult PullParameters(mozilla::GonkCameraParameters& aParams) MOZ_OVERRIDE;
    1.37 +  virtual int StartRecording() MOZ_OVERRIDE;
    1.38 +  virtual int StopRecording() MOZ_OVERRIDE;
    1.39 +  virtual int SetListener(const sp<GonkCameraListener>& aListener) MOZ_OVERRIDE;
    1.40 +  virtual int StoreMetaDataInBuffers(bool aEnabled) MOZ_OVERRIDE;
    1.41 +
    1.42 +  virtual int
    1.43 +  PushParameters(const CameraParameters& aParams) MOZ_OVERRIDE
    1.44 +  {
    1.45 +    return GonkCameraHardware::PushParameters(aParams);
    1.46 +  }
    1.47 +
    1.48 +  virtual void
    1.49 +  PullParameters(CameraParameters& aParams) MOZ_OVERRIDE
    1.50 +  {
    1.51 +    GonkCameraHardware::PullParameters(aParams);
    1.52 +  }
    1.53 +
    1.54 +  TestGonkCameraHardware(mozilla::nsGonkCameraControl* aTarget,
    1.55 +                         uint32_t aCameraId,
    1.56 +                         const sp<Camera>& aCamera);
    1.57 +  virtual ~TestGonkCameraHardware();
    1.58 +
    1.59 +  virtual nsresult Init() MOZ_OVERRIDE;
    1.60 +
    1.61 +protected:
    1.62 +  const nsCString TestCase();
    1.63 +  const nsCString GetExtraParameters();
    1.64 +  bool IsTestCaseInternal(const char* aTest, const char* aFile, int aLine);
    1.65 +  int TestCaseError(int aDefaultError);
    1.66 +
    1.67 +  int StartAutoFocusMoving(bool aIsMoving);
    1.68 +
    1.69 +private:
    1.70 +  TestGonkCameraHardware(const TestGonkCameraHardware&) MOZ_DELETE;
    1.71 +  TestGonkCameraHardware& operator=(const TestGonkCameraHardware&) MOZ_DELETE;
    1.72 +};
    1.73 +
    1.74 +#define IsTestCase(test)  IsTestCaseInternal((test), __FILE__, __LINE__)
    1.75 +
    1.76 +} // namespace android
    1.77 +
    1.78 +#endif // DOM_CAMERA_TESTGONKCAMERAHARDWARE_H

mercurial