Ignore:
Timestamp:
Dec 1, 2011 10:49:07 AM (13 years ago)
Author:
ming
Message:

Closed #1420: Add support for event manager

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjmedia/src/test/vid_port_test.c

    r3715 r3893  
    3333static pj_bool_t is_quitting = PJ_FALSE; 
    3434 
    35 static pj_status_t vid_event_cb(pjmedia_event_subscription *esub, 
    36                                 pjmedia_event *event) 
    37 { 
    38     PJ_UNUSED_ARG(esub); 
     35static pj_status_t vid_event_cb(pjmedia_event *event, 
     36                                void *user_data) 
     37{ 
     38    PJ_UNUSED_ARG(user_data); 
    3939 
    4040    if (event->type == PJMEDIA_EVENT_WND_CLOSED) 
     
    5353    pjmedia_vid_port_param param; 
    5454    pjmedia_video_format_detail *vfd; 
    55     pjmedia_event_subscription esub; 
    5655    pj_status_t status; 
    5756    int rc = 0, i; 
     
    119118 
    120119    /* Set event handler */ 
    121     pjmedia_event_subscription_init(&esub, &vid_event_cb, NULL); 
    122     pjmedia_event_subscribe( 
    123             pjmedia_vid_port_get_event_publisher(renderer), 
    124             &esub); 
     120    pjmedia_event_subscribe(NULL, pool, &vid_event_cb, NULL, renderer); 
    125121 
    126122    /* Connect capture to renderer */ 
     
    154150    if (capture) 
    155151        pjmedia_vid_port_destroy(capture); 
    156     if (renderer) 
     152    if (renderer) { 
     153        pjmedia_event_unsubscribe(NULL, &vid_event_cb, NULL, renderer); 
    157154        pjmedia_vid_port_destroy(renderer); 
     155    } 
    158156 
    159157    pj_pool_release(pool); 
Note: See TracChangeset for help on using the changeset viewer.