Remove spurious logging.
When logging was enabled, the log was a little *too*
verbose, making it unreadable. Removing some of the
more frequently hit log messages.
BUG: b/32942120
TEST: Can run camera samples
Change-Id: I136c20279699e4c87b3ef1c3042b88c20c301002
diff --git a/modules/camera/3_4/camera.cpp b/modules/camera/3_4/camera.cpp
index d4be03d..2dcf1c7 100644
--- a/modules/camera/3_4/camera.cpp
+++ b/modules/camera/3_4/camera.cpp
@@ -394,7 +394,6 @@
{
int res;
- ALOGV("%s:%d: request=%p", __func__, mId, temp_request);
ATRACE_CALL();
if (temp_request == NULL) {
@@ -406,8 +405,7 @@
// past the end of this method.
std::shared_ptr<CaptureRequest> request = std::make_shared<CaptureRequest>(temp_request);
- ALOGV("%s:%d: Request Frame:%d", __func__, mId,
- request->frame_number);
+ ALOGV("%s:%d: frame: %d", __func__, mId, request->frame_number);
// Null/Empty indicates use last settings
if (request->settings.isEmpty() && !mSettingsSet) {
diff --git a/modules/camera/3_4/common.h b/modules/camera/3_4/common.h
index e77c0b2..ca5151d 100644
--- a/modules/camera/3_4/common.h
+++ b/modules/camera/3_4/common.h
@@ -39,6 +39,14 @@
ALOGW_IF(cond, "%s:%d: " fmt, __func__, __LINE__, ##args); \
} while(0)
+#define HAL_LOGI(fmt, args...) do { \
+ ALOGI("%s:%d: " fmt, __func__, __LINE__, ##args); \
+ } while(0)
+
+#define HAL_LOGI_IF(cond, fmt, args...) do { \
+ ALOGI_IF(cond, "%s:%d: " fmt, __func__, __LINE__, ##args); \
+ } while(0)
+
#define HAL_LOGD(fmt, args...) do { \
ALOGD("%s:%d: " fmt, __func__, __LINE__, ##args); \
} while(0)
diff --git a/modules/camera/3_4/metadata/control.h b/modules/camera/3_4/metadata/control.h
index 6442f90..ed86d39 100644
--- a/modules/camera/3_4/metadata/control.h
+++ b/modules/camera/3_4/metadata/control.h
@@ -64,9 +64,7 @@
template <typename T>
Control<T>::Control(std::unique_ptr<TaggedControlDelegate<T>> delegate,
std::unique_ptr<TaggedControlOptions<T>> options)
- : delegate_(std::move(delegate)), options_(std::move(options)) {
- HAL_LOG_ENTER();
-}
+ : delegate_(std::move(delegate)), options_(std::move(options)) {}
template <typename T>
std::vector<int32_t> Control<T>::StaticTags() const {
@@ -89,8 +87,6 @@
template <typename T>
int Control<T>::PopulateStaticFields(android::CameraMetadata* metadata) const {
- HAL_LOG_ENTER();
-
if (!options_) {
HAL_LOGV("No options for control, nothing to populate.");
return 0;
@@ -102,8 +98,6 @@
template <typename T>
int Control<T>::PopulateDynamicFields(android::CameraMetadata* metadata) const {
- HAL_LOG_ENTER();
-
// Populate the current setting.
T value;
int res = delegate_->GetValue(&value);
@@ -116,8 +110,6 @@
template <typename T>
int Control<T>::PopulateTemplateRequest(
int template_type, android::CameraMetadata* metadata) const {
- HAL_LOG_ENTER();
-
// Populate with a default.
T value;
int res;
@@ -138,7 +130,6 @@
template <typename T>
bool Control<T>::SupportsRequestValues(
const android::CameraMetadata& metadata) const {
- HAL_LOG_ENTER();
if (metadata.isEmpty()) {
// Implicitly supported.
return true;
@@ -167,7 +158,6 @@
template <typename T>
int Control<T>::SetRequestValues(const android::CameraMetadata& metadata) {
- HAL_LOG_ENTER();
if (metadata.isEmpty()) {
// No changes necessary.
return 0;
diff --git a/modules/camera/3_4/metadata/enum_converter.cpp b/modules/camera/3_4/metadata/enum_converter.cpp
index f4c9819..d5e0a87 100644
--- a/modules/camera/3_4/metadata/enum_converter.cpp
+++ b/modules/camera/3_4/metadata/enum_converter.cpp
@@ -29,8 +29,6 @@
}
int EnumConverter::MetadataToV4L2(uint8_t value, int32_t* conversion) {
- HAL_LOG_ENTER();
-
// Unfortunately no bi-directional map lookup in C++.
// Breaking on second, not first found so that a warning
// can be given if there are multiple values.
@@ -60,8 +58,6 @@
}
int EnumConverter::V4L2ToMetadata(int32_t value, uint8_t* conversion) {
- HAL_LOG_ENTER();
-
auto element_range = v4l2_to_metadata_.equal_range(value);
if (element_range.first == element_range.second) {
HAL_LOGV("Couldn't find metadata conversion of V4L2 value %d.", value);
diff --git a/modules/camera/3_4/metadata/property.h b/modules/camera/3_4/metadata/property.h
index 03da434..6884c7d 100644
--- a/modules/camera/3_4/metadata/property.h
+++ b/modules/camera/3_4/metadata/property.h
@@ -37,31 +37,26 @@
virtual int PopulateStaticFields(
android::CameraMetadata* metadata) const override {
- HAL_LOG_ENTER();
return UpdateMetadata(metadata, tag_, value_);
};
virtual int PopulateDynamicFields(
android::CameraMetadata* metadata) const override {
- HAL_LOG_ENTER();
return 0;
};
virtual int PopulateTemplateRequest(
int template_type, android::CameraMetadata* metadata) const override {
- HAL_LOG_ENTER();
return 0;
};
virtual bool SupportsRequestValues(
const android::CameraMetadata& metadata) const override {
- HAL_LOG_ENTER();
return true;
};
virtual int SetRequestValues(
const android::CameraMetadata& metadata) override {
- HAL_LOG_ENTER();
return 0;
};
diff --git a/modules/camera/3_4/stream_format.cpp b/modules/camera/3_4/stream_format.cpp
index 5940b71..2abfdb0 100644
--- a/modules/camera/3_4/stream_format.cpp
+++ b/modules/camera/3_4/stream_format.cpp
@@ -31,9 +31,7 @@
width_(stream.getWidth()),
height_(stream.getHeight()),
bytes_per_line_(0),
- min_buffer_size_(0) {
- HAL_LOG_ENTER();
-}
+ min_buffer_size_(0) {}
StreamFormat::StreamFormat(const v4l2_format& format)
: type_(format.type),
@@ -42,13 +40,9 @@
width_(format.fmt.pix.width),
height_(format.fmt.pix.height),
bytes_per_line_(format.fmt.pix.bytesperline),
- min_buffer_size_(format.fmt.pix.sizeimage) {
- HAL_LOG_ENTER();
-}
+ min_buffer_size_(format.fmt.pix.sizeimage) {}
void StreamFormat::FillFormatRequest(v4l2_format* format) const {
- HAL_LOG_ENTER();
-
memset(format, 0, sizeof(*format));
format->type = type_;
format->fmt.pix.pixelformat = v4l2_pixel_format_;
diff --git a/modules/camera/3_4/v4l2_gralloc.cpp b/modules/camera/3_4/v4l2_gralloc.cpp
index 9ada128..0b093ea 100644
--- a/modules/camera/3_4/v4l2_gralloc.cpp
+++ b/modules/camera/3_4/v4l2_gralloc.cpp
@@ -51,8 +51,6 @@
}
V4L2Gralloc* V4L2Gralloc::NewV4L2Gralloc() {
- HAL_LOG_ENTER();
-
// Initialize and check the gralloc module.
const hw_module_t* module = nullptr;
int res = hw_get_module(GRALLOC_HARDWARE_MODULE_ID, &module);
@@ -78,13 +76,9 @@
// Private. As checked by above factory, module will be non-null
// and a supported version.
-V4L2Gralloc::V4L2Gralloc(const gralloc_module_t* module) : mModule(module) {
- HAL_LOG_ENTER();
-}
+V4L2Gralloc::V4L2Gralloc(const gralloc_module_t* module) : mModule(module) {}
V4L2Gralloc::~V4L2Gralloc() {
- HAL_LOG_ENTER();
-
// Unlock buffers that are still locked.
unlockAllBuffers();
}
@@ -92,8 +86,6 @@
int V4L2Gralloc::lock(const camera3_stream_buffer_t* camera_buffer,
uint32_t bytes_per_line,
v4l2_buffer* device_buffer) {
- HAL_LOG_ENTER();
-
// Lock the camera buffer (varies depending on if the buffer is YUV or not).
std::unique_ptr<BufferData> buffer_data(
new BufferData{camera_buffer, nullptr, bytes_per_line});
@@ -129,12 +121,10 @@
reinterpret_cast<uint8_t*>(yuv_data.cb) +
(stream->height / 2 * yuv_data.cstride))) {
// If so, great, point to the beginning.
- HAL_LOGV("V4L2 YUV matches gralloc YUV.");
data = yuv_data.y;
} else {
// If not, allocate a contiguous buffer of appropriate size
// (to be transformed back upon unlock).
- HAL_LOGV("Need to transform V4L2 YUV to gralloc YUV.");
data = new uint8_t[device_buffer->length];
// Make a dynamically-allocated copy of yuv_data,
// since it will be needed at transform time.
@@ -195,8 +185,6 @@
}
int V4L2Gralloc::unlock(const v4l2_buffer* device_buffer) {
- HAL_LOG_ENTER();
-
// TODO(b/30000211): support multi-planar data (video_capture_mplane).
if (device_buffer->type != V4L2_BUF_TYPE_VIDEO_CAPTURE) {
return -EINVAL;
diff --git a/modules/camera/3_4/v4l2_wrapper.cpp b/modules/camera/3_4/v4l2_wrapper.cpp
index a0c5f04..2f21c94 100644
--- a/modules/camera/3_4/v4l2_wrapper.cpp
+++ b/modules/camera/3_4/v4l2_wrapper.cpp
@@ -41,8 +41,6 @@
{1920, 1080}, {1280, 720}, {640, 480}, {320, 240}};
V4L2Wrapper* V4L2Wrapper::NewV4L2Wrapper(const std::string device_path) {
- HAL_LOG_ENTER();
-
std::unique_ptr<V4L2Gralloc> gralloc(V4L2Gralloc::NewV4L2Gralloc());
if (!gralloc) {
HAL_LOGE("Failed to initialize gralloc helper.");
@@ -56,13 +54,9 @@
std::unique_ptr<V4L2Gralloc> gralloc)
: device_path_(std::move(device_path)),
gralloc_(std::move(gralloc)),
- connection_count_(0) {
- HAL_LOG_ENTER();
-}
+ connection_count_(0) {}
-V4L2Wrapper::~V4L2Wrapper() {
- HAL_LOG_ENTER();
-}
+V4L2Wrapper::~V4L2Wrapper() {}
int V4L2Wrapper::Connect() {
HAL_LOG_ENTER();
@@ -135,8 +129,6 @@
}
int V4L2Wrapper::StreamOn() {
- HAL_LOG_ENTER();
-
if (!format_) {
HAL_LOGE("Stream format must be set before turning on stream.");
return -EINVAL;
@@ -148,14 +140,13 @@
return -ENODEV;
}
+ HAL_LOGV("Stream turned on.");
return 0;
}
int V4L2Wrapper::StreamOff() {
- HAL_LOG_ENTER();
-
if (!format_) {
- // Can't have turned on the stream wihtout format being set,
+ // Can't have turned on the stream without format being set,
// so nothing to turn off here.
return 0;
}
@@ -173,12 +164,12 @@
return gralloc_res;
}
+ HAL_LOGV("Stream turned off.");
return 0;
}
int V4L2Wrapper::QueryControl(uint32_t control_id,
v4l2_query_ext_ctrl* result) {
- HAL_LOG_ENTER();
int res;
memset(result, 0, sizeof(*result));
@@ -238,8 +229,6 @@
}
int V4L2Wrapper::GetControl(uint32_t control_id, int32_t* value) {
- HAL_LOG_ENTER();
-
// For extended controls (any control class other than "user"),
// G_EXT_CTRL must be used instead of G_CTRL.
if (V4L2_CTRL_ID2CLASS(control_id) != V4L2_CTRL_CLASS_USER) {
@@ -272,7 +261,6 @@
int V4L2Wrapper::SetControl(uint32_t control_id,
int32_t desired,
int32_t* result) {
- HAL_LOG_ENTER();
int32_t result_value = 0;
// TODO(b/29334616): When async, this may need to check if the stream
@@ -336,8 +324,6 @@
int V4L2Wrapper::GetFormatFrameSizes(uint32_t v4l2_format,
std::set<std::array<int32_t, 2>>* sizes) {
- HAL_LOG_ENTER();
-
v4l2_frmsizeenum size_query;
memset(&size_query, 0, sizeof(size_query));
size_query.pixel_format = v4l2_format;
@@ -535,8 +521,6 @@
}
int V4L2Wrapper::EnqueueBuffer(const camera3_stream_buffer_t* camera_buffer) {
- HAL_LOG_ENTER();
-
if (!format_) {
HAL_LOGE("Stream format must be set before enqueuing buffers.");
return -ENODEV;
@@ -596,8 +580,6 @@
}
int V4L2Wrapper::DequeueBuffer(v4l2_buffer* buffer) {
- HAL_LOG_ENTER();
-
if (!format_) {
HAL_LOGE("Stream format must be set before dequeueing buffers.");
return -ENODEV;