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
fb43d75f
Commit
fb43d75f
authored
May 12, 2015
by
Thomas Guillem
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mediacodec: move restart handling in DecodeVideo
parent
44b32150
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
19 deletions
+24
-19
modules/codec/omxil/android_mediacodec.c
modules/codec/omxil/android_mediacodec.c
+24
-19
No files found.
modules/codec/omxil/android_mediacodec.c
View file @
fb43d75f
...
...
@@ -1344,12 +1344,11 @@ static int GetOutput(decoder_t *p_dec, JNIEnv *env, picture_t *p_pic, jlong time
return
0
;
}
static
void
H264ProcessBlock
(
decoder_t
*
p_dec
,
JNIEnv
*
env
,
block_t
*
p_block
,
bool
*
p_
delayed_open
)
static
void
H264ProcessBlock
(
decoder_t
*
p_dec
,
block_t
*
p_block
,
bool
*
p_
csd_changed
,
bool
*
p_size_changed
)
{
decoder_sys_t
*
p_sys
=
p_dec
->
p_sys
;
struct
H264ConvertState
convert_state
=
{
0
,
0
};
bool
b_size_changed
;
assert
(
p_dec
->
fmt_in
.
i_codec
==
VLC_CODEC_H264
&&
p_block
);
...
...
@@ -1358,22 +1357,14 @@ static void H264ProcessBlock(decoder_t *p_dec, JNIEnv *env, block_t *p_block,
convert_h264_to_annexb
(
p_block
->
p_buffer
,
p_block
->
i_buffer
,
p_sys
->
nal_size
,
&
convert_state
);
}
else
if
(
H264SetCSD
(
p_dec
,
p_block
->
p_buffer
,
p_block
->
i_buffer
,
&
b
_size_changed
)
==
VLC_SUCCESS
)
p
_size_changed
)
==
VLC_SUCCESS
)
{
if
(
p_sys
->
codec
&&
b_size_changed
)
{
msg_Err
(
p_dec
,
"SPS/PPS changed during playback and "
"MediaCodec configured with a different video size. "
"Restart it !"
);
CloseMediaCodec
(
p_dec
,
env
);
}
if
(
!
p_sys
->
codec
)
*
p_delayed_open
=
true
;
*
p_csd_changed
=
true
;
}
}
static
void
HEVCProcessBlock
(
decoder_t
*
p_dec
,
JNIEnv
*
env
,
block_t
*
p_block
,
bool
*
p_
delayed_open
)
static
void
HEVCProcessBlock
(
decoder_t
*
p_dec
,
block_t
*
p_block
,
bool
*
p_
csd_changed
,
bool
*
p_size_changed
)
{
decoder_sys_t
*
p_sys
=
p_dec
->
p_sys
;
struct
H264ConvertState
convert_state
=
{
0
,
0
};
...
...
@@ -1387,8 +1378,8 @@ static void HEVCProcessBlock(decoder_t *p_dec, JNIEnv *env, block_t *p_block,
}
/* TODO */
VLC_UNUSED
(
env
);
VLC_UNUSED
(
p_
delayed_open
);
VLC_UNUSED
(
p_csd_changed
);
VLC_UNUSED
(
p_
size_changed
);
}
static
picture_t
*
DecodeVideo
(
decoder_t
*
p_dec
,
block_t
**
pp_block
)
...
...
@@ -1450,11 +1441,25 @@ static picture_t *DecodeVideo(decoder_t *p_dec, block_t **pp_block)
if
(
b_new_block
)
{
bool
b_csd_changed
=
false
,
b_size_changed
=
false
;
p_sys
->
b_new_block
=
false
;
if
(
p_dec
->
fmt_in
.
i_codec
==
VLC_CODEC_H264
)
H264ProcessBlock
(
p_dec
,
env
,
p_block
,
&
b_delayed_open
);
H264ProcessBlock
(
p_dec
,
p_block
,
&
b_csd_changed
,
&
b_size_changed
);
else
if
(
p_dec
->
fmt_in
.
i_codec
==
VLC_CODEC_HEVC
)
HEVCProcessBlock
(
p_dec
,
env
,
p_block
,
&
b_delayed_open
);
HEVCProcessBlock
(
p_dec
,
p_block
,
&
b_csd_changed
,
&
b_size_changed
);
if
(
p_sys
->
codec
&&
b_csd_changed
)
{
if
(
b_size_changed
)
{
msg_Err
(
p_dec
,
"SPS/PPS changed during playback and "
"video size are different. Restart it !"
);
CloseMediaCodec
(
p_dec
,
env
);
}
}
if
(
!
p_sys
->
codec
)
b_delayed_open
=
true
;
}
/* try delayed opening if there is a new extra data */
...
...
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