This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Does user need to "un-registe" registerEventHandler() function?

I have two questions.

First, I found demo.c show me how to get event via registerEventHandler.

But I did not find the demo program show me when and how to cancel this event handler.

Please tell me how do this or just ignore the event.

 

Second, why decLink_h264.c need to set a flag pChObj->decErrorMsg.reportA8 = FALSE; to avoid reporting the decord error repeatly?

If the program did not have this flag, what is the result?

  • To unregister EventHandler you should invoke Vsys_registerEventHandler with callback = NULL.eg:

    Vsys_registerEventHandler(NULL,NULL). This will detach the application event handler and application will no longer get event callbacks.

     

    Star.SK Chen said:

    Second, why decLink_h264.c need to set a flag pChObj->decErrorMsg.reportA8 = FALSE; to avoid reporting the decord error repeatly?

    If the program did not have this flag, what is the result?

    Sending message to A8 has a high overhead and by default this is disabled. Application can enable decode  error reporting if it really is taking some action based on decode errors.Else it will cause reduction in performance as each error frame will be reported from M3 to A8 by a message .