//Cache stats, figure out the state, config overlay
bool VideoOverlay::prepare(hwc_context_t *ctx, hwc_display_contents_1_t *list) {
    sIsModeOn = false;
    if((!ctx->mMDP.hasOverlay) ||
                            (qdutils::MDPVersion::getInstance().getMDPVersion()
                             <= qdutils::MDP_V4_0)) {
       ALOGD_IF(VIDEO_DEBUG,"%s, this hw doesnt support overlay", __FUNCTION__);
       return false;
    }
    if(sYuvLayerIndex == -1) {
        return false;
    }
    chooseState(ctx);
    //if the state chosen above is CLOSED, skip this block.
    if(sState != ovutils::OV_CLOSED) {
        hwc_layer_1_t *yuvLayer = &list->hwLayers[sYuvLayerIndex];
        hwc_layer_1_t *ccLayer = NULL;
        if(sCCLayerIndex != -1)
            ccLayer = &list->hwLayers[sCCLayerIndex];

        if(configure(ctx, yuvLayer, ccLayer)) {
            markFlags(&list->hwLayers[sYuvLayerIndex]);
            sIsModeOn = true;
        }
    }

    ALOGD_IF(VIDEO_DEBUG, "%s: stats: yuvCount = %d, yuvIndex = %d,"
            "IsYuvLayerSkip = %d, ccLayerIndex = %d, IsModeOn = %d",
            __FUNCTION__, sYuvCount, sYuvLayerIndex,
            sIsYuvLayerSkip, sCCLayerIndex, sIsModeOn);

    return sIsModeOn;
}
//Cache stats, figure out the state, config overlay
bool ExtOnly::prepare(hwc_context_t *ctx, hwc_display_contents_1_t *list) {
    sIsModeOn = false;
    if(!ctx->mMDP.hasOverlay) {
       ALOGD_IF(EXTONLY_DEBUG,"%s, this hw doesnt support overlay",
            __FUNCTION__);
       return false;
    }
    if(sExtIndex == -1) {
        return false;
    }
    chooseState(ctx);
    //if the state chosen above is CLOSED, skip this block.
    if(sState != ovutils::OV_CLOSED) {
        hwc_layer_1_t *extLayer = &list->hwLayers[sExtIndex];
        if(configure(ctx, extLayer)) {
            markFlags(extLayer);
            sIsModeOn = true;
        }
    }

    ALOGD_IF(EXTONLY_DEBUG, "%s: stats: extCount = %d, extIndex = %d,"
            "IsExtBlock = %d, IsModeOn = %d",
            __func__, sExtCount, sExtIndex,
            sIsExtBlock, sIsModeOn);

    return sIsModeOn;
}
예제 #3
0
void Field::onCellMarkChanged(){
    int COUNT = 0;
    for (int i = 0; i < m_cells.size(); i++){
        if(m_cells[i]->mark() == Cell::MarkFlagged){
            COUNT++;
        }
    }
    if (m_MarkFlags == COUNT){
        return;
    }
    else{
        m_MarkFlags = COUNT;
    }

    emit(numberOfFlagsChanged(markFlags()));
}
예제 #4
0
//Cache stats, figure out the state, config overlay
bool VideoOverlay::prepare(hwc_context_t *ctx, hwc_layer_list_t *list) {
    sIsModeOn = false;
    if(!ctx->hasOverlay) {
        ALOGD_IF(VIDEO_DEBUG,"%s, this hw doesnt support overlay", __FUNCTION__);
        return false;
    }
    chooseState(ctx);
    //if the state chosen above is CLOSED, skip this block.
    if(sState != ovutils::OV_CLOSED) {
        if(configure(ctx, &list->hwLayers[sYuvLayerIndex])) {
            markFlags(&list->hwLayers[sYuvLayerIndex]);
        }
    }

    ALOGD_IF(VIDEO_DEBUG, "%s: stats: yuvCount = %d, yuvIndex = %d,"
             "IsModeOn = %d, IsSkipLayer = %d", __FUNCTION__, sYuvCount,
             sYuvLayerIndex, sIsModeOn, sIsLayerSkip);

    return sIsModeOn;
}
예제 #5
0
//Cache stats, figure out the state, config overlay
bool VideoOverlay::prepare(hwc_context_t *ctx, hwc_display_contents_1_t *list,
        int dpy) {

    int yuvIndex =  ctx->listStats[dpy].yuvIndex;
    sIsModeOn[dpy] = false;

    if(!ctx->mMDP.hasOverlay) {
       ALOGD_IF(VIDEO_DEBUG,"%s, this hw doesnt support overlay", __FUNCTION__);
       return false;
    }

    if(yuvIndex == -1 || ctx->listStats[dpy].yuvCount != 1) {
        return false;
    }

    //index guaranteed to be not -1 at this point
    hwc_layer_1_t *yuvLayer = &list->hwLayers[yuvIndex];

    private_handle_t *hnd = (private_handle_t *)yuvLayer->handle;
    if(ctx->mSecureMode) {
        if (! isSecureBuffer(hnd)) {
            ALOGD_IF(VIDEO_DEBUG, "%s: Handle non-secure video layer"
                     "during secure playback gracefully", __FUNCTION__);
            return false;
        }
    } else {
        if (isSecureBuffer(hnd)) {
            ALOGD_IF(VIDEO_DEBUG, "%s: Handle secure video layer"
                     "during non-secure playback gracefully", __FUNCTION__);
            return false;
        }
    }
    chooseState(ctx, dpy, yuvLayer);
    if(configure(ctx, dpy, yuvLayer)) {
        markFlags(yuvLayer);
        sIsModeOn[dpy] = true;
    }

    return sIsModeOn[dpy];
}