- Timestamp:
- Feb 24, 2011 7:47:55 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/branches/projects/2.0-dev/pjmedia/src/pjmedia-videodev/sdl_dev.c
r3401 r3420 91 91 struct sdl_stream 92 92 { 93 pjmedia_vid_ stream base; /**< Base stream*/94 pjmedia_vid_param param; /**< Settings*/95 pj_pool_t *pool; /**< Memory pool.*/96 97 pjmedia_vid_cb vid_cb; /**< Stream callback.*/98 void *user_data; /**< Application data.*/99 100 pj_thread_t *sdl_thread; /**< SDL thread.*/101 pj_bool_t 102 pj_bool_t 103 pj_bool_t 104 pj_status_t 105 106 SDL_Rect rect; /**< Display rectangle.*/107 SDL_Surface *screen; /**< Display screen.*/108 SDL_Surface *surf; /**< RGB surface.*/109 SDL_Overlay *overlay; /**< YUV overlay.*/93 pjmedia_vid_dev_stream base; /**< Base stream */ 94 pjmedia_vid_param param; /**< Settings */ 95 pj_pool_t *pool; /**< Memory pool. */ 96 97 pjmedia_vid_cb vid_cb; /**< Stream callback. */ 98 void *user_data; /**< Application data. */ 99 100 pj_thread_t *sdl_thread; /**< SDL thread. */ 101 pj_bool_t is_quitting; 102 pj_bool_t is_running; 103 pj_bool_t render_exited; 104 pj_status_t status; 105 106 SDL_Rect rect; /**< Display rectangle. */ 107 SDL_Surface *screen; /**< Display screen. */ 108 SDL_Surface *surf; /**< RGB surface. */ 109 SDL_Overlay *overlay; /**< YUV overlay. */ 110 110 111 111 /* For frame conversion */ 112 pjmedia_converter 113 pjmedia_conversion_param conv_param;114 pjmedia_frame 112 pjmedia_converter *conv; 113 pjmedia_conversion_param conv_param; 114 pjmedia_frame conv_buf; 115 115 116 116 pjmedia_video_apply_fmt_param vafp; … … 129 129 unsigned index, 130 130 pjmedia_vid_param *param); 131 static pj_status_t sdl_factory_create_stream(pjmedia_vid_dev_factory *f, 132 const pjmedia_vid_param *param, 133 const pjmedia_vid_cb *cb, 134 void *user_data, 135 pjmedia_vid_stream **p_vid_strm); 136 137 static pj_status_t sdl_stream_get_param(pjmedia_vid_stream *strm, 131 static pj_status_t sdl_factory_create_stream( 132 pjmedia_vid_dev_factory *f, 133 const pjmedia_vid_param *param, 134 const pjmedia_vid_cb *cb, 135 void *user_data, 136 pjmedia_vid_dev_stream **p_vid_strm); 137 138 static pj_status_t sdl_stream_get_param(pjmedia_vid_dev_stream *strm, 138 139 pjmedia_vid_param *param); 139 static pj_status_t sdl_stream_get_cap(pjmedia_vid_ stream *strm,140 static pj_status_t sdl_stream_get_cap(pjmedia_vid_dev_stream *strm, 140 141 pjmedia_vid_dev_cap cap, 141 142 void *value); 142 static pj_status_t sdl_stream_set_cap(pjmedia_vid_ stream *strm,143 static pj_status_t sdl_stream_set_cap(pjmedia_vid_dev_stream *strm, 143 144 pjmedia_vid_dev_cap cap, 144 145 const void *value); 145 static pj_status_t sdl_stream_put_frame(pjmedia_vid_ stream *strm,146 static pj_status_t sdl_stream_put_frame(pjmedia_vid_dev_stream *strm, 146 147 const pjmedia_frame *frame); 147 static pj_status_t sdl_stream_start(pjmedia_vid_ stream *strm);148 static pj_status_t sdl_stream_stop(pjmedia_vid_ stream *strm);149 static pj_status_t sdl_stream_destroy(pjmedia_vid_ stream *strm);148 static pj_status_t sdl_stream_start(pjmedia_vid_dev_stream *strm); 149 static pj_status_t sdl_stream_stop(pjmedia_vid_dev_stream *strm); 150 static pj_status_t sdl_stream_destroy(pjmedia_vid_dev_stream *strm); 150 151 151 152 /* Operations */ … … 160 161 }; 161 162 162 static pjmedia_vid_ stream_op stream_op =163 static pjmedia_vid_dev_stream_op stream_op = 163 164 { 164 165 &sdl_stream_get_param, … … 408 409 } 409 410 if (strm->is_running) 410 pjmedia_vid_ stream_stop(&strm->base);411 pjmedia_vid_dev_stream_stop(&strm->base); 411 412 else 412 pjmedia_vid_ stream_start(&strm->base);413 pjmedia_vid_dev_stream_start(&strm->base); 413 414 break; 414 415 case SDL_VIDEORESIZE: … … 434 435 * To process PJMEDIA_EVENT_WINDOW_CLOSE event, 435 436 * application should do this in the on_event_cb callback: 436 * 1. stop further calls to #pjmedia_vid_stream_put_frame() 437 * 1. stop further calls to 438 * #pjmedia_vid_dev_stream_put_frame() 437 439 * 2. return PJ_SUCCESS 438 440 * Upon returning from the callback, SDL will destroy its … … 484 486 485 487 /* API: create stream */ 486 static pj_status_t sdl_factory_create_stream(pjmedia_vid_dev_factory *f, 487 const pjmedia_vid_param *param, 488 const pjmedia_vid_cb *cb, 489 void *user_data, 490 pjmedia_vid_stream **p_vid_strm) 488 static pj_status_t sdl_factory_create_stream( 489 pjmedia_vid_dev_factory *f, 490 const pjmedia_vid_param *param, 491 const pjmedia_vid_cb *cb, 492 void *user_data, 493 pjmedia_vid_dev_stream **p_vid_strm) 491 494 { 492 495 struct sdl_factory *sf = (struct sdl_factory*)f; … … 549 552 550 553 /* API: Get stream info. */ 551 static pj_status_t sdl_stream_get_param(pjmedia_vid_ stream *s,554 static pj_status_t sdl_stream_get_param(pjmedia_vid_dev_stream *s, 552 555 pjmedia_vid_param *pi) 553 556 { … … 568 571 569 572 /* API: get capability */ 570 static pj_status_t sdl_stream_get_cap(pjmedia_vid_ stream *s,573 static pj_status_t sdl_stream_get_cap(pjmedia_vid_dev_stream *s, 571 574 pjmedia_vid_dev_cap cap, 572 575 void *pval) … … 587 590 588 591 /* API: set capability */ 589 static pj_status_t sdl_stream_set_cap(pjmedia_vid_ stream *s,592 static pj_status_t sdl_stream_set_cap(pjmedia_vid_dev_stream *s, 590 593 pjmedia_vid_dev_cap cap, 591 594 const void *pval) … … 606 609 607 610 /* API: Put frame from stream */ 608 static pj_status_t sdl_stream_put_frame(pjmedia_vid_ stream *strm,611 static pj_status_t sdl_stream_put_frame(pjmedia_vid_dev_stream *strm, 609 612 const pjmedia_frame *frame) 610 613 { … … 665 668 666 669 /* API: Start stream. */ 667 static pj_status_t sdl_stream_start(pjmedia_vid_ stream *strm)670 static pj_status_t sdl_stream_start(pjmedia_vid_dev_stream *strm) 668 671 { 669 672 struct sdl_stream *stream = (struct sdl_stream*)strm; … … 678 681 679 682 /* API: Stop stream. */ 680 static pj_status_t sdl_stream_stop(pjmedia_vid_ stream *strm)683 static pj_status_t sdl_stream_stop(pjmedia_vid_dev_stream *strm) 681 684 { 682 685 struct sdl_stream *stream = (struct sdl_stream*)strm; … … 695 698 696 699 /* API: Destroy stream. */ 697 static pj_status_t sdl_stream_destroy(pjmedia_vid_ stream *strm)700 static pj_status_t sdl_stream_destroy(pjmedia_vid_dev_stream *strm) 698 701 { 699 702 struct sdl_stream *stream = (struct sdl_stream*)strm;
Note: See TracChangeset
for help on using the changeset viewer.