Transcoding: Add source and destination fd in TranscodingRequest
Bug: 177463767
Test: Unit test.
Change-Id: I1ea37ab82340bff1d37682dcf4bc5d04edce61dc
diff --git a/media/libmediatranscoding/aidl/android/media/TranscodingRequestParcel.aidl b/media/libmediatranscoding/aidl/android/media/TranscodingRequestParcel.aidl
index 4b19f6a..7047073 100644
--- a/media/libmediatranscoding/aidl/android/media/TranscodingRequestParcel.aidl
+++ b/media/libmediatranscoding/aidl/android/media/TranscodingRequestParcel.aidl
@@ -33,11 +33,25 @@
*/
@utf8InCpp String sourceFilePath;
+ /*
+ * The filedescrptor of the sourceFilePath. If the source Fd is provided, transcoding service
+ * will use this fd instead of calling back to client side to open the sourceFilePath.
+ * -1 means not available.
+ */
+ int sourceFd = -1;
+
/**
* The absolute file path of the destination file.
*/
@utf8InCpp String destinationFilePath;
+ /*
+ * The filedescrptor of the destinationFilePath. If the destination Fd is provided, transcoding
+ * service will use this fd instead of calling back to client side to open the sourceFilePath.
+ * -1 means not available.
+ */
+ int destinationFd = -1;
+
/**
* The UID of the client that this transcoding request is for. Only privileged caller could
* set this Uid as only they could do the transcoding on behalf of the client.
diff --git a/media/libmediatranscoding/include/media/TranscodingRequest.h b/media/libmediatranscoding/include/media/TranscodingRequest.h
index 485403f..e782386 100644
--- a/media/libmediatranscoding/include/media/TranscodingRequest.h
+++ b/media/libmediatranscoding/include/media/TranscodingRequest.h
@@ -36,7 +36,9 @@
private:
void setTo(const TranscodingRequestParcel& parcel) {
sourceFilePath = parcel.sourceFilePath;
+ sourceFd = parcel.sourceFd;
destinationFilePath = parcel.destinationFilePath;
+ destinationFd = parcel.destinationFd;
clientUid = parcel.clientUid;
clientPid = parcel.clientPid;
clientPackageName = parcel.clientPackageName;