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

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

Merge "MediaTranscodingService: Rework Service's AIDL."

parents 4793ecdd 48c365e0
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -6,10 +6,11 @@ aidl_interface {
        "aidl/android/media/IMediaTranscodingService.aidl",
        "aidl/android/media/ITranscodingServiceClient.aidl",
        "aidl/android/media/TranscodingErrorCode.aidl",
        "aidl/android/media/TranscodingJobPriority.aidl",
        "aidl/android/media/TranscodingType.aidl",
        "aidl/android/media/TranscodingVideoCodecType.aidl",
        "aidl/android/media/TranscodingJob.aidl",
        "aidl/android/media/TranscodingRequest.aidl",
        "aidl/android/media/TranscodingResult.aidl",
        "aidl/android/media/TranscodingJobParcel.aidl",
        "aidl/android/media/TranscodingRequestParcel.aidl",
        "aidl/android/media/TranscodingResultParcel.aidl",
    ],
}
+31 −6
Original line number Diff line number Diff line
@@ -16,8 +16,8 @@

package android.media;

import android.media.TranscodingJob;
import android.media.TranscodingRequest;
import android.media.TranscodingJobParcel;
import android.media.TranscodingRequestParcel;
import android.media.ITranscodingServiceClient;

/**
@@ -26,6 +26,25 @@ import android.media.ITranscodingServiceClient;
 * {@hide}
 */
interface IMediaTranscodingService {
    /**
     * All MediaTranscoding service and device Binder calls may return a
     * ServiceSpecificException with the following error codes
     */
    const int ERROR_PERMISSION_DENIED = 1;
    const int ERROR_ALREADY_EXISTS = 2;
    const int ERROR_ILLEGAL_ARGUMENT = 3;
    const int ERROR_DISCONNECTED = 4;
    const int ERROR_TIMED_OUT = 5;
    const int ERROR_DISABLED = 6;
    const int ERROR_INVALID_OPERATION = 7;

    /**
     * Default UID/PID values for non-privileged callers of
     * registerClient().
     */
    const int USE_CALLING_UID = -1;
    const int USE_CALLING_PID = -1;

    /**
     * Register the client with the MediaTranscodingService.
     *
@@ -34,10 +53,16 @@ interface IMediaTranscodingService {
     * Client should save this Id and use it for all the transaction with the service.
     *
     * @param client interface for the MediaTranscodingService to call the client.
     * @param opPackageName op package name of the client.
     * @param clientUid user id of the client.
     * @param clientPid process id of the client.
     * @return a unique positive Id assigned to the client by the service, -1  means failed to
     * register.
     */
    int registerClient(in ITranscodingServiceClient client);
    int registerClient(in ITranscodingServiceClient client,
                       in String opPackageName,
                       in int clientUid,
                       in int clientPid);

    /**
    * Unregister the client with the MediaTranscodingService.
@@ -58,8 +83,8 @@ interface IMediaTranscodingService {
     * @return a unique positive jobId generated by the MediaTranscodingService, -1 means failure.
     */
    int submitRequest(in int clientId,
                      in TranscodingRequest request,
                      out TranscodingJob job);
                      in TranscodingRequestParcel request,
                      out TranscodingJobParcel job);

    /**
     * Cancels a transcoding job.
@@ -77,5 +102,5 @@ interface IMediaTranscodingService {
     * @param job(output variable) the TranscodingJob associated with the jobId.
     * @return true if succeeds, false otherwise.
     */
    boolean getJobWithId(in int jobId, out TranscodingJob job);
    boolean getJobWithId(in int jobId, out TranscodingJobParcel job);
}
+6 −4
Original line number Diff line number Diff line
@@ -17,8 +17,8 @@
package android.media;

import android.media.TranscodingErrorCode;
import android.media.TranscodingJob;
import android.media.TranscodingResult;
import android.media.TranscodingJobParcel;
import android.media.TranscodingResultParcel;

/**
 * ITranscodingServiceClient interface for the MediaTranscodingervice to communicate with the
@@ -39,7 +39,7 @@ interface ITranscodingServiceClient {
    * @param jobId jobId assigned by the MediaTranscodingService upon receiving request.
    * @param result contains the transcoded file stats and other transcoding metrics if requested.
    */
    oneway void onTranscodingFinished(in int jobId, in TranscodingResult result);
    oneway void onTranscodingFinished(in int jobId, in TranscodingResultParcel result);

    /**
    * Called when the transcoding associated with the jobId failed.
@@ -60,7 +60,9 @@ interface ITranscodingServiceClient {
    * @param oldAwaitNumber previous number of jobs ahead of current job.
    * @param newAwaitNumber updated number of jobs ahead of current job.
    */
    oneway void onAwaitNumberOfJobsChanged(in int jobId, in int oldAwaitNumber, in int newAwaitNumber);
    oneway void onAwaitNumberOfJobsChanged(in int jobId,
                                           in int oldAwaitNumber,
                                           in int newAwaitNumber);

    /**
    * Called when there is an update on the progress of the TranscodingJob.
+3 −3
Original line number Diff line number Diff line
@@ -16,7 +16,7 @@

package android.media;

import android.media.TranscodingRequest;
import android.media.TranscodingRequestParcel;

/**
 * TranscodingJob is generated by the MediaTranscodingService upon receiving a TranscodingRequest.
@@ -26,7 +26,7 @@ import android.media.TranscodingRequest;
 * {@hide}
 */
//TODO(hkuang): Implement the parcelable.
parcelable TranscodingJob {
parcelable TranscodingJobParcel {
    /**
     * A unique positive Id generated by the MediaTranscodingService.
     */
@@ -35,7 +35,7 @@ parcelable TranscodingJob {
    /**
     * The request associated with the TranscodingJob.
     */
    TranscodingRequest request;
    TranscodingRequestParcel request;

    /**
    * Current number of jobs ahead of this job. The service schedules the job based on the priority
+37 −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;

/**
 * Priority of a transcoding job.
 *
 * {@hide}
 */
@Backing(type="int")
enum TranscodingJobPriority {
    // TODO(hkuang): define what each priority level actually mean.
    kUnspecified = 0,
    kLow = 1,
    /**
     * 2 ~ 20 is reserved for future use.
     */
    kNormal = 21,
    /**
     * 22 ~ 30 is reserved for future use.
     */
    kHigh = 31,
}
 No newline at end of file
Loading