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

Commit 96471b83 authored by hkuang's avatar hkuang Committed by Hangyu Kuang
Browse files

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

This will also help for testing from java service and the benchmarking
later as we need to capture all the job event and log the timing.

Bug: 145628554
Bug: 154734285
Test: Unit test
Change-Id: If4f2016de08c8e25e67b50548241f1182f3dcb93
parent d4f4d87c
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