Loading media/java/android/media/tv/tuner/FrontendSettings.javadeleted 100644 → 0 +0 −25 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; /** * Frontend settings for tune and scan operations. * TODO: remove * @hide */ public abstract class FrontendSettings { } media/java/android/media/tv/tuner/Tuner.java +14 −5 Original line number Diff line number Diff line Loading @@ -222,6 +222,7 @@ public class Tuner implements AutoCloseable { private Integer mDemuxHandle; private Integer mDescramblerHandle; private Descrambler mDescrambler; private final TunerResourceManager.ResourcesReclaimListener mResourceListener = new TunerResourceManager.ResourcesReclaimListener() { Loading Loading @@ -249,6 +250,7 @@ public class Tuner implements AutoCloseable { mHandler = createEventHandler(); } mHandler = createEventHandler(); int[] clientId = new int[1]; ResourceClientProfile profile = new ResourceClientProfile(tvInputSessionId, useCase); mTunerResourceManager.registerClientProfile( Loading Loading @@ -286,7 +288,7 @@ public class Tuner implements AutoCloseable { public void shareFrontendFromTuner(@NonNull Tuner tuner) { mTunerResourceManager.shareFrontend(mClientId, tuner.mClientId); mFrontendHandle = tuner.mFrontendHandle; nativeOpenFrontendByHandle(mFrontendHandle); mFrontend = nativeOpenFrontendByHandle(mFrontendHandle); } /** Loading Loading @@ -319,6 +321,7 @@ public class Tuner implements AutoCloseable { mTunerResourceManager.releaseLnb(mLnbHandle); mLnb = null; } nativeClose(); } /** Loading Loading @@ -359,13 +362,16 @@ public class Tuner implements AutoCloseable { private native Lnb nativeOpenLnbByHandle(int handle); private native Lnb nativeOpenLnbByName(String name); private native Descrambler nativeOpenDescrambler(); private native Descrambler nativeOpenDescramblerByHandle(int handle); private native Descrambler nativeOpenDemuxByhandle(int handle); private native DvrRecorder nativeOpenDvrRecorder(long bufferSize); private native DvrPlayback nativeOpenDvrPlayback(long bufferSize); private static native DemuxCapabilities nativeGetDemuxCapabilities(); private native int nativeClose(); /** * Listener for resource lost. Loading Loading @@ -554,6 +560,7 @@ public class Tuner implements AutoCloseable { boolean granted = mTunerResourceManager.requestFrontend(request, feHandle); if (granted) { mFrontendHandle = feHandle[0]; mFrontend = nativeOpenFrontendByHandle(mFrontendHandle); } return granted; } Loading Loading @@ -819,7 +826,7 @@ public class Tuner implements AutoCloseable { Objects.requireNonNull(executor, "executor must not be null"); Objects.requireNonNull(cb, "LnbCallback must not be null"); checkResource(TunerResourceManager.TUNER_RESOURCE_TYPE_LNB); return nativeOpenLnbByHandle(mLnbHandle); return mLnb; } /** Loading @@ -837,7 +844,6 @@ public class Tuner implements AutoCloseable { Objects.requireNonNull(name, "LNB name must not be null"); Objects.requireNonNull(executor, "executor must not be null"); Objects.requireNonNull(cb, "LnbCallback must not be null"); checkResource(TunerResourceManager.TUNER_RESOURCE_TYPE_LNB); return nativeOpenLnbByName(name); } Loading @@ -847,6 +853,7 @@ public class Tuner implements AutoCloseable { boolean granted = mTunerResourceManager.requestLnb(request, lnbHandle); if (granted) { mLnbHandle = lnbHandle[0]; mLnb = nativeOpenLnbByHandle(mLnbHandle); } return granted; } Loading Loading @@ -877,7 +884,7 @@ public class Tuner implements AutoCloseable { @Nullable public Descrambler openDescrambler() { checkResource(TunerResourceManager.TUNER_RESOURCE_TYPE_DESCRAMBLER); return nativeOpenDescrambler(); return mDescrambler; } /** Loading Loading @@ -930,6 +937,7 @@ public class Tuner implements AutoCloseable { boolean granted = mTunerResourceManager.requestDemux(request, demuxHandle); if (granted) { mDemuxHandle = demuxHandle[0]; nativeOpenDemuxByhandle(mDemuxHandle); } return granted; } Loading @@ -940,6 +948,7 @@ public class Tuner implements AutoCloseable { boolean granted = mTunerResourceManager.requestDescrambler(request, descramblerHandle); if (granted) { mDescramblerHandle = descramblerHandle[0]; nativeOpenDescramblerByHandle(mDescramblerHandle); } return granted; } Loading media/java/android/media/tv/tuner/filter/Filter.java +5 −7 Original line number Diff line number Diff line Loading @@ -23,7 +23,6 @@ import android.annotation.Nullable; import android.annotation.SystemApi; import android.hardware.tv.tuner.V1_0.Constants; import android.media.tv.tuner.Tuner.Result; import android.media.tv.tuner.TunerUtils; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; Loading Loading @@ -239,13 +238,12 @@ public class Filter implements AutoCloseable { */ @Result public int configure(@NonNull FilterConfiguration config) { // TODO: validate main type, subtype, config, settings int subType; Settings s = config.getSettings(); if (s != null) { subType = s.getType(); } else { subType = TunerUtils.getFilterSubtype(mMainType, mSubtype); int subType = (s == null) ? mSubtype : s.getType(); if (mMainType != config.getType() || mSubtype != subType) { throw new IllegalArgumentException("Invalid filter config. filter main type=" + mMainType + ", filter subtype=" + mSubtype + ". config main type=" + config.getType() + ", config subtype=" + subType); } return nativeConfigureFilter(config.getType(), subType, config); } Loading media/java/android/media/tv/tuner/filter/MediaEvent.java +4 −2 Original line number Diff line number Diff line Loading @@ -28,6 +28,8 @@ import android.media.MediaCodec.LinearBlock; */ @SystemApi public class MediaEvent extends FilterEvent { private native int nativeGetAudioHandle(); private final int mStreamId; private final boolean mIsPtsPresent; private final long mPts; Loading Loading @@ -134,7 +136,7 @@ public class MediaEvent extends FilterEvent{ * @see android.media.AudioTrack#ENCAPSULATION_MODE_HANDLE */ public long getAudioHandle() { // TODO: implement nativeGetAudioHandle(); return mDataId; } Loading media/java/android/media/tv/tuner/filter/TimeFilter.java +1 −2 Original line number Diff line number Diff line Loading @@ -67,8 +67,7 @@ public class TimeFilter implements AutoCloseable { @Result public int setCurrentTimestamp(long timestamp) { int res = nativeSetTimestamp(timestamp); // TODO: use a constant for SUCCESS if (res == 0) { if (res == Tuner.RESULT_SUCCESS) { mEnable = true; } return res; Loading Loading
media/java/android/media/tv/tuner/FrontendSettings.javadeleted 100644 → 0 +0 −25 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; /** * Frontend settings for tune and scan operations. * TODO: remove * @hide */ public abstract class FrontendSettings { }
media/java/android/media/tv/tuner/Tuner.java +14 −5 Original line number Diff line number Diff line Loading @@ -222,6 +222,7 @@ public class Tuner implements AutoCloseable { private Integer mDemuxHandle; private Integer mDescramblerHandle; private Descrambler mDescrambler; private final TunerResourceManager.ResourcesReclaimListener mResourceListener = new TunerResourceManager.ResourcesReclaimListener() { Loading Loading @@ -249,6 +250,7 @@ public class Tuner implements AutoCloseable { mHandler = createEventHandler(); } mHandler = createEventHandler(); int[] clientId = new int[1]; ResourceClientProfile profile = new ResourceClientProfile(tvInputSessionId, useCase); mTunerResourceManager.registerClientProfile( Loading Loading @@ -286,7 +288,7 @@ public class Tuner implements AutoCloseable { public void shareFrontendFromTuner(@NonNull Tuner tuner) { mTunerResourceManager.shareFrontend(mClientId, tuner.mClientId); mFrontendHandle = tuner.mFrontendHandle; nativeOpenFrontendByHandle(mFrontendHandle); mFrontend = nativeOpenFrontendByHandle(mFrontendHandle); } /** Loading Loading @@ -319,6 +321,7 @@ public class Tuner implements AutoCloseable { mTunerResourceManager.releaseLnb(mLnbHandle); mLnb = null; } nativeClose(); } /** Loading Loading @@ -359,13 +362,16 @@ public class Tuner implements AutoCloseable { private native Lnb nativeOpenLnbByHandle(int handle); private native Lnb nativeOpenLnbByName(String name); private native Descrambler nativeOpenDescrambler(); private native Descrambler nativeOpenDescramblerByHandle(int handle); private native Descrambler nativeOpenDemuxByhandle(int handle); private native DvrRecorder nativeOpenDvrRecorder(long bufferSize); private native DvrPlayback nativeOpenDvrPlayback(long bufferSize); private static native DemuxCapabilities nativeGetDemuxCapabilities(); private native int nativeClose(); /** * Listener for resource lost. Loading Loading @@ -554,6 +560,7 @@ public class Tuner implements AutoCloseable { boolean granted = mTunerResourceManager.requestFrontend(request, feHandle); if (granted) { mFrontendHandle = feHandle[0]; mFrontend = nativeOpenFrontendByHandle(mFrontendHandle); } return granted; } Loading Loading @@ -819,7 +826,7 @@ public class Tuner implements AutoCloseable { Objects.requireNonNull(executor, "executor must not be null"); Objects.requireNonNull(cb, "LnbCallback must not be null"); checkResource(TunerResourceManager.TUNER_RESOURCE_TYPE_LNB); return nativeOpenLnbByHandle(mLnbHandle); return mLnb; } /** Loading @@ -837,7 +844,6 @@ public class Tuner implements AutoCloseable { Objects.requireNonNull(name, "LNB name must not be null"); Objects.requireNonNull(executor, "executor must not be null"); Objects.requireNonNull(cb, "LnbCallback must not be null"); checkResource(TunerResourceManager.TUNER_RESOURCE_TYPE_LNB); return nativeOpenLnbByName(name); } Loading @@ -847,6 +853,7 @@ public class Tuner implements AutoCloseable { boolean granted = mTunerResourceManager.requestLnb(request, lnbHandle); if (granted) { mLnbHandle = lnbHandle[0]; mLnb = nativeOpenLnbByHandle(mLnbHandle); } return granted; } Loading Loading @@ -877,7 +884,7 @@ public class Tuner implements AutoCloseable { @Nullable public Descrambler openDescrambler() { checkResource(TunerResourceManager.TUNER_RESOURCE_TYPE_DESCRAMBLER); return nativeOpenDescrambler(); return mDescrambler; } /** Loading Loading @@ -930,6 +937,7 @@ public class Tuner implements AutoCloseable { boolean granted = mTunerResourceManager.requestDemux(request, demuxHandle); if (granted) { mDemuxHandle = demuxHandle[0]; nativeOpenDemuxByhandle(mDemuxHandle); } return granted; } Loading @@ -940,6 +948,7 @@ public class Tuner implements AutoCloseable { boolean granted = mTunerResourceManager.requestDescrambler(request, descramblerHandle); if (granted) { mDescramblerHandle = descramblerHandle[0]; nativeOpenDescramblerByHandle(mDescramblerHandle); } return granted; } Loading
media/java/android/media/tv/tuner/filter/Filter.java +5 −7 Original line number Diff line number Diff line Loading @@ -23,7 +23,6 @@ import android.annotation.Nullable; import android.annotation.SystemApi; import android.hardware.tv.tuner.V1_0.Constants; import android.media.tv.tuner.Tuner.Result; import android.media.tv.tuner.TunerUtils; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; Loading Loading @@ -239,13 +238,12 @@ public class Filter implements AutoCloseable { */ @Result public int configure(@NonNull FilterConfiguration config) { // TODO: validate main type, subtype, config, settings int subType; Settings s = config.getSettings(); if (s != null) { subType = s.getType(); } else { subType = TunerUtils.getFilterSubtype(mMainType, mSubtype); int subType = (s == null) ? mSubtype : s.getType(); if (mMainType != config.getType() || mSubtype != subType) { throw new IllegalArgumentException("Invalid filter config. filter main type=" + mMainType + ", filter subtype=" + mSubtype + ". config main type=" + config.getType() + ", config subtype=" + subType); } return nativeConfigureFilter(config.getType(), subType, config); } Loading
media/java/android/media/tv/tuner/filter/MediaEvent.java +4 −2 Original line number Diff line number Diff line Loading @@ -28,6 +28,8 @@ import android.media.MediaCodec.LinearBlock; */ @SystemApi public class MediaEvent extends FilterEvent { private native int nativeGetAudioHandle(); private final int mStreamId; private final boolean mIsPtsPresent; private final long mPts; Loading Loading @@ -134,7 +136,7 @@ public class MediaEvent extends FilterEvent{ * @see android.media.AudioTrack#ENCAPSULATION_MODE_HANDLE */ public long getAudioHandle() { // TODO: implement nativeGetAudioHandle(); return mDataId; } Loading
media/java/android/media/tv/tuner/filter/TimeFilter.java +1 −2 Original line number Diff line number Diff line Loading @@ -67,8 +67,7 @@ public class TimeFilter implements AutoCloseable { @Result public int setCurrentTimestamp(long timestamp) { int res = nativeSetTimestamp(timestamp); // TODO: use a constant for SUCCESS if (res == 0) { if (res == Tuner.RESULT_SUCCESS) { mEnable = true; } return res; Loading