Commit d8fc0a94 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

Export Content-Type out of HTTP access using Control.

parent 100c9257
......@@ -62,7 +62,9 @@ enum access_query_e
* XXX: avoid to use it unless you can't */
ACCESS_SET_PRIVATE_ID_STATE, /* arg1= int i_private_data, vlc_bool_t b_selected can fail */
ACCESS_SET_PRIVATE_ID_CA, /* arg1= int i_program_number, uint16_t i_vpid, uint16_t i_apid1, uint16_t i_apid2, uint16_t i_apid3, uint8_t i_length, uint8_t *p_data */
ACCESS_GET_PRIVATE_ID_STATE /* arg1=int i_private_data arg2=vlc_bool_t * res=can fail */
ACCESS_GET_PRIVATE_ID_STATE, /* arg1=int i_private_data arg2=vlc_bool_t * res=can fail */
ACCESS_GET_CONTENT_TYPE, /* arg1=char **ppsz_content_type */
};
struct access_t
......@@ -132,6 +134,14 @@ static inline int access2_Control( access_t *p_access, int i_query, ... )
return i_result;
}
static inline char *access_GetContentType( access_t *p_access )
{
char *res;
if( access2_Control( p_access, ACCESS_GET_CONTENT_TYPE, &res ) )
return NULL;
return res;
}
static inline void access_InitFields( access_t *p_a )
{
p_a->info.i_update = 0;
......
......@@ -519,6 +519,7 @@ static int Control( access_t *p_access, int i_query, va_list args )
case ACCESS_SET_PAUSE_STATE: /* 8 */
case ACCESS_SET_TITLE: /* 9 */
case ACCESS_SET_SEEKPOINT: /* 10 */
case ACCESS_GET_CONTENT_TYPE:
return VLC_EGENERIC;
case ACCESS_SET_PRIVATE_ID_STATE: /* 11 */
......
......@@ -380,6 +380,7 @@ static int Control( access_t *p_access, int i_query, va_list args )
case ACCESS_GET_META:
case ACCESS_SET_SEEKPOINT:
case ACCESS_SET_PRIVATE_ID_STATE:
case ACCESS_GET_CONTENT_TYPE:
return VLC_EGENERIC;
default:
......
......@@ -301,6 +301,7 @@ static int Control( access_t *p_access, int i_query, va_list args )
case ACCESS_SET_TITLE:
case ACCESS_SET_SEEKPOINT:
case ACCESS_SET_PRIVATE_ID_STATE:
case ACCESS_GET_CONTENT_TYPE:
return VLC_EGENERIC;
default:
......
......@@ -319,6 +319,7 @@ static int Control( access_t *p_access, int i_query, va_list args )
case ACCESS_SET_TITLE:
case ACCESS_SET_SEEKPOINT:
case ACCESS_SET_PRIVATE_ID_STATE:
case ACCESS_GET_CONTENT_TYPE:
return VLC_EGENERIC;
default:
......
......@@ -542,6 +542,7 @@ static int Control( access_t *p_access, int i_query, va_list args )
case ACCESS_GET_TITLE_INFO:
case ACCESS_SET_TITLE:
case ACCESS_SET_SEEKPOINT:
case ACCESS_GET_CONTENT_TYPE:
return VLC_EGENERIC;
case ACCESS_SET_PRIVATE_ID_STATE:
......
......@@ -305,6 +305,7 @@ static int Control( access_t *p_access, int i_query, va_list args )
case ACCESS_SET_TITLE:
case ACCESS_SET_SEEKPOINT:
case ACCESS_SET_PRIVATE_ID_STATE:
case ACCESS_GET_CONTENT_TYPE:
return VLC_EGENERIC;
default:
......
......@@ -382,6 +382,7 @@ static int Control( access_t *p_access, int i_query, va_list args )
case ACCESS_SET_SEEKPOINT:
case ACCESS_SET_PRIVATE_ID_STATE:
case ACCESS_GET_META:
case ACCESS_GET_CONTENT_TYPE:
return VLC_EGENERIC;
default:
......
......@@ -557,6 +557,7 @@ static int Control( access_t *p_access, int i_query, va_list args )
case ACCESS_SET_TITLE:
case ACCESS_SET_SEEKPOINT:
case ACCESS_SET_PRIVATE_ID_STATE:
case ACCESS_GET_CONTENT_TYPE:
return VLC_EGENERIC;
default:
......
......@@ -412,6 +412,7 @@ static int Control( access_t *p_access, int i_query, va_list args )
case ACCESS_SET_SEEKPOINT:
case ACCESS_SET_PRIVATE_ID_STATE:
case ACCESS_GET_META:
case ACCESS_GET_CONTENT_TYPE:
return VLC_EGENERIC;
default:
......
......@@ -746,6 +746,11 @@ static int Control( access_t *p_access, int i_query, va_list args )
vlc_meta_Set( p_meta, vlc_meta_NowPlaying, p_sys->psz_icy_title );
break;
case ACCESS_GET_CONTENT_TYPE:
*va_arg( args, char ** ) =
p_sys->psz_mime ? strdup( p_sys->psz_mime ) : NULL;
break;
case ACCESS_GET_TITLE_INFO:
case ACCESS_SET_TITLE:
case ACCESS_SET_SEEKPOINT:
......
......@@ -283,6 +283,7 @@ static int Control( access_t *p_access, int i_query, va_list args )
case ACCESS_SET_TITLE:
case ACCESS_SET_SEEKPOINT:
case ACCESS_SET_PRIVATE_ID_STATE:
case ACCESS_GET_CONTENT_TYPE:
return VLC_EGENERIC;
default:
......
......@@ -268,6 +268,7 @@ static int Control( access_t *p_access, int i_query, va_list args )
case ACCESS_SET_TITLE:
case ACCESS_SET_SEEKPOINT:
case ACCESS_SET_PRIVATE_ID_STATE:
case ACCESS_GET_CONTENT_TYPE:
return VLC_EGENERIC;
......
......@@ -1149,6 +1149,7 @@ static int Control( access_t *p_access, int i_query, va_list args )
case ACCESS_SET_TITLE:
case ACCESS_SET_SEEKPOINT:
case ACCESS_SET_PRIVATE_ID_STATE:
case ACCESS_GET_CONTENT_TYPE:
return VLC_EGENERIC;
default:
......
......@@ -350,6 +350,7 @@ static int Control( access_t *p_access, int i_query, va_list args )
case ACCESS_SET_SEEKPOINT:
case ACCESS_SET_PRIVATE_ID_STATE:
case ACCESS_GET_META:
case ACCESS_GET_CONTENT_TYPE:
return VLC_EGENERIC;
default:
......
......@@ -418,6 +418,7 @@ static int Control( access_t *p_access, int i_query, va_list args )
case ACCESS_SET_TITLE:
case ACCESS_SET_SEEKPOINT:
case ACCESS_SET_PRIVATE_ID_STATE:
case ACCESS_GET_CONTENT_TYPE:
return VLC_EGENERIC;
default:
......
......@@ -196,6 +196,7 @@ static int Control( access_t *p_access, int i_query, va_list args )
case ACCESS_SET_TITLE:
case ACCESS_SET_SEEKPOINT:
case ACCESS_SET_PRIVATE_ID_STATE:
case ACCESS_GET_CONTENT_TYPE:
return VLC_EGENERIC;
default:
......
......@@ -308,6 +308,7 @@ static int Control( access_t *p_access, int i_query, va_list args )
case ACCESS_SET_TITLE:
case ACCESS_SET_SEEKPOINT:
case ACCESS_SET_PRIVATE_ID_STATE:
case ACCESS_GET_CONTENT_TYPE:
return VLC_EGENERIC;
default:
......
......@@ -314,6 +314,7 @@ static int Control( access_t *p_access, int i_query, va_list args )
}
case ACCESS_SET_PRIVATE_ID_STATE:
case ACCESS_GET_CONTENT_TYPE:
return VLC_EGENERIC;
default:
......
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