Added default metadata entries.
Default entries for controls/properties that could theoretically
be queried from/controlled by V4L2, but are not yet implemented
in this HAL.
BUG: 30140438
TEST: unit tests pass
Change-Id: I78264f3f0d37b41614b24ef71000fee175a3bb17
diff --git a/modules/camera/3_4/metadata/control.h b/modules/camera/3_4/metadata/control.h
index c0426c1..6442f90 100644
--- a/modules/camera/3_4/metadata/control.h
+++ b/modules/camera/3_4/metadata/control.h
@@ -120,10 +120,18 @@
// Populate with a default.
T value;
- int res = options_->DefaultValueForTemplate(template_type, &value);
+ int res;
+ if (options_) {
+ res = options_->DefaultValueForTemplate(template_type, &value);
+ } else {
+ // If there's no options (and thus no default option),
+ // fall back to whatever the current value is.
+ res = delegate_->GetValue(&value);
+ }
if (res) {
return res;
}
+
return UpdateMetadata(metadata, delegate_->tag(), value);
}