mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-09 03:15:11 +00:00
Bug 990761 - handle HDR sending us more than one picture, r=dhylands
This commit is contained in:
parent
dcfd96e877
commit
1f2a99f065
@ -139,6 +139,8 @@ nsGonkCameraControl::Initialize()
|
||||
|
||||
// Set preferred preview frame format.
|
||||
mParams.Set(CAMERA_PARAM_PREVIEWFORMAT, NS_LITERAL_STRING("yuv420sp"));
|
||||
// Turn off any normal pictures returned by the HDR scene mode
|
||||
mParams.Set(CAMERA_PARAM_SCENEMODE_HDR_RETURNNORMALPICTURE, false);
|
||||
PushParametersImpl();
|
||||
|
||||
// Grab any other settings we'll need later.
|
||||
|
@ -147,7 +147,6 @@ protected:
|
||||
bool mFlashSupported;
|
||||
bool mLuminanceSupported;
|
||||
bool mAutoFlashModeOverridden;
|
||||
|
||||
Atomic<uint32_t> mDeferConfigUpdate;
|
||||
GonkCameraParameters mParams;
|
||||
|
||||
|
@ -81,6 +81,10 @@ GonkCameraParameters::Parameters::GetTextKey(uint32_t aKey)
|
||||
return "iso";
|
||||
case CAMERA_PARAM_LUMINANCE:
|
||||
return "luminance-condition";
|
||||
case CAMERA_PARAM_SCENEMODE_HDR_RETURNNORMALPICTURE:
|
||||
// Not every platform defines KEY_QC_HDR_NEED_1X;
|
||||
// for those that don't, we use the raw string key.
|
||||
return "hdr-need-1x";
|
||||
|
||||
case CAMERA_PARAM_SUPPORTED_PREVIEWSIZES:
|
||||
return KEY_SUPPORTED_PREVIEW_SIZES;
|
||||
@ -685,6 +689,19 @@ GonkCameraParameters::GetTranslated(uint32_t aKey, uint32_t& aValue)
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
// Handle bools
|
||||
nsresult
|
||||
GonkCameraParameters::SetTranslated(uint32_t aKey, const bool& aValue)
|
||||
{
|
||||
return SetImpl(aKey, aValue);
|
||||
}
|
||||
|
||||
nsresult
|
||||
GonkCameraParameters::GetTranslated(uint32_t aKey, bool& aValue)
|
||||
{
|
||||
return GetImpl(aKey, aValue);
|
||||
}
|
||||
|
||||
nsresult
|
||||
ParseItem(const char* aStart, const char* aEnd, ICameraControl::Size* aItem)
|
||||
{
|
||||
|
@ -103,13 +103,18 @@ protected:
|
||||
{
|
||||
public:
|
||||
using android::CameraParameters::set;
|
||||
using android::CameraParameters::get;
|
||||
using android::CameraParameters::TRUE;
|
||||
using android::CameraParameters::FALSE;
|
||||
|
||||
void set(const char* aKey, float aValue) { setFloat(aKey, aValue); }
|
||||
void set(const char* aKey, double aValue) { setFloat(aKey, aValue); }
|
||||
void set(const char* aKey, bool aValue) { set(aKey, aValue ? TRUE : FALSE); }
|
||||
void get(const char* aKey, float& aRet) { aRet = getFloat(aKey); }
|
||||
void get(const char* aKey, double& aRet) { aRet = getFloat(aKey); }
|
||||
void get(const char* aKey, const char*& aRet) { aRet = android::CameraParameters::get(aKey); }
|
||||
void get(const char* aKey, const char*& aRet) { aRet = get(aKey); }
|
||||
void get(const char* aKey, int& aRet) { aRet = getInt(aKey); }
|
||||
void get(const char* aKey, bool& aRet) { aRet = strcmp(get(aKey), FALSE); }
|
||||
|
||||
static const char* GetTextKey(uint32_t aKey);
|
||||
};
|
||||
@ -173,6 +178,8 @@ protected:
|
||||
nsresult GetTranslated(uint32_t aKey, int& aValue);
|
||||
nsresult SetTranslated(uint32_t aKey, const uint32_t& aValue);
|
||||
nsresult GetTranslated(uint32_t aKey, uint32_t& aValue);
|
||||
nsresult SetTranslated(uint32_t aKey, const bool& aValue);
|
||||
nsresult GetTranslated(uint32_t aKey, bool& aValue);
|
||||
nsresult GetTranslated(uint32_t aKey, nsTArray<nsString>& aValues);
|
||||
nsresult GetTranslated(uint32_t aKey, nsTArray<double>& aValues);
|
||||
|
||||
|
@ -51,6 +51,7 @@ enum {
|
||||
CAMERA_PARAM_SENSORANGLE,
|
||||
CAMERA_PARAM_ISOMODE,
|
||||
CAMERA_PARAM_LUMINANCE,
|
||||
CAMERA_PARAM_SCENEMODE_HDR_RETURNNORMALPICTURE,
|
||||
|
||||
// supported features
|
||||
CAMERA_PARAM_SUPPORTED_PREVIEWSIZES,
|
||||
|
Loading…
Reference in New Issue
Block a user