Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bug 740997 - ICS camera support, r=jst,gal,roc
- Loading branch information
Mike Habicher
committed
Jul 30, 2012
1 parent
4237747
commit 9e245cc
Showing
38 changed files
with
4,807 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -70,6 +70,7 @@ DIRS += \ | |
ipc \ | ||
identity \ | ||
workers \ | ||
camera \ | ||
$(NULL) | ||
|
||
ifdef MOZ_B2G_RIL | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
/* 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/. */ | ||
|
||
#ifndef DOM_CAMERA_NSCAMERACAPABILITIES_H | ||
#define DOM_CAMERA_NSCAMERACAPABILITIES_H | ||
|
||
#include "CameraControl.h" | ||
#include "nsAutoPtr.h" | ||
|
||
namespace mozilla { | ||
|
||
typedef nsresult (*ParseItemAndAddFunc)(JSContext* aCx, JSObject* aArray, PRUint32 aIndex, const char* aStart, char** aEnd); | ||
|
||
class nsCameraCapabilities : public nsICameraCapabilities | ||
{ | ||
public: | ||
NS_DECL_ISUPPORTS | ||
NS_DECL_NSICAMERACAPABILITIES | ||
|
||
nsCameraCapabilities(nsCameraControl* aCamera); | ||
|
||
nsresult ParameterListToNewArray( | ||
JSContext* cx, | ||
JSObject** aArray, | ||
PRUint32 aKey, | ||
ParseItemAndAddFunc aParseItemAndAdd | ||
); | ||
nsresult StringListToNewObject(JSContext* aCx, JS::Value* aArray, PRUint32 aKey); | ||
nsresult DimensionListToNewObject(JSContext* aCx, JS::Value* aArray, PRUint32 aKey); | ||
|
||
private: | ||
nsCameraCapabilities(const nsCameraCapabilities&) MOZ_DELETE; | ||
nsCameraCapabilities& operator=(const nsCameraCapabilities&) MOZ_DELETE; | ||
|
||
protected: | ||
/* additional members */ | ||
~nsCameraCapabilities(); | ||
nsCOMPtr<nsCameraControl> mCamera; | ||
}; | ||
|
||
} // namespace mozilla | ||
|
||
#endif // DOM_CAMERA_NSCAMERACAPABILITIES_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
/* -*- Mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; tab-width: 40 -*- */ | ||
/* vim: set ts=2 et sw=2 tw=40: */ | ||
/* 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/. */ | ||
|
||
#ifndef DOM_CAMERA_CAMERACOMMON_H | ||
#define DOM_CAMERA_CAMERACOMMON_H | ||
|
||
#ifndef __func__ | ||
#ifdef __FUNCTION__ | ||
#define __func__ __FUNCTION__ | ||
#else | ||
#define __func__ __FILE__ | ||
#endif | ||
#endif | ||
|
||
#ifndef NAN | ||
#define NAN std::numeric_limits<double>::quiet_NaN() | ||
#endif | ||
|
||
#include "nsThreadUtils.h" | ||
#include "nsIDOMCameraManager.h" | ||
|
||
#define DOM_CAMERA_LOG( l, ... ) \ | ||
do { \ | ||
if ( DOM_CAMERA_LOG_LEVEL >= (l) ) { \ | ||
printf_stderr (__VA_ARGS__); \ | ||
} \ | ||
} while (0) | ||
|
||
#define DOM_CAMERA_LOGA( ... ) DOM_CAMERA_LOG( 0, __VA_ARGS__ ) | ||
|
||
enum { | ||
DOM_CAMERA_LOG_NOTHING, | ||
DOM_CAMERA_LOG_ERROR, | ||
DOM_CAMERA_LOG_WARNING, | ||
DOM_CAMERA_LOG_INFO | ||
}; | ||
|
||
#define DOM_CAMERA_LOGI( ... ) DOM_CAMERA_LOG( DOM_CAMERA_LOG_INFO, __VA_ARGS__ ) | ||
#define DOM_CAMERA_LOGW( ... ) DOM_CAMERA_LOG( DOM_CAMERA_LOG_WARNING, __VA_ARGS__ ) | ||
#define DOM_CAMERA_LOGE( ... ) DOM_CAMERA_LOG( DOM_CAMERA_LOG_ERROR, __VA_ARGS__ ) | ||
|
||
class CameraErrorResult : public nsRunnable | ||
{ | ||
public: | ||
CameraErrorResult(nsICameraErrorCallback* onError, const nsString& aErrorMsg) | ||
: mOnErrorCb(onError) | ||
, mErrorMsg(aErrorMsg) | ||
{ } | ||
|
||
NS_IMETHOD Run() | ||
{ | ||
MOZ_ASSERT(NS_IsMainThread()); | ||
|
||
if (mOnErrorCb) { | ||
mOnErrorCb->HandleEvent(mErrorMsg); | ||
} | ||
return NS_OK; | ||
} | ||
|
||
protected: | ||
nsCOMPtr<nsICameraErrorCallback> mOnErrorCb; | ||
const nsString mErrorMsg; | ||
}; | ||
|
||
#endif // DOM_CAMERA_CAMERACOMMON_H |
Oops, something went wrong.