Home | History | Annotate | Download | only in scene0
      1 # Copyright 2014 The Android Open Source Project
      2 #
      3 # Licensed under the Apache License, Version 2.0 (the "License");
      4 # you may not use this file except in compliance with the License.
      5 # You may obtain a copy of the License at
      6 #
      7 #      http://www.apache.org/licenses/LICENSE-2.0
      8 #
      9 # Unless required by applicable law or agreed to in writing, software
     10 # distributed under the License is distributed on an "AS IS" BASIS,
     11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     12 # See the License for the specific language governing permissions and
     13 # limitations under the License.
     14 
     15 import its.caps
     16 import its.image
     17 import its.device
     18 import its.objects
     19 import its.target
     20 import pprint
     21 
     22 def main():
     23     """Test that a capture result is returned from a manual capture; dump it.
     24     """
     25 
     26     with its.device.ItsSession() as cam:
     27         # Arbitrary capture request exposure values; image content is not
     28         # important for this test, only the metadata.
     29         props = cam.get_camera_properties()
     30         its.caps.skip_unless(its.caps.manual_sensor(props))
     31 
     32         req,fmt = its.objects.get_fastest_manual_capture_settings(props)
     33         cap = cam.do_capture(req, fmt)
     34         pprint.pprint(cap["metadata"])
     35 
     36         # No pass/fail check; test passes if it completes.
     37 
     38 if __name__ == '__main__':
     39     main()
     40 
     41