Exemple #1
0
void
X3aAnalyzer::notify_calculation_done (X3aResultList &results)
{
    XCAM_ASSERT (!results.empty ());
    if (_callback)
        _callback->x3a_calculation_done (this, results);
}
Exemple #2
0
XCamReturn
SmartAnalyzer::analyze (SmartPtr<BufferProxy> &buffer)
{
    XCamReturn ret = XCAM_RETURN_NO_ERROR;
    X3aResultList results;

    if (!buffer.ptr ()) {
        XCAM_LOG_DEBUG ("SmartAnalyzer::analyze got NULL buffer!");
        return XCAM_RETURN_ERROR_PARAM;
    }

    SmartHandlerList::iterator i_handler = _handlers.begin ();
    for (; i_handler != _handlers.end ();  ++i_handler)
    {
        SmartPtr<SmartAnalysisHandler> handler = *i_handler;
        if (!handler->is_valid ())
            continue;

        ret = handler->analyze (buffer, results);
        if (ret != XCAM_RETURN_NO_ERROR && ret != XCAM_RETURN_BYPASS) {
            XCAM_LOG_WARNING ("smart analyzer analyze handler(%s) context failed", XCAM_STR(handler->get_name()));
            handler->destroy_context ();
        }
    }

    if (!results.empty ()) {
        set_results_timestamp (results, buffer->get_timestamp ());
        notify_calculation_done (results);
    }

    return XCAM_RETURN_NO_ERROR;
}
Exemple #3
0
void
SmartAnalyzer::post_smart_results (X3aResultList &results, int64_t timestamp)
{
    if (!results.empty ()) {
        set_results_timestamp (results, timestamp);
        notify_calculation_done (results);
    }
}
Exemple #4
0
XCamReturn
X3aAnalyzer::analyze_3a_statistics (SmartPtr<X3aStats> &stats)
{
    XCamReturn ret = XCAM_RETURN_NO_ERROR;
    X3aResultList results;

    ret = pre_3a_analyze (stats);
    if (ret != XCAM_RETURN_NO_ERROR) {
        notify_calculation_failed(
            NULL, stats->get_timestamp (), "ae calculation failed");
        return ret;
    }

    ret = _ae_handler->analyze (results);
    if (ret != XCAM_RETURN_NO_ERROR) {
        notify_calculation_failed(
            _ae_handler.ptr(), stats->get_timestamp (), "ae calculation failed");
        return ret;
    }

    ret = _awb_handler->analyze (results);
    if (ret != XCAM_RETURN_NO_ERROR) {
        notify_calculation_failed(
            _awb_handler.ptr(), stats->get_timestamp (), "awb calculation failed");
        return ret;
    }

    ret = _af_handler->analyze (results);
    if (ret != XCAM_RETURN_NO_ERROR) {
        notify_calculation_failed(
            _af_handler.ptr(), stats->get_timestamp (), "af calculation failed");
        return ret;
    }

    ret = _common_handler->analyze (results);
    if (ret != XCAM_RETURN_NO_ERROR) {
        notify_calculation_failed(
            _common_handler.ptr(), stats->get_timestamp (), "3a other calculation failed");
        return ret;
    }

    ret = post_3a_analyze (results);
    if (ret != XCAM_RETURN_NO_ERROR) {
        notify_calculation_failed(
            NULL, stats->get_timestamp (), "3a collect results failed");
        return ret;
    }

    if (!results.empty ())
        notify_calculation_done (results);

    return ret;

}