mmxtest.c
资源名称:NETVIDEO.rar [点击查看]
上传用户:sun1608
上传日期:2007-02-02
资源大小:6116k
文件大小:1k
源码类别:
流媒体/Mpeg4/MP4
开发平台:
Visual C++
- #include "../mpeg3private.inc"
- #include <stdio.h>
- #include <string.h>
- int mpeg3_mmx_test()
- {
- int result = 0;
- FILE *proc;
- char string[MPEG3_STRLEN];
- #ifdef HAVE_MMX
- if(!(proc = fopen(MPEG3_PROC_CPUINFO, "r")))
- {
- fprintf(stderr, "mpeg3_mmx_test: failed to open /proc/cpuinfon");
- return 0;
- }
- while(!feof(proc))
- {
- fgets(string, MPEG3_STRLEN, proc);
- /* Got the flags line */
- if(!strncasecmp(string, "flags", 5))
- {
- char *needle;
- needle = strstr(string, "mmx");
- if(!needle)
- {
- fclose(proc);
- return 0;
- }
- if(!strncasecmp(needle, "mmx", 3))
- {
- fclose(proc);
- return 1;
- }
- }
- }
- fclose(proc);
- #endif
- return 0;
- }