V4L2 HALv3 initial check in

Decent outline of an initial HALv3. Still a lot to be filled in.
Adapted from the reference implementation in libhardware.

BUG: 29006356
TEST: Ran simple test program. Connects to the HAL and then
  fails because there are no cameras (expected behavior right now).

Change-Id: I11c7e00dca1bbb6ade6b5a0f55fedac3d2d01695
diff --git a/modules/camera/3_4/Common.h b/modules/camera/3_4/Common.h
new file mode 100644
index 0000000..f1ef23a
--- /dev/null
+++ b/modules/camera/3_4/Common.h
@@ -0,0 +1,61 @@
+/*
+ * Copyright 2015 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef ANDROID_DEVICE_CAMERA_COMMON_H
+#define ANDROID_DEVICE_CAMERA_COMMON_H
+
+// #define LOG_NDEBUG 0
+#include <cutils/log.h>
+
+#define LOG_TAG "V4L2CameraHAL"
+
+// Helpers of logging (showing function name and line number).
+#define HAL_LOGE(fmt, args...) do { \
+    ALOGE("%s:%d: " fmt, __func__, __LINE__, ##args);   \
+  } while(0)
+
+#define HAL_LOGE_IF(cond, fmt, args...) do { \
+    ALOGE_IF(cond, "%s:%d: " fmt, __func__, __LINE__, ##args);  \
+  } while(0)
+
+#define HAL_LOGW(fmt, args...) do { \
+    ALOGW("%s:%d: " fmt, __func__, __LINE__, ##args);   \
+  } while(0)
+
+#define HAL_LOGW_IF(cond, fmt, args...) do { \
+    ALOGW_IF(cond, "%s:%d: " fmt, __func__, __LINE__, ##args);  \
+  } while(0)
+
+#define HAL_LOGD(fmt, args...) do { \
+    ALOGD("%s:%d: " fmt, __func__, __LINE__, ##args);   \
+  } while(0)
+
+#define HAL_LOGV(fmt, args...) do { \
+    ALOGV("%s:%d: " fmt, __func__, __LINE__, ##args);   \
+  } while(0)
+
+// Log enter/exit of methods.
+#define HAL_LOG_ENTER() HAL_LOGV("enter")
+#define HAL_LOG_EXIT() HAL_LOGV("exit")
+
+// Fix confliction in case it's defined elsewhere.
+#ifndef DISALLOW_COPY_AND_ASSIGN
+#define DISALLOW_COPY_AND_ASSIGN(TypeName) \
+  TypeName(const TypeName&);  \
+  void operator=(const TypeName&);
+#endif
+
+#endif