Subversion Repositories Kolibri OS

Rev

Blame | Last modification | View Log | Download | RSS feed

  1.  
  2. #define BLACK_MAGIC_SOUND
  3. #define BLACK_MAGIC_VIDEO
  4.  
  5. typedef struct
  6. {
  7.     volatile uint32_t   lock;
  8.     char               *buffer;
  9.     volatile uint32_t   count;
  10. }astream_t;
  11.  
  12. typedef struct
  13. {
  14.   unsigned int  code;
  15.   unsigned int  sender;
  16.   unsigned int  stream;
  17.   unsigned int  offset;
  18.   unsigned int  size;
  19.   unsigned int  unused[2];
  20. }SND_EVENT;
  21.  
  22. extern astream_t astream;
  23. extern AVRational video_time_base;
  24.  
  25. int init_audio(int format);
  26. int init_video(AVCodecContext *ctx);
  27. int decode_video(AVCodecContext  *ctx, AVPacket *pkt);
  28. double get_master_clock();
  29.  
  30.  
  31. int create_thread(void (*proc)(void *param), void *param, int stack_size);
  32.  
  33. void spinlock_lock(volatile uint32_t *val);
  34.  
  35. static inline void spinlock_unlock(volatile uint32_t *val)
  36. {
  37.     *val = 0;
  38. }
  39.  
  40. static inline void GetNotify(void *event)
  41. {
  42.     __asm__ __volatile__ (
  43.     "int $0x40"
  44.     ::"a"(68),"b"(14),"c"(event));
  45. }
  46.  
  47. static inline uint32_t check_os_event()
  48. {
  49.     uint32_t val;
  50.     __asm__ __volatile__(
  51.     "int $0x40"
  52.     :"=a"(val)
  53.     :"a"(11));
  54.     return val;
  55. };
  56.  
  57. static inline uint32_t get_os_button()
  58. {
  59.     uint32_t val;
  60.     __asm__ __volatile__(
  61.     "int $0x40"
  62.     :"=a"(val)
  63.     :"a"(17));
  64.     return val>>8;
  65. };
  66.  
  67. static inline void yield(void)
  68. {
  69.     __asm__ __volatile__(
  70.     "int $0x40"
  71.     ::"a"(68), "b"(1));
  72. };
  73.  
  74. static inline void delay(uint32_t time)
  75. {
  76.     __asm__ __volatile__(
  77.     "int $0x40"
  78.     ::"a"(5), "b"(time));
  79. };
  80.