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/V4L2Camera.h b/modules/camera/3_4/V4L2Camera.h
index c9a7a71..bb6aac8 100644
--- a/modules/camera/3_4/V4L2Camera.h
+++ b/modules/camera/3_4/V4L2Camera.h
@@ -29,6 +29,7 @@
 #include "ArrayVector.h"
 #include "Camera.h"
 #include "Common.h"
+#include "V4L2Gralloc.h"
 
 namespace v4l2_camera_hal {
 // V4L2Camera is a specific V4L2-supported camera device. The Camera object
@@ -75,6 +76,8 @@
   const std::string mDevicePath;
   // The opened device fd.
   ScopedFd mDeviceFd;
+  // Gralloc helper.
+  V4L2Gralloc mGralloc;
   // Lock protecting use of the device.
   android::Mutex mDeviceLock;
   // Wrapper around ioctl.
@@ -86,6 +89,7 @@
   uint32_t mOutStreamFormat;
   uint32_t mOutStreamWidth;
   uint32_t mOutStreamHeight;
+  uint32_t mOutStreamBytesPerLine;
   uint32_t mOutStreamMaxBuffers;
 
   bool mTemplatesInitialized;