3rd party media : problem implementing SDP manually

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

 I am still trying to stream audio/video with VLC, replacing PJMEDIA. I have
a problem for writing the SDP manually. For a first try, I wrote a SDP for
streaming a MPEG-1 Audio Layer II file (MP2, static payload 14). My code is
(a lot is taken from pjmedia_endpt_create_sdp) :

static const pj_str_t STR_AUDIO = { "audio", 5};
>     static const pj_str_t STR_VIDEO = { "video", 5};
>     static const pj_str_t STR_IN = { "IN", 2 };
>     static const pj_str_t STR_IP4 = { "IP4", 3};
>     static const pj_str_t STR_RTP_AVP = { "RTP/AVP", 7 };
>     static const pj_str_t STR_SDP_NAME = { "pjmedia", 7 };
>     static const pj_str_t STR_SENDRECV = { "sendrecv", 8 };
>
>
>     pj_time_val tv;
>     pjmedia_sdp_session *sdp;
>     pjmedia_sdp_media *m;
>     pjmedia_sdp_attr *attr;
>     pj_pool_t *pool;
>
>     pool = pj_pool_create(&cp.factory,  // the factory
>             "pool2",   // pool's name
>             4000,      // initial size
>             4000,      // increment size
>             NULL);
>
>
>     /* Create and initialize basic SDP session */
>     sdp = PJ_POOL_ZALLOC_T(pool, pjmedia_sdp_session);
>
>     pj_gettimeofday(&tv);
>     sdp->origin.user = pj_str("-");
>     sdp->origin.version = sdp->origin.id = tv.sec + 2208988800UL;
>     sdp->origin.net_type = STR_IN;
>     sdp->origin.addr_type = STR_IP4;
>     sdp->origin.addr = pj_str(transport->local_name.host.ptr);
>     sdp->name = STR_SDP_NAME;
>
>     /* Since we only support one media stream at present, put the
>      * SDP connection line in the session level.
>      */
>     sdp->conn = PJ_POOL_ZALLOC_T(pool, pjmedia_sdp_conn);
>     sdp->conn->net_type = STR_IN;
>     sdp->conn->addr_type = STR_IP4;
>     sdp->conn->addr = sdp->conn->addr;
>
>
>     /* SDP time and attributes. */
>     sdp->time.start = sdp->time.stop = 0;
>     sdp->attr_count = 0;
>
>     /* Create media stream 0: */
>
>     sdp->media_count = 1;
>     m = PJ_POOL_ZALLOC_T(pool, pjmedia_sdp_media);
>     sdp->media[0] = m;
>
>     /* Standard media info: */
>     m->desc.media = pj_str("audio");
>     m->desc.port = 4000;
>     m->desc.port_count = 1;
>     pj_strdup (pool, &m->desc.transport, &STR_RTP_AVP);
>     m->desc.fmt_count = 1;
>     m->desc.fmt[0] = pj_str("14");
>
>     m->attr_count = 0;
>
>
>     char temp[80];
>     pj_str_t dst_uri = pj_str("sip:bob at open-ims.test");
>     pj_str_t local_uri;
>     pjsip_dialog *dlg;
>     pjmedia_sdp_session *local_sdp;
>     pjsip_tx_data *tdata;
>
>     pj_ansi_sprintf(temp, "sip:simpleuac@%s",
> pjsip_endpt_name(g_endpt)->ptr);
>     local_uri = pj_str(temp);
>
>     /* Create UAC dialog */
>     status = pjsip_dlg_create_uac( pjsip_ua_instance(),
>             &local_uri,  /* local URI */
>             NULL,        /* local Contact */
>             &dst_uri,    /* remote URI */
>             &dst_uri,    /* remote target */
>             &dlg);        /* dialog */
>     if (status != PJ_SUCCESS) {
>         app_perror(THIS_FILE, "Unable to create UAC dialog", status);
>     }
>
>
>     local_sdp=sdp;
>     pj_register_strerror(PJMEDIA_ERRNO_START, PJ_ERRNO_SPACE_SIZE,
> &pjmedia_strerror);
>
>     /* Create the INVITE session, and pass the SDP returned earlier
>      * as the session's initial capability.
>      */
>     status = pjsip_inv_create_uac( dlg, local_sdp, 0, &g_inv);
>     PJ_ASSERT_RETURN(status == PJ_SUCCESS, 1);



But I get "*pjmedia_sdp_neg_create_w_local_offer: Assertion
`(status=pjmedia_sdp_validate(local))==0' failed*". I should have an error
in my SDP but I don't see where ! I did not put a rtpmap but if I understood
well it should not be needed for a static payload.


Cheers,

Damien
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.pjsip.org/pipermail/pjsip_lists.pjsip.org/attachments/20080714/0b5116b3/attachment.html 


[Index of Archives]     [Asterisk Users]     [Asterisk App Development]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [Linux API]
  Powered by Linux