Loading media/libmediatranscoding/Android.bp +1 −0 Original line number Diff line number Diff line Loading @@ -25,6 +25,7 @@ aidl_interface { "aidl/android/media/ITranscodingClientCallback.aidl", "aidl/android/media/TranscodingErrorCode.aidl", "aidl/android/media/TranscodingJobPriority.aidl", "aidl/android/media/TranscodingJobStats.aidl", "aidl/android/media/TranscodingType.aidl", "aidl/android/media/TranscodingVideoCodecType.aidl", "aidl/android/media/TranscodingVideoTrackFormat.aidl", Loading media/libmediatranscoding/TranscodingJobScheduler.cpp +2 −1 Original line number Diff line number Diff line Loading @@ -351,7 +351,8 @@ void TranscodingJobScheduler::onFinish(ClientIdType clientId, JobIdType jobId) { auto clientCallback = mJobMap[jobKey].callback.lock(); if (clientCallback != nullptr) { clientCallback->onTranscodingFinished( jobId, TranscodingResultParcel({jobId, -1 /*actualBitrateBps*/})); jobId, TranscodingResultParcel({jobId, -1 /*actualBitrateBps*/, std::nullopt /*jobStats*/})); } } Loading media/libmediatranscoding/aidl/android/media/TranscodingJobStats.aidl 0 → 100644 +45 −0 Original line number Diff line number Diff line /* * Copyright (C) 2020 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package android.media; /** * TranscodingJobStats encapsulated the stats of the a TranscodingJob. * * {@hide} */ parcelable TranscodingJobStats { /** * System time of when the job is created. */ long jobCreatedTimeUs; /** * System time of when the job is finished. */ long jobFinishedTimeUs; /** * Total time spend on transcoding, exclude the time in pause. */ long totalProcessingTimeUs; /** * Total time spend on handling the job, include the time in pause. * The totaltimeUs is actually the same as jobFinishedTimeUs - jobCreatedTimeUs. */ long totalTimeUs; } media/libmediatranscoding/aidl/android/media/TranscodingRequestParcel.aidl +8 −1 Original line number Diff line number Diff line Loading @@ -77,4 +77,11 @@ parcelable TranscodingRequestParcel { * Test configuration. This will be available only when isForTesting is set to true. */ @nullable TranscodingTestConfig testConfig; /** * Whether to get the stats of the transcoding. * If this is enabled, the TranscodingJobStats will be returned in TranscodingResultParcel * upon transcoding finishes. */ boolean enableStats = false; } media/libmediatranscoding/aidl/android/media/TranscodingResultParcel.aidl +7 −1 Original line number Diff line number Diff line Loading @@ -16,6 +16,8 @@ package android.media; import android.media.TranscodingJobStats; /** * Result of the transcoding. * Loading @@ -34,5 +36,9 @@ parcelable TranscodingResultParcel { */ int actualBitrateBps; // TODO(hkuang): Add more fields. /** * Stats of the transcoding job. This will only be available when client requests to get the * stats in TranscodingRequestParcel. */ @nullable TranscodingJobStats jobStats; } No newline at end of file Loading
media/libmediatranscoding/Android.bp +1 −0 Original line number Diff line number Diff line Loading @@ -25,6 +25,7 @@ aidl_interface { "aidl/android/media/ITranscodingClientCallback.aidl", "aidl/android/media/TranscodingErrorCode.aidl", "aidl/android/media/TranscodingJobPriority.aidl", "aidl/android/media/TranscodingJobStats.aidl", "aidl/android/media/TranscodingType.aidl", "aidl/android/media/TranscodingVideoCodecType.aidl", "aidl/android/media/TranscodingVideoTrackFormat.aidl", Loading
media/libmediatranscoding/TranscodingJobScheduler.cpp +2 −1 Original line number Diff line number Diff line Loading @@ -351,7 +351,8 @@ void TranscodingJobScheduler::onFinish(ClientIdType clientId, JobIdType jobId) { auto clientCallback = mJobMap[jobKey].callback.lock(); if (clientCallback != nullptr) { clientCallback->onTranscodingFinished( jobId, TranscodingResultParcel({jobId, -1 /*actualBitrateBps*/})); jobId, TranscodingResultParcel({jobId, -1 /*actualBitrateBps*/, std::nullopt /*jobStats*/})); } } Loading
media/libmediatranscoding/aidl/android/media/TranscodingJobStats.aidl 0 → 100644 +45 −0 Original line number Diff line number Diff line /* * Copyright (C) 2020 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package android.media; /** * TranscodingJobStats encapsulated the stats of the a TranscodingJob. * * {@hide} */ parcelable TranscodingJobStats { /** * System time of when the job is created. */ long jobCreatedTimeUs; /** * System time of when the job is finished. */ long jobFinishedTimeUs; /** * Total time spend on transcoding, exclude the time in pause. */ long totalProcessingTimeUs; /** * Total time spend on handling the job, include the time in pause. * The totaltimeUs is actually the same as jobFinishedTimeUs - jobCreatedTimeUs. */ long totalTimeUs; }
media/libmediatranscoding/aidl/android/media/TranscodingRequestParcel.aidl +8 −1 Original line number Diff line number Diff line Loading @@ -77,4 +77,11 @@ parcelable TranscodingRequestParcel { * Test configuration. This will be available only when isForTesting is set to true. */ @nullable TranscodingTestConfig testConfig; /** * Whether to get the stats of the transcoding. * If this is enabled, the TranscodingJobStats will be returned in TranscodingResultParcel * upon transcoding finishes. */ boolean enableStats = false; }
media/libmediatranscoding/aidl/android/media/TranscodingResultParcel.aidl +7 −1 Original line number Diff line number Diff line Loading @@ -16,6 +16,8 @@ package android.media; import android.media.TranscodingJobStats; /** * Result of the transcoding. * Loading @@ -34,5 +36,9 @@ parcelable TranscodingResultParcel { */ int actualBitrateBps; // TODO(hkuang): Add more fields. /** * Stats of the transcoding job. This will only be available when client requests to get the * stats in TranscodingRequestParcel. */ @nullable TranscodingJobStats jobStats; } No newline at end of file