Commit 56d427bd authored by Tillmann Karras's avatar Tillmann Karras Committed by Jean-Baptiste Kempf

SAP: show session info as stream description

This adds the SDP i= line (session information) as the description field
in the metadata of the SAP stream.
Signed-off-by: default avatarJean-Baptiste Kempf <jb@videolan.org>
parent f2b3b0f4
...@@ -172,6 +172,9 @@ struct sdp_t ...@@ -172,6 +172,9 @@ struct sdp_t
/* s= field */ /* s= field */
char *psz_sessionname; char *psz_sessionname;
/* i= field */
char *psz_sessioninfo;
/* old cruft */ /* old cruft */
/* "computed" URI */ /* "computed" URI */
char *psz_uri; char *psz_uri;
...@@ -849,6 +852,9 @@ sap_announce_t *CreateAnnounce( services_discovery_t *p_sd, uint32_t *i_source, ...@@ -849,6 +852,9 @@ sap_announce_t *CreateAnnounce( services_discovery_t *p_sd, uint32_t *i_source,
p_input = input_item_NewWithType( p_sap->p_sdp->psz_uri, p_input = input_item_NewWithType( p_sap->p_sdp->psz_uri,
p_sdp->psz_sessionname, p_sdp->psz_sessionname,
0, NULL, 0, -1, ITEM_TYPE_NET ); 0, NULL, 0, -1, ITEM_TYPE_NET );
vlc_meta_t *p_meta = vlc_meta_New();
vlc_meta_Set( p_meta, vlc_meta_Description, p_sdp->psz_sessioninfo );
p_input->p_meta = p_meta;
p_sap->p_item = p_input; p_sap->p_item = p_input;
if( !p_input ) if( !p_input )
{ {
...@@ -1269,9 +1275,20 @@ static sdp_t *ParseSDP (vlc_object_t *p_obj, const char *psz_sdp) ...@@ -1269,9 +1275,20 @@ static sdp_t *ParseSDP (vlc_object_t *p_obj, const char *psz_sdp)
} }
case 'I': case 'I':
{
expect = 'U'; expect = 'U';
/* optional (and may be empty) */
if (cat == 'i') if (cat == 'i')
{
assert (p_sdp->psz_sessioninfo == NULL);
p_sdp->psz_sessioninfo = strdup (data);
if (p_sdp->psz_sessioninfo == NULL)
goto error;
EnsureUTF8 (p_sdp->psz_sessioninfo);
break; break;
}
}
case 'U': case 'U':
expect = 'E'; expect = 'E';
if (cat == 'u') if (cat == 'u')
...@@ -1509,6 +1526,7 @@ static int Decompress( const unsigned char *psz_src, unsigned char **_dst, int i ...@@ -1509,6 +1526,7 @@ static int Decompress( const unsigned char *psz_src, unsigned char **_dst, int i
static void FreeSDP( sdp_t *p_sdp ) static void FreeSDP( sdp_t *p_sdp )
{ {
free( p_sdp->psz_sessionname ); free( p_sdp->psz_sessionname );
free( p_sdp->psz_sessioninfo );
free( p_sdp->psz_uri ); free( p_sdp->psz_uri );
for (unsigned j = 0; j < p_sdp->mediac; j++) for (unsigned j = 0; j < p_sdp->mediac; j++)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment