VLC 4.0.0-dev
Loading...
Searching...
No Matches
vlc_fingerprinter.h
Go to the documentation of this file.
1/*****************************************************************************
2 * vlc_fingerprinter.h: Fingerprinter abstraction layer
3 *****************************************************************************
4 * Copyright (C) 2012 VLC authors and VideoLAN
5 *
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU Lesser General Public License as published by
8 * the Free Software Foundation; either version 2.1 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public License
17 * along with this program; if not, write to the Free Software Foundation,
18 * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
19 *****************************************************************************/
20
21#ifndef VLC_FINGERPRINTER_H
22# define VLC_FINGERPRINTER_H
23
24#include <vlc_common.h>
25#include <vlc_meta.h>
26#include <vlc_input_item.h>
27#include <vlc_arrays.h>
28
29# ifdef __cplusplus
30extern "C" {
31# endif
32
38 unsigned int i_duration; /* track length hint in seconds, 0 if unknown */
39 struct
40 {
41 char *psz_fingerprint;
44};
50 ( fingerprint_request_t * ) calloc( 1, sizeof( fingerprint_request_t ) );
51 if ( !p_r ) return NULL;
52 p_r->results.psz_fingerprint = NULL;
53 p_r->i_duration = 0;
55 p_r->p_item = p_item;
56 vlc_array_init( & p_r->results.metas_array ); /* shouldn't be needed */
57 return p_r;
58}
59
63 free( p_f->results.psz_fingerprint );
64 for( size_t i = 0; i < vlc_array_count( & p_f->results.metas_array ); i++ )
66 free( p_f );
67}
68
71 struct vlc_object_t obj;
73 /* Specific interfaces */
79 fingerprint_request_t * ( *pf_getresults ) ( struct fingerprinter_thread_t *f );
80 void ( *pf_apply ) ( fingerprint_request_t *, size_t i_resultid );
81};
86
87# ifdef __cplusplus
88}
89# endif
90
91#endif
#define VLC_API
Definition fourcc_gen.c:31
input_item_t * input_item_Hold(input_item_t *p_item)
Holds an input item, i.e.
Definition item.c:412
void input_item_Release(input_item_t *p_item)
Releases an input item, i.e.
Definition item.c:420
void vlc_meta_Delete(vlc_meta_t *m)
Definition meta.c:115
Definition vlc_fingerprinter.h:37
vlc_array_t metas_array
Definition vlc_fingerprinter.h:43
unsigned int i_duration
Definition vlc_fingerprinter.h:39
char * psz_fingerprint
Definition vlc_fingerprinter.h:42
input_item_t * p_item
Definition vlc_fingerprinter.h:38
struct fingerprint_request_t::@228 results
Definition vlc_fingerprinter.h:71
struct vlc_object_t obj
Definition vlc_fingerprinter.h:72
module_t * p_module
Definition vlc_fingerprinter.h:77
void(* pf_apply)(fingerprint_request_t *, size_t i_resultid)
Definition vlc_fingerprinter.h:81
fingerprinter_sys_t * p_sys
Definition vlc_fingerprinter.h:75
int(* pf_enqueue)(struct fingerprinter_thread_t *f, fingerprint_request_t *r)
Definition vlc_fingerprinter.h:79
Describes an input and is used to spawn input_thread_t objects.
Definition vlc_input_item.h:98
Internal module descriptor.
Definition modules.h:76
Definition vlc_arrays.h:259
Definition meta.c:40
VLC object common members.
Definition vlc_objects.h:53
This file defines functions, structures and macros for handling arrays in vlc.
static void vlc_array_init(vlc_array_t *p_array)
Definition vlc_arrays.h:264
#define vlc_array_item_at_index(ar, idx)
Definition vlc_arrays.h:283
static size_t vlc_array_count(const vlc_array_t *p_array)
Definition vlc_arrays.h:277
This file is a collection of common definitions and types.
static fingerprint_request_t * fingerprint_request_New(input_item_t *p_item)
Definition vlc_fingerprinter.h:48
struct fingerprinter_sys_t fingerprinter_sys_t
Definition vlc_fingerprinter.h:34
void fingerprinter_Destroy(fingerprinter_thread_t *p_fingerprint)
Definition fingerprinter.c:54
fingerprinter_thread_t * fingerprinter_Create(vlc_object_t *p_this)
Definition fingerprinter.c:30
static void fingerprint_request_Delete(fingerprint_request_t *p_f)
Definition vlc_fingerprinter.h:61
This file defines functions, structures and enums for input items in vlc.
This file defines functions and structures for stream meta-data in vlc.