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
a522648d
Commit
a522648d
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
android_window: render picture on Display, and not via pool.pic_unlock
Signed-off-by:
Jean-Baptiste Kempf
<
jb@videolan.org
>
parent
00c28704
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
31 additions
and
27 deletions
+31
-27
modules/codec/omxil/android_mediacodec.c
modules/codec/omxil/android_mediacodec.c
+1
-2
modules/codec/omxil/omxil.c
modules/codec/omxil/omxil.c
+4
-4
modules/video_output/android/android_window.c
modules/video_output/android/android_window.c
+24
-19
modules/video_output/android/android_window.h
modules/video_output/android/android_window.h
+2
-2
No files found.
modules/codec/omxil/android_mediacodec.c
View file @
a522648d
...
...
@@ -619,7 +619,7 @@ static void CloseDecoder(vlc_object_t *p_this)
/*****************************************************************************
* vout callbacks
*****************************************************************************/
static
void
UnlockPicture
(
picture_t
*
p_pic
)
static
void
UnlockPicture
(
picture_t
*
p_pic
,
bool
b_render
)
{
picture_sys_t
*
p_picsys
=
p_pic
->
p_sys
;
decoder_t
*
p_dec
=
p_picsys
->
priv
.
hw
.
p_dec
;
...
...
@@ -637,7 +637,6 @@ static void UnlockPicture(picture_t* p_pic)
}
uint32_t
i_index
=
p_picsys
->
priv
.
hw
.
i_index
;
bool
b_render
=
p_picsys
->
b_render
;
p_sys
->
inflight_picture
[
i_index
]
=
NULL
;
/* Release the MediaCodec buffer. */
...
...
modules/codec/omxil/omxil.c
View file @
a522648d
...
...
@@ -96,7 +96,7 @@ static OMX_ERRORTYPE OmxFillBufferDone( OMX_HANDLETYPE, OMX_PTR,
#if defined(USE_IOMX)
static
void
*
DequeueThread
(
void
*
data
);
static
void
UnlockPicture
(
picture_t
*
p_pic
);
static
void
UnlockPicture
(
picture_t
*
p_pic
,
bool
b_render
);
static
void
HwBuffer_Init
(
decoder_t
*
p_dec
,
OmxPort
*
p_port
);
static
void
HwBuffer_Destroy
(
decoder_t
*
p_dec
,
OmxPort
*
p_port
);
static
int
HwBuffer_AllocateBuffers
(
decoder_t
*
p_dec
,
OmxPort
*
p_port
);
...
...
@@ -2589,7 +2589,7 @@ static void *DequeueThread( void *data )
/*****************************************************************************
* vout callbacks
*****************************************************************************/
static
void
UnlockPicture
(
picture_t
*
p_pic
)
static
void
UnlockPicture
(
picture_t
*
p_pic
,
bool
b_render
)
{
picture_sys_t
*
p_picsys
=
p_pic
->
p_sys
;
decoder_t
*
p_dec
=
p_picsys
->
priv
.
hw
.
p_dec
;
...
...
@@ -2610,7 +2610,7 @@ static void UnlockPicture( picture_t* p_pic )
p_handle
=
p_port
->
pp_buffers
[
p_picsys
->
priv
.
hw
.
i_index
]
->
pBuffer
;
OMX_DBG
(
"DisplayBuffer: %s %p"
,
p_picsys
->
b_render
?
"render"
:
"cancel"
,
p_handle
);
b_render
?
"render"
:
"cancel"
,
p_handle
);
if
(
!
p_handle
)
{
...
...
@@ -2618,7 +2618,7 @@ static void UnlockPicture( picture_t* p_pic )
goto
end
;
}
if
(
p_picsys
->
b_render
)
if
(
b_render
)
p_port
->
p_hwbuf
->
anwpriv
.
queue
(
p_port
->
p_hwbuf
->
window_priv
,
p_handle
);
else
p_port
->
p_hwbuf
->
anwpriv
.
cancel
(
p_port
->
p_hwbuf
->
window_priv
,
p_handle
);
...
...
modules/video_output/android/android_window.c
View file @
a522648d
...
...
@@ -465,7 +465,8 @@ static int AndroidWindow_Setup(vout_display_sys_t *sys,
static
void
AndroidWindow_UnlockPicture
(
vout_display_sys_t
*
sys
,
android_window
*
p_window
,
picture_t
*
p_pic
)
picture_t
*
p_pic
,
bool
b_render
)
{
picture_sys_t
*
p_picsys
=
p_pic
->
p_sys
;
...
...
@@ -475,8 +476,7 @@ static void AndroidWindow_UnlockPicture(vout_display_sys_t *sys,
if
(
p_handle
==
NULL
)
return
;
sys
->
anwp
.
unlockData
(
p_window
->
p_handle_priv
,
p_handle
,
p_picsys
->
b_render
);
sys
->
anwp
.
unlockData
(
p_window
->
p_handle_priv
,
p_handle
,
b_render
);
}
else
sys
->
anw
.
unlockAndPost
(
p_window
->
p_handle
);
}
...
...
@@ -506,7 +506,7 @@ static int AndroidWindow_LockPicture(vout_display_sys_t *sys,
p_picsys
->
priv
.
sw
.
buf
.
height
<
0
||
(
unsigned
)
p_picsys
->
priv
.
sw
.
buf
.
width
<
p_window
->
fmt
.
i_width
||
(
unsigned
)
p_picsys
->
priv
.
sw
.
buf
.
height
<
p_window
->
fmt
.
i_height
)
{
AndroidWindow_UnlockPicture
(
sys
,
p_window
,
p_pic
);
AndroidWindow_UnlockPicture
(
sys
,
p_window
,
p_pic
,
false
);
return
-
1
;
}
...
...
@@ -689,30 +689,36 @@ static int DefaultLockPicture(picture_t *p_pic)
return
AndroidWindow_LockPicture
(
sys
,
sys
->
p_window
,
p_pic
);
}
static
void
DefaultUnlockPicture
(
picture_t
*
p_pic
)
static
void
DefaultUnlockPicture
(
picture_t
*
p_pic
,
bool
b_render
)
{
picture_sys_t
*
p_picsys
=
p_pic
->
p_sys
;
vout_display_sys_t
*
sys
=
p_picsys
->
p_vd_sys
;
AndroidWindow_UnlockPicture
(
sys
,
sys
->
p_window
,
p_pic
);
AndroidWindow_UnlockPicture
(
sys
,
sys
->
p_window
,
p_pic
,
b_render
);
}
static
int
LockPicture
(
picture_t
*
p_pic
)
static
void
UnlockPicture
(
picture_t
*
p_pic
,
bool
b_render
)
{
picture_sys_t
*
p_picsys
=
p_pic
->
p_sys
;
p_picsys
->
b_render
=
false
;
if
(
p_picsys
->
pf_lock_pic
)
return
p_picsys
->
pf_lock_pic
(
p_pic
);
return
0
;
if
(
p_picsys
->
b_locked
&&
p_picsys
->
pf_unlock_pic
)
p_picsys
->
pf_unlock_pic
(
p_pic
,
b_render
);
p_picsys
->
b_locked
=
false
;
}
static
void
Unl
ockPicture
(
picture_t
*
p_pic
)
static
int
PoolL
ockPicture
(
picture_t
*
p_pic
)
{
picture_sys_t
*
p_picsys
=
p_pic
->
p_sys
;
if
(
p_picsys
->
pf_unlock_pic
)
p_picsys
->
pf_unlock_pic
(
p_pic
);
if
(
p_picsys
->
pf_lock_pic
&&
p_picsys
->
pf_lock_pic
(
p_pic
)
!=
0
)
return
-
1
;
p_picsys
->
b_locked
=
true
;
return
0
;
}
static
void
PoolUnlockPicture
(
picture_t
*
p_pic
)
{
UnlockPicture
(
p_pic
,
false
);
}
static
picture_pool_t
*
PoolAlloc
(
vout_display_t
*
vd
,
unsigned
requested_count
)
...
...
@@ -750,8 +756,8 @@ static picture_pool_t *PoolAlloc(vout_display_t *vd, unsigned requested_count)
memset
(
&
pool_cfg
,
0
,
sizeof
(
pool_cfg
));
pool_cfg
.
picture_count
=
requested_count
;
pool_cfg
.
picture
=
pp_pics
;
pool_cfg
.
lock
=
LockPicture
;
pool_cfg
.
unlock
=
UnlockPicture
;
pool_cfg
.
lock
=
Pool
LockPicture
;
pool_cfg
.
unlock
=
Pool
UnlockPicture
;
pool
=
picture_pool_NewExtended
(
&
pool_cfg
);
error:
...
...
@@ -804,7 +810,7 @@ static void SubpictureDisplay(vout_display_t *vd, subpicture_t *subpicture)
&
sys
->
p_sub_pic
->
format
);
picture_BlendSubpicture
(
sys
->
p_sub_pic
,
sys
->
p_spu_blend
,
subpicture
);
}
AndroidWindow_UnlockPicture
(
sys
,
sys
->
p_sub_window
,
sys
->
p_sub_pic
);
AndroidWindow_UnlockPicture
(
sys
,
sys
->
p_sub_window
,
sys
->
p_sub_pic
,
true
);
}
static
picture_pool_t
*
Pool
(
vout_display_t
*
vd
,
unsigned
requested_count
)
...
...
@@ -820,10 +826,9 @@ static void Display(vout_display_t *vd, picture_t *picture,
subpicture_t
*
subpicture
)
{
vout_display_sys_t
*
sys
=
vd
->
sys
;
picture_sys_t
*
p_picsys
=
picture
->
p_sys
;
/* refcount lowers to 0, and pool_cfg.unlock is called */
p_picsys
->
b_render
=
true
;
UnlockPicture
(
picture
,
true
)
;
picture_Release
(
picture
);
if
(
subpicture
)
{
...
...
modules/video_output/android/android_window.h
View file @
a522648d
...
...
@@ -40,7 +40,7 @@ struct picture_sys_t
vout_display_sys_t
*
p_vd_sys
;
int
(
*
pf_lock_pic
)(
picture_t
*
);
void
(
*
pf_unlock_pic
)(
picture_t
*
);
void
(
*
pf_unlock_pic
)(
picture_t
*
,
bool
b_render
);
union
{
struct
{
...
...
@@ -53,7 +53,7 @@ struct picture_sys_t
ANativeWindow_Buffer
buf
;
}
sw
;
}
priv
;
bool
b_
render
;
bool
b_
locked
;
};
#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