VLC 4.0.0-dev
Loading...
Searching...
No Matches
vlc_preparser.h
Go to the documentation of this file.
1/*****************************************************************************
2 * preparser.h
3 *****************************************************************************
4 * Copyright (C) 1999-2023 VLC authors and VideoLAN
5 *
6 * Authors: Samuel Hocevar <sam@zoy.org>
7 * Clément Stenac <zorglub@videolan.org>
8 *
9 * This program is free software; you can redistribute it and/or modify it
10 * under the terms of the GNU Lesser General Public License as published by
11 * the Free Software Foundation; either version 2.1 of the License, or
12 * (at your option) any later version.
13 *
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU Lesser General Public License for more details.
18 *
19 * You should have received a copy of the GNU Lesser General Public License
20 * along with this program; if not, write to the Free Software Foundation,
21 * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
22 *****************************************************************************/
23
24#ifndef VLC_PREPARSER_H
25#define VLC_PREPARSER_H 1
26
27#include <vlc_input_item.h>
28
29/**
30 * @defgroup vlc_preparser Preparser
31 * @ingroup input
32 * @{
33 * @file
34 * VLC Preparser API
35 */
36
37/**
38 * Preparser opaque structure.
39 *
40 * The preparser object will retrieve the meta data of any given input item in
41 * an asynchronous way.
42 * It will also issue art fetching requests.
43 */
44typedef struct vlc_preparser_t vlc_preparser_t;
46/**
47 * This function creates the preparser object and thread.
48 *
49 * @param obj the parent object
50 * @return a valid preparser object or NULL in case of error
51 */
53
54/**
55 * This function enqueues the provided item to be preparsed or fetched.
56 *
57 * The input item is retained until the preparsing is done or until the
58 * preparser object is deleted.
59 *
60 * @param preparser the preparser object
61 * @param item a valid item to preparse
62 * @param option preparse flag, cf @ref input_item_meta_request_option_t
63 * @param cbs callback to listen to events (can't be NULL)
64 * @param cbs_userdata opaque pointer used by the callbacks
65 * @param timeout maximum time allowed to preparse the item. If -1, the default
66 * "preparse-timeout" option will be used as a timeout. If 0, it will wait
67 * indefinitely. If > 0, the timeout will be used (in milliseconds).
68 * @param id unique id provided by the caller. This is can be used to cancel
69 * the request with vlc_preparser_Cancel()
70 * @returns VLC_SUCCESS if the item was scheduled for preparsing, an error code
71 * otherwise
72 * If this returns an error, the on_preparse_ended will *not* be invoked
73 */
76 const struct vlc_metadata_cbs *cbs,
77 void *cbs_userdata,
78 int timeout, void *id );
79
80/**
81 * This function cancel all preparsing requests for a given id
82 *
83 * @param preparser the preparser object
84 * @param id unique id given to vlc_preparser_Push()
85 */
86VLC_API void vlc_preparser_Cancel( vlc_preparser_t *preparser, void *id );
87
88/**
89 * This function destroys the preparser object and thread.
90 *
91 * @param preparser the preparser object
92 * All pending input items will be released.
93 */
95
96/**
97 * This function deactivates the preparser
98 *
99 * All pending requests will be removed, and it will block until the currently
100 * running entity has finished (if any).
101 *
102 * @param preparser the preparser object
103 */
105
106/** @} vlc_preparser */
107
108#endif
109
#define VLC_API
Definition fourcc_gen.c:31
void vlc_preparser_Deactivate(vlc_preparser_t *preparser)
This function deactivates the preparser.
Definition preparser.c:425
vlc_preparser_t * vlc_preparser_New(vlc_object_t *obj)
This function creates the preparser object and thread.
Definition preparser.c:311
int vlc_preparser_Push(vlc_preparser_t *preparser, input_item_t *item, input_item_meta_request_option_t option, const struct vlc_metadata_cbs *cbs, void *cbs_userdata, int timeout, void *id)
This function enqueues the provided item to be preparsed or fetched.
Definition preparser.c:346
void vlc_preparser_Cancel(vlc_preparser_t *preparser, void *id)
This function cancel all preparsing requests for a given id.
Definition preparser.c:399
void vlc_preparser_Delete(vlc_preparser_t *preparser)
This function destroys the preparser object and thread.
Definition preparser.c:431
Describes an input and is used to spawn input_thread_t objects.
Definition vlc_input_item.h:98
Definition vlc_input_item.h:531
VLC object common members.
Definition vlc_objects.h:53
Definition preparser.c:35
This file is a collection of common definitions and types.
This file defines functions, structures and enums for input items in vlc.
input_item_meta_request_option_t
Definition vlc_input_item.h:508