taskid = SCI_CREATE_THREAD("render", "jc-task-test", OnRender, 1, 0, 1024, 20, 227, SCI_PREEMPT, SCI_DONT_START);
SCI_ResumeThread(taskid);
sig_ptr = (RENDER_SIG_T *)malloc(sizeof(RENDER_SIG_T));
static void OnTimer(uint32 p)
{
sig_ptr->command = 222;
sig_ptr->data = p;
SCI_TRACE_LOW("render taskid=%d", taskid);
if (SCI_SUCCESS != SCI_SendSignal((xSignalHeader)sig_ptr, taskid)) {
SCI_TRACE_LOW("sendsignal failed");
}
}
static void OnRender(void* param)
{
RENDER_SIG_T *sig_ptr_t = SCI_NULL;
JRTC_APPLET_T* applet_ptr = SCI_NULL;
jrtc_test_t* test = SCI_NULL;
SCI_TRACE_LOW("onRender");
while (1) {
sig_ptr_t = (RENDER_SIG_T *)SCI_GetSignal(taskid);
if (sig_ptr_t == SCI_NULL)
continue;
applet_ptr = (jrtc_test_t*)(sig_ptr_t->data);
test = &(applet_ptr->test);
switch (sig_ptr_t->command)
{
case 222:
{
SCI_TRACE_LOW("match command");
if (test->testptr) {
if (applet_ptr->client_state != state) {
applet_ptr->client_state = state;
MMK_PostMsg(applet_ptr->win_handle, MSG_FULL_PAINT, 0, 0);
}
if (test->swap_to_video && test->show_preview && state ==
JRTC_TALKING)
{
test->show_preview = test->swap_to_video = 0;
}
}
image = test->show_preview ? &test->txframe : &test->rxframe;
if (image->
get != image->
put) {
lcd_show(image);
}
}break;
default:
SCI_TRACE_LOW("no match command");
break;
}
}
}
@ JRTC_JOINED
成功加入会话, 将打开音视频设备