Checked Media on video/image recording

Change-Id: I24940627b716bf215bfe72f676dcbd16b719138f
This commit is contained in:
KalimochoAz
2011-03-17 16:54:35 +01:00
parent a7dcbacf54
commit f847ac0bfd
3 changed files with 59 additions and 43 deletions

View File

@@ -90,7 +90,7 @@ PRODUCT_COPY_FILES += \
device/htc/click/custom/rzscontrol:system/bin/rzscontrol
PRODUCT_PROPERTY_OVERRIDES += \
ro.media.dec.jpeg.memcap=10000000
ro.media.dec.jpeg.memcap=20000000
PRODUCT_PROPERTY_OVERRIDES += \
rild.libpath=/system/lib/libhtc_ril.so \

View File

@@ -14,7 +14,7 @@
** limitations under the License.
*/
// NOTE VERSION_C
#define REVISION_C "7006.3."
#define REVISION_C "7007.2."
//#define LOG_NDEBUG 0
#define LOG_TAG "QualcommCameraHardware"
@@ -59,8 +59,6 @@ extern "C" {
#include "msm_camera.h" // Tattoo kernel
#define REVISION "0.4"
// init for Tattoo
#define THUMBNAIL_WIDTH_STR "192"
#define THUMBNAIL_HEIGHT_STR "144"
@@ -140,6 +138,7 @@ static preview_size_type preview_sizes[] = {
{ 288, 192 },
{ 240, 240 }, // QCIF
{ 240, 160 }, // SQVGA
{ 176, 144 }
};
static int attr_lookup(const struct str_map *const arr, const char *name)
@@ -314,7 +313,7 @@ void QualcommCameraHardware::initDefaultParameters()
p.set(CameraParameters::KEY_SUPPORTED_EFFECTS, effect_values);
p.set(CameraParameters::KEY_SUPPORTED_WHITE_BALANCE, whitebalance_values);
p.set(CameraParameters::KEY_SUPPORTED_PICTURE_SIZES, "2048x1536,1600x1200,1024x768");
p.set(CameraParameters::KEY_SUPPORTED_PREVIEW_SIZES, "320x240,240x160,192x144");
p.set(CameraParameters::KEY_SUPPORTED_PREVIEW_SIZES, "320x240,240x160,176x144");
if (setParameters(p) != NO_ERROR) {
LOGE("Failed to set default parameters?!");
@@ -453,6 +452,7 @@ void QualcommCameraHardware::startCamera()
else
LOGV("Config thread created successfully");
// init this in order to avoid false preview displays
bFramePresent=false;
LOGV("startCamera X");
@@ -824,7 +824,7 @@ static void *prev_frame_click(void *user)
return NULL;
}
// customized cam_frame function based on reassembled libmmcamera.so
// customized camframe_callback function based on reassembled libmmcamera.so
static void *cam_frame_click(void *data)
{
LOGV("Entering cam_frame_click");
@@ -940,26 +940,26 @@ void QualcommCameraHardware::runJpegEncodeThread(void *data)
bool encode_location = true;
camera_position_type pt;
#define PARSE_LOCATION(what,type,fmt,desc) do { \
pt.what = 0; \
const char *what##_str = mParameters.get("gps-"#what); \
LOGD("GPS PARM %s --> [%s]", "gps-"#what, what##_str); \
if (what##_str) { \
type what = 0; \
if (sscanf(what##_str, fmt, &what) == 1) \
pt.what = what; \
else { \
LOGE("GPS " #what " %s could not" \
" be parsed as a " #desc, what##_str); \
encode_location = false; \
} \
} \
else { \
LOGD("GPS " #what " not specified: " \
"defaulting to zero in EXIF header."); \
encode_location = false; \
} \
} while(0)
#define PARSE_LOCATION(what,type,fmt,desc) do { \
pt.what = 0; \
const char *what##_str = mParameters.get("gps-"#what); \
LOGD("GPS PARM %s --> [%s]", "gps-"#what, what##_str); \
if (what##_str) { \
type what = 0; \
if (sscanf(what##_str, fmt, &what) == 1) \
pt.what = what; \
else { \
LOGE("GPS " #what " %s could not" \
" be parsed as a " #desc, what##_str); \
encode_location = false; \
} \
} \
else { \
LOGD("GPS " #what " not specified: " \
"defaulting to zero in EXIF header."); \
encode_location = false; \
} \
} while(0)
PARSE_LOCATION(timestamp, long, "%ld", "long");
if (!pt.timestamp) pt.timestamp = time(NULL);
@@ -967,7 +967,7 @@ void QualcommCameraHardware::runJpegEncodeThread(void *data)
PARSE_LOCATION(latitude, double, "%lf", "double float");
PARSE_LOCATION(longitude, double, "%lf", "double float");
#undef PARSE_LOCATION
#undef PARSE_LOCATION
if (encode_location) {
LOGD("setting image location ALT %d LAT %lf LON %lf",
@@ -1069,8 +1069,6 @@ bool QualcommCameraHardware::initPreview()
LOGV("set preview callback");
LINK_cam_set_frame_callback();
// TODO: memset(*s, 0, 0x14)
mFrameThreadRunning = !pthread_create(&mFrameThread,
NULL,
cam_frame_click, //frame_thread,

View File

@@ -77,14 +77,27 @@
-->
<MediaSettings>
<!-- Each camcorder profile defines a set of predefined configuration parameters -->
<CamcorderProfiles>
<CamcorderProfiles cameraId="0">
<EncoderProfile quality="hd" fileFormat="mp4" duration="60">
<Video codec="m4v"
bitRate="360000"
width="352"
height="288"
frameRate="30" />
<Audio codec="aac"
bitRate="64000"
sampleRate="16000"
channels="1" />
</EncoderProfile>
<EncoderProfile quality="high" fileFormat="mp4" duration="60">
<Video codec="h263"
bitRate="360000"
width="352"
height="288"
frameRate="30" />
frameRate="24" />
<Audio codec="aac"
bitRate="64000"
@@ -92,7 +105,7 @@
channels="1" />
</EncoderProfile>
<EncoderProfile quality="low" fileFormat="3gp" duration="60">
<EncoderProfile quality="low" fileFormat="3gp" duration="30">
<Video codec="h263"
bitRate="192000"
width="176"
@@ -106,17 +119,11 @@
</EncoderProfile>
<ImageEncoding quality="100" />
<ImageEncoding quality="90" />
<ImageEncoding quality="80" />
<ImageDecoding memCap="20000000" />
<Camera previewFrameRate="0" />
<ImageEncoding quality="70" />
</CamcorderProfiles>
<EncoderOutputFileFormat name="3gp" />
<EncoderOutputFileFormat name="mp4" />
@@ -125,14 +132,20 @@
In other words, the applications won't be able to use the codec
or query the capabilities of the codec at all if it is disabled
-->
<VideoEncoderCap name="h263" enabled="true"
minBitRate="192000" maxBitRate="420000"
<VideoEncoderCap name="h264" enabled="true"
minBitRate="64000" maxBitRate="420000"
minFrameWidth="176" maxFrameWidth="352"
minFrameHeight="144" maxFrameHeight="288"
minFrameRate="24" maxFrameRate="30" />
minFrameRate="1" maxFrameRate="30" />
<VideoEncoderCap name="h263" enabled="true"
minBitRate="64000" maxBitRate="420000"
minFrameWidth="176" maxFrameWidth="352"
minFrameHeight="144" maxFrameHeight="288"
minFrameRate="1" maxFrameRate="30" />
<VideoEncoderCap name="m4v" enabled="true"
minBitRate="192000" maxBitRate="420000"
minBitRate="64000" maxBitRate="420000"
minFrameWidth="176" maxFrameWidth="352"
minFrameHeight="144" maxFrameHeight="288"
minFrameRate="1" maxFrameRate="30" />
@@ -142,6 +155,11 @@
minSampleRate="8000" maxSampleRate="16000"
minChannels="1" maxChannels="1" />
<AudioEncoderCap name="amrwb" enabled="true"
minBitRate="6600" maxBitRate="23050"
minSampleRate="16000" maxSampleRate="16000"
minChannels="1" maxChannels="1" />
<AudioEncoderCap name="amrnb" enabled="true"
minBitRate="5525" maxBitRate="12200"
minSampleRate="8000" maxSampleRate="8000"