Ejemplo n.º 1
0
void video_async_file_unlink (char *filename,uint8 filelength)
{
    uint8 FreeFilehandle;
    boolean FileHandleFound = FALSE;

    /*Check if Async Task is runing*/
    if(init_complete == 1)
    {
        for(FreeFilehandle=0;FreeFilehandle<MAX_FILE_CLOSE_SIZE;FreeFilehandle++)
        {
            if(filenames [FreeFilehandle].used == 0)
            {
                FileHandleFound = TRUE;
                break;
            }            
        }

        ASSERT (FileHandleFound);
        ASSERT (filelength < MAX_FILE_NAME_SIZE);

        filenames [FreeFilehandle].used = 1;
        memcpy (filenames [FreeFilehandle].filename,filename,filelength);
        filenames [FreeFilehandle].filename[filelength] = '\0';

       (void)rex_set_sigs ( &video_async_tcb,          /* tcb for which the sigs will be set */
                             VIDEO_ASYNC_SIG_FILEUNLINK /* the sigs to set                    */
                            );

    }
    /*If Async Task has not been initialized delete file immediately*/
    else
    {
      efs_unlink (filename);    
    }
}
Ejemplo n.º 2
0
void video_async_file_close (VIDEO_ENG_FILE *fs_handle)
{
    uint8 FreeFilehandle;
    boolean FileHandleFound = FALSE;

    /*Check if Async Task is initialized*/
    if(init_complete == 1)
    {
        for(FreeFilehandle=0;FreeFilehandle<MAX_FILE_CLOSE_SIZE;FreeFilehandle++)
        {
            if(fs_handle_close [FreeFilehandle] == NULL)
            {
                FileHandleFound = TRUE;
                break;
            }            
        }

        ASSERT (FileHandleFound);

        fs_handle_close [FreeFilehandle] = fs_handle;

        (void)rex_set_sigs ( &video_async_tcb,         /* tcb for which the sigs will be set */
                             VIDEO_ASYNC_SIG_FILECLOSE /* the sigs to set                    */
                            );
    }
    /*If Async Task has not been initialized close file handle immediately*/
    else
    {
      video_eng_file_fclose (fs_handle);   
    }

}
Ejemplo n.º 3
0
void video_aysnc_request_complete(rex_tcb_type * tcb, uint32 sig)
{
    if (tcb == NULL)
    {
        return;
    }
    if (init_complete == 1)
    {
        video_async_client_tcb = tcb;
        video_async_client_sig = sig;
        (void) rex_set_sigs(&video_async_tcb,
                            VIDEO_ASYNC_SIG_REQ_COMPLETE
                           );
    }
    else
    {
        (void)rex_set_sigs(tcb,sig);
    }
}
Ejemplo n.º 4
0
Archivo: db.c Proyecto: bgtwoigu/1110
void db_setuiminitmask(byte mask)
{
    // 如果已经在初始化状态,则不发送SIGNAL
    MSG_FATAL("db_setuiminitmask 0x%x 0x%x",mask,db_uiminitmask,0);
    if(db_uiminitmask)
    {
        db_uiminitmask = (db_uiminitmask | mask);
        return;
    }
    db_uiminitmask = (db_uiminitmask | mask);
    (void)rex_set_sigs(&uim_tcb, UIMDATA_INIT_SIG);
}
rce_nde_p rce_nfy_sig_rex(rce_nde_p nde_p, rce_nfy_p nfy_p)
{
   if (RCE_NULL != nfy_p)
   {
      RCEVT_SIGEX_SIGREX* sigex_p = (RCEVT_SIGEX_SIGREX*)(&(nfy_p->sigex));
      rce_nde_p rc = RCE_NULL;
      rex_set_sigs(sigex_p->signal, sigex_p->mask);
      rc = nde_p;
      return rc;
   }
   else
   {
      ERR_FATAL("null handle use", 0, 0, 0);
      return RCE_NULL;
   }
}
Ejemplo n.º 6
0
void  ds_put_cmd
(
  ds_cmd_type    *cmd_ptr                 /* Pointer to command to be sent */
)
{

/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/


  /*-------------------------------------------------------------------------
    Put the command on the command queue, and set the command queue signal.
  -------------------------------------------------------------------------*/
  q_put( &dsi_cmd_q, &cmd_ptr->hdr.link );
  (void)rex_set_sigs( &ds_tcb, DS_CMD_Q_SIG );

} /* ds_put_cmd() */
Ejemplo n.º 7
0
void mccrxtx_cmd
(
  mccrxtx_cmd_type  *cmd_ptr   /* Pointer to MCCRXTX message buffer */
)
{
#ifdef FEATURE_MC_QUEUE_WATERMARK
  /* Usually RXTX takes a free buffer from MCC_RXTX_FREE_Q and  */
  /* put it onto mcc_rxtx_q by calling the function. It also    */
  /* takes a free buffer from MC_CMD_FREE_Q. So we need to      */
  /* update watermark for both these queues.                    */
  mc_update_watermark(MCWM_CMD_FREE_Q);
  mc_update_watermark(MCWM_RXTX_FREE_Q);
#endif

  /* Set the request status to busy. initialize and link the command  */
  /* onto the MC command queue, set a signal to the MC task and exit. */

  cmd_ptr->hdr.status = MCCRXTX_BUSY_S;
  (void) q_link(cmd_ptr, &cmd_ptr->hdr.cmd_hdr.link);
  q_put(&mcc_rxtx_q, &cmd_ptr->hdr.cmd_hdr.link);
  (void) rex_set_sigs( &mc_tcb, MCC_Q_SIG );

} /* mccrxtx_cmd */
Ejemplo n.º 8
0
Archivo: venc.c Proyecto: bgtwoigu/1110
static void transcoder_video_engine_cb
(
  video_status_type  status,        /* Status of callback                 */
  void               *client_data   /* Client data from calling function  */
)
{
    boolean inbranch =FALSE;
    venc_context_type  *context;
 
    context = (venc_context_type *) client_data;

    if(!context || !venc_context)
    {
       MSG_ERROR("Raw engine not running, got a spurious callback",0,0,0);
       return;
    }
    venc_context->videoStatus = status;
    switch(status)    
    { 
    case VIDEO_SUCCESS:
    {
        switch((int32)client_data)
        {
        case VENC_FRAME_CALLBACK:
            venc_context->frame_inuse[(venc_context->num_buffers +4)%VENC_FRAME_BUFFER_SIZE]
                     = FALSE;
            inbranch = TRUE;
            break;
        default:
            break;
        }

        if(inbranch)
            break;
        switch(venc_context->state)
        {
        case VIDEO_ENC_RAW_ENG_DSP_INIT:
            /* Video Engine Initialization complete */
            venc_context->state = VIDEO_ENC_RAW_ENG_INIT;
            (void)rex_set_sigs((rex_tcb_type *)venc_context->tcb, VENC_SIG);
            break;
        case VIDEO_ENC_RAW_ENG_INIT:
            /* Video Engine Start Complete */
            venc_context->state = VIDEO_ENC_RAW_ENG_START;
            (void)rex_set_sigs((rex_tcb_type *)venc_context->tcb, VENC_SIG);
            break;
        case VIDEO_ENC_RAW_ENG_START:
            venc_context->state = VIDEO_ENC_RAW_ENG_ENCODE;
            (void)rex_set_sigs((rex_tcb_type *)venc_context->tcb, VENC_SIG);
            break;
        case VIDEO_ENC_RAW_ENG_STOPPING:
        case VIDEO_ENC_RAW_ENG_PAUSE:
        case VIDEO_ENC_RAW_ENG_RESUME:
        case VIDEO_ENC_RAW_ENG_ENCODE:
            (void)rex_set_sigs((rex_tcb_type *)venc_context->tcb, VENC_SIG);
            break;
        case VIDEO_ENC_RAW_ENG_STOPPED:
            if(venc_context->last_status == VIDEO_LIMIT_REACHED)
            {
                venc_context->callback(venc_context->last_status, 
                                       venc_context->frame_cb_data,
                                       venc_context->client_data);
                if(venc_context)
                {
                   free(venc_context);
                   venc_context = NULL;
                }
            }
            else
            {
                (void)rex_set_sigs((rex_tcb_type *)venc_context->tcb, VENC_SIG);
            }
            break;
         default:
            break;
        }

    }
    break;

    case VIDEO_FAILURE:
    case VIDEO_LIMIT_NEAR:
    case VIDEO_LIMIT_IMMINENT:
        /* Error from Video Engine, will be called in VS task */
        if (venc_context->callback != NULL) 
        {
            venc_context->callback(status, venc_context->frame_cb_data,
                                     venc_context->client_data);
        }

        (void)rex_set_sigs((rex_tcb_type *)venc_context->tcb, VENC_SIG);

        break;
	case VIDEO_LIMIT_REACHED:
        /* Limit reached now we have to call video_eng_exit */
        venc_context->last_status = status;
        venc_context->state = VIDEO_ENC_RAW_ENG_STOPPED;
        video_eng_exit(transcoder_video_engine_cb, (void*)venc_context);
        break;
    default:
        break;
    }
} 
Ejemplo n.º 9
0
static void
video_async_task (dword parm)
{
  rex_sigs_type sigs;
  uint8 usedfilehandle;

  (void) parm;
  /*lint -e{716} infinite loop requires here */
  while (1) 
  {
    /* XXX: Replace 0xffffffff with the actual signal mask once we know
     * what signal to use to process the async writes. 0xffffffff will work
     * though.
     */
    sigs = rex_wait (0xffffffff);
    (void)rex_clr_sigs (rex_self (), 0xffffffff);

    if ((sigs & TASK_OFFLINE_SIG) != 0)
      task_offline ();

    if ((sigs & TASK_STOP_SIG) != 0)
      task_stop ();

    if ((VIDEO_ASYNC_SIG & sigs) != 0) 
    {
       efs_process_async_writes ();
    }

    if( ((sigs & VIDEO_ASYNC_SIG_FILECLOSE)  != 0)||
        ((sigs & VIDEO_ASYNC_SIG_FILEUNLINK) != 0)
      )
      {
        for(usedfilehandle = 0;usedfilehandle<MAX_FILE_CLOSE_SIZE;usedfilehandle++)
        {
          if(fs_handle_close[usedfilehandle])
          {
            (void)video_eng_file_fclose (fs_handle_close[usedfilehandle]);
            fs_handle_close[usedfilehandle] = NULL;
          }
        }
        for(usedfilehandle = 0;usedfilehandle<MAX_FILE_CLOSE_SIZE;usedfilehandle++)
        {
          if(filenames [usedfilehandle].used == 1)
          {
            efs_unlink (filenames [usedfilehandle].filename);
            filenames [usedfilehandle].used = 0;
          }
        }      
      }
     /* this should be before INIT if block in this loop
      ** Here we assume that all the previous call to the efs 
      ** are synchronous
      */
      if (sigs & VIDEO_ASYNC_SIG_REQ_COMPLETE)
      {
          (void)rex_set_sigs(video_async_client_tcb,
                             video_async_client_sig
                            );
          video_async_client_tcb = NULL;
      }
  }
}
Ejemplo n.º 10
0
void mccsrch_set_srch_rpt_signal ( void )
{
  /* Sets the MCC_Q_SIG for MC */
  ( void ) rex_set_sigs ( &mc_tcb, MCC_Q_SIG );
}