Add helper class for dealing with gralloc.

This reverts commit a485a7e60db95039df5de82119e47878372550ac
(which reverts the original version of this CL).

Fixed build errors - put reinterpret_cast around delete [] in
V4L2Gralloc destructor, and fixed missing parens around another
reinterpret cast.

BUG: 29335262
Change-Id: Iaa5a71afef8850ba499cb1a7159a831da4f7014a
diff --git a/modules/camera/3_4/Android.mk b/modules/camera/3_4/Android.mk
index bea434a..ad02c20 100644
--- a/modules/camera/3_4/Android.mk
+++ b/modules/camera/3_4/Android.mk
@@ -35,6 +35,7 @@
     libcamera_client \
     libcamera_metadata \
     libcutils \
+    libhardware \
     liblog \
     libnativehelper \
     libsync \
@@ -51,6 +52,7 @@
   StreamFormat.cpp \
   V4L2Camera.cpp \
   V4L2CameraHAL.cpp \
+  V4L2Gralloc.cpp \
   V4L2Wrapper.cpp \
 
 LOCAL_CFLAGS += -Wall -Wextra -fvisibility=hidden