core: extend libvlc_MetaRequest and rename it

This function can now pass a timeout and an unique id that can be used to
cancel requests pushed with this id.

Rename it because Meta is too meta.
This commit is contained in:
Thomas Guillem 2016-06-01 11:59:09 +02:00
parent f93621c6d5
commit ed11de7b82
7 changed files with 12 additions and 10 deletions

View File

@ -399,8 +399,9 @@ enum input_item_preparse_status
ITEM_PREPARSE_DONE
};
VLC_API int libvlc_MetaRequest(libvlc_int_t *, input_item_t *,
input_item_meta_request_option_t );
VLC_API int libvlc_MetadataRequest( libvlc_int_t *, input_item_t *,
input_item_meta_request_option_t,
int, void * );
VLC_API int libvlc_ArtRequest(libvlc_int_t *, input_item_t *,
input_item_meta_request_option_t );

View File

@ -764,7 +764,7 @@ static int media_parse(libvlc_media_t *media, bool b_async,
parse_scope |= META_REQUEST_OPTION_SCOPE_NETWORK;
if (parse_flag & libvlc_media_do_interact)
parse_scope |= META_REQUEST_OPTION_DO_INTERACT;
ret = libvlc_MetaRequest(libvlc, item, parse_scope);
ret = libvlc_MetadataRequest(libvlc, item, parse_scope, 0, NULL);
if (ret != VLC_SUCCESS)
return ret;
}

View File

@ -354,7 +354,7 @@
continue;
}
libvlc_MetaRequest(p_intf->p_libvlc, [o_item input], META_REQUEST_OPTION_NONE);
libvlc_MetadataRequest(p_intf->p_libvlc, [o_item input], META_REQUEST_OPTION_NONE, -1, NULL);
}
[self playlistUpdated];

View File

@ -209,7 +209,7 @@
[_imageWell setImage: [NSImage imageNamed: @"noart.png"]];
} else {
if (!input_item_IsPreparsed(p_item))
libvlc_MetaRequest(getIntf()->p_libvlc, p_item, META_REQUEST_OPTION_NONE);
libvlc_MetadataRequest(getIntf()->p_libvlc, p_item, META_REQUEST_OPTION_NONE, -1, NULL);
/* fill uri info */
char *psz_url = vlc_uri_decode(input_item_GetURI(p_item));

View File

@ -365,7 +365,7 @@ static input_thread_t *Create( vlc_object_t *p_parent, input_item_t *p_item,
else if( p_item->b_preparse_interact )
{
/* If true, this item was asked explicitly to interact with the user
* (via libvlc_MetaRequest). Sub items created from this input won't
* (via libvlc_MetadataRequest). Sub items created from this input won't
* have this flag and won't interact with the user */
p_input->i_flags &= ~OBJECT_FLAGS_NOINTERACT;
}

View File

@ -613,8 +613,9 @@ static void GetFilenames( libvlc_int_t *p_vlc, unsigned n,
* Requests extraction of the meta data for an input item (a.k.a. preparsing).
* The actual extraction is asynchronous.
*/
int libvlc_MetaRequest(libvlc_int_t *libvlc, input_item_t *item,
input_item_meta_request_option_t i_options)
int libvlc_MetadataRequest(libvlc_int_t *libvlc, input_item_t *item,
input_item_meta_request_option_t i_options,
int timeout, void *id)
{
libvlc_priv_t *priv = libvlc_priv(libvlc);
@ -627,7 +628,7 @@ int libvlc_MetaRequest(libvlc_int_t *libvlc, input_item_t *item,
if( i_options & META_REQUEST_OPTION_DO_INTERACT )
item->b_preparse_interact = true;
vlc_mutex_unlock( &item->lock );
playlist_preparser_Push(priv->parser, item, i_options, -1, NULL);
playlist_preparser_Push( priv->parser, item, i_options, timeout, id );
return VLC_SUCCESS;
}

View File

@ -238,7 +238,7 @@ libvlc_InternalDestroy
libvlc_InternalInit
libvlc_Quit
libvlc_SetExitHandler
libvlc_MetaRequest
libvlc_MetadataRequest
libvlc_ArtRequest
vlc_UrlParse
vlc_UrlClean