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
3e075a2b
Commit
3e075a2b
authored
Mar 25, 2008
by
Pierre d'Herbemont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
control: Remove dynamic_media_list_*.
parent
0f4951b8
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
0 additions
and
285 deletions
+0
-285
extras/buildsystem/cmake/CMakeLists/src_CMakeLists.txt
extras/buildsystem/cmake/CMakeLists/src_CMakeLists.txt
+0
-1
include/vlc/libvlc.h
include/vlc/libvlc.h
+0
-25
src/Makefile.am
src/Makefile.am
+0
-1
src/control/dynamic_media_list.c
src/control/dynamic_media_list.c
+0
-258
No files found.
extras/buildsystem/cmake/CMakeLists/src_CMakeLists.txt
View file @
3e075a2b
...
...
@@ -150,7 +150,6 @@ set( SOURCES_libvlc_control
control/vlm.c
control/video.c
control/audio.c
control/dynamic_media_list.c
control/event.c
control/flat_media_list_view.c
control/hierarchical_media_list_view.c
...
...
include/vlc/libvlc.h
View file @
3e075a2b
...
...
@@ -690,31 +690,6 @@ VLC_PUBLIC_API libvlc_media_list_t *
/** @} */
/*****************************************************************************
* Dynamic Media List (Deprecated)
*****************************************************************************/
/** defgroup libvlc_media_list MediaList
* \ingroup libvlc
* LibVLC Media List
* @{ */
VLC_DEPRECATED_API
libvlc_dynamic_media_list_t
*
libvlc_dynamic_media_list_new
(
libvlc_media_list_t
*
p_mlist
,
libvlc_tag_query_t
*
p_query
,
libvlc_tag_t
tag
,
libvlc_exception_t
*
p_e
);
VLC_DEPRECATED_API
void
libvlc_dynamic_media_list_release
(
libvlc_dynamic_media_list_t
*
p_dmlist
);
VLC_DEPRECATED_API
void
libvlc_dynamic_media_list_retain
(
libvlc_dynamic_media_list_t
*
p_dmlist
);
VLC_DEPRECATED_API
libvlc_media_list_t
*
libvlc_dynamic_media_list_media_list
(
libvlc_dynamic_media_list_t
*
p_dmlist
,
libvlc_exception_t
*
p_e
);
/** @} */
/*****************************************************************************
* Media Library
*****************************************************************************/
...
...
src/Makefile.am
View file @
3e075a2b
...
...
@@ -358,7 +358,6 @@ SOURCES_libvlc_control = \
control/vlm.c
\
control/video.c
\
control/audio.c
\
control/dynamic_media_list.c
\
control/event.c
\
control/flat_media_list_view.c
\
control/hierarchical_media_list_view.c
\
...
...
src/control/dynamic_media_list.c
deleted
100644 → 0
View file @
0f4951b8
/*****************************************************************************
* dynamic_media_list.c: libvlc new API media list functions
*****************************************************************************
* Copyright (C) 2007 the VideoLAN team
* $Id$
*
* Authors: Pierre d'Herbemont <pdherbemont # videolan.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.
*****************************************************************************/
#include "libvlc_internal.h"
#include <vlc/libvlc.h>
#include <assert.h>
#include "vlc_arrays.h"
static
const
char
*
libvlc_default_dynamic_media_list_tag_key
=
"VLCPlaylist"
;
/*
* Private functions
*/
/**************************************************************************
* own_media_list_item_added (private) (Event Callback)
**************************************************************************/
static
void
own_media_list_item_added
(
const
libvlc_event_t
*
p_event
,
void
*
p_user_data
)
{
/* Add our tag */
libvlc_dynamic_media_list_t
*
p_dmlist
=
p_user_data
;
libvlc_media_descriptor_t
*
p_md
=
p_event
->
u
.
media_list_item_added
.
item
;
if
(
!
p_dmlist
->
tag
||
!
p_dmlist
->
psz_tag_key
)
return
;
libvlc_media_descriptor_add_tag
(
p_md
,
p_dmlist
->
tag
,
p_dmlist
->
psz_tag_key
,
NULL
);
}
/**************************************************************************
* own_media_list_item_removed (private) (Event Callback)
**************************************************************************/
static
void
own_media_list_item_deleted
(
const
libvlc_event_t
*
p_event
,
void
*
p_user_data
)
{
/* Remove our tag */
libvlc_dynamic_media_list_t
*
p_dmlist
=
p_user_data
;
libvlc_media_descriptor_t
*
p_md
=
p_event
->
u
.
media_list_item_added
.
item
;
if
(
!
p_dmlist
->
tag
||
!
p_dmlist
->
psz_tag_key
)
return
;
libvlc_media_descriptor_remove_tag
(
p_md
,
p_dmlist
->
tag
,
p_dmlist
->
psz_tag_key
,
NULL
);
}
/**************************************************************************
* dynamic_list_propose_item (private) (Event Callback)
*
* This is called if the dynamic sublist's data provider adds a new item.
**************************************************************************/
static
void
dynamic_list_propose_item
(
const
libvlc_event_t
*
p_event
,
void
*
p_user_data
)
{
/* Check if the item matches our tag query */
libvlc_dynamic_media_list_t
*
p_dmlist
=
p_user_data
;
libvlc_media_descriptor_t
*
p_md
=
p_event
->
u
.
media_list_item_added
.
item
;
//libvlc_media_descriptor_lock( p_md );
if
(
libvlc_tag_query_match
(
p_dmlist
->
p_query
,
p_md
,
NULL
)
)
{
int
i
=
libvlc_media_list_index_of_item
(
p_dmlist
->
p_mlist
,
p_md
,
NULL
);
if
(
i
>=
0
)
{
/* We already have it */
libvlc_media_list_unlock
(
p_dmlist
->
p_mlist
);
return
;
}
libvlc_media_list_lock
(
p_dmlist
->
p_mlist
);
libvlc_media_list_add_media_descriptor
(
p_dmlist
->
p_mlist
,
p_md
,
NULL
);
libvlc_media_list_unlock
(
p_dmlist
->
p_mlist
);
}
//libvlc_media_descriptor_unlock( p_md );
}
/**************************************************************************
* dynamic_list_remove_item (private) (Event Callback)
*
* This is called if the dynamic sublist's data provider adds a new item.
**************************************************************************/
static
void
dynamic_list_remove_item
(
const
libvlc_event_t
*
p_event
,
void
*
p_user_data
)
{
/* Remove the item here too if we have it */
libvlc_dynamic_media_list_t
*
p_dmlist
=
p_user_data
;
libvlc_media_descriptor_t
*
p_md
=
p_event
->
u
.
media_list_item_deleted
.
item
;
//libvlc_media_descriptor_lock( p_md );
if
(
libvlc_tag_query_match
(
p_dmlist
->
p_query
,
p_md
,
NULL
)
)
{
int
i
;
libvlc_media_list_lock
(
p_dmlist
->
p_mlist
);
i
=
libvlc_media_list_index_of_item
(
p_dmlist
->
p_mlist
,
p_md
,
NULL
);
if
(
i
<
0
)
{
/* We've missed one item addition, that could happen especially
* if we add item in a threaded maner, so we just ignore */
libvlc_media_list_unlock
(
p_dmlist
->
p_mlist
);
//libvlc_media_descriptor_unlock( p_md );
return
;
}
libvlc_media_list_remove_index
(
p_dmlist
->
p_mlist
,
i
,
NULL
);
libvlc_media_list_unlock
(
p_dmlist
->
p_mlist
);
}
//libvlc_media_descriptor_unlock( p_md );
}
/*
* Public libvlc functions
*/
/**************************************************************************
* new (Public)
**************************************************************************/
libvlc_dynamic_media_list_t
*
libvlc_dynamic_media_list_new
(
libvlc_media_list_t
*
p_mlist
,
libvlc_tag_query_t
*
p_query
,
libvlc_tag_t
tag
,
libvlc_exception_t
*
p_e
)
{
libvlc_dynamic_media_list_t
*
p_dmlist
;
libvlc_event_manager_t
*
p_em
;
int
count
,
i
;
(
void
)
p_e
;
p_dmlist
=
malloc
(
sizeof
(
libvlc_dynamic_media_list_t
));
if
(
!
p_mlist
)
return
NULL
;
p_dmlist
->
i_refcount
=
1
;
p_dmlist
->
p_libvlc_instance
=
p_mlist
->
p_libvlc_instance
;
p_dmlist
->
tag
=
strdup
(
tag
);
p_dmlist
->
psz_tag_key
=
strdup
(
libvlc_default_dynamic_media_list_tag_key
);
p_dmlist
->
p_mlist
=
libvlc_media_list_new
(
p_mlist
->
p_libvlc_instance
,
p_e
);
if
(
!
p_dmlist
->
p_mlist
)
{
if
(
!
libvlc_exception_raised
(
p_e
)
)
libvlc_exception_raise
(
p_e
,
"Can't get the new media_list"
);
return
NULL
;
}
/* We have a query */
libvlc_tag_query_retain
(
p_query
);
p_dmlist
->
p_query
=
p_query
;
/* We have a media provider */
libvlc_media_list_retain
(
p_mlist
);
p_dmlist
->
p_media_provider
=
p_mlist
;
libvlc_media_list_lock
(
p_mlist
);
count
=
libvlc_media_list_count
(
p_mlist
,
p_e
);
/* This should be running in a thread, a good plan to achieve that
* move all the dynamic code to libvlc_tag_query. */
for
(
i
=
0
;
i
<
count
;
i
++
)
{
libvlc_media_descriptor_t
*
p_md
;
p_md
=
libvlc_media_list_item_at_index
(
p_mlist
,
i
,
p_e
);
if
(
libvlc_tag_query_match
(
p_query
,
p_md
,
NULL
)
)
libvlc_media_list_add_media_descriptor
(
p_dmlist
->
p_mlist
,
p_md
,
p_e
);
}
/* And we will listen to its event, so we can update p_dmlist->p_mlist
* accordingly */
p_em
=
libvlc_media_list_event_manager
(
p_mlist
,
p_e
);
libvlc_event_attach
(
p_em
,
libvlc_MediaListItemAdded
,
dynamic_list_propose_item
,
p_dmlist
,
p_e
);
libvlc_event_attach
(
p_em
,
libvlc_MediaListItemDeleted
,
dynamic_list_remove_item
,
p_dmlist
,
p_e
);
libvlc_media_list_unlock
(
p_mlist
);
/* Make sure item added/removed will gain/loose our mark */
p_em
=
libvlc_media_list_event_manager
(
p_dmlist
->
p_mlist
,
p_e
);
libvlc_event_attach
(
p_em
,
libvlc_MediaListItemAdded
,
own_media_list_item_added
,
p_dmlist
,
p_e
);
libvlc_event_attach
(
p_em
,
libvlc_MediaListItemDeleted
,
own_media_list_item_deleted
,
p_dmlist
,
p_e
);
return
p_dmlist
;
}
/**************************************************************************
* release (Public)
*
* Release an object.
**************************************************************************/
void
libvlc_dynamic_media_list_release
(
libvlc_dynamic_media_list_t
*
p_dmlist
)
{
p_dmlist
->
i_refcount
--
;
if
(
p_dmlist
->
i_refcount
>
0
)
return
;
free
(
p_dmlist
->
tag
);
free
(
p_dmlist
->
psz_tag_key
);
/* Refcount null, time to free */
if
(
p_dmlist
->
p_media_provider
)
libvlc_media_list_release
(
p_dmlist
->
p_media_provider
);
if
(
p_dmlist
->
p_query
)
libvlc_tag_query_release
(
p_dmlist
->
p_query
);
free
(
p_dmlist
);
}
/**************************************************************************
* retain (Public)
**************************************************************************/
void
libvlc_dynamic_media_list_retain
(
libvlc_dynamic_media_list_t
*
p_dmlist
)
{
p_dmlist
->
i_refcount
++
;
}
/**************************************************************************
* media_list (Public)
**************************************************************************/
libvlc_media_list_t
*
libvlc_dynamic_media_list_media_list
(
libvlc_dynamic_media_list_t
*
p_dmlist
,
libvlc_exception_t
*
p_e
)
{
VLC_UNUSED
(
p_e
);
libvlc_media_list_retain
(
p_dmlist
->
p_mlist
);
return
p_dmlist
->
p_mlist
;
}
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