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
1779b7fe
Commit
1779b7fe
authored
Nov 21, 2014
by
Thomas Guillem
Committed by
Jean-Baptiste Kempf
Nov 21, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
nativewindowpriv: use only one call to lock/unlock sw buffers
Signed-off-by:
Jean-Baptiste Kempf
<
jb@videolan.org
>
parent
5a5ce58a
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
20 deletions
+24
-20
modules/video_output/android/android_window.c
modules/video_output/android/android_window.c
+5
-14
modules/video_output/android/nativewindowpriv.c
modules/video_output/android/nativewindowpriv.c
+17
-4
modules/video_output/android/utils.h
modules/video_output/android/utils.h
+2
-2
No files found.
modules/video_output/android/android_window.c
View file @
1779b7fe
...
...
@@ -470,20 +470,13 @@ static void AndroidWindow_UnlockPicture(vout_display_sys_t *sys,
picture_sys_t
*
p_picsys
=
p_pic
->
p_sys
;
if
(
p_window
->
b_use_priv
)
{
int
err
=
0
;
void
*
p_handle
=
p_picsys
->
priv
.
sw
.
p_handle
;
if
(
p_handle
==
NULL
)
return
;
err
=
sys
->
anwp
.
unlockData
(
p_window
->
p_handle_priv
,
p_handle
);
if
(
err
==
0
)
{
if
(
p_picsys
->
b_render
)
err
=
sys
->
anwp
.
queue
(
p_window
->
p_handle_priv
,
p_handle
);
else
err
=
sys
->
anwp
.
cancel
(
p_window
->
p_handle_priv
,
p_handle
);
}
sys
->
anwp
.
unlockData
(
p_window
->
p_handle_priv
,
p_handle
,
p_picsys
->
b_render
);
}
else
sys
->
anw
.
unlockAndPost
(
p_window
->
p_handle
);
}
...
...
@@ -498,11 +491,9 @@ static int AndroidWindow_LockPicture(vout_display_sys_t *sys,
void
*
p_handle
;
int
err
;
err
=
sys
->
anwp
.
dequeue
(
p_window
->
p_handle_priv
,
&
p_handle
);
err
=
err
==
0
?
sys
->
anwp
.
lock
(
p_window
->
p_handle_priv
,
p_handle
)
:
err
;
err
=
err
==
0
?
sys
->
anwp
.
lockData
(
p_window
->
p_handle_priv
,
p_handle
,
&
p_picsys
->
priv
.
sw
.
buf
)
:
err
;
err
=
sys
->
anwp
.
lockData
(
p_window
->
p_handle_priv
,
&
p_handle
,
&
p_picsys
->
priv
.
sw
.
buf
);
if
(
err
!=
0
)
return
-
1
;
p_picsys
->
priv
.
sw
.
p_handle
=
p_handle
;
...
...
modules/video_output/android/nativewindowpriv.c
View file @
1779b7fe
...
...
@@ -291,15 +291,22 @@ int ANativeWindowPriv_cancel( native_window_priv *priv, void *p_handle )
return
0
;
}
int
ANativeWindowPriv_lockData
(
native_window_priv
*
priv
,
void
*
p_handle
,
int
ANativeWindowPriv_lockData
(
native_window_priv
*
priv
,
void
*
*
p
p_handle
,
ANativeWindow_Buffer
*
p_out_anb
)
{
ANativeWindowBuffer_t
*
anb
=
(
ANativeWindowBuffer_t
*
)
p_handle
;
ANativeWindowBuffer_t
*
anb
;
status_t
err
=
NO_ERROR
;
void
*
p_data
;
err
=
ANativeWindowPriv_dequeue
(
priv
,
pp_handle
);
CHECK_ERR
();
anb
=
(
ANativeWindowBuffer_t
*
)
*
pp_handle
;
CHECK_ANB
();
err
=
ANativeWindowPriv_lock
(
priv
,
*
pp_handle
);
CHECK_ERR
();
err
=
priv
->
gralloc
->
lock
(
priv
->
gralloc
,
anb
->
handle
,
priv
->
usage
,
0
,
0
,
anb
->
width
,
anb
->
height
,
&
p_data
);
CHECK_ERR
();
...
...
@@ -314,16 +321,22 @@ int ANativeWindowPriv_lockData( native_window_priv *priv, void *p_handle,
return
0
;
}
int
ANativeWindowPriv_unlockData
(
native_window_priv
*
priv
,
void
*
p_handle
)
int
ANativeWindowPriv_unlockData
(
native_window_priv
*
priv
,
void
*
p_handle
,
bool
b_render
)
{
ANativeWindowBuffer_t
*
anb
=
(
ANativeWindowBuffer_t
*
)
p_handle
;
status_t
err
=
NO_ERROR
;
CHECK_ANB
();
err
=
priv
->
gralloc
->
unlock
(
priv
->
gralloc
,
anb
->
handle
);
err
=
priv
->
gralloc
->
unlock
(
priv
->
gralloc
,
anb
->
handle
);
CHECK_ERR
();
if
(
b_render
)
ANativeWindowPriv_queue
(
priv
,
p_handle
);
else
ANativeWindowPriv_cancel
(
priv
,
p_handle
);
return
0
;
}
...
...
modules/video_output/android/utils.h
View file @
1779b7fe
...
...
@@ -82,8 +82,8 @@ typedef int (*ptr_ANativeWindowPriv_dequeue) (native_window_priv *, void **);
typedef
int
(
*
ptr_ANativeWindowPriv_lock
)
(
native_window_priv
*
,
void
*
);
typedef
int
(
*
ptr_ANativeWindowPriv_queue
)
(
native_window_priv
*
,
void
*
);
typedef
int
(
*
ptr_ANativeWindowPriv_cancel
)
(
native_window_priv
*
,
void
*
);
typedef
int
(
*
ptr_ANativeWindowPriv_lockData
)
(
native_window_priv
*
,
void
*
,
ANativeWindow_Buffer
*
);
typedef
int
(
*
ptr_ANativeWindowPriv_unlockData
)
(
native_window_priv
*
,
void
*
);
typedef
int
(
*
ptr_ANativeWindowPriv_lockData
)
(
native_window_priv
*
,
void
*
*
,
ANativeWindow_Buffer
*
);
typedef
int
(
*
ptr_ANativeWindowPriv_unlockData
)
(
native_window_priv
*
,
void
*
,
bool
b_render
);
typedef
int
(
*
ptr_ANativeWindowPriv_setOrientation
)
(
native_window_priv
*
,
int
);
typedef
struct
...
...
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