camera 3_4: Fix compilation errors

Compile Error:
hardware/libhardware/modules/camera/3_4/camera.cpp:502:9: error: non-constant-expression cannot be narrowed from type 'std::__1::vector<camera3_stream_buffer, std::__1::allocator<camera3_stream_buffer> >::size_type' (aka 'unsigned long') to 'uint32_t' (aka 'unsigned int') in initializer list [-Wc++11-narrowing]
        request->output_buffers.size(),
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Compile Error:
hardware/libhardware/modules/camera/3_4/v4l2_gralloc.cpp:168:15: error: use of undeclared identifier 'EINVAL'
      return -EINVAL;

Test: Add to device.mk
        USE_CAMERA_V4L2_HAL := true
        PRODUCT_PACKAGES += camera.v4l2
      mma

Change-Id: Ia6bbd6bac06540214d2c6167a8826f3f4c946e57
Merged-In: Ia6bbd6bac06540214d2c6167a8826f3f4c946e57
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
diff --git a/modules/camera/3_4/camera.cpp b/modules/camera/3_4/camera.cpp
index 7f42eef..83905ea 100644
--- a/modules/camera/3_4/camera.cpp
+++ b/modules/camera/3_4/camera.cpp
@@ -499,7 +499,7 @@
     camera3_capture_result_t result {
         request->frame_number,
         request->settings.getAndLock(),
-        request->output_buffers.size(),
+        static_cast<uint32_t>(request->output_buffers.size()),
         request->output_buffers.data(),
         request->input_buffer.get(),
         1  // Total result; only 1 part.
diff --git a/modules/camera/3_4/request_tracker_test.cpp b/modules/camera/3_4/request_tracker_test.cpp
index a68ff57..8b73bd8 100644
--- a/modules/camera/3_4/request_tracker_test.cpp
+++ b/modules/camera/3_4/request_tracker_test.cpp
@@ -35,7 +35,7 @@
     stream2_.max_buffers = 3;
     dut_.reset(new RequestTracker());
     streams_ = {&stream1_, &stream2_};
-    camera3_stream_configuration_t config{streams_.size(), streams_.data(), 0};
+    camera3_stream_configuration_t config{static_cast<uint32_t>(streams_.size()), streams_.data(), 0};
     dut_->SetStreamConfiguration(config);
   }
 
diff --git a/modules/camera/3_4/static_properties_test.cpp b/modules/camera/3_4/static_properties_test.cpp
index e78e343..2cdb9d4 100644
--- a/modules/camera/3_4/static_properties_test.cpp
+++ b/modules/camera/3_4/static_properties_test.cpp
@@ -107,7 +107,7 @@
       stream_addresses.push_back(&streams[i]);
     }
     camera3_stream_configuration_t config = {
-        stream_addresses.size(),
+        static_cast<uint32_t>(stream_addresses.size()),
         stream_addresses.data(),
         CAMERA3_STREAM_CONFIGURATION_NORMAL_MODE};
     PrepareDefaultDUT();
@@ -443,7 +443,7 @@
 TEST_F(StaticPropertiesTest, ConfigureNullStreams) {
   std::vector<camera3_stream_t*> streams(2, nullptr);
   camera3_stream_configuration_t config = {
-      streams.size(), streams.data(), CAMERA3_STREAM_CONFIGURATION_NORMAL_MODE};
+      static_cast<uint32_t>(streams.size()), streams.data(), CAMERA3_STREAM_CONFIGURATION_NORMAL_MODE};
   PrepareDefaultDUT();
   EXPECT_FALSE(dut_->StreamConfigurationSupported(&config));
 }
diff --git a/modules/camera/3_4/v4l2_gralloc.cpp b/modules/camera/3_4/v4l2_gralloc.cpp
index 7da3c4e..1c8ca48 100644
--- a/modules/camera/3_4/v4l2_gralloc.cpp
+++ b/modules/camera/3_4/v4l2_gralloc.cpp
@@ -18,6 +18,7 @@
 
 #include <linux/videodev2.h>
 
+#include <cerrno>
 #include <cstdlib>
 
 #include <hardware/camera3.h>