summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIgor Murashkin <iam@google.com>2013-04-23 14:31:02 -0700
committerIgor Murashkin <iam@google.com>2013-04-24 14:20:26 -0700
commitc469f7dc234ec0b901440902cd6e39acaf9b0781 (patch)
treeb44e26a7ae2a80939ef6752d91ee5849fc469688
parentba682d42fd0af627fa59c5698a9e56def9c0d074 (diff)
downloadandroid_system_media-c469f7dc234ec0b901440902cd6e39acaf9b0781.tar.gz
android_system_media-c469f7dc234ec0b901440902cd6e39acaf9b0781.tar.bz2
android_system_media-c469f7dc234ec0b901440902cd6e39acaf9b0781.zip
camera_metadata: add new android.led.transmit and availableLeds fields
Bug: 8554573 Change-Id: Iaa93deeab5ee228bf7e01c58d80f1cdb5b2bb79c
-rw-r--r--camera/docs/docs.html234
-rw-r--r--camera/docs/html.mako10
-rwxr-xr-xcamera/docs/metadata-generate1
-rw-r--r--camera/docs/metadata_properties.xml40
-rw-r--r--camera/include/system/camera_metadata_tags.h18
-rw-r--r--camera/src/camera_metadata_tag_info.c39
6 files changed, 340 insertions, 2 deletions
diff --git a/camera/docs/docs.html b/camera/docs/docs.html
index f149184f..6fdf265c 100644
--- a/camera/docs/docs.html
+++ b/camera/docs/docs.html
@@ -343,6 +343,13 @@
<li><a href="#dynamic_android.tonemap.mode">android.tonemap.mode</a> (dynamic)</li>
</ul>
</li> <!-- toc_section -->
+ <li><p class="toc_section"><a href="#section_led">led</a></p>
+ <ul class="toc_section">
+ <li><a href="#controls_android.led.transmit">android.led.transmit</a> (controls)</li>
+ <li><a href="#dynamic_android.led.transmit">android.led.transmit</a> (dynamic)</li>
+ <li><a href="#static_android.led.availableLeds">android.led.availableLeds</a> (static)</li>
+ </ul>
+ </li> <!-- toc_section -->
</ul>
<h1>Properties</h1>
@@ -9871,6 +9878,233 @@
</tbody>
<!-- end of section -->
+ <tr><td colspan="7" id="section_led" class="section">led</td></tr>
+
+
+ <tr><td colspan="7" class="kind">controls</td></tr>
+
+ <thead>
+ <tr>
+ <th class="th_name">Property Name</th>
+ <th class="th_type">Type</th>
+ <th class="th_description">Description</th>
+ <th class="th_units">Units</th>
+ <th class="th_range">Range</th>
+ <th class="th_notes">Notes</th>
+ <th class="th_tags">Tags</th>
+ </tr>
+ </thead>
+
+ <tbody>
+
+
+
+
+
+
+
+
+
+
+ <tr class="entry" id="controls_android.led.transmit">
+ <td class="entry_name">android.<wbr>led.<wbr>transmit</td>
+ <td class="entry_type">
+ <span class="entry_type_name entry_type_name_enum">byte</span>
+
+
+
+ <ul class="entry_type_enum">
+ <li>
+ <span class="entry_type_enum_name">OFF</span>
+ </li>
+ <li>
+ <span class="entry_type_enum_name">ON</span>
+ </li>
+ </ul>
+
+ </td> <!-- entry_type -->
+
+ <td class="entry_description">
+ This LED is nominally used to indicate to the user
+ that the camera is powered on and may be streaming images back to the
+ Application Processor.<wbr> In certain rare circumstances,<wbr> the OS may
+ disable this when video is processed locally and not transmitted to
+ any untrusted applications.<wbr>
+<br>
+<br> In particular,<wbr> the LED *must* always be on when the data could be
+ transmitted off the device.<wbr> The LED *should* always be on whenever
+ data is stored locally on the device.<wbr>
+<br>
+<br> The LED *may* be off if a trusted application is using the data that
+ doesn't violate the above rules.<wbr>
+
+ </td>
+
+ <td class="entry_units">
+ </td>
+
+ <td class="entry_range">
+ </td>
+
+ <td class="entry_notes">
+ </td>
+
+ <td class="entry_tags">
+ </td>
+
+ </tr> <!-- end of entry -->
+
+
+
+ <!-- end of kind -->
+ </tbody>
+ <tr><td colspan="7" class="kind">dynamic</td></tr>
+
+ <thead>
+ <tr>
+ <th class="th_name">Property Name</th>
+ <th class="th_type">Type</th>
+ <th class="th_description">Description</th>
+ <th class="th_units">Units</th>
+ <th class="th_range">Range</th>
+ <th class="th_notes">Notes</th>
+ <th class="th_tags">Tags</th>
+ </tr>
+ </thead>
+
+ <tbody>
+
+
+
+
+
+
+
+
+
+
+ <tr class="entry" id="dynamic_android.led.transmit">
+ <td class="entry_name">android.<wbr>led.<wbr>transmit</td>
+ <td class="entry_type">
+ <span class="entry_type_name entry_type_name_enum">byte</span>
+
+
+
+ <ul class="entry_type_enum">
+ <li>
+ <span class="entry_type_enum_name">OFF</span>
+ </li>
+ <li>
+ <span class="entry_type_enum_name">ON</span>
+ </li>
+ </ul>
+
+ </td> <!-- entry_type -->
+
+ <td class="entry_description">
+ This LED is nominally used to indicate to the user
+ that the camera is powered on and may be streaming images back to the
+ Application Processor.<wbr> In certain rare circumstances,<wbr> the OS may
+ disable this when video is processed locally and not transmitted to
+ any untrusted applications.<wbr>
+<br>
+<br> In particular,<wbr> the LED *must* always be on when the data could be
+ transmitted off the device.<wbr> The LED *should* always be on whenever
+ data is stored locally on the device.<wbr>
+<br>
+<br> The LED *may* be off if a trusted application is using the data that
+ doesn't violate the above rules.<wbr>
+
+ </td>
+
+ <td class="entry_units">
+ </td>
+
+ <td class="entry_range">
+ </td>
+
+ <td class="entry_notes">
+ </td>
+
+ <td class="entry_tags">
+ </td>
+
+ </tr> <!-- end of entry -->
+
+
+
+ <!-- end of kind -->
+ </tbody>
+ <tr><td colspan="7" class="kind">static</td></tr>
+
+ <thead>
+ <tr>
+ <th class="th_name">Property Name</th>
+ <th class="th_type">Type</th>
+ <th class="th_description">Description</th>
+ <th class="th_units">Units</th>
+ <th class="th_range">Range</th>
+ <th class="th_notes">Notes</th>
+ <th class="th_tags">Tags</th>
+ </tr>
+ </thead>
+
+ <tbody>
+
+
+
+
+
+
+
+
+
+
+ <tr class="entry" id="static_android.led.availableLeds">
+ <td class="entry_name">android.<wbr>led.<wbr>available<wbr>Leds</td>
+ <td class="entry_type">
+ <span class="entry_type_name entry_type_name_enum">byte</span>
+ <span class="entry_type_container">x</span>
+
+ <span class="entry_type_array">
+ n
+ </span>
+
+
+ <ul class="entry_type_enum">
+ <li>
+ <span class="entry_type_enum_name">TRANSMIT</span>
+ <span class="entry_type_enum_notes">android.<wbr>led.<wbr>transmit control is used</span>
+ </li>
+ </ul>
+
+ </td> <!-- entry_type -->
+
+ <td class="entry_description">
+ A list of camera LEDs that are available on this system.<wbr>
+
+ </td>
+
+ <td class="entry_units">
+ </td>
+
+ <td class="entry_range">
+ </td>
+
+ <td class="entry_notes">
+ </td>
+
+ <td class="entry_tags">
+ </td>
+
+ </tr> <!-- end of entry -->
+
+
+
+ <!-- end of kind -->
+ </tbody>
+
+ <!-- end of section -->
<!-- </namespace> -->
</table>
diff --git a/camera/docs/html.mako b/camera/docs/html.mako
index 0baf1813..b1b97597 100644
--- a/camera/docs/html.mako
+++ b/camera/docs/html.mako
@@ -73,6 +73,8 @@
</head>
<%!
+ import re
+
# insert word break hints for the browser
def wbr(text):
new_txt = text
@@ -91,6 +93,10 @@
new_txt = new_txt.replace(i, i + "<wbr>")
return new_txt
+
+ # insert line breaks after every two \n\n
+ def br(text):
+ return re.sub(r"(\r?\n)(\r?\n)", r"\1<br>\2<br>", text)
%>
@@ -233,7 +239,7 @@
<td class="entry_description">
% if prop.description is not None:
- ${prop.description | wbr}
+ ${prop.description | wbr, br}
% endif
</td>
@@ -251,7 +257,7 @@
<td class="entry_notes">
% if prop.notes is not None:
- ${prop.notes | wbr}
+ ${prop.notes | wbr, br}
% endif
</td>
diff --git a/camera/docs/metadata-generate b/camera/docs/metadata-generate
index 8e5bf56f..59aaff28 100755
--- a/camera/docs/metadata-generate
+++ b/camera/docs/metadata-generate
@@ -48,6 +48,7 @@ function gen_file() {
}
$thisdir/metadata-check-dependencies || exit 1
+$thisdir/metadata-validate $thisdir/metadata_properties.xml || exit 1
$thisdir/metadata-parser-sanity-check || exit 1
gen_file html.mako docs.html || exit 1
gen_file camera_metadata_tag_info.mako ../src/camera_metadata_tag_info.c || exit 1
diff --git a/camera/docs/metadata_properties.xml b/camera/docs/metadata_properties.xml
index 14d865f0..4db5bac2 100644
--- a/camera/docs/metadata_properties.xml
+++ b/camera/docs/metadata_properties.xml
@@ -2203,5 +2203,45 @@ xsi:schemaLocation="http://schemas.android.com/service/camera/metadata/ metadata
</clone>
</dynamic>
</section>
+ <section name="led">
+ <controls>
+ <entry name="transmit" type="byte" enum="true">
+ <enum>
+ <value>OFF</value>
+ <value>ON</value>
+ </enum>
+ <description>This LED is nominally used to indicate to the user
+ that the camera is powered on and may be streaming images back to the
+ Application Processor. In certain rare circumstances, the OS may
+ disable this when video is processed locally and not transmitted to
+ any untrusted applications.
+
+ In particular, the LED *must* always be on when the data could be
+ transmitted off the device. The LED *should* always be on whenever
+ data is stored locally on the device.
+
+ The LED *may* be off if a trusted application is using the data that
+ doesn't violate the above rules.
+ </description>
+ </entry>
+ </controls>
+ <dynamic>
+ <clone entry="android.led.transmit" kind="controls"></clone>
+ </dynamic>
+ <static>
+ <entry name="availableLeds" type="byte" enum="true" container="array">
+ <array>
+ <size>n</size>
+ </array>
+ <enum>
+ <value>TRANSMIT
+ <notes>android.led.transmit control is used</notes>
+ </value>
+ </enum>
+ <description>A list of camera LEDs that are available on this system.
+ </description>
+ </entry>
+ </static>
+ </section>
</namespace>
</metadata>
diff --git a/camera/include/system/camera_metadata_tags.h b/camera/include/system/camera_metadata_tags.h
index 47968e38..8d5cdf40 100644
--- a/camera/include/system/camera_metadata_tags.h
+++ b/camera/include/system/camera_metadata_tags.h
@@ -57,6 +57,7 @@ typedef enum camera_metadata_section {
ANDROID_STATISTICS,
ANDROID_STATISTICS_INFO,
ANDROID_TONEMAP,
+ ANDROID_LED,
ANDROID_SECTION_COUNT,
VENDOR_SECTION = 0x8000
@@ -89,6 +90,7 @@ typedef enum camera_metadata_section_start {
ANDROID_STATISTICS_START = ANDROID_STATISTICS << 16,
ANDROID_STATISTICS_INFO_START = ANDROID_STATISTICS_INFO << 16,
ANDROID_TONEMAP_START = ANDROID_TONEMAP << 16,
+ ANDROID_LED_START = ANDROID_LED << 16,
VENDOR_SECTION_START = VENDOR_SECTION << 16
} camera_metadata_section_start_t;
@@ -301,6 +303,10 @@ typedef enum camera_metadata_tag {
ANDROID_TONEMAP_MAX_CURVE_POINTS,
ANDROID_TONEMAP_END,
+ ANDROID_LED_TRANSMIT = ANDROID_LED_START,
+ ANDROID_LED_AVAILABLE_LEDS,
+ ANDROID_LED_END,
+
} camera_metadata_tag_t;
/**
@@ -637,3 +643,15 @@ typedef enum camera_metadata_enum_android_tonemap_mode {
} camera_metadata_enum_android_tonemap_mode_t;
+// ANDROID_LED_TRANSMIT
+typedef enum camera_metadata_enum_android_led_transmit {
+ ANDROID_LED_TRANSMIT_OFF,
+ ANDROID_LED_TRANSMIT_ON,
+} camera_metadata_enum_android_led_transmit_t;
+
+// ANDROID_LED_AVAILABLE_LEDS
+typedef enum camera_metadata_enum_android_led_available_leds {
+ ANDROID_LED_AVAILABLE_LEDS_TRANSMIT,
+} camera_metadata_enum_android_led_available_leds_t;
+
+
diff --git a/camera/src/camera_metadata_tag_info.c b/camera/src/camera_metadata_tag_info.c
index 6a4e0e6a..c547dfb7 100644
--- a/camera/src/camera_metadata_tag_info.c
+++ b/camera/src/camera_metadata_tag_info.c
@@ -53,6 +53,7 @@ const char *camera_metadata_section_names[ANDROID_SECTION_COUNT] = {
[ANDROID_STATISTICS] = "android.statistics",
[ANDROID_STATISTICS_INFO] = "android.statistics.info",
[ANDROID_TONEMAP] = "android.tonemap",
+ [ANDROID_LED] = "android.led",
};
unsigned int camera_metadata_section_bounds[ANDROID_SECTION_COUNT][2] = {
@@ -100,6 +101,8 @@ unsigned int camera_metadata_section_bounds[ANDROID_SECTION_COUNT][2] = {
ANDROID_STATISTICS_INFO_END },
[ANDROID_TONEMAP] = { ANDROID_TONEMAP_START,
ANDROID_TONEMAP_END },
+ [ANDROID_LED] = { ANDROID_LED_START,
+ ANDROID_LED_END },
};
static tag_info_t android_color_correction[ANDROID_COLOR_CORRECTION_END -
@@ -504,6 +507,14 @@ static tag_info_t android_tonemap[ANDROID_TONEMAP_END -
{ "maxCurvePoints", TYPE_INT32 },
};
+static tag_info_t android_led[ANDROID_LED_END -
+ ANDROID_LED_START] = {
+ [ ANDROID_LED_TRANSMIT - ANDROID_LED_START ] =
+ { "transmit", TYPE_BYTE },
+ [ ANDROID_LED_AVAILABLE_LEDS - ANDROID_LED_START ] =
+ { "availableLeds", TYPE_BYTE },
+};
+
tag_info_t *tag_info[ANDROID_SECTION_COUNT] = {
android_color_correction,
@@ -528,6 +539,7 @@ tag_info_t *tag_info[ANDROID_SECTION_COUNT] = {
android_statistics,
android_statistics_info,
android_tonemap,
+ android_led,
};
int camera_metadata_enum_snprint(uint32_t tag,
@@ -1804,6 +1816,33 @@ int camera_metadata_enum_snprint(uint32_t tag,
break;
}
+ case ANDROID_LED_TRANSMIT: {
+ switch (value) {
+ case ANDROID_LED_TRANSMIT_OFF:
+ msg = "OFF";
+ ret = 0;
+ break;
+ case ANDROID_LED_TRANSMIT_ON:
+ msg = "ON";
+ ret = 0;
+ break;
+ default:
+ msg = "error: enum value out of range";
+ }
+ break;
+ }
+ case ANDROID_LED_AVAILABLE_LEDS: {
+ switch (value) {
+ case ANDROID_LED_AVAILABLE_LEDS_TRANSMIT:
+ msg = "TRANSMIT";
+ ret = 0;
+ break;
+ default:
+ msg = "error: enum value out of range";
+ }
+ break;
+ }
+
}
strncpy(dst, msg, size - 1);