Correctly process streams

The reference implementation stream validation/setting
was all out of whack, particularly the handling of "reuse"
streams. This CL does away with that, and plugs in the
static_properties/request_tracker validation/tracking of
configured streams.

Implementation specific features, such as gralloc flags,
are moved down into the V4L2Camera class out of the Camera class.

BUG: https://b/33057320, https://b/31044638
TEST: unit tests pass, some previously failing CTS tests are passing
(and no regressions), simple test camera preview app runs.

Change-Id: Ie8568239a1348dac45bf829ef928e500e01fdcda
diff --git a/modules/camera/3_4/v4l2_wrapper.cpp b/modules/camera/3_4/v4l2_wrapper.cpp
index fd4f169..b24535c 100644
--- a/modules/camera/3_4/v4l2_wrapper.cpp
+++ b/modules/camera/3_4/v4l2_wrapper.cpp
@@ -31,7 +31,6 @@
 #include <nativehelper/ScopedFd.h>
 
 #include "common.h"
-#include "stream.h"
 #include "stream_format.h"
 #include "v4l2_gralloc.h"
 
@@ -440,17 +439,10 @@
   return 0;
 }
 
-int V4L2Wrapper::SetFormat(const default_camera_hal::Stream& stream,
+int V4L2Wrapper::SetFormat(const StreamFormat& desired_format,
                            uint32_t* result_max_buffers) {
   HAL_LOG_ENTER();
 
-  // Should be checked earlier; sanity check.
-  if (stream.isInputType()) {
-    HAL_LOGE("Input streams not supported.");
-    return -EINVAL;
-  }
-
-  StreamFormat desired_format(stream);
   if (format_ && desired_format == *format_) {
     HAL_LOGV("Already in correct format, skipping format setting.");
     *result_max_buffers = buffers_.size();