Loading media/jni/android_media_tv_Tuner.cpp +16 −13 Original line number Diff line number Diff line Loading @@ -226,7 +226,6 @@ void LnbClientCallbackImpl::onEvent(const LnbEventType lnbEventType) { } else { ALOGE("LnbClientCallbackImpl::onEvent:" "Lnb object has been freed. Ignoring callback."); env->DeleteWeakGlobalRef(mLnbObj); } } Loading @@ -245,7 +244,6 @@ void LnbClientCallbackImpl::onDiseqcMessage(const hidl_vec<uint8_t>& diseqcMessa } else { ALOGE("LnbClientCallbackImpl::onDiseqcMessage:" "Lnb object has been freed. Ignoring callback."); env->DeleteWeakGlobalRef(mLnbObj); } } Loading Loading @@ -276,7 +274,6 @@ void DvrClientCallbackImpl::onRecordStatus(RecordStatus status) { } else { ALOGE("DvrClientCallbackImpl::onRecordStatus:" "Dvr object has been freed. Ignoring callback."); env->DeleteWeakGlobalRef(mDvrObj); } } Loading @@ -292,7 +289,6 @@ void DvrClientCallbackImpl::onPlaybackStatus(PlaybackStatus status) { } else { ALOGE("DvrClientCallbackImpl::onPlaybackStatus:" "Dvr object has been freed. Ignoring callback."); env->DeleteWeakGlobalRef(mDvrObj); } } Loading Loading @@ -846,7 +842,6 @@ void FilterClientCallbackImpl::onFilterEvent_1_1(const DemuxFilterEvent& filterE } else { ALOGE("FilterClientCallbackImpl::onFilterEvent_1_1:" "Filter object has been freed. Ignoring callback."); env->DeleteWeakGlobalRef(mFilterObj); } } Loading @@ -871,7 +866,6 @@ void FilterClientCallbackImpl::onFilterStatus(const DemuxFilterStatus status) { } else { ALOGE("FilterClientCallbackImpl::onFilterStatus:" "Filter object has been freed. Ignoring callback."); env->DeleteWeakGlobalRef(mFilterObj); } } Loading Loading @@ -907,7 +901,6 @@ void FrontendClientCallbackImpl::onEvent(FrontendEventType frontendEventType) { } else { ALOGE("FrontendClientCallbackImpl::onEvent:" "Frontend object has been freed. Ignoring callback."); env->DeleteWeakGlobalRef(mObject); } } Loading @@ -920,7 +913,6 @@ void FrontendClientCallbackImpl::onScanMessage( if (env->IsSameObject(frontend, nullptr)) { ALOGE("FrontendClientCallbackImpl::onScanMessage:" "Frontend object has been freed. Ignoring callback."); env->DeleteWeakGlobalRef(mObject); return; } switch(type) { Loading Loading @@ -1078,7 +1070,6 @@ void FrontendClientCallbackImpl::onScanMessageExt1_1(FrontendScanMessageTypeExt1 if (env->IsSameObject(frontend, nullptr)) { ALOGE("FrontendClientCallbackImpl::onScanMessageExt1_1:" "Frontend object has been freed. Ignoring callback."); env->DeleteWeakGlobalRef(mObject); return; } switch(type) { Loading Loading @@ -1243,7 +1234,6 @@ jobject JTuner::openFrontendByHandle(int feHandle) { if (env->IsSameObject(tuner, nullptr)) { ALOGE("openFrontendByHandle" "Tuner object has been freed. Failed to open frontend."); env->DeleteWeakGlobalRef(mObject); return NULL; } Loading Loading @@ -2211,6 +2201,10 @@ jobject JTuner::getFrontendStatus(jintArray types) { intBandwidth = static_cast<jint>(bandwidth.dvbt()); break; } case FrontendBandwidth::hidl_discriminator::dvbc: { intBandwidth = static_cast<jint>(bandwidth.dvbc()); break; } case FrontendBandwidth::hidl_discriminator::isdbt: { intBandwidth = static_cast<jint>(bandwidth.isdbt()); break; Loading Loading @@ -2731,12 +2725,10 @@ static FrontendSettings getDvbsFrontendSettings(JNIEnv *env, const jobject& sett FrontendDvbsVcmMode vcmMode = static_cast<FrontendDvbsVcmMode>( env->GetIntField(settings, env->GetFieldID(clazz, "mVcmMode", "I"))); FrontendDvbsCodeRate coderate = getDvbsCodeRate(env, settings); FrontendDvbsSettings frontendDvbsSettings { .frequency = freq, .modulation = modulation, .coderate = coderate, .symbolRate = symbolRate, .rolloff = rolloff, .pilot = pilot, Loading @@ -2744,6 +2736,13 @@ static FrontendSettings getDvbsFrontendSettings(JNIEnv *env, const jobject& sett .standard = standard, .vcmMode = vcmMode, }; jobject jcodeRate = env->GetObjectField(settings, env->GetFieldID(clazz, "mCodeRate", "Landroid/media/tv/tuner/frontend/DvbsCodeRate;")); if (jcodeRate != NULL) { frontendDvbsSettings.coderate = getDvbsCodeRate(env, settings); } frontendSettings.dvbs(frontendDvbsSettings); return frontendSettings; } Loading @@ -2755,7 +2754,7 @@ static void getDvbsFrontendSettingsExt1_1(JNIEnv *env, const jobject& settings, static_cast<FrontendDvbsScanType>( env->GetIntField(settings, env->GetFieldID(clazz, "mScanType", "I"))); bool isDiseqcRxMessage = static_cast<bool>(env->GetBooleanField( settings, env->GetFieldID(clazz, "mIsDiseqcRxMessage", "B"))); settings, env->GetFieldID(clazz, "mIsDiseqcRxMessage", "Z"))); FrontendDvbsSettingsExt1_1 dvbsExt1_1 { .scanType = scanType, Loading Loading @@ -2995,6 +2994,10 @@ static void getDtmbFrontendSettings(JNIEnv *env, const jobject& settings, static FrontendSettings getFrontendSettings(JNIEnv *env, int type, jobject settings) { ALOGD("getFrontendSettings %d", type); if (type == static_cast<int>(::android::hardware::tv::tuner::V1_1::FrontendType::DTMB)) { return FrontendSettings(); } FrontendType feType = static_cast<FrontendType>(type); switch(feType) { case FrontendType::ANALOG: Loading media/jni/tuner/FrontendClient.cpp +8 −7 Original line number Diff line number Diff line Loading @@ -588,14 +588,15 @@ vector<FrontendStatusExt1_1> FrontendClient::getHidlStatusExt( break; } case TunerFrontendStatus::codeRates: { int size = s.get<TunerFrontendStatus::codeRates>().size(); status.codeRates().resize(size); for (int i = 0; i < size; i++) { auto aidlCodeRate = s.get<TunerFrontendStatus::codeRates>()[i]; status.codeRates()[i] = static_cast<hardware::tv::tuner::V1_1::FrontendInnerFec>(aidlCodeRate); vector<hardware::tv::tuner::V1_1::FrontendInnerFec> codeRates; for (auto aidlCodeRate : s.get<TunerFrontendStatus::codeRates>()) { codeRates.push_back( static_cast<hardware::tv::tuner::V1_1::FrontendInnerFec>(aidlCodeRate)); } if (codeRates.size() > 0) { status.codeRates(codeRates); hidlStatus.push_back(status); } break; } case TunerFrontendStatus::bandwidth: { Loading Loading
media/jni/android_media_tv_Tuner.cpp +16 −13 Original line number Diff line number Diff line Loading @@ -226,7 +226,6 @@ void LnbClientCallbackImpl::onEvent(const LnbEventType lnbEventType) { } else { ALOGE("LnbClientCallbackImpl::onEvent:" "Lnb object has been freed. Ignoring callback."); env->DeleteWeakGlobalRef(mLnbObj); } } Loading @@ -245,7 +244,6 @@ void LnbClientCallbackImpl::onDiseqcMessage(const hidl_vec<uint8_t>& diseqcMessa } else { ALOGE("LnbClientCallbackImpl::onDiseqcMessage:" "Lnb object has been freed. Ignoring callback."); env->DeleteWeakGlobalRef(mLnbObj); } } Loading Loading @@ -276,7 +274,6 @@ void DvrClientCallbackImpl::onRecordStatus(RecordStatus status) { } else { ALOGE("DvrClientCallbackImpl::onRecordStatus:" "Dvr object has been freed. Ignoring callback."); env->DeleteWeakGlobalRef(mDvrObj); } } Loading @@ -292,7 +289,6 @@ void DvrClientCallbackImpl::onPlaybackStatus(PlaybackStatus status) { } else { ALOGE("DvrClientCallbackImpl::onPlaybackStatus:" "Dvr object has been freed. Ignoring callback."); env->DeleteWeakGlobalRef(mDvrObj); } } Loading Loading @@ -846,7 +842,6 @@ void FilterClientCallbackImpl::onFilterEvent_1_1(const DemuxFilterEvent& filterE } else { ALOGE("FilterClientCallbackImpl::onFilterEvent_1_1:" "Filter object has been freed. Ignoring callback."); env->DeleteWeakGlobalRef(mFilterObj); } } Loading @@ -871,7 +866,6 @@ void FilterClientCallbackImpl::onFilterStatus(const DemuxFilterStatus status) { } else { ALOGE("FilterClientCallbackImpl::onFilterStatus:" "Filter object has been freed. Ignoring callback."); env->DeleteWeakGlobalRef(mFilterObj); } } Loading Loading @@ -907,7 +901,6 @@ void FrontendClientCallbackImpl::onEvent(FrontendEventType frontendEventType) { } else { ALOGE("FrontendClientCallbackImpl::onEvent:" "Frontend object has been freed. Ignoring callback."); env->DeleteWeakGlobalRef(mObject); } } Loading @@ -920,7 +913,6 @@ void FrontendClientCallbackImpl::onScanMessage( if (env->IsSameObject(frontend, nullptr)) { ALOGE("FrontendClientCallbackImpl::onScanMessage:" "Frontend object has been freed. Ignoring callback."); env->DeleteWeakGlobalRef(mObject); return; } switch(type) { Loading Loading @@ -1078,7 +1070,6 @@ void FrontendClientCallbackImpl::onScanMessageExt1_1(FrontendScanMessageTypeExt1 if (env->IsSameObject(frontend, nullptr)) { ALOGE("FrontendClientCallbackImpl::onScanMessageExt1_1:" "Frontend object has been freed. Ignoring callback."); env->DeleteWeakGlobalRef(mObject); return; } switch(type) { Loading Loading @@ -1243,7 +1234,6 @@ jobject JTuner::openFrontendByHandle(int feHandle) { if (env->IsSameObject(tuner, nullptr)) { ALOGE("openFrontendByHandle" "Tuner object has been freed. Failed to open frontend."); env->DeleteWeakGlobalRef(mObject); return NULL; } Loading Loading @@ -2211,6 +2201,10 @@ jobject JTuner::getFrontendStatus(jintArray types) { intBandwidth = static_cast<jint>(bandwidth.dvbt()); break; } case FrontendBandwidth::hidl_discriminator::dvbc: { intBandwidth = static_cast<jint>(bandwidth.dvbc()); break; } case FrontendBandwidth::hidl_discriminator::isdbt: { intBandwidth = static_cast<jint>(bandwidth.isdbt()); break; Loading Loading @@ -2731,12 +2725,10 @@ static FrontendSettings getDvbsFrontendSettings(JNIEnv *env, const jobject& sett FrontendDvbsVcmMode vcmMode = static_cast<FrontendDvbsVcmMode>( env->GetIntField(settings, env->GetFieldID(clazz, "mVcmMode", "I"))); FrontendDvbsCodeRate coderate = getDvbsCodeRate(env, settings); FrontendDvbsSettings frontendDvbsSettings { .frequency = freq, .modulation = modulation, .coderate = coderate, .symbolRate = symbolRate, .rolloff = rolloff, .pilot = pilot, Loading @@ -2744,6 +2736,13 @@ static FrontendSettings getDvbsFrontendSettings(JNIEnv *env, const jobject& sett .standard = standard, .vcmMode = vcmMode, }; jobject jcodeRate = env->GetObjectField(settings, env->GetFieldID(clazz, "mCodeRate", "Landroid/media/tv/tuner/frontend/DvbsCodeRate;")); if (jcodeRate != NULL) { frontendDvbsSettings.coderate = getDvbsCodeRate(env, settings); } frontendSettings.dvbs(frontendDvbsSettings); return frontendSettings; } Loading @@ -2755,7 +2754,7 @@ static void getDvbsFrontendSettingsExt1_1(JNIEnv *env, const jobject& settings, static_cast<FrontendDvbsScanType>( env->GetIntField(settings, env->GetFieldID(clazz, "mScanType", "I"))); bool isDiseqcRxMessage = static_cast<bool>(env->GetBooleanField( settings, env->GetFieldID(clazz, "mIsDiseqcRxMessage", "B"))); settings, env->GetFieldID(clazz, "mIsDiseqcRxMessage", "Z"))); FrontendDvbsSettingsExt1_1 dvbsExt1_1 { .scanType = scanType, Loading Loading @@ -2995,6 +2994,10 @@ static void getDtmbFrontendSettings(JNIEnv *env, const jobject& settings, static FrontendSettings getFrontendSettings(JNIEnv *env, int type, jobject settings) { ALOGD("getFrontendSettings %d", type); if (type == static_cast<int>(::android::hardware::tv::tuner::V1_1::FrontendType::DTMB)) { return FrontendSettings(); } FrontendType feType = static_cast<FrontendType>(type); switch(feType) { case FrontendType::ANALOG: Loading
media/jni/tuner/FrontendClient.cpp +8 −7 Original line number Diff line number Diff line Loading @@ -588,14 +588,15 @@ vector<FrontendStatusExt1_1> FrontendClient::getHidlStatusExt( break; } case TunerFrontendStatus::codeRates: { int size = s.get<TunerFrontendStatus::codeRates>().size(); status.codeRates().resize(size); for (int i = 0; i < size; i++) { auto aidlCodeRate = s.get<TunerFrontendStatus::codeRates>()[i]; status.codeRates()[i] = static_cast<hardware::tv::tuner::V1_1::FrontendInnerFec>(aidlCodeRate); vector<hardware::tv::tuner::V1_1::FrontendInnerFec> codeRates; for (auto aidlCodeRate : s.get<TunerFrontendStatus::codeRates>()) { codeRates.push_back( static_cast<hardware::tv::tuner::V1_1::FrontendInnerFec>(aidlCodeRate)); } if (codeRates.size() > 0) { status.codeRates(codeRates); hidlStatus.push_back(status); } break; } case TunerFrontendStatus::bandwidth: { Loading