Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
VLC
Manage
Activity
Members
Labels
Code
Merge requests
1
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Lyndon Brown
VLC
Commits
46130b4f
Commit
46130b4f
authored
3 years ago
by
Rémi Denis-Courmont
Committed by
Hugo Beauzée-Luyssen
3 years ago
Browse files
Options
Downloads
Patches
Plain Diff
vdpau: remove dead code
parent
0a82e325
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
modules/hw/vdpau/Makefile.am
+1
-1
1 addition, 1 deletion
modules/hw/vdpau/Makefile.am
modules/hw/vdpau/instance.c
+0
-126
0 additions, 126 deletions
modules/hw/vdpau/instance.c
modules/hw/vdpau/vlc_vdpau.h
+0
-26
0 additions, 26 deletions
modules/hw/vdpau/vlc_vdpau.h
with
1 addition
and
153 deletions
modules/hw/vdpau/Makefile.am
+
1
−
1
View file @
46130b4f
vdpaudir
=
$(
pluginsdir
)
/vdpau
libvlc_vdpau_la_SOURCES
=
hw/vdpau/vlc_vdpau.c hw/vdpau/vlc_vdpau.h
hw/vdpau/instance.c
libvlc_vdpau_la_SOURCES
=
hw/vdpau/vlc_vdpau.c hw/vdpau/vlc_vdpau.h
libvlc_vdpau_la_CFLAGS
=
$(
VDPAU_CFLAGS
)
libvlc_vdpau_la_LIBADD
=
$(
X_LIBS
)
$(
X_PRE_LIBS
)
-lX11
$(
LIBDL
)
libvlc_vdpau_la_LDFLAGS
=
\
...
...
This diff is collapsed.
Click to expand it.
modules/hw/vdpau/instance.c
deleted
100644 → 0
+
0
−
126
View file @
0a82e325
/*****************************************************************************
* instance.c: VDPAU instance management for VLC
*****************************************************************************
* Copyright (C) 2013 Rémi Denis-Courmont
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; either version 2.1 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 Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser 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.
*****************************************************************************/
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include
<stdlib.h>
#include
<stdint.h>
#include
<assert.h>
#include
<pthread.h>
#include
<X11/Xlib.h>
#include
<vlc_common.h>
#include
"vlc_vdpau.h"
#pragma GCC visibility push(default)
typedef
struct
vdp_instance
{
Display
*
display
;
vdp_t
*
vdp
;
VdpDevice
device
;
struct
vdp_instance
*
next
;
}
vdp_instance_t
;
static
vdp_instance_t
*
vdp_instance_create
(
const
char
*
name
,
int
num
)
{
vdp_instance_t
*
vi
=
malloc
(
sizeof
(
*
vi
));
if
(
unlikely
(
vi
==
NULL
))
return
NULL
;
vi
->
display
=
XOpenDisplay
(
name
);
if
(
vi
->
display
==
NULL
)
{
free
(
vi
);
return
NULL
;
}
if
(
num
<
0
)
num
=
XDefaultScreen
(
vi
->
display
);
VdpStatus
err
=
vdp_create_x11
(
vi
->
display
,
num
,
&
vi
->
vdp
,
&
vi
->
device
);
if
(
err
!=
VDP_STATUS_OK
)
{
XCloseDisplay
(
vi
->
display
);
free
(
vi
);
return
NULL
;
}
vi
->
next
=
NULL
;
return
vi
;
}
static
void
vdp_instance_destroy
(
vdp_instance_t
*
vi
)
{
vdp_device_destroy
(
vi
->
vdp
,
vi
->
device
);
vdp_destroy_x11
(
vi
->
vdp
);
XCloseDisplay
(
vi
->
display
);
free
(
vi
);
}
static
vdp_instance_t
*
list
=
NULL
;
static
pthread_mutex_t
lock
=
PTHREAD_MUTEX_INITIALIZER
;
/** Finds an existing VDPAU instance for the given X11 display and screen.
* If not found, (try to) create a new one.
* @param display_name X11 display string, NULL for default
* @param snum X11 screen number, strictly negative for default
**/
VdpStatus
vdp_get_x11
(
const
char
*
display_name
,
int
snum
,
vdp_t
**
restrict
vdpp
,
VdpDevice
*
restrict
devicep
)
{
vdp_instance_t
*
vi
=
vdp_instance_create
(
display_name
,
snum
);
if
(
vi
==
NULL
)
return
VDP_STATUS_ERROR
;
pthread_mutex_lock
(
&
lock
);
vi
->
next
=
list
;
list
=
vi
;
pthread_mutex_unlock
(
&
lock
);
*
vdpp
=
vi
->
vdp
;
*
devicep
=
vi
->
device
;
return
VDP_STATUS_OK
;
}
void
vdp_release_x11
(
vdp_t
*
vdp
)
{
vdp_instance_t
*
vi
,
**
pp
=
&
list
;
pthread_mutex_lock
(
&
lock
);
for
(;;)
{
vi
=
*
pp
;
assert
(
vi
!=
NULL
);
if
(
vi
->
vdp
==
vdp
)
break
;
pp
=
&
vi
->
next
;
}
*
pp
=
vi
->
next
;
/* Unlink the instance */
pthread_mutex_unlock
(
&
lock
);
if
(
vi
!=
NULL
)
vdp_instance_destroy
(
vi
);
}
This diff is collapsed.
Click to expand it.
modules/hw/vdpau/vlc_vdpau.h
+
0
−
26
View file @
46130b4f
...
...
@@ -172,32 +172,6 @@ VdpStatus vdp_create_x11(void *dpy, int snum, vdp_t **vdpp, VdpDevice *devp);
*/
void
vdp_destroy_x11
(
vdp_t
*
);
/* Instance reuse */
/**
* Creates a VDPAU instance.
*
* This function connects to the X11 server and creates a VDPAU instance and
* VDPAU device matching the specified screen number.
*
* @param name X11 display name
* @param snum X11 screen number
* @param vdp memory location to hold the VDPAU instance pointer [OUT]
* @param dev memory location to hold the VDPAU device handle [OUT]
* @return VDP_STATUS_OK on success, otherwise a VDPAU error code.
*
* @note Use vdp_release_x11() to release the instance. <b>Do not use</b>
* vdp_device_destroy() and/or vdp_destroy_x11() with vdp_get_x11().
*/
VdpStatus
vdp_get_x11
(
const
char
*
name
,
int
num
,
vdp_t
**
vdp
,
VdpDevice
*
dev
);
/**
* Decreases the reference count of a VDPAU instance created by vdp_get_x11().
* If it reaches zero, destroy the corresponding VDPAU device, then the VDPAU
* instance and remove the pair from the process-wide list.
*/
void
vdp_release_x11
(
vdp_t
*
);
/* VLC specifics */
# include <stdatomic.h>
# include <stdbool.h>
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment