Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b5f48c98 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "transcoding: Adding TranscodingJobStats for benchmarking."

parents 9267056e 0bd73744
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -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",
+2 −1
Original line number Diff line number Diff line
@@ -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*/}));
            }
        }

+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;
}
+8 −1
Original line number Diff line number Diff line
@@ -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;
}
+7 −1
Original line number Diff line number Diff line
@@ -16,6 +16,8 @@

package android.media;

import android.media.TranscodingJobStats;

/**
 * Result of the transcoding.
 *
@@ -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