Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-gpu
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc-gpu
Commits
3b7408fa
Commit
3b7408fa
authored
Sep 23, 2006
by
Antoine Cellerier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add dummy meta engine with highest priority. Will check if meta is already available.
parent
56010546
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
117 additions
and
0 deletions
+117
-0
modules/meta_engine/Modules.am
modules/meta_engine/Modules.am
+1
-0
modules/meta_engine/dummy.c
modules/meta_engine/dummy.c
+116
-0
No files found.
modules/meta_engine/Modules.am
View file @
3b7408fa
SOURCES_musicbrainz = musicbrainz.c
SOURCES_dummy = dummy.c
modules/meta_engine/dummy.c
0 → 100644
View file @
3b7408fa
/*****************************************************************************
* dummy.c
*****************************************************************************
* Copyright (C) 2006 the VideoLAN team
* $Id$
*
* Authors: Antoine Cellerier <dionoea -at- videolan -dot- org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
/*****************************************************************************
* Preamble
*****************************************************************************/
#define _GNU_SOURCE
#include <stdlib.h>
/* malloc(), free() */
#include <vlc/vlc.h>
#include <vlc/intf.h>
#include <vlc_meta.h>
#include <vlc_meta_engine.h>
#include <charset.h>
/*****************************************************************************
* Local prototypes
*****************************************************************************/
static
int
FindMeta
(
vlc_object_t
*
);
/*****************************************************************************
* Module descriptor
*****************************************************************************/
vlc_module_begin
();
/* set_category( CAT_INTERFACE );
set_subcategory( SUBCAT_INTERFACE_CONTROL );*/
set_shortname
(
N_
(
"Dummy"
)
);
set_description
(
_
(
"Dummy meta data"
)
);
set_capability
(
"meta engine"
,
1000
);
set_callbacks
(
FindMeta
,
NULL
);
vlc_module_end
();
/*****************************************************************************
*****************************************************************************/
static
int
FindMeta
(
vlc_object_t
*
p_this
)
{
meta_engine_t
*
p_me
=
(
meta_engine_t
*
)
p_this
;
input_item_t
*
p_item
=
p_me
->
p_item
;
if
(
!
p_item
->
p_meta
)
return
VLC_EGENERIC
;
uint32_t
i_meta
=
0
;
#define CHECK( a, b ) \
if( p_item->p_meta->psz_ ## a && *p_item->p_meta->psz_ ## a ) \
i_meta |= VLC_META_ENGINE_ ## b;
CHECK
(
title
,
TITLE
)
CHECK
(
author
,
AUTHOR
)
CHECK
(
artist
,
ARTIST
)
CHECK
(
genre
,
GENRE
)
CHECK
(
copyright
,
COPYRIGHT
)
CHECK
(
album
,
COLLECTION
)
CHECK
(
tracknum
,
SEQ_NUM
)
CHECK
(
description
,
DESCRIPTION
)
CHECK
(
rating
,
RATING
)
CHECK
(
date
,
DATE
)
CHECK
(
url
,
URL
)
CHECK
(
language
,
LANGUAGE
)
CHECK
(
arturl
,
ART_URL
)
if
(
!
(
i_meta
&
VLC_META_ENGINE_ART_URL
)
)
{
if
(
i_meta
&
VLC_META_ENGINE_COLLECTION
&&
i_meta
&
VLC_META_ENGINE_ARTIST
)
{
FILE
*
p_file
;
char
*
psz_filename
;
asprintf
(
&
psz_filename
,
"file://%s/"
CONFIG_DIR
"/art/%s/%s/art.jpg"
,
/* ahem ... we can have other filetype too... */
p_me
->
p_libvlc
->
psz_homedir
,
p_item
->
p_meta
->
psz_artist
,
p_item
->
p_meta
->
psz_album
);
p_file
=
utf8_fopen
(
psz_filename
+
7
,
"r"
);
if
(
p_file
)
{
fclose
(
p_file
);
vlc_meta_SetArtURL
(
p_item
->
p_meta
,
psz_filename
);
i_meta
|=
VLC_META_ENGINE_ART_URL
;
}
free
(
psz_filename
);
}
}
/* Add checks for musicbrainz meta */
if
(
(
p_me
->
i_mandatory
&
i_meta
)
==
p_me
->
i_mandatory
)
{
return
VLC_SUCCESS
;
}
else
{
return
VLC_EGENERIC
;
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment