Camera: Attach Jpeg/R composite stream metrics

Add Jpeg/R composite logic to generate stream
statistics and attach the corresponding data as
part of the camera device stats.
Cleanup unused jpeg orientation code. The Jpeg/R
orientation in this scenario is handled by the
exif generate from the same capture result which
also takes jpeg orientation in to account.

Bug:262265296
Test: atest -c -d
cts/tests/camera/src/android/hardware/camera2/cts/StillCaptureTest.java#testJpegRCapture
--iterations=10
+
Check that data collected via:
"./out/host/linux-x86/bin/statsd_testdrive 227"
while CTS is running include Jpeg/R stream metrics.

Change-Id: Icc67bbfa57ed3751757e64901122aff6150ee0d0
diff --git a/services/camera/libcameraservice/api2/JpegRCompositeStream.h b/services/camera/libcameraservice/api2/JpegRCompositeStream.h
index 4b462b5..3dfed30 100644
--- a/services/camera/libcameraservice/api2/JpegRCompositeStream.h
+++ b/services/camera/libcameraservice/api2/JpegRCompositeStream.h
@@ -22,6 +22,7 @@
 #include "system/graphics-base-v1.1.h"
 
 #include "api1/client2/JpegProcessor.h"
+#include "utils/SessionStatsBuilder.h"
 
 #include "CompositeStream.h"
 
@@ -65,6 +66,9 @@
     static status_t getCompositeStreamInfo(const OutputStreamInfo &streamInfo,
             const CameraMetadata& ch, std::vector<OutputStreamInfo>* compositeOutput /*out*/);
 
+    // Get composite stream stats
+    void getStreamStats(hardware::CameraStreamStats* streamStats) override;
+
 protected:
 
     bool threadLoop() override;
@@ -80,8 +84,10 @@
         bool                      errorNotified;
         int64_t                   frameNumber;
         int32_t                   requestId;
+        nsecs_t                   requestTimeNs;
 
-        InputFrame() : error(false), errorNotified(false), frameNumber(-1), requestId(-1) { }
+        InputFrame() : error(false), errorNotified(false), frameNumber(-1), requestId(-1),
+            requestTimeNs(-1) { }
     };
 
     status_t processInputFrame(nsecs_t ts, const InputFrame &inputFrame);
@@ -119,6 +125,8 @@
     bool                 mP010BufferAcquired, mBlobBufferAcquired;
     sp<Surface>          mP010Surface, mBlobSurface, mOutputSurface;
     int32_t              mOutputColorSpace;
+    int64_t              mOutputStreamUseCase;
+    nsecs_t              mFirstRequestLatency;
     sp<ProducerListener> mProducerListener;
 
     ssize_t              mMaxJpegBufferSize;
@@ -137,6 +145,8 @@
     std::unordered_map<int64_t, InputFrame> mPendingInputFrames;
 
     const CameraMetadata mStaticInfo;
+
+    SessionStatsBuilder  mSessionStatsBuilder;
 };
 
 }; //namespace camera3