type
stringclasses
5 values
content
stringlengths
9
163k
functions
void set_yuv_prop(yuv_seq_t *yuv, int b_realloc, int w, int h, int fmt, int nbit, int nlsb, int btile, int stride, int io_size) { yuv->width = w; yuv->height = h; yuv->yuvfmt = fmt; yuv->nbit = nbit; yuv->nlsb = nlsb; yuv->btile ...
functions
else if (yuv->nbit == 8) { t->tw = 8; t->th = 4; t->tsz = 32; }
functions
else if (fmt == YUVFMT_420P) { yuv->uv_stride = yuv->y_stride / 2; yuv->uv_size = yuv->y_size / 4; yuv->io_size = yuv->y_size + 2 * yuv->uv_size; }
functions
else if (fmt == YUVFMT_420SP) { assert( is_bit_aligned(1, yuv->height) ); yuv->uv_stride = yuv->y_stride; yuv->uv_size = yuv->y_size / 2; yuv->io_size = yuv->y_size + yuv->uv_size; }
functions
else if (fmt == YUVFMT_422P) { yuv->uv_stride = yuv->y_stride / 2; yuv->uv_size = yuv->y_size / 2; yuv->io_size = yuv->y_size + 2 * yuv->uv_size; }
functions
void set_yuv_prop_by_copy(yuv_seq_t *dst, int b_realloc, yuv_seq_t *src) { return set_yuv_prop(dst, b_realloc, src->width, src->height, src->yuvfmt, src->nbit, src->nlsb, src->btile, src->y_stride, src->io_size); }
functions
int yuv_buf_realloc(yuv_seq_t *yuv, int buf_size) { if (!yuv) { xerr("null yuv"); return 0; }
functions
void yuv_buf_free(yuv_seq_t *yuv) { if (yuv && yuv->pbuf) { xlog(SLOG_MEM, "@buf>> yuv_buf_free() = 0x%08x\n", yuv->pbuf); free(yuv->pbuf); yuv->pbuf = 0; yuv->buf_size = 0; }
functions
void show_yuv_prop(yuv_seq_t *yuv, int level, const char *prompt) { const char* show_fmt(int ifmt); xlog(level, "%s@0x%08x : {", SAFE_STR(prompt,""), yuv); if (!yuv) { return; }
includes
#include <X11/Xlib.h>
includes
#include <X11/Xutil.h>
includes
#include <freerdp/locale/keyboard.h>
functions
boolean xf_event_Expose(xfInfo* xfi, XEvent* event, boolean app) { int x, y; int w, h; x = event->xexpose.x; y = event->xexpose.y; w = event->xexpose.width; h = event->xexpose.height; if (app != true) { XCopyArea(xfi->display, xfi->primary, xfi->window->handle, xfi->gc, x, y, w, h, x, y); }
functions
boolean xf_event_VisibilityNotify(xfInfo* xfi, XEvent* event, boolean app) { xfi->unobscured = event->xvisibility.state == VisibilityUnobscured; return true; }
functions
boolean xf_event_MotionNotify(xfInfo* xfi, XEvent* event, boolean app) { rdpInput* input; int x, y; Window childWindow; input = xfi->instance->input; x = event->xmotion.x; y = event->xmotion.y; if (xfi->mouse_motion != true) { if ((event->xmotion.state & (Button1Mask | Button2Mask | Button3Mask)) == 0) r...
functions
boolean xf_event_ButtonPress(xfInfo* xfi, XEvent* event, boolean app) { int x, y; int flags; Window childWindow; boolean wheel; boolean extended; rdpInput* input; input = xfi->instance->input; x = 0; y = 0; flags = 0; wheel = false; extended = false; switch (event->xbutton.button) { case 1: x = ev...
functions
boolean xf_event_ButtonRelease(xfInfo* xfi, XEvent* event, boolean app) { int x, y; int flags; Window childWindow; boolean extended; rdpInput* input; input = xfi->instance->input; x = 0; y = 0; flags = 0; extended = false; switch (event->xbutton.button) { case 1: x = event->xbutton.x; y = event->...
functions
boolean xf_event_KeyPress(xfInfo* xfi, XEvent* event, boolean app) { KeySym keysym; char str[256]; XLookupString((XKeyEvent*) event, str, sizeof(str), &keysym, NULL); xf_kbd_set_keypress(xfi, event->xkey.keycode, keysym); if (xfi->fullscreen_toggle && xf_kbd_handle_special_keys(xfi, keysym)) return true; xf...
functions
boolean xf_event_KeyRelease(xfInfo* xfi, XEvent* event, boolean app) { XEvent next_event; if (XPending(xfi->display)) { memset(&next_event, 0, sizeof(next_event)); XPeekEvent(xfi->display, &next_event); if (next_event.type == KeyPress) { if (next_event.xkey.keycode == event->xkey.keycode) return tru...
functions
boolean xf_event_FocusIn(xfInfo* xfi, XEvent* event, boolean app) { if (event->xfocus.mode == NotifyGrab) return true; xfi->focused = true; if (xfi->mouse_active && (app != true)) XGrabKeyboard(xfi->display, xfi->window->handle, true, GrabModeAsync, GrabModeAsync, CurrentTime); if (app) { xf_rail_se...
functions
boolean xf_event_FocusOut(xfInfo* xfi, XEvent* event, boolean app) { if (event->xfocus.mode == NotifyUngrab) return true; xfi->focused = false; if (event->xfocus.mode == NotifyWhileGrabbed) XUngrabKeyboard(xfi->display, CurrentTime); if (app) xf_rail_send_activate(xfi, event->xany.window, false); return ...
functions
boolean xf_event_MappingNotify(xfInfo* xfi, XEvent* event, boolean app) { if (event->xmapping.request == MappingModifier) { XFreeModifiermap(xfi->modifier_map); xfi->modifier_map = XGetModifierMapping(xfi->display); }
functions
boolean xf_event_ClientMessage(xfInfo* xfi, XEvent* event, boolean app) { if ((event->xclient.message_type == xfi->WM_PROTOCOLS) && ((Atom) event->xclient.data.l[0] == xfi->WM_DELETE_WINDOW)) { if (app) { DEBUG_X11("RAIL window closed"); rdpWindow* window; rdpRail* rail = ((rdpContext*) xfi->context...
functions
boolean xf_event_EnterNotify(xfInfo* xfi, XEvent* event, boolean app) { if (app != true) { xfi->mouse_active = true; if (xfi->fullscreen) XSetInputFocus(xfi->display, xfi->window->handle, RevertToPointerRoot, CurrentTime); if (xfi->focused) XGrabKeyboard(xfi->display, xfi->window->handle, true, GrabMode...
functions
boolean xf_event_LeaveNotify(xfInfo* xfi, XEvent* event, boolean app) { if (app != true) { xfi->mouse_active = false; XUngrabKeyboard(xfi->display, CurrentTime); }
functions
boolean xf_event_ConfigureNotify(xfInfo* xfi, XEvent* event, boolean app) { rdpWindow* window; rdpRail* rail = ((rdpContext*) xfi->context)->rail; window = window_list_get_by_extra_id(rail->list, (void*) event->xconfigure.window); if (window != NULL) { xfWindow*...
functions
boolean xf_event_MapNotify(xfInfo* xfi, XEvent* event, boolean app) { RECTANGLE_16 rect; rdpWindow* window; rdpUpdate* update = xfi->instance->update; rdpRail* rail = ((rdpContext*) xfi->context)->rail; if (app != true) { if (xfi->suppress_output == true) { xfi->suppress_output = false; rect.left = 0; ...
functions
boolean xf_event_UnmapNotify(xfInfo* xfi, XEvent* event, boolean app) { rdpWindow* window; rdpUpdate* update = xfi->instance->update; rdpRail* rail = ((rdpContext*) xfi->context)->rail; xf_kbd_release_all_keypress(xfi); if (app != true) { if (xfi->suppress_output == false) { xfi->suppress_output = true; ...
functions
boolean xf_event_SelectionNotify(xfInfo* xfi, XEvent* event, boolean app) { if (app != true) { if (xf_cliprdr_process_selection_notify(xfi, event)) return true; }
functions
boolean xf_event_SelectionRequest(xfInfo* xfi, XEvent* event, boolean app) { if (app != true) { if (xf_cliprdr_process_selection_request(xfi, event)) return true; }
functions
boolean xf_event_SelectionClear(xfInfo* xfi, XEvent* event, boolean app) { if (app != true) { if (xf_cliprdr_process_selection_clear(xfi, event)) return true; }
functions
boolean xf_event_PropertyNotify(xfInfo* xfi, XEvent* event, boolean app) { //This section handles sending the appropriate commands to the rail server //when the window has been minimized, maximized, restored locally //ie. not using the buttons on the rail window itself if (app == true) { rdpWindow* windo...
functions
boolean xf_event_suppress_events(xfInfo *xfi, rdpWindow *window, XEvent*event) { if (! xfi->remote_app) return false; switch (xfi->window->local_move.state) { case LMS_NOT_ACTIVE: // No local move in progress, nothing to do //Prevent Configure from happening during indeterminant state of Horz or Vert Max...
functions
server switch(event->type) { case ConfigureNotify: // Starting to see move events // from the X server. Local // move is now in progress. xfi->window->local_move.state = LMS_ACTIVE; // Allow these events to be processed during move to keep // our state up to date. break; ...
functions
progress switch(event->type) { case ConfigureNotify: case VisibilityNotify: case PropertyNotify: case Expose: case GravityNotify: // Keep us up to date on position break; default: DEBUG_X11_LMS("Event Type to break LMS: %s", X11_EVENT_STRINGS[event->type]); // Any other...
functions
boolean xf_event_process(freerdp* instance, XEvent* event) { boolean status = true; xfInfo* xfi = ((xfContext*) instance->context)->xfi; rdpRail* rail = ((rdpContext*) xfi->context)->rail; rdpWindow* window; if (xfi->remote_app) { window = window_list_get_by_extra_id( rail->list, (void*) event->xexpose.wind...
includes
#include <unistd.h>
functions
unsigned rvid_alloc_stream_handle() { static unsigned counter = 0; unsigned stream_handle = 0; unsigned pid = getpid(); int i; for (i = 0; i < 32; ++i) stream_handle |= ((pid >> i) & 1) << (31 - i); stream_handle ^= ++counter; return stream_handle; }
functions
bool rvid_create_buffer(struct radeon_winsys *ws, struct rvid_buffer *buffer, unsigned size, enum radeon_bo_domain domain, enum radeon_bo_flag flags) { buffer->domain = domain; buffer->flags = flags; buffer->buf = ws->buffer_create(ws, size, 4096, false, domain, flags); if (!buffer->buf) return false; bu...
functions
void rvid_destroy_buffer(struct rvid_buffer *buffer) { pb_reference(&buffer->buf, NULL); buffer->cs_handle = NULL; }
functions
bool rvid_resize_buffer(struct radeon_winsys *ws, struct radeon_winsys_cs *cs, struct rvid_buffer *new_buf, unsigned new_size) { unsigned bytes = MIN2(new_buf->buf->size, new_size); struct rvid_buffer old_buf = *new_buf; void *src = NULL, *dst = NULL; if (!rvid_create_buffer(ws, new_buf, new_size, new_buf->doma...
functions
void rvid_clear_buffer(struct radeon_winsys *ws, struct radeon_winsys_cs *cs, struct rvid_buffer* buffer) { void *ptr = ws->buffer_map(buffer->cs_handle, cs, PIPE_TRANSFER_WRITE); if (!ptr) return; memset(ptr, 0, buffer->buf->size); ws->buffer_unmap(buffer->cs_handle); }
functions
void rvid_join_surfaces(struct radeon_winsys* ws, unsigned bind, struct pb_buffer** buffers[VL_NUM_COMPONENTS], struct radeon_surface *surfaces[VL_NUM_COMPONENTS]) { unsigned best_tiling, best_wh, off; unsigned size, alignment; struct pb_buffer *pb; unsigned i, j; for (i = 0, best_tiling = 0, best_wh = ~0; ...
functions
int rvid_get_video_param(struct pipe_screen *screen, enum pipe_video_profile profile, enum pipe_video_entrypoint entrypoint, enum pipe_video_cap param) { struct r600_common_screen *rscreen = (struct r600_common_screen *)screen; if (entrypoint == PIPE_VIDEO_ENTRYPOINT_ENCODE) { switch (param) { case P...
functions
boolean rvid_is_format_supported(struct pipe_screen *screen, enum pipe_format format, enum pipe_video_profile profile, enum pipe_video_entrypoint entrypoint) { /* we can only handle this one with UVD */ if (profile != PIPE_VIDEO_PROFILE_UNKNOWN) return format == PIPE_FORMAT_NV12; return vl_video_bu...
includes
#include <stdlib.h>
includes
#include <stdio.h>
includes
#include <string.h>
includes
#include <math.h>
includes
#include <float.h>
includes
#include <limits.h>
includes
#include <ctype.h>
functions
int cJSON_strcasecmp(const char *s1,const char *s2) { if (!s1) return (s1==s2)?0:1;if (!s2) return 1; for(; tolower(*s1) == tolower(*s2); ++s1, ++s2) if(*s1 == 0) return 0; return tolower(*(const unsigned char *)s1) - tolower(*(const unsigned char *)s2); }
functions
void cJSON_InitHooks(cJSON_Hooks* hooks) { if (!hooks) { /* Reset hooks */ cJSON_malloc = vm_malloc; cJSON_free = vm_free; return; }
functions
void cJSON_Delete(cJSON *c) { cJSON *next; while (c) { next=c->next; if (!(c->type&cJSON_IsReference) && c->child) cJSON_Delete(c->child); if (!(c->type&cJSON_IsReference) && c->valuestring) cJSON_free(c->valuestring); if (c->string) cJSON_free(c->string); cJSON_free(c); c=next; }
functions
int cJSON_GetArraySize(cJSON *array) {cJSON *c=array->child;int i=0;while(c)i++,c=c->next;return i;}
functions
void suffix_object(cJSON *prev,cJSON *item) {prev->next=item;item->prev=prev;}
functions
void cJSON_AddItemToArray(cJSON *array, cJSON *item) {cJSON *c=array->child;if (!item) return; if (!c) {array->child=item;}
functions
void cJSON_AddItemToObject(cJSON *object,const char *string,cJSON *item) {if (!item) return; if (item->string) cJSON_free(item->string);item->string=cJSON_strdup(string);cJSON_AddItemToArray(object,item);}
functions
void cJSON_AddItemReferenceToArray(cJSON *array, cJSON *item) {cJSON_AddItemToArray(array,create_reference(item));}
functions
void cJSON_AddItemReferenceToObject(cJSON *object,const char *string,cJSON *item) {cJSON_AddItemToObject(object,string,create_reference(item));}
functions
void cJSON_DeleteItemFromArray(cJSON *array,int which) {cJSON_Delete(cJSON_DetachItemFromArray(array,which));}
functions
void cJSON_DeleteItemFromObject(cJSON *object,const char *string) {cJSON_Delete(cJSON_DetachItemFromObject(object,string));}
functions
void cJSON_ReplaceItemInArray(cJSON *array,int which,cJSON *newitem) {cJSON *c=array->child;while (c && which>0) c=c->next,which--;if (!c) return; newitem->next=c->next;newitem->prev=c->prev;if (newitem->next) newitem->next->prev=newitem; if (c==array->child) array->child=newitem; else newitem->prev->next=newitem;...
functions
void cJSON_ReplaceItemInObject(cJSON *object,const char *string,cJSON *newitem){int i=0;cJSON *c=object->child;while(c && cJSON_strcasecmp(c->string,string))i++,c=c->next;if(c){newitem->string=cJSON_strdup(string);cJSON_ReplaceItemInArray(object,i,newitem);}
includes
#include <Include.h>
includes
#include <Driver_Include.h>
includes
#include <Tools_Include.h>
includes
#include <Tos_Mema.h>
includes
#include <GPIO_Driver.h>
includes
#include <Func_Face.h>
includes
#include <IIC_Driver.c>
includes
#include <Key_Driver.c>
includes
#include <..\USER\Prj_Insect\App.h>
includes
#include <..\USER\Prj_Insect\SHT2x.c>
includes
#include <..\USER\Prj_Insect\ADC_Driver.c>
includes
#include <..\USER\Prj_Insect\PWM_Driver.c>
includes
#include <..\USER\Prj_Insect\Moto_Driver.c>
includes
#include <..\USER\Prj_Insect\WS2812_Driver.c>
includes
#include <..\USER\Prj_Insect\BEEP_Driver.c>
includes
#include <..\USER\Prj_Insect\IR_Driver.c>
includes
#include <..\USER\Prj_Insect\MPU6050_Driver.c>
includes
#include <..\USER\Prj_Insect\App.c>
includes
#include <..\USER\Prj_Insect\App1.c>
includes
#include <..\USER\Prj_Insect\GIDE_Driver.c>
includes
#include <COMenu.c>
functions
void Task0(void *Tags) { Remap_SWJ_JTAGDisable(); DeBug_OutSet(DeBug_USART1); ADC1_Init((uintbus)&UIShowValue.ADC); GPIO_SetIndex(5,0);//¹Ø·äÃùÆ÷ GPIO_SetIndex(2,1);//½Ó½ü¼¤Àø GPIO_SetIndex(3,1);//½Ó½ü¼¤Àø GPIO_SetIndex(6,1);//POW1 GPIO_SetIndex(0,1);//¹ØEYE GPIO_SetIndex(1,1);//¹ØEYE GPIO_SetIn...
functions
void Task1(void *Tags) { while(1) { Tos_TaskDelay(1000); GPIO_SetIndex(0,0); GPIO_SetIndex(1,0); Tos_TaskDelay(10); GPIO_SetIndex(0,1); GPIO_SetIndex(1,1); Tos_TaskDelay(100); GPIO_SetIndex(0,0); GPIO_SetIndex(1,0); Tos_TaskDelay(10); GPIO_SetIndex(0,1); GPIO_SetIndex(1,1); ...
functions
uint8 GetKeyBoardValue() { uint8 Value=0x00; if(GPIO_GetIndex(14))Value=Key_WkUp; if(GPIO_GetIndex(7))Value=Key_Enter; return Value; }
functions
void Task_Moto(void *Tags) { while(1) { switch(UIShowValue.SaveValue.RunMode) { case 0:DeBug("radom=%d",RandomADC(80,-80),Infor_Warning); Moto_AB(RandomADC(80,-80),RandomADC(80,-80)); Tos_TaskDelay(1000); Moto_Stop(); break; case 1:WS_Double();Tos_TaskDelay(1000);break; c...
functions
void Task_Power(void *Tags) { uint8 i; Tos_ArrayMessage Msg[5]; MGUI_KeyMsg *TaskMsg,TaskMsgBuf[5]; for(i=0;i<5;i++)Msg[i].Qmsg_Addr=&TaskMsgBuf[i]; Tos_TaskCreateQmsg(&Msg[0],5); Tos_TaskGetHandKey(); //Beep_ON(); TestStart(); GPIO_SetIndex(7,0);//¸´Óð´Å¥ÊäÈë while(1) { TaskMsg=MUI_Get...
functions
void Task_Power1(void *Tags) { uint8 i; Tos_ArrayMessage Msg[5]; MGUI_KeyMsg *TaskMsg,TaskMsgBuf[5]; for(i=0;i<5;i++)Msg[i].Qmsg_Addr=&TaskMsgBuf[i]; Tos_TaskCreateQmsg(&Msg[0],5); Tos_TaskGetHandKey(); GPIO_SetIndex(7,0);//¸´Óð´Å¥ÊäÈë while(1) { TaskMsg=MUI_GetKey(0); if(TaskMsg) ...
main
int main(void) { NVIC_SetVectorTable(NVIC_VectTab_FLASH, 0x5000); Mema_Init(&MemBuf[0]); DeviceList_Init(); DeviceMount_Usart(USART1); DeviceMount_GPIO(IO_Control_List); DeviceMount_Moto(); Tos_ListCreate(TaskList1); while(1); }
includes
#include <sys/event.h>
includes
#include <stdio.h>
includes
#include <stdlib.h>
includes
#include <unistd.h>
includes
#include <libkern/OSAtomic.h>
includes
#include <assert.h>
includes
#include <sys/sysctl.h>