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

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

Merge "getDemuxCaps() API"

parents 05528bc6 34258934
Loading
Loading
Loading
Loading
+114 −0
Original line number Diff line number Diff line
/*
 * Copyright 2019 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.tv.tuner;

/**
 * Capabilities info for Demux.
 * @hide
 */
public class DemuxCapabilities {
    private final int mNumDemux;
    private final int mNumRecord;
    private final int mNumPlayback;
    private final int mNumTsFilter;
    private final int mNumSectionFilter;
    private final int mNumAudioFilter;
    private final int mNumVideoFilter;
    private final int mNumPesFilter;
    private final int mNumPcrFilter;
    private final int mNumBytesInSectionFilter;
    private final int mFilterCaps;
    private final int[] mLinkCaps;

    DemuxCapabilities(int numDemux, int numRecord, int numPlayback, int numTsFilter,
            int numSectionFilter, int numAudioFilter, int numVideoFilter, int numPesFilter,
            int numPcrFilter, int numBytesInSectionFilter, int filterCaps, int[] linkCaps) {
        mNumDemux = numDemux;
        mNumRecord = numRecord;
        mNumPlayback = numPlayback;
        mNumTsFilter = numTsFilter;
        mNumSectionFilter = numSectionFilter;
        mNumAudioFilter = numAudioFilter;
        mNumVideoFilter = numVideoFilter;
        mNumPesFilter = numPesFilter;
        mNumPcrFilter = numPcrFilter;
        mNumBytesInSectionFilter = numBytesInSectionFilter;
        mFilterCaps = filterCaps;
        mLinkCaps = linkCaps;
    }

    /** Gets total number of demuxes. */
    public int getNumDemux() {
        return mNumDemux;
    }
    /** Gets max number of recordings at a time. */
    public int getNumRecord() {
        return mNumRecord;
    }
    /** Gets max number of playbacks at a time. */
    public int getNumPlayback() {
        return mNumPlayback;
    }
    /** Gets number of TS filters. */
    public int getNumTsFilter() {
        return mNumTsFilter;
    }
    /** Gets number of section filters. */
    public int getNumSectionFilter() {
        return mNumSectionFilter;
    }
    /** Gets number of audio filters. */
    public int getNumAudioFilter() {
        return mNumAudioFilter;
    }
    /** Gets number of video filters. */
    public int getNumVideoFilter() {
        return mNumVideoFilter;
    }
    /** Gets number of PES filters. */
    public int getNumPesFilter() {
        return mNumPesFilter;
    }
    /** Gets number of PCR filters. */
    public int getNumPcrFilter() {
        return mNumPcrFilter;
    }
    /** Gets number of bytes in the mask of a section filter. */
    public int getNumBytesInSectionFilter() {
        return mNumBytesInSectionFilter;
    }
    /**
     * Gets filter capabilities in bit field.
     *
     * The bits of the returned value is corresponding to the types in
     * {@link TunerConstants.FilterType}.
     */
    public int getFilterCapabilities() {
        return mFilterCaps;
    }

    /**
     * Gets link capabilities.
     *
     * The returned array contains the same elements as the number of types in
     * {@link TunerConstants.FilterType}.
     * The ith element represents the filter's capability as the source for the ith type
     */
    public int[] getLinkCapabilities() {
        return mLinkCaps;
    }
}
+7 −0
Original line number Diff line number Diff line
@@ -127,6 +127,8 @@ public final class Tuner implements AutoCloseable {

    private native Dvr nativeOpenDvr(int type, int bufferSize);

    private static native DemuxCapabilities nativeGetDemuxCapabilities();

    /**
     * Frontend Callback.
     *
@@ -434,6 +436,11 @@ public final class Tuner implements AutoCloseable {
        return mFrontend.mId;
    }

    /** @hide */
    private static DemuxCapabilities getDemuxCapabilities() {
        return nativeGetDemuxCapabilities();
    }

    private List<Integer> getFrontendIds() {
        mFrontendIds = nativeGetFrontendIds();
        return mFrontendIds;
+6 −0
Original line number Diff line number Diff line
@@ -880,6 +880,10 @@ static jobject android_media_tv_Tuner_open_dvr(JNIEnv *env, jobject thiz, jint t
    return tuner->openDvr(static_cast<DvrType>(type), bufferSize);
}

static jobject android_media_tv_Tuner_get_demux_caps(JNIEnv*, jobject) {
    return NULL;
}

static int android_media_tv_Tuner_attach_filter(JNIEnv *env, jobject dvr, jobject filter) {
    sp<IDvr> dvrSp = getDvr(env, dvr)->getIDvr();
    sp<IFilter> filterSp = getFilter(env, filter)->getIFilter();
@@ -1123,6 +1127,8 @@ static const JNINativeMethod gTunerMethods[] = {
            (void *)android_media_tv_Tuner_open_descrambler },
    { "nativeOpenDvr", "(II)Landroid/media/tv/tuner/Tuner$Dvr;",
            (void *)android_media_tv_Tuner_open_dvr },
    { "nativeGetDemuxCapabilities", "()Landroid/media/tv/tuner/DemuxCapabilities;",
            (void *)android_media_tv_Tuner_get_demux_caps },
};

static const JNINativeMethod gFilterMethods[] = {