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
c4b27e28
Commit
c4b27e28
authored
Nov 19, 2014
by
Thomas Guillem
Committed by
Jean-Baptiste Kempf
Nov 19, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
nativewindowpriv: better use of defines (cosmetics)
Signed-off-by:
Jean-Baptiste Kempf
<
jb@videolan.org
>
parent
b2bf1acb
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
17 deletions
+21
-17
modules/video_output/android/nativewindowpriv.c
modules/video_output/android/nativewindowpriv.c
+21
-17
No files found.
modules/video_output/android/nativewindowpriv.c
View file @
c4b27e28
...
@@ -31,11 +31,15 @@
...
@@ -31,11 +31,15 @@
#include <android/native_window.h>
#include <android/native_window.h>
#if ANDROID_API <= 13
#define ANDROID_HC_OR_LATER (ANDROID_API >= 11)
#define ANDROID_ICS_OR_LATER (ANDROID_API >= 14)
#define ANDROID_JBMR2_OR_LATER (ANDROID_API >= 18)
#if ANDROID_ICS_OR_LATER
#include <system/window.h>
#else
#include <ui/android_native_buffer.h>
#include <ui/android_native_buffer.h>
#include <ui/egl/android_natives.h>
#include <ui/egl/android_natives.h>
#else
#include <system/window.h>
#endif
#endif
#include <hardware/gralloc.h>
#include <hardware/gralloc.h>
...
@@ -45,7 +49,7 @@
...
@@ -45,7 +49,7 @@
#define NO_ERROR 0
#define NO_ERROR 0
typedef
int32_t
status_t
;
typedef
int32_t
status_t
;
#if
ANDROID_API <= 13
#if
!ANDROID_ICS_OR_LATER
typedef
android_native_buffer_t
ANativeWindowBuffer_t
;
typedef
android_native_buffer_t
ANativeWindowBuffer_t
;
#endif
#endif
typedef
struct
native_window_priv
native_window_priv
;
typedef
struct
native_window_priv
native_window_priv
;
...
@@ -79,14 +83,14 @@ struct native_window_priv
...
@@ -79,14 +83,14 @@ struct native_window_priv
static
int
window_connect
(
ANativeWindow
*
anw
)
static
int
window_connect
(
ANativeWindow
*
anw
)
{
{
#if ANDROID_
API >= 14
#if ANDROID_
ICS_OR_LATER
return
native_window_api_connect
(
anw
,
NATIVE_WINDOW_API_MEDIA
);
return
native_window_api_connect
(
anw
,
NATIVE_WINDOW_API_MEDIA
);
#endif
#endif
}
}
static
int
window_disconnect
(
ANativeWindow
*
anw
)
static
int
window_disconnect
(
ANativeWindow
*
anw
)
{
{
#if ANDROID_
API >= 14
#if ANDROID_
ICS_OR_LATER
return
native_window_api_disconnect
(
anw
,
NATIVE_WINDOW_API_MEDIA
);
return
native_window_api_disconnect
(
anw
,
NATIVE_WINDOW_API_MEDIA
);
#endif
#endif
}
}
...
@@ -143,17 +147,14 @@ int ANativeWindowPriv_setup( native_window_priv *priv, int w, int h, int hal_for
...
@@ -143,17 +147,14 @@ int ANativeWindowPriv_setup( native_window_priv *priv, int w, int h, int hal_for
priv
->
usage
=
hw_usage
|
GRALLOC_USAGE_HW_RENDER
|
GRALLOC_USAGE_HW_TEXTURE
;
priv
->
usage
=
hw_usage
|
GRALLOC_USAGE_HW_RENDER
|
GRALLOC_USAGE_HW_TEXTURE
;
else
else
priv
->
usage
=
GRALLOC_USAGE_SW_READ_NEVER
|
GRALLOC_USAGE_SW_WRITE_OFTEN
;
priv
->
usage
=
GRALLOC_USAGE_SW_READ_NEVER
|
GRALLOC_USAGE_SW_WRITE_OFTEN
;
#if ANDROID_
API >= 11
#if ANDROID_
HC_OR_LATER
priv
->
usage
|=
GRALLOC_USAGE_EXTERNAL_DISP
;
priv
->
usage
|=
GRALLOC_USAGE_EXTERNAL_DISP
;
#endif
#endif
err
=
native_window_set_usage
(
priv
->
anw
,
priv
->
usage
);
err
=
native_window_set_usage
(
priv
->
anw
,
priv
->
usage
);
CHECK_ERR
();
CHECK_ERR
();
#if ANDROID_API <= 13
#if ANDROID_ICS_OR_LATER
err
=
native_window_set_buffers_geometry
(
priv
->
anw
,
w
,
h
,
hal_format
);
CHECK_ERR
();
#else
err
=
native_window_set_scaling_mode
(
priv
->
anw
,
NATIVE_WINDOW_SCALING_MODE_SCALE_TO_WINDOW
);
err
=
native_window_set_scaling_mode
(
priv
->
anw
,
NATIVE_WINDOW_SCALING_MODE_SCALE_TO_WINDOW
);
CHECK_ERR
();
CHECK_ERR
();
...
@@ -162,6 +163,9 @@ int ANativeWindowPriv_setup( native_window_priv *priv, int w, int h, int hal_for
...
@@ -162,6 +163,9 @@ int ANativeWindowPriv_setup( native_window_priv *priv, int w, int h, int hal_for
err
=
native_window_set_buffers_format
(
priv
->
anw
,
hal_format
);
err
=
native_window_set_buffers_format
(
priv
->
anw
,
hal_format
);
CHECK_ERR
();
CHECK_ERR
();
#else
err
=
native_window_set_buffers_geometry
(
priv
->
anw
,
w
,
h
,
hal_format
);
CHECK_ERR
();
#endif
#endif
return
0
;
return
0
;
...
@@ -171,7 +175,7 @@ int ANativeWindowPriv_getMinUndequeued( native_window_priv *priv, unsigned int *
...
@@ -171,7 +175,7 @@ int ANativeWindowPriv_getMinUndequeued( native_window_priv *priv, unsigned int *
{
{
status_t
err
;
status_t
err
;
#if ANDROID_
API >= 11
#if ANDROID_
HC_OR_LATER
err
=
priv
->
anw
->
query
(
priv
->
anw
,
NATIVE_WINDOW_MIN_UNDEQUEUED_BUFFERS
,
min_undequeued
);
err
=
priv
->
anw
->
query
(
priv
->
anw
,
NATIVE_WINDOW_MIN_UNDEQUEUED_BUFFERS
,
min_undequeued
);
CHECK_ERR
();
CHECK_ERR
();
#endif
#endif
...
@@ -186,7 +190,7 @@ int ANativeWindowPriv_getMinUndequeued( native_window_priv *priv, unsigned int *
...
@@ -186,7 +190,7 @@ int ANativeWindowPriv_getMinUndequeued( native_window_priv *priv, unsigned int *
int
ANativeWindowPriv_getMaxBufferCount
(
native_window_priv
*
priv
,
unsigned
int
*
max_buffer_count
)
int
ANativeWindowPriv_getMaxBufferCount
(
native_window_priv
*
priv
,
unsigned
int
*
max_buffer_count
)
{
{
#if ANDROID_
API >= 14
#if ANDROID_
ICS_OR_LATER
*
max_buffer_count
=
32
;
*
max_buffer_count
=
32
;
#else
#else
*
max_buffer_count
=
15
;
*
max_buffer_count
=
15
;
...
@@ -222,7 +226,7 @@ int ANativeWindowPriv_dequeue( native_window_priv *priv, void **pp_handle )
...
@@ -222,7 +226,7 @@ int ANativeWindowPriv_dequeue( native_window_priv *priv, void **pp_handle )
ANativeWindowBuffer_t
*
anb
;
ANativeWindowBuffer_t
*
anb
;
status_t
err
=
NO_ERROR
;
status_t
err
=
NO_ERROR
;
#if ANDROID_
API >= 18
#if ANDROID_
JBMR2_OR_LATER
err
=
priv
->
anw
->
dequeueBuffer_DEPRECATED
(
priv
->
anw
,
&
anb
);
err
=
priv
->
anw
->
dequeueBuffer_DEPRECATED
(
priv
->
anw
,
&
anb
);
#else
#else
err
=
priv
->
anw
->
dequeueBuffer
(
priv
->
anw
,
&
anb
);
err
=
priv
->
anw
->
dequeueBuffer
(
priv
->
anw
,
&
anb
);
...
@@ -241,7 +245,7 @@ int ANativeWindowPriv_lock( native_window_priv *priv, void *p_handle )
...
@@ -241,7 +245,7 @@ int ANativeWindowPriv_lock( native_window_priv *priv, void *p_handle )
CHECK_ANB
();
CHECK_ANB
();
#if ANDROID_
API >= 18
#if ANDROID_
JBMR2_OR_LATER
err
=
priv
->
anw
->
lockBuffer_DEPRECATED
(
priv
->
anw
,
anb
);
err
=
priv
->
anw
->
lockBuffer_DEPRECATED
(
priv
->
anw
,
anb
);
#else
#else
err
=
priv
->
anw
->
lockBuffer
(
priv
->
anw
,
anb
);
err
=
priv
->
anw
->
lockBuffer
(
priv
->
anw
,
anb
);
...
@@ -294,7 +298,7 @@ int ANativeWindowPriv_queue( native_window_priv *priv, void *p_handle )
...
@@ -294,7 +298,7 @@ int ANativeWindowPriv_queue( native_window_priv *priv, void *p_handle )
CHECK_ANB
();
CHECK_ANB
();
#if ANDROID_
API >= 18
#if ANDROID_
JBMR2_OR_LATER
err
=
priv
->
anw
->
queueBuffer_DEPRECATED
(
priv
->
anw
,
anb
);
err
=
priv
->
anw
->
queueBuffer_DEPRECATED
(
priv
->
anw
,
anb
);
#else
#else
err
=
priv
->
anw
->
queueBuffer
(
priv
->
anw
,
anb
);
err
=
priv
->
anw
->
queueBuffer
(
priv
->
anw
,
anb
);
...
@@ -311,7 +315,7 @@ int ANativeWindowPriv_cancel( native_window_priv *priv, void *p_handle )
...
@@ -311,7 +315,7 @@ int ANativeWindowPriv_cancel( native_window_priv *priv, void *p_handle )
CHECK_ANB
();
CHECK_ANB
();
#if ANDROID_
API >= 18
#if ANDROID_
JBMR2_OR_LATER
err
=
priv
->
anw
->
cancelBuffer_DEPRECATED
(
priv
->
anw
,
anb
);
err
=
priv
->
anw
->
cancelBuffer_DEPRECATED
(
priv
->
anw
,
anb
);
#else
#else
err
=
priv
->
anw
->
cancelBuffer
(
priv
->
anw
,
anb
);
err
=
priv
->
anw
->
cancelBuffer
(
priv
->
anw
,
anb
);
...
...
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