- 论坛徽章:
- 0
|
1 /*
2 * by kf701 2008-08-25
3 *
4 * test for swfdec 0.6.8
5 */
6
7 #include
8 #include
9 #include
10 #include
11 #include
12 #include
13 #include
14 #include
15 #include
16 #include
17 #include
18 #include
19 #include
20 #include
21 #include
22 #include
23 #include
24 #include
25 #include
26 #include
27 #include
28
29 int dlp_width, dlp_height;
30
31 int has_fb = 1, has_oss = 1;
32
33 int main(int argc, char **argv)
34 {
35 int fps = 15;
36 int width = 320, height = 240;
37 int blk_size = 0;
38 long diff, sleep_time;
39 SwfdecPlayer *player;
40 unsigned char *imgbuf, *sbuf;
41 cairo_surface_t *surface;
42 cairo_t *cr;
43
44 if( argc = 0 && !swfdec_player_is_initialized (player))
59 {
60 swfdec_player_advance (player, diff);
61 diff = swfdec_player_get_next_event (player);
62 }
63
64 fps = swfdec_player_get_rate( player );
65 swfdec_player_get_default_size (player, &width, &height);
66
67 printf("fps: %d, width: %d, height: %d\n", fps, width, height);
68
69 dlp_width = width;
70 dlp_height = height;
71
72 if( fb_init() 0 )
104 {
105 sbuf = malloc( blk_size );
106 memset( sbuf, 0, blk_size );
107 swfdec_player_render_audio(player, sbuf, 0, blk_size/4);
108 oss_write( sbuf, blk_size );
109 free( sbuf );
110 }
111 }
112
113 usleep( sleep_time );
114 }
115
116 return 0;
117 }
本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u/3063/showart_1150726.html |
|