Ignore:
Timestamp:
Jul 12, 2011 9:08:56 AM (10 years ago)
Author:
bennylp
Message:

More on re #1284:

  • Replaced bit_info mechanism to report format change in codec with event
  • Updated vid_port, vid_codec_test, etc.
  • Add event publisher to vid_codec
  • Add event publisher to pjmedia_port
  • Add event publisher to vid_stream
File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/branches/projects/2.0-dev/pjmedia/src/pjmedia-codec/ffmpeg_codecs.c

    r3563 r3622  
    879879    /* Create pool for codec instance */ 
    880880    pool = pj_pool_create(ffmpeg_factory.pf, "ffmpeg codec", 512, 512, NULL); 
    881     codec = PJ_POOL_ZALLOC_T(pool, pjmedia_vid_codec); 
     881    codec = PJ_POOL_ALLOC_T(pool, pjmedia_vid_codec); 
    882882    if (!codec) { 
    883883        status = PJ_ENOMEM; 
    884884        goto on_error; 
    885885    } 
     886    pjmedia_vid_codec_init(codec); 
    886887    codec->op = &ffmpeg_op; 
    887888    codec->factory = factory; 
     
    14041405                return status; 
    14051406 
    1406             /* Notify application via the bit_info field of pjmedia_frame */ 
    1407             output->bit_info = PJMEDIA_VID_CODEC_EVENT_FMT_CHANGED; 
     1407            /* Broadcast event */ 
     1408            if (pjmedia_event_publisher_has_sub(&codec->epub)) { 
     1409                pjmedia_event event; 
     1410 
     1411                pjmedia_event_init(&event, PJMEDIA_EVENT_FMT_CHANGED, 
     1412                                   &input->timestamp, &codec->epub); 
     1413                event.data.fmt_changed.dir = PJMEDIA_DIR_DECODING; 
     1414                pj_memcpy(&event.data.fmt_changed.new_fmt, &ff->param.dec_fmt, 
     1415                          sizeof(ff->param.dec_fmt)); 
     1416                pjmedia_event_publish(&codec->epub, &event); 
     1417            } 
    14081418        } 
    14091419 
Note: See TracChangeset for help on using the changeset viewer.