打开APP
userphoto
未登录

开通VIP,畅享免费电子书等14项超值服

开通VIP
如何将opencore移植到cygwin

为什么是cygwin?

cygwin是所有windows的编译平台中,和opencore本来的编译方式最接近的一个,mingw中有很多的头文件和linux下的接口没有实现,而vs2005等微软的平台又和gnu的语法有差异,而且vs2005不支持makefile的这种编译方式。因此采用cygwin是最简便,需要改动最小的方式。

在cygwin下编译通过的步骤:

1,在oscl/oscl/config 下,将linux文件夹copy一份到CYGWIN_NT-5.1

2,将tools_v2/build/make/下的linux.mk copy为 CYGWIN_NT-5.1.mk

3,cygwin下的stuct tm没有变量tm_gmtoff,因此,需要改变oscl/oscl/osclbase/src/oscl_time.inl

其中的OSCL_COND_EXPORT_REF OSCL_INLINE int32 TimeValue::get_local_time()函数改为:

  1. #ifdef __CYGWIN__   
  2. inline static int get_gmt_offset()  
  3. {  
  4.     struct timeval now;  
  5.     time_t t1, t2;  
  6.     struct tm t;  
  7.     gettimeofday(&now, NULL);  
  8.     t1 = now.tv_sec;  
  9.     t2 = 0;  
  10.     gmtime_r(&t1, &t);  
  11.     t.tm_isdst = 0;   
  12.     t2 = mktime(&t);  
  13.     return (int)difftime(t1, t2);  
  14. }  
  15. #endif  
  16. OSCL_COND_EXPORT_REF OSCL_INLINE int32 TimeValue::get_local_time()  
  17. {  
  18.     // Daylight saving time offset of 1 hour in the summer  
  19.     uint dst_offset = 60 * 60;  
  20.     int32 GMTime = ts.tv_sec;  
  21.     struct tm *timeptr;  
  22.     struct tm buffer;  
  23.     int dstFlag;  
  24.     timeptr = localtime_r(&ts.tv_sec, &buffer);  
  25. #ifdef __CYGWIN__  
  26.     GMTime -= get_gmt_offset();  
  27. #else  
  28.     GMTime -= timeptr->tm_gmtoff;  
  29. #endif  
  30.     dstFlag = timeptr->tm_isdst;  
  31.     if (dstFlag == 1)  
  32.     {  
  33.         // Daylight saving time. Add an hour's offset to get GMT  
  34.         GMTime += dst_offset;  
  35.     }  
  36.     return GMTime;  
  37. }  

4,如果文件pvmi\pvmf\build\make\local.mk中的SRCS :没有加上文件pvmf_event_handling.cpp

加上这个源文件(这个bug packetvideo应该解了)。 

在cygwin下编译的时候,系统有可能报告错误“extern_tools_v2/bin/linux/make: cannot execute binary file”

这是因为opencore将路径extern_tools_v2/bin/linux/给加到PATH环境变量下面去了,处理的办法是,要么从PATH环境变量下去掉extern_tools_v2/bin/linux/,或者删掉extern_tools_v2/bin/linux/文件夹下的内容。

本文只是关注如何编译,并没有涉及到如何在windows下完成播放,作者已经完成了采用SDL作为输出方式的采用opencore框架的一个简单的命令行播放器,啥时候有空了,我会发布出来的。


本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请点击举报
打开APP,阅读全文并永久保存 查看更多类似文章
猜你喜欢
类似文章
真正能在windows下编译的linux 0.11,不是在Cygwin,也不是在虚拟机里!...
lfs简要解析
LFS编译过程必备辅助手册(一)
Cocos2dx.3x入门三部曲-Hello Game项目创建(二)
Android的多媒体框架OpenCore介绍 第二部分 OpenCore的代码结构
Android C++开发环境搭建
更多类似文章 >>
生活服务
热点新闻
分享 收藏 导长图 关注 下载文章
绑定账号成功
后续可登录账号畅享VIP特权!
如果VIP功能使用有故障,
可点击这里联系客服!

联系客服