simple direct layer(sdl) 和 symbian

来源:互联网 发布:四川旅游学院网络教学 编辑:程序博客网 时间:2024/06/10 21:09

   sdl是个跨平台的多媒体开源库,可用来播放视频图像。 symbian版的sdl地址是: http://koti.mbnet.fi/mertama/sdl.html, 作者markus是个热心的牛人,本人得过他不少指教。

    symbian不鼓励使用多线程,但有些多媒体的复杂应用很难用活动对象来解决,所以symbian为多线程设置了Rthread类。在多线程里调用使用SDL得注意以下几点:

 

In general, you must be very aware of concurrency and data integrity issues when writing multi-threaded programs. Some good guidelines include:

  • Don't call SDL video/event functions from separate threads(很重要,sdl_video里的函数比如SDL_SetVideoMode和SDL_DisplayYUVOverlay都必须放在主线程里,而不能新建个线程)

  •  

  • Don't use any library functions in separate threads

  • Don't perform any memory management in separate threads

  • Lock global variables which may be accessed by multiple threads

  • Never terminate threads, always set a flag and wait for them to quit

  • Think very carefully about all possible ways your code may interact

 

原创粉丝点击