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

Commit c6be7e44 authored by Hangyu Kuang's avatar Hangyu Kuang Committed by Android (Google) Code Review
Browse files

Merge "transcoding: Add start/pause/resume event update to interface."

parents b25ceccf 96471b83
Loading
Loading
Loading
Loading
+24 −0
Original line number Diff line number Diff line
@@ -39,6 +39,30 @@ interface ITranscodingClientCallback {
    ParcelFileDescriptor openFileDescriptor(in @utf8InCpp String fileUri,
                                            in @utf8InCpp String mode);

    /**
    * Called when the transcoding associated with the jobId finished.
    * This will only be called if client request to get all the status of the job.
    *
    * @param jobId jobId assigned by the MediaTranscodingService upon receiving request.
    */
    oneway void onTranscodingStarted(in int jobId);

    /**
    * Called when the transcoding associated with the jobId is paused.
    * This will only be called if client request to get all the status of the job.
    *
    * @param jobId jobId assigned by the MediaTranscodingService upon receiving request.
    */
    oneway void onTranscodingPaused(in int jobId);

    /**
    * Called when the transcoding associated with the jobId is resumed.
    * This will only be called if client request to get all the status of the job.
    *
    * @param jobId jobId assigned by the MediaTranscodingService upon receiving request.
    */
    oneway void onTranscodingResumed(in int jobId);

    /**
    * Called when the transcoding associated with the jobId finished.
    *
+8 −2
Original line number Diff line number Diff line
@@ -58,8 +58,15 @@ parcelable TranscodingRequestParcel {

    /**
     * Whether to receive update on progress and change of awaitNumJobs.
     * Default to false.
     */
    boolean requestUpdate;
    boolean requestProgressUpdate = false;

    /**
     * Whether to receive update on job's start/stop/pause/resume.
     * Default to false.
     */
    boolean requestJobEventUpdate = false;

    /**
     * Whether this request is for testing.
@@ -69,6 +76,5 @@ parcelable TranscodingRequestParcel {
    /**
     * Test configuration. This is only valid when isForTesting is set to true.
     */

    TranscodingTestConfig testConfig;
}
+2 −1
Original line number Diff line number Diff line
@@ -39,7 +39,8 @@ private:
        destinationFilePath = parcel.destinationFilePath;
        transcodingType = parcel.transcodingType;
        priority = parcel.priority;
        requestUpdate = parcel.requestUpdate;
        requestProgressUpdate = parcel.requestProgressUpdate;
        requestJobEventUpdate = parcel.requestJobEventUpdate;
        isForTesting = parcel.isForTesting;
        testConfig = parcel.testConfig;
    }
+6 −0
Original line number Diff line number Diff line
@@ -64,6 +64,12 @@ struct TestClientCallback : public BnTranscodingClientCallback {
        return Status::ok();
    }

    Status onTranscodingStarted(int32_t /*in_jobId*/) override { return Status::ok(); }

    Status onTranscodingPaused(int32_t /*in_jobId*/) override { return Status::ok(); }

    Status onTranscodingResumed(int32_t /*in_jobId*/) override { return Status::ok(); }

    Status onTranscodingFinished(int32_t in_jobId,
                                 const TranscodingResultParcel& in_result) override {
        EXPECT_EQ(in_jobId, in_result.jobId);
+6 −0
Original line number Diff line number Diff line
@@ -167,6 +167,12 @@ struct TestClientCallback : public BnTranscodingClientCallback {
        return Status::ok();
    }

    Status onTranscodingStarted(int32_t /*in_jobId*/) override { return Status::ok(); }

    Status onTranscodingPaused(int32_t /*in_jobId*/) override { return Status::ok(); }

    Status onTranscodingResumed(int32_t /*in_jobId*/) override { return Status::ok(); }

    Status onTranscodingFinished(int32_t in_jobId,
                                 const TranscodingResultParcel& in_result) override {
        EXPECT_EQ(in_jobId, in_result.jobId);
Loading