Changeset 3640 for pjproject


Ignore:
Timestamp:
Jul 14, 2011 4:56:08 AM (13 years ago)
Author:
bennylp
Message:

Fixed #1325: signature fix pjmedia objects

Location:
pjproject/branches/projects/2.0-dev
Files:
1 added
29 edited

Legend:

Unmodified
Added
Removed
  • pjproject/branches/projects/2.0-dev/pjmedia/include/pjmedia/conference.h

    r3327 r3640  
    4747 * The conference bridge signature in pjmedia_port_info. 
    4848 */ 
    49 #define PJMEDIA_CONF_BRIDGE_SIGNATURE   \ 
    50                     PJMEDIA_PORT_SIGNATURE('C', 'O', 'N', 'F') 
     49#define PJMEDIA_CONF_BRIDGE_SIGNATURE   PJMEDIA_SIG_PORT_CONF 
    5150 
    5251/** 
    5352 * The audio switchboard signature in pjmedia_port_info. 
    5453 */ 
    55 #define PJMEDIA_CONF_SWITCH_SIGNATURE   \ 
    56                     PJMEDIA_PORT_SIGNATURE('A', 'S', 'W', 'I') 
     54#define PJMEDIA_CONF_SWITCH_SIGNATURE   PJMEDIA_SIG_PORT_CONF_SWITCH 
    5755 
    5856 
  • pjproject/branches/projects/2.0-dev/pjmedia/include/pjmedia/event.h

    r3622 r3640  
    2525 */ 
    2626#include <pjmedia/format.h> 
     27#include <pjmedia/signatures.h> 
    2728#include <pj/list.h> 
    2829 
     
    183184     */ 
    184185    unsigned                             proc_cnt; 
     186 
     187    /** 
     188     * The object signature of the event publisher. Application may use 
     189     * this to check which publisher published the event. 
     190     */ 
     191    pjmedia_obj_sig                      epub_sig; 
    185192 
    186193    /** 
     
    269276struct pjmedia_event_publisher 
    270277{ 
     278    /** The object signature of the publisher */ 
     279    pjmedia_obj_sig             sig; 
     280 
    271281    /** List of subscriptions for this event publisher */ 
    272282    pjmedia_event_subscription  subscription_list; 
     
    291301 * 
    292302 * @param epub          The event publisher. 
    293  */ 
    294 PJ_DECL(void) pjmedia_event_publisher_init(pjmedia_event_publisher *epub); 
     303 * @param sig           The object signature of the publisher. 
     304 */ 
     305PJ_DECL(void) pjmedia_event_publisher_init(pjmedia_event_publisher *epub, 
     306                                           pjmedia_obj_sig sig); 
    295307 
    296308/** 
  • pjproject/branches/projects/2.0-dev/pjmedia/include/pjmedia/port.h

    r3622 r3640  
    2929#include <pjmedia/format.h> 
    3030#include <pjmedia/frame.h> 
     31#include <pjmedia/signatures.h> 
    3132#include <pj/assert.h> 
    3233#include <pj/os.h> 
     
    190191 * Create 32bit port signature from ASCII characters. 
    191192 */ 
    192 #define PJMEDIA_PORT_SIGNATURE(a,b,c,d)     \ 
    193             (a<<24 | b<<16 | c<<8 | d) 
     193#define PJMEDIA_PORT_SIG(a,b,c,d)               PJMEDIA_OBJ_SIG(a,b,c,d) 
    194194 
    195195 
  • pjproject/branches/projects/2.0-dev/pjmedia/include/pjmedia/vid_codec.h

    r3622 r3640  
    431431 * 
    432432 * @param codec     The codec to be initialized. 
    433  */ 
    434 PJ_DECL(void) pjmedia_vid_codec_init(pjmedia_vid_codec *codec); 
     433 * @param sig       Codec's object signature (see signatures.h) 
     434 */ 
     435PJ_DECL(void) pjmedia_vid_codec_init(pjmedia_vid_codec *codec, 
     436                                     pjmedia_obj_sig sig); 
    435437 
    436438/** 
  • pjproject/branches/projects/2.0-dev/pjmedia/src/pjmedia-codec/ffmpeg_codecs.c

    r3630 r3640  
    887887        goto on_error; 
    888888    } 
    889     pjmedia_vid_codec_init(codec); 
     889    pjmedia_vid_codec_init(codec, PJMEDIA_SIG_VID_CODEC_FFMPEG); 
    890890    codec->op = &ffmpeg_op; 
    891891    codec->factory = factory; 
  • pjproject/branches/projects/2.0-dev/pjmedia/src/pjmedia-videodev/colorbar_dev.c

    r3617 r3640  
    417417    pj_memcpy(&strm->vafp, &vafp, sizeof(vafp)); 
    418418    strm->ts_inc = PJMEDIA_SPF2(param->clock_rate, &vfd->fps, 1); 
    419     pjmedia_event_publisher_init(&strm->base.epub); 
     419    pjmedia_event_publisher_init(&strm->base.epub, PJMEDIA_SIG_VID_DEV_COLORBAR); 
    420420 
    421421    for (i = 0; i < vfi->plane_cnt; ++i) { 
  • pjproject/branches/projects/2.0-dev/pjmedia/src/pjmedia-videodev/sdl_dev.c

    r3626 r3640  
    10121012    pj_memcpy(&strm->vid_cb, cb, sizeof(*cb)); 
    10131013    strm->user_data = user_data; 
    1014     pjmedia_event_publisher_init(&strm->base.epub); 
     1014    pjmedia_event_publisher_init(&strm->base.epub, PJMEDIA_SIG_VID_DEV_SDL); 
    10151015 
    10161016    /* Create render stream here */ 
  • pjproject/branches/projects/2.0-dev/pjmedia/src/pjmedia-videodev/v4l2_dev.c

    r3617 r3640  
    574574    stream->user_data = user_data; 
    575575    stream->fd = INVALID_FD; 
    576     pjmedia_event_publisher_init(&stream->base.epub); 
     576    pjmedia_event_publisher_init(&stream->base.epub, PJMEDIA_SIG_VID_DEV_V4L2); 
    577577 
    578578    stream->fd = v4l2_open(vdi->dev_name, O_RDWR | O_NONBLOCK, 0); 
  • pjproject/branches/projects/2.0-dev/pjmedia/src/pjmedia/avi_player.c

    r3425 r3640  
    4444#define COMPARE_TAG(doc_tag, tag) (doc_tag == *((pj_uint32_t *)avi_tags[tag])) 
    4545 
    46 #define SIGNATURE           PJMEDIA_PORT_SIGNATURE('A', 'V', 'I', 'P') 
     46#define SIGNATURE           PJMEDIA_SIG_PORT_VID_AVI_PLAYER 
    4747 
    4848#if 0 
  • pjproject/branches/projects/2.0-dev/pjmedia/src/pjmedia/bidirectional.c

    r3392 r3640  
    2323 
    2424#define THIS_FILE   "bidirectional.c" 
    25 #define SIGNATURE   PJMEDIA_PORT_SIGNATURE('B', 'D', 'I', 'R') 
     25#define SIGNATURE   PJMEDIA_SIG_PORT_BIDIR 
    2626 
    2727struct bidir_port 
  • pjproject/branches/projects/2.0-dev/pjmedia/src/pjmedia/conference.c

    r3392 r3640  
    6565 
    6666#define SIGNATURE           PJMEDIA_CONF_BRIDGE_SIGNATURE 
    67 #define SIGNATURE_PORT      PJMEDIA_PORT_SIGNATURE('C', 'O', 'N', 'P') 
     67#define SIGNATURE_PORT      PJMEDIA_SIG_PORT_CONF_PASV 
    6868/* Normal level is hardcodec to 128 in all over places */ 
    6969#define NORMAL_LEVEL        128 
  • pjproject/branches/projects/2.0-dev/pjmedia/src/pjmedia/echo_port.c

    r3392 r3640  
    2727 
    2828#define THIS_FILE   "ec_port.c" 
    29 #define SIGNATURE   PJMEDIA_PORT_SIGNATURE('E', 'C', 'H', 'O') 
     29#define SIGNATURE   PJMEDIA_SIG_PORT_ECHO 
    3030#define BUF_COUNT   32 
    3131 
  • pjproject/branches/projects/2.0-dev/pjmedia/src/pjmedia/event.c

    r3622 r3640  
    4141        event->timestamp.u64 = ts->u64; 
    4242    event->epub = epub; 
     43    if (epub) 
     44        event->epub_sig = epub->sig; 
    4345} 
    4446 
    45 PJ_DEF(void) pjmedia_event_publisher_init(pjmedia_event_publisher *epub) 
     47PJ_DEF(void) pjmedia_event_publisher_init(pjmedia_event_publisher *epub, 
     48                                          pjmedia_obj_sig sig) 
    4649{ 
    4750    pj_bzero(epub, sizeof(*epub)); 
    4851    pj_list_init(&epub->subscription_list); 
     52    epub->sig = sig; 
    4953} 
    5054 
  • pjproject/branches/projects/2.0-dev/pjmedia/src/pjmedia/mem_capture.c

    r3392 r3640  
    2626#define THIS_FILE           "mem_capture.c" 
    2727 
    28 #define SIGNATURE           PJMEDIA_PORT_SIGNATURE('M', 'R', 'e', 'c') 
     28#define SIGNATURE           PJMEDIA_SIG_PORT_MEM_CAPTURE 
    2929#define BYTES_PER_SAMPLE    2 
    3030 
  • pjproject/branches/projects/2.0-dev/pjmedia/src/pjmedia/mem_player.c

    r3392 r3640  
    2626#define THIS_FILE           "mem_player.c" 
    2727 
    28 #define SIGNATURE           PJMEDIA_PORT_SIGNATURE('M', 'P', 'l', 'y') 
     28#define SIGNATURE           PJMEDIA_SIG_PORT_MEM_PLAYER 
    2929#define BYTES_PER_SAMPLE    2 
    3030 
  • pjproject/branches/projects/2.0-dev/pjmedia/src/pjmedia/null_port.c

    r3392 r3640  
    2525 
    2626 
    27 #define SIGNATURE   PJMEDIA_PORT_SIGNATURE('N', 'U', 'L', 'L') 
     27#define SIGNATURE   PJMEDIA_SIG_PORT_NULL 
    2828 
    2929static pj_status_t null_get_frame(pjmedia_port *this_port,  
  • pjproject/branches/projects/2.0-dev/pjmedia/src/pjmedia/resample_port.c

    r3448 r3640  
    2626 
    2727#define BYTES_PER_SAMPLE        2 
    28 #define SIGNATURE               PJMEDIA_PORT_SIGNATURE('R','S','M','P') 
     28#define SIGNATURE               PJMEDIA_SIG_PORT_RESAMPLE 
    2929 
    3030 
  • pjproject/branches/projects/2.0-dev/pjmedia/src/pjmedia/splitcomb.c

    r3392 r3640  
    2626 
    2727 
    28 #define SIGNATURE           PJMEDIA_PORT_SIGNATURE('S', 'p', 'C', 'b') 
    29 #define SIGNATURE_PORT      PJMEDIA_PORT_SIGNATURE('S', 'p', 'C', 'P') 
     28#define SIGNATURE           PJMEDIA_SIG_PORT_SPLIT_COMB 
     29#define SIGNATURE_PORT      PJMEDIA_SIG_PORT_SPLIT_COMB_P 
    3030#define THIS_FILE           "splitcomb.c" 
    3131#define TMP_SAMP_TYPE       pj_int16_t 
  • pjproject/branches/projects/2.0-dev/pjmedia/src/pjmedia/stereo_port.c

    r3392 r3640  
    2525 
    2626 
    27 #define SIGNATURE               PJMEDIA_PORT_SIGNATURE('S','T','R','O') 
     27#define SIGNATURE               PJMEDIA_SIG_PORT_STEREO 
    2828 
    2929 
  • pjproject/branches/projects/2.0-dev/pjmedia/src/pjmedia/stream.c

    r3536 r3640  
    19831983     */ 
    19841984    pjmedia_port_info_init(&stream->port.info, &name, 
    1985                            PJMEDIA_PORT_SIGNATURE('S', 'T', 'R', 'M'), 
     1985                           PJMEDIA_SIG_PORT_STREAM, 
    19861986                           info->fmt.clock_rate, info->fmt.channel_cnt, 
    19871987                           16, 80); 
  • pjproject/branches/projects/2.0-dev/pjmedia/src/pjmedia/tonegen.c

    r3392 r3640  
    335335/****************************************************************************/ 
    336336 
    337 #define SIGNATURE   PJMEDIA_PORT_SIGNATURE('t', 'n', 'g', 'n') 
     337#define SIGNATURE   PJMEDIA_SIG_PORT_TONEGEN 
    338338#define THIS_FILE   "tonegen.c" 
    339339 
  • pjproject/branches/projects/2.0-dev/pjmedia/src/pjmedia/vid_codec.c

    r3622 r3640  
    7070 * Initialize pjmedia_vid_codec structure with default values. 
    7171 */ 
    72 PJ_DEF(void) pjmedia_vid_codec_init(pjmedia_vid_codec *codec) 
     72PJ_DEF(void) pjmedia_vid_codec_init(pjmedia_vid_codec *codec, 
     73                                    pjmedia_obj_sig sig) 
    7374{ 
    7475    pj_bzero(codec, sizeof(*codec)); 
    75     pj_list_init(&codec->epub); 
     76    pjmedia_event_publisher_init(&codec->epub, sig); 
    7677} 
    7778 
  • pjproject/branches/projects/2.0-dev/pjmedia/src/pjmedia/vid_port.c

    r3631 r3640  
    2626#include <pj/pool.h> 
    2727 
     28#define SIGNATURE       PJMEDIA_SIG_VID_PORT 
    2829#define THIS_FILE       "vid_port.c" 
    2930 
     
    202203    vp->dir = prm->vidparam.dir; 
    203204//    vp->cap_size = vfd->size; 
    204     pjmedia_event_publisher_init(&vp->epub); 
     205    pjmedia_event_publisher_init(&vp->epub, SIGNATURE); 
    205206 
    206207    vparam = prm->vidparam; 
     
    312313        pp->base.put_frame = &vid_pasv_port_put_frame; 
    313314        pjmedia_port_info_init2(&pp->base.info, &vp->dev_name, 
    314                                 PJMEDIA_PORT_SIGNATURE('v', 'i', 'd', 'p'), 
     315                                PJMEDIA_SIG_VID_PORT, 
    315316                                prm->vidparam.dir, &prm->vidparam.fmt); 
    316317 
  • pjproject/branches/projects/2.0-dev/pjmedia/src/pjmedia/vid_stream.c

    r3622 r3640  
    4343#define LOGERR_(expr)                   stream_perror expr 
    4444#define TRC_(expr)                      PJ_LOG(5,expr) 
     45#define SIGNATURE                       PJMEDIA_SIG_PORT_VID_STREAM 
    4546 
    4647/* Tracing jitter buffer operations in a stream session to a CSV file. 
     
    11081109 
    11091110    /* Init port. */ 
    1110     pjmedia_port_info_init2(pi, &name, 
    1111                             PJMEDIA_PORT_SIGNATURE('V', 'C', 'H', 'N'), 
    1112                             dir, fmt); 
     1111    pjmedia_port_info_init2(pi, &name, SIGNATURE, dir, fmt); 
    11131112    if (dir == PJMEDIA_DIR_DECODING) { 
    11141113        channel->port.get_frame = &get_frame; 
     
    12531252 
    12541253    /* Init event publisher and subscribe to codec events */ 
    1255     pjmedia_event_publisher_init(&stream->epub); 
     1254    pjmedia_event_publisher_init(&stream->epub, SIGNATURE); 
    12561255    pjmedia_event_subscription_init(&stream->esub_codec, &stream_event_cb, 
    12571256                                    stream); 
  • pjproject/branches/projects/2.0-dev/pjmedia/src/pjmedia/vid_tee.c

    r3627 r3640  
    2525 
    2626#define TEE_PORT_NAME   "vid_tee" 
    27 #define TEE_PORT_SIGN   PJMEDIA_PORT_SIGNATURE('V', 'T', 'E', 'E') 
     27#define TEE_PORT_SIGN   PJMEDIA_SIG_PORT_VID_TEE 
    2828#define MAX_DST_PORT_COUNT 20 
    2929 
  • pjproject/branches/projects/2.0-dev/pjmedia/src/pjmedia/wav_player.c

    r3392 r3640  
    3333 
    3434 
    35 #define SIGNATURE           PJMEDIA_PORT_SIGNATURE('F', 'P', 'l', 'y') 
     35#define SIGNATURE           PJMEDIA_SIG_PORT_WAV_PLAYER 
    3636#define BITS_PER_SAMPLE     16 
    3737 
  • pjproject/branches/projects/2.0-dev/pjmedia/src/pjmedia/wav_playlist.c

    r3392 r3640  
    3333#define THIS_FILE           "wav_playlist.c" 
    3434 
    35 #define SIGNATURE           PJMEDIA_PORT_SIGNATURE('P', 'l', 's', 't') 
     35#define SIGNATURE           PJMEDIA_SIG_PORT_WAV_PLAYLIST 
    3636#define BYTES_PER_SAMPLE    2 
    3737 
  • pjproject/branches/projects/2.0-dev/pjmedia/src/pjmedia/wav_writer.c

    r3392 r3640  
    3131 
    3232#define THIS_FILE           "wav_writer.c" 
    33 #define SIGNATURE           PJMEDIA_PORT_SIGNATURE('F', 'W', 'R', 'T') 
     33#define SIGNATURE           PJMEDIA_SIG_PORT_WAV_WRITER 
    3434 
    3535 
  • pjproject/branches/projects/2.0-dev/pjsip-apps/src/samples/playsine.c

    r3392 r3640  
    139139    name = pj_str("sine generator"); 
    140140    pjmedia_port_info_init(&port->info, &name, 
    141                            PJMEDIA_PORT_SIGNATURE('s', 'i', 'n', 'e'), 
     141                           PJMEDIA_SIG_CLASS_PORT_AUD('s', 'i'), 
    142142                           sampling_rate, 
    143143                           channel_count, 
Note: See TracChangeset for help on using the changeset viewer.