mirror of
https://github.com/roytam1/palemoon27.git
synced 2026-05-26 14:30:27 +00:00
4ac9bef80d
- Bug 936092, initial DnD support for e10s, r=enndeakin,karlt (3cde556cf) - Bug 1152066 - Remove ugly dynamic loading code now that we can assume this symbol exists. r=roc (04813dd18) - Bug 966395 - Correctly propagate the input language's direction on OSX. r=masayuki/mrbkap (14a21fa0c) - Bug 1158791 - Try harder to avoid Gtk-Critical errors in xpcshell tests. r=karlt (f6cec3b99) - Bug 1153922 - Add a SandboxOptions option for creating the sandbox in a fresh JS::Zone. r=mrbkap (f99b17726) - Bug 968520 - Always use fallible allocator with nsTArray_base::ShrinkCapacity. r=froydnj (b7cf63063) - Bug 1160027 - Move ResourceQueue implementation from header file - r=cpearce (5fabd8c8f) - Bug 1119277 - Remove the process CPU priority parameter and simplify all the associated code. r=khuey, r=dhylands (32d2b0df2) - Goanna -> Gecko (2b16bec4c) - Bug 892371 - Adjust oom_score_adj values for foreground processes according to an LRU policy. r=dhylands, r=khuey (61cdfc3db) - Bug 892371 - Add mochitests covering LRU priority adjustments for both foreground and background processes. r=khuey (46676e34f) - Bug 1164297 - tweaks to logging modules of MediaDecoderStateMachine to remove accessing to env vars. r=cpearce. (e9dc910da) - Bug 1150539: log getUserMedia constraints used in MediaManager:5. r=jesup (161853b66) - Bug 1139027 - Permit running of camera mochitests on B2G desktop. r=mikeh (8bb265db2) - Bug 1145403 - Don't open MediaManager on shutdown. r=jesup (9338eef82) - Bug 1046245 - enumerateDevices w/non-blocking e10s, nsICryptoHMAC, clear cookies, lambdas. r=keeler, florian, billm, jesup (ce9d684a0) - remove StopWebRtcLoc() to be readded in Bug 1219339 - Part2 (7a0c901fc) - Bug 1046245 - IO on STS thread + cleanup BackgroundChild on shutdown r=jesup (e85dd7716) - Bug 579517 follow-up: Remove NSPR types that crept in (35aee15a6) - Bug 1152443 - Fix broken validation which prevented reading of enumerate_devices.txt. r=jesup (4e135355b) - Bug 1143562 - use /data/b2g/mozilla/gmp as the gmp storage folder on B2G. r=cpearce. (ddc07f09a) - Bug 1143562. Part2 - only init |mStorageBaseDir| in the chrome process. r=cpearce (3039a4f44) - remove specific hack, this code is going away anyway (34aed4d6b) - Bug 1057908 - GeckoMediaPluginService needs to be proxied from Content processes to parent process. Part 0 - Make mozIGeckoMediaPluginService::GetPluginVersionForAPI return whether we even have the plugin. r=cpearce. (e6ac61630) - Bug 1057908 - GeckoMediaPluginService needs to be proxied from Content processes to parent process. Part 1 - split GeckoMediaPluginService into a part for chrome and a part for both content and chrome. r=jwwang. (09f8c4a83) - Bug 1057908 - GeckoMediaPluginService needs to be proxied from Content processes to parent process. Part 2 - support asynchronous GMP API getters. r=jwwang,rjesup. (e33266976) - Bug 1143532 - Include pid in the log messages of GMPParent. r=edwin (8486ebc50) - Bug 1057908 - GeckoMediaPluginService needs to be proxied from Content processes to parent process. Part 3 - split the GMP IPDL actors in 2 parts (and use opens to open the second in non-e10s). r=billm. (d17fa36ff) - Bug 1057908 - GeckoMediaPluginService needs to be proxied from Content processes to parent process. Part 4 - make GetNodeId asynchronous. r=jwwang. (db7a21e4a) - Bug 1150049 - tidy up nsImageBoxFrame::Init a little bit; r=dholbert (41c258a71) - Bug 1150266 - fix IPDL thinko for never-inline method declarations; r=bent (445d3420b) - Bug 1150207 - Convert a focus() call to use SpecialPowers to avoid out-of-order focusing behaviour. r=mwargers (4d134848c) - Bug 1148641 - Guard against null parameters to SendSetTargetAPZCNotification. r=botond (8c5f4bb6d) - Bug 1096172 - Fix position reporting of bad charrefs in RCDATA. r=hsivonen. (77100d26d) - Bug 1149971 Part 2: Cet rid of kCurrentProcessId as it makes lots of static initializers. r=dvander (3efaefdba) - remove android widgets (0c2565418) - Bug 1129991 - Remove QuotaManager::SetCurrentWindow(); r=bent (7ccabf88c) - Bug 1133748 - Fix ipdl code for bridged protocols that are also opened. r=billm. (402751d09) - Bug 1057908 - GeckoMediaPluginService needs to be proxied from Content processes to parent process. Part 5 - use bridging for GMP in e10s. r=billm. (e45a87c5f) - Bug 1057908 followup: Add missing 'override' annotation on GMPServiceParent::ActorDestroy method decl. rs=ehsan (48f53b28a) - Bug 1057908 - GeckoMediaPluginService needs to be proxied from Content processes to parent process. Add nsServiceManagerUtils.h include to WMFDecoderModule.cpp. (67cddb4da) - kill android widgets better (bec243c8d)
301 lines
8.8 KiB
C++
301 lines
8.8 KiB
C++
/*
|
|
* Copyright (C) 2008 The Android Open Source Project
|
|
* Copyright (C) 2015 Mozilla Foundation
|
|
*
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
* you may not use this file except in compliance with the License.
|
|
* You may obtain a copy of the License at
|
|
*
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
*
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
* See the License for the specific language governing permissions and
|
|
* limitations under the License.
|
|
*/
|
|
|
|
#ifndef DOM_CAMERA_FALLBACKCAMERAPLATFORM_H
|
|
#define DOM_CAMERA_FALLBACKCAMERAPLATFORM_H
|
|
|
|
#include <inttypes.h>
|
|
#include <string.h>
|
|
|
|
typedef struct {
|
|
int32_t id;
|
|
int32_t score;
|
|
int32_t rect[4];
|
|
int32_t left_eye[2];
|
|
int32_t right_eye[2];
|
|
int32_t mouth[2];
|
|
} camera_face_t;
|
|
|
|
typedef struct {
|
|
uint32_t number_of_faces;
|
|
camera_face_t* faces;
|
|
} camera_frame_metadata_t;
|
|
|
|
namespace android {
|
|
enum camcorder_quality {
|
|
CAMCORDER_QUALITY_LOW,
|
|
CAMCORDER_QUALITY_HIGH,
|
|
CAMCORDER_QUALITY_QCIF,
|
|
CAMCORDER_QUALITY_CIF,
|
|
CAMCORDER_QUALITY_480P,
|
|
CAMCORDER_QUALITY_720P,
|
|
CAMCORDER_QUALITY_1080P,
|
|
CAMCORDER_QUALITY_QVGA,
|
|
CAMCORDER_QUALITY_VGA,
|
|
CAMCORDER_QUALITY_LIST_START = CAMCORDER_QUALITY_LOW,
|
|
CAMCORDER_QUALITY_LIST_END = CAMCORDER_QUALITY_VGA
|
|
};
|
|
|
|
enum output_format {
|
|
OUTPUT_FORMAT_THREE_GPP,
|
|
OUTPUT_FORMAT_MPEG_4
|
|
};
|
|
|
|
enum video_encoder {
|
|
VIDEO_ENCODER_H263,
|
|
VIDEO_ENCODER_H264,
|
|
VIDEO_ENCODER_MPEG_4_SP
|
|
};
|
|
|
|
enum audio_encoder {
|
|
AUDIO_ENCODER_AMR_WB,
|
|
AUDIO_ENCODER_AMR_NB,
|
|
AUDIO_ENCODER_AAC
|
|
};
|
|
|
|
template <class T>
|
|
class sp final
|
|
{
|
|
public:
|
|
sp()
|
|
: mPtr(nullptr)
|
|
{ }
|
|
|
|
sp(T *aPtr)
|
|
: mPtr(aPtr)
|
|
{ }
|
|
|
|
virtual ~sp() { }
|
|
T* get() const { return mPtr; }
|
|
void clear() { mPtr = nullptr; }
|
|
T* operator->() const { return get(); }
|
|
|
|
private:
|
|
nsRefPtr<T> mPtr;
|
|
};
|
|
|
|
typedef uint64_t nsecs_t;
|
|
|
|
enum error_t {
|
|
OK = 0,
|
|
UNKNOWN_ERROR,
|
|
INVALID_OPERATION
|
|
};
|
|
|
|
enum camera_msg_t {
|
|
CAMERA_MSG_SHUTTER,
|
|
CAMERA_MSG_COMPRESSED_IMAGE
|
|
};
|
|
|
|
class String8 final
|
|
{
|
|
public:
|
|
String8() { }
|
|
String8(const char* aData) { mData.AssignASCII(aData); }
|
|
virtual ~String8() { }
|
|
const char* string() const { return mData.Data(); }
|
|
|
|
private:
|
|
nsCString mData;
|
|
};
|
|
|
|
enum camera_facing_t {
|
|
CAMERA_FACING_BACK,
|
|
CAMERA_FACING_FRONT
|
|
};
|
|
|
|
struct CameraInfo {
|
|
camera_facing_t facing;
|
|
};
|
|
|
|
class Camera final : public nsISupports
|
|
{
|
|
public:
|
|
NS_DECL_ISUPPORTS;
|
|
|
|
void disconnect() { }
|
|
String8 getParameters() { return String8(); }
|
|
int setParameters(const String8& aParams) { return UNKNOWN_ERROR; }
|
|
int storeMetaDataInBuffers(bool aEnabled) { return UNKNOWN_ERROR; }
|
|
int autoFocus() { return UNKNOWN_ERROR; }
|
|
int cancelAutoFocus() { return UNKNOWN_ERROR; }
|
|
int takePicture(uint32_t flags) { return UNKNOWN_ERROR; }
|
|
int startPreview() { return UNKNOWN_ERROR; }
|
|
int stopPreview() { return UNKNOWN_ERROR; }
|
|
int startRecording() { return UNKNOWN_ERROR; }
|
|
int stopRecording() { return UNKNOWN_ERROR; }
|
|
int startFaceDetection() { return UNKNOWN_ERROR; }
|
|
int stopFaceDetection() { return UNKNOWN_ERROR; }
|
|
static int32_t getNumberOfCameras() { return 2; }
|
|
|
|
static int getCameraInfo(int32_t aDevice, CameraInfo* aInfo)
|
|
{
|
|
switch (aDevice) {
|
|
case 0:
|
|
aInfo->facing = CAMERA_FACING_BACK;
|
|
break;
|
|
case 1:
|
|
aInfo->facing = CAMERA_FACING_FRONT;
|
|
break;
|
|
default:
|
|
return UNKNOWN_ERROR;
|
|
}
|
|
return OK;
|
|
}
|
|
|
|
protected:
|
|
Camera() { }
|
|
virtual ~Camera() { }
|
|
|
|
private:
|
|
Camera(const Camera&) = delete;
|
|
Camera& operator=(const Camera&) = delete;
|
|
};
|
|
|
|
class CameraParameters final
|
|
{
|
|
public:
|
|
static const char KEY_PREVIEW_SIZE[];
|
|
static const char KEY_SUPPORTED_PREVIEW_SIZES[];
|
|
static const char KEY_PREVIEW_FPS_RANGE[];
|
|
static const char KEY_SUPPORTED_PREVIEW_FPS_RANGE[];
|
|
static const char KEY_PREVIEW_FORMAT[];
|
|
static const char KEY_SUPPORTED_PREVIEW_FORMATS[];
|
|
static const char KEY_PREVIEW_FRAME_RATE[];
|
|
static const char KEY_SUPPORTED_PREVIEW_FRAME_RATES[];
|
|
static const char KEY_PICTURE_SIZE[];
|
|
static const char KEY_SUPPORTED_PICTURE_SIZES[];
|
|
static const char KEY_PICTURE_FORMAT[];
|
|
static const char KEY_SUPPORTED_PICTURE_FORMATS[];
|
|
static const char KEY_JPEG_THUMBNAIL_WIDTH[];
|
|
static const char KEY_JPEG_THUMBNAIL_HEIGHT[];
|
|
static const char KEY_SUPPORTED_JPEG_THUMBNAIL_SIZES[];
|
|
static const char KEY_JPEG_THUMBNAIL_QUALITY[];
|
|
static const char KEY_JPEG_QUALITY[];
|
|
static const char KEY_ROTATION[];
|
|
static const char KEY_GPS_LATITUDE[];
|
|
static const char KEY_GPS_LONGITUDE[];
|
|
static const char KEY_GPS_ALTITUDE[];
|
|
static const char KEY_GPS_TIMESTAMP[];
|
|
static const char KEY_GPS_PROCESSING_METHOD[];
|
|
static const char KEY_WHITE_BALANCE[];
|
|
static const char KEY_SUPPORTED_WHITE_BALANCE[];
|
|
static const char KEY_EFFECT[];
|
|
static const char KEY_SUPPORTED_EFFECTS[];
|
|
static const char KEY_ANTIBANDING[];
|
|
static const char KEY_SUPPORTED_ANTIBANDING[];
|
|
static const char KEY_SCENE_MODE[];
|
|
static const char KEY_SUPPORTED_SCENE_MODES[];
|
|
static const char KEY_FLASH_MODE[];
|
|
static const char KEY_SUPPORTED_FLASH_MODES[];
|
|
static const char KEY_FOCUS_MODE[];
|
|
static const char KEY_SUPPORTED_FOCUS_MODES[];
|
|
static const char KEY_MAX_NUM_FOCUS_AREAS[];
|
|
static const char KEY_FOCUS_AREAS[];
|
|
static const char KEY_FOCAL_LENGTH[];
|
|
static const char KEY_HORIZONTAL_VIEW_ANGLE[];
|
|
static const char KEY_VERTICAL_VIEW_ANGLE[];
|
|
static const char KEY_EXPOSURE_COMPENSATION[];
|
|
static const char KEY_MAX_EXPOSURE_COMPENSATION[];
|
|
static const char KEY_MIN_EXPOSURE_COMPENSATION[];
|
|
static const char KEY_EXPOSURE_COMPENSATION_STEP[];
|
|
static const char KEY_AUTO_EXPOSURE_LOCK[];
|
|
static const char KEY_AUTO_EXPOSURE_LOCK_SUPPORTED[];
|
|
static const char KEY_AUTO_WHITEBALANCE_LOCK[];
|
|
static const char KEY_AUTO_WHITEBALANCE_LOCK_SUPPORTED[];
|
|
static const char KEY_MAX_NUM_METERING_AREAS[];
|
|
static const char KEY_METERING_AREAS[];
|
|
static const char KEY_ZOOM[];
|
|
static const char KEY_MAX_ZOOM[];
|
|
static const char KEY_ZOOM_RATIOS[];
|
|
static const char KEY_ZOOM_SUPPORTED[];
|
|
static const char KEY_SMOOTH_ZOOM_SUPPORTED[];
|
|
static const char KEY_FOCUS_DISTANCES[];
|
|
static const char KEY_VIDEO_SIZE[];
|
|
static const char KEY_SUPPORTED_VIDEO_SIZES[];
|
|
static const char KEY_MAX_NUM_DETECTED_FACES_HW[];
|
|
static const char KEY_MAX_NUM_DETECTED_FACES_SW[];
|
|
static const char KEY_PREFERRED_PREVIEW_SIZE_FOR_VIDEO[];
|
|
static const char KEY_VIDEO_FRAME_FORMAT[];
|
|
static const char KEY_RECORDING_HINT[];
|
|
static const char KEY_VIDEO_SNAPSHOT_SUPPORTED[];
|
|
static const char KEY_VIDEO_STABILIZATION[];
|
|
static const char KEY_VIDEO_STABILIZATION_SUPPORTED[];
|
|
static const char KEY_LIGHTFX[];
|
|
};
|
|
|
|
class MediaProfiles final
|
|
{
|
|
public:
|
|
static MediaProfiles* getInstance() {
|
|
if (!sMediaProfiles) {
|
|
sMediaProfiles = new MediaProfiles();
|
|
}
|
|
return sMediaProfiles;
|
|
}
|
|
|
|
bool hasCamcorderProfile(int aCameraId, camcorder_quality aQuality) const {
|
|
switch (aQuality) {
|
|
case CAMCORDER_QUALITY_LOW:
|
|
case CAMCORDER_QUALITY_HIGH:
|
|
case CAMCORDER_QUALITY_QVGA:
|
|
case CAMCORDER_QUALITY_VGA:
|
|
return true;
|
|
default:
|
|
break;
|
|
}
|
|
return false;
|
|
}
|
|
|
|
int getCamcorderProfileParamByName(const char* aParameter, int aCameraId, camcorder_quality aQuality) const {
|
|
switch (aQuality) {
|
|
case CAMCORDER_QUALITY_LOW:
|
|
case CAMCORDER_QUALITY_QVGA:
|
|
if (strcmp(aParameter, "vid.width") == 0) {
|
|
return 320;
|
|
} else if (strcmp(aParameter, "vid.height") == 0) {
|
|
return 240;
|
|
}
|
|
return 0;
|
|
case CAMCORDER_QUALITY_HIGH:
|
|
case CAMCORDER_QUALITY_VGA:
|
|
if (strcmp(aParameter, "vid.width") == 0) {
|
|
return 640;
|
|
} else if (strcmp(aParameter, "vid.height") == 0) {
|
|
return 480;
|
|
}
|
|
return 0;
|
|
default:
|
|
break;
|
|
}
|
|
return -1;
|
|
}
|
|
|
|
protected:
|
|
MediaProfiles() { }
|
|
virtual ~MediaProfiles() { }
|
|
|
|
private:
|
|
MediaProfiles(const MediaProfiles&) = delete;
|
|
MediaProfiles& operator=(const MediaProfiles&) = delete;
|
|
|
|
static MediaProfiles* sMediaProfiles;
|
|
};
|
|
}
|
|
|
|
#endif
|