Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
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
Commits
ceebb977
Commit
ceebb977
authored
Jun 22, 2013
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vdpau: context structure for video surfaces
parent
99d6ce3b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
78 additions
and
0 deletions
+78
-0
modules/hw/vdpau/picture.c
modules/hw/vdpau/picture.c
+63
-0
modules/hw/vdpau/vlc_vdpau.h
modules/hw/vdpau/vlc_vdpau.h
+15
-0
No files found.
modules/hw/vdpau/picture.c
0 → 100644
View file @
ceebb977
/*****************************************************************************
* picture.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 <stdio.h>
#include <assert.h>
#include <vlc_common.h>
#include <vlc_picture.h>
#include "vlc_vdpau.h"
#pragma GCC visibility push(default)
static
void
SurfaceDestroy
(
void
*
opaque
)
{
vlc_vdp_video_t
*
ctx
=
opaque
;
VdpStatus
err
;
err
=
vdp_video_surface_destroy
(
ctx
->
vdp
,
ctx
->
surface
);
if
(
err
!=
VDP_STATUS_OK
)
fprintf
(
stderr
,
"video surface destruction failure: %s
\n
"
,
vdp_get_error_string
(
ctx
->
vdp
,
err
));
vdp_release_x11
(
ctx
->
vdp
);
free
(
ctx
);
}
VdpStatus
vlc_vdp_video_attach
(
vdp_t
*
vdp
,
VdpVideoSurface
surface
,
picture_t
*
pic
)
{
vlc_vdp_video_t
*
ctx
=
malloc
(
sizeof
(
*
ctx
));
if
(
unlikely
(
ctx
==
NULL
))
{
vdp_video_surface_destroy
(
vdp
,
surface
);
return
VDP_STATUS_RESOURCES
;
}
ctx
->
destroy
=
SurfaceDestroy
;
ctx
->
surface
=
surface
;
ctx
->
vdp
=
vdp_hold_x11
(
vdp
,
&
ctx
->
device
);
assert
(
pic
->
context
==
NULL
);
pic
->
context
=
ctx
;
return
VDP_STATUS_OK
;
}
modules/hw/vdpau/vlc_vdpau.h
View file @
ceebb977
...
@@ -244,4 +244,19 @@ struct picture_sys_t
...
@@ -244,4 +244,19 @@ struct picture_sys_t
VdpDevice
device
;
VdpDevice
device
;
const
vdp_t
*
vdp
;
const
vdp_t
*
vdp
;
};
};
typedef
struct
vlc_vdp_video
{
void
(
*
destroy
)(
void
*
);
/* must be first @ref picture_Release() */
VdpVideoSurface
surface
;
VdpDevice
device
;
vdp_t
*
vdp
;
}
vlc_vdp_video_t
;
/**
* Attaches a VDPAU video surface as context of a VLC picture.
* @note In case of error, the surface is destroyed immediately. Otherwise,
* it will be destroyed at the same time as the picture it was attached to.
*/
VdpStatus
vlc_vdp_video_attach
(
vdp_t
*
,
VdpVideoSurface
,
picture_t
*
);
#endif
#endif
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