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

Commit 7343fee9 authored by shubang's avatar shubang Committed by Shubang Lu
Browse files

Complete Java APIs of demux.hal

Test: make
Change-Id: Ied9df878620632eb60ec16fd5ec7c3f989ffb7c4
parent 3c5d179a
Loading
Loading
Loading
Loading
+57 −0
Original line number Diff line number Diff line
@@ -110,6 +110,10 @@ public final class Tuner implements AutoCloseable {
    private native int nativeSetLnb(int lnbId);
    private native int nativeSetLna(boolean enable);
    private native FrontendStatus[] nativeGetFrontendStatus(int[] statusTypes);
    private native int nativeGetAvSyncHwId(Filter filter);
    private native long nativeGetAvSyncTime(int avSyncId);
    private native int nativeConnectCiCam(int ciCamId);
    private native int nativeDisconnectCiCam();
    private native Filter nativeOpenFilter(int type, int subType, int bufferSize);

    private native List<Integer> nativeGetLnbIds();
@@ -351,6 +355,59 @@ public final class Tuner implements AutoCloseable {
        return nativeGetFrontendStatus(statusTypes);
    }

    /**
     * Gets hardware sync ID for audio and video.
     *
     * @param filter the filter instance for the hardware sync ID.
     * @return the id of hardware A/V sync.
     * @hide
     */
    public int getAvSyncHwId(Filter filter) {
        return nativeGetAvSyncHwId(filter);
    }
    /**
     * Gets the current timestamp for A/V sync
     *
     * The timestamp is maintained by hardware. The timestamp based on 90KHz, and it's format is the
     * same as PTS (Presentation Time Stamp).
     *
     * @param avSyncHwId the hardware id of A/V sync.
     * @return the current timestamp of hardware A/V sync.
     * @hide
     */
    public long getAvSyncTime(int avSyncHwId) {
        return nativeGetAvSyncTime(avSyncHwId);
    }


    /**
     * Connects Conditional Access Modules (CAM) through Common Interface (CI)
     *
     * The demux uses the output from the frontend as the input by default, and must change to use
     * the output from CI-CAM as the input after this call.
     *
     * @param ciCamId specify CI-CAM Id to connect.
     * @return result status of the operation.
     * @hide
     */
    @Result
    public int connectCiCam(int ciCamId) {
        return nativeConnectCiCam(ciCamId);
    }

    /**
     * Disconnects Conditional Access Modules (CAM)
     *
     * The demux will use the output from the frontend as the input after this call.
     *
     * @return result status of the operation.
     * @hide
     */
    @Result
    public int disconnectCiCam() {
        return nativeDisconnectCiCam();
    }

    private List<Integer> getFrontendIds() {
        mFrontendIds = nativeGetFrontendIds();
        return mFrontendIds;
+21 −0
Original line number Diff line number Diff line
@@ -636,6 +636,22 @@ static jobjectArray android_media_tv_Tuner_get_frontend_status(JNIEnv, jobject,
    return NULL;
}

static int android_media_tv_Tuner_gat_av_sync_hw_id(JNIEnv*, jobject, jobject) {
    return 0;
}

static jlong android_media_tv_Tuner_gat_av_sync_time(JNIEnv*, jobject, jint) {
    return 0;
}

static int android_media_tv_Tuner_connect_cicam(JNIEnv*, jobject, jint) {
    return 0;
}

static int android_media_tv_Tuner_disconnect_cicam(JNIEnv*, jobject) {
    return 0;
}

static jobject android_media_tv_Tuner_get_lnb_ids(JNIEnv *env, jobject thiz) {
    sp<JTuner> tuner = getTuner(env, thiz);
    return tuner->getLnbIds();
@@ -944,6 +960,11 @@ static const JNINativeMethod gTunerMethods[] = {
    { "nativeSetLna", "(Z)I", (void *)android_media_tv_Tuner_set_lna },
    { "nativeGetFrontendStatus", "([I)[Landroid/media/tv/tuner/FrontendStatus;",
            (void *)android_media_tv_Tuner_get_frontend_status },
    { "nativeGetAvSyncHwId", "(Landroid/media/tv/tuner/Tuner$Filter;)I",
            (void *)android_media_tv_Tuner_gat_av_sync_hw_id },
    { "nativeGetAvSyncTime", "(I)J", (void *)android_media_tv_Tuner_gat_av_sync_time },
    { "nativeConnectCiCam", "(I)I", (void *)android_media_tv_Tuner_connect_cicam },
    { "nativeDisconnectCiCam", "()I", (void *)android_media_tv_Tuner_disconnect_cicam },
    { "nativeOpenFilter", "(III)Landroid/media/tv/tuner/Tuner$Filter;",
            (void *)android_media_tv_Tuner_open_filter },
    { "nativeGetLnbIds", "()Ljava/util/List;",