Fix typo for xproc buffer sharing

BZ: 147558

change parameter order and fix typo

Change-Id: I30299c1f92d2b93432ce992cec2fd1bca7d917f8
Signed-off-by: Zhao Liang <leo.zhao@intel.com>
diff --git a/test/BSClient.cpp b/test/BSClient.cpp
index b368642..bffb09d 100755
--- a/test/BSClient.cpp
+++ b/test/BSClient.cpp
@@ -22,7 +22,7 @@
     uint32_t tokenPC = 0xC0000000;
     uint32_t token;
 #ifdef INTEL_VIDEO_XPROC_SHARING
-    token = IntelMetadataBuffer::MakeSessionFlag(IntelMetadataBuffer::WEBRTC_BASE, true, false);
+    token = IntelMetadataBuffer::MakeSessionFlag(true, false, IntelMetadataBuffer::WEBRTC_BASE);
 #endif
     int memmode = 0;
     int clearcontext = 1;
diff --git a/videoencoder/IntelMetadataBuffer.cpp b/videoencoder/IntelMetadataBuffer.cpp
index b7dcfc0..686f223 100644
--- a/videoencoder/IntelMetadataBuffer.cpp
+++ b/videoencoder/IntelMetadataBuffer.cpp
@@ -820,7 +820,7 @@
     return IMB_SUCCESS;
 }
 
-uint32_t IntelMetadataBuffer::MakeSessionFlag(uint16_t sindex, bool romoteProvider, bool remoteConsumer)
+uint32_t IntelMetadataBuffer::MakeSessionFlag(bool romoteProvider, bool remoteConsumer, uint16_t sindex)
 {
     uint32_t sessionflag = 0;
 
@@ -828,7 +828,7 @@
         sessionflag |= REMOTE_PROVIDER;
 
     if (remoteConsumer)
-        sessionflag |= REMOTE_PROVIDER;
+        sessionflag |= REMOTE_CONSUMER;
 
     return sessionflag + sindex;
 }
diff --git a/videoencoder/IntelMetadataBuffer.h b/videoencoder/IntelMetadataBuffer.h
index 00b6649..fb18317 100644
--- a/videoencoder/IntelMetadataBuffer.h
+++ b/videoencoder/IntelMetadataBuffer.h
@@ -135,7 +135,7 @@
     static const uint16_t WEBRTC_BASE =    0x2000;
     static const uint16_t VIDEOEDIT_BASE = 0x3000;
 
-    static uint32_t MakeSessionFlag(uint16_t sindex, bool romoteProvider, bool remoteConsumer);
+   static uint32_t MakeSessionFlag(bool romoteProvider, bool remoteConsumer, uint16_t sindex);
 
 private:
     uint32_t mSessionFlag;