PVMFStatus PVOMA1KMJRecognizerPlugin::Recognize( PVMFDataStreamFactory& aSourceDataStreamFactory,
                                                 PVMFRecognizerMIMEStringList* aFormatHint,
                                                 Oscl_Vector<PVMFRecognizerResult,OsclMemAllocator>& aRecognizerResult
                                                )
{
  Oscl_FileServer fileServ;
    PVFile pvfile;

    // set data stream
    pvfile.SetCPM(&aSourceDataStreamFactory);

    // open data stream
    int32 ret = pvfile.Open( NULL,Oscl_File::MODE_READ | Oscl_File::MODE_BINARY,fileServ);
    if(ret)  // open data stream failed
    {
        LOGD("PVOMA1KMJRecognizerPlugin:Recognize pvfile.Open failed");
        return PVMFFailure;
    }

    DrmPluginDataAccess dataAccess(&pvfile);

    T_DRM_Input_Data drmInputData =
    {
        (int32_t)&dataAccess,
        TYPE_DRM_UNKNOWN,
        DrmPluginGetDataLen,
        DrmPluginReadData,
        DrmPluginSeekData
    };

    int32_t session = SVC_drm_openSession(drmInputData);

    if((DRM_MEDIA_DATA_INVALID == session) || (DRM_FAILURE == session))
    {
        LOGD("PVOMA1KMJRecognizerPlugin:Recognize SVC_drm_openSession failed");
    pvfile.Close();
        return PVMFFailure;
    }

    char mediaType[CONTENT_TYPE_LEN] = {0};
    ret = SVC_drm_getContentType(session,(uint8_t*)mediaType);

    SVC_drm_closeSession(session);
    pvfile.Close();

    if(DRM_SUCCESS != ret)  // get DRM content type failed
    {
        LOGD("PVOMA1KMJRecognizerPlugin:Recognize SVC_drm_getTypeDirectly failed");
        return PVMFFailure;
    }

    // save content type for use by outer
    PVMFRecognizerResult result;

    RecognizeContentType(mediaType,result.iRecognizedFormat);
    result.iRecognitionConfidence = PVMFRecognizerConfidenceCertain;
    aRecognizerResult.push_back(result);

    return PVMFSuccess;
}
bool
CPatchEngine::ProcessRecievedPatchList( void )
{GUCEF_TRACE;

    GUCEF_DEBUG_LOG( CORE::LOGLEVEL_NORMAL, "CPatchEngine: Processing patch list" );

    // Now we must process the raw patch set data to turn it into something we can use
    // Get the required codec for the current raw patch set data type
    CORE::CDStoreCodecRegistry::TDStoreCodecPtr codecPtr = CORE::CCoreGlobal::Instance()->GetDStoreCodecRegistry().Lookup( m_config.GetPatchListCodec() );
    if ( NULL != codecPtr )
    {
        // Prepare vars for the decoding process
        CORE::CDataNode rootNode;
        CORE::CMFileAccess dataAccess( m_listDataBuffer.GetConstBufferPtr() ,
                                       m_listDataBuffer.GetDataSize()       );

        // decode the data in our buffer into a data tree
        if ( codecPtr->BuildDataTree( &rootNode   ,
                                      &dataAccess ) )
        {
            // Now we have to parse the data tree into something more familiar
            CPatchListParser::TPatchList patchList;
            CPatchListParser listParser;
            listParser.ParsePatchList( rootNode  ,
                                       patchList );

            // Now that the raw data has been processed into a real patch list we can commence
            // with the patching process for this patch list
            return m_patchListEngine->Start( patchList                                  ,
                                             m_config.GetLocalRootDir()                 ,
                                             m_config.GetLocalTempStorageRootDir()      ,
                                             m_config.GetStopOnFileReplacementFailure() );
        }
    }

    GUCEF_DEBUG_LOG( CORE::LOGLEVEL_NORMAL, "CPatchEngine: Error while processing patch list" );

    // If we get here then we failed to decode the raw data into a patch set
    NotifyObservers( PatchListDecodingFailedEvent );
    return false;
}