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
ebb8fafb
Commit
ebb8fafb
authored
May 19, 2015
by
Thomas Guillem
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mediacodec: PutInput: separate JNI part from Decoder part
parent
d6d6f301
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
56 additions
and
45 deletions
+56
-45
modules/codec/omxil/mediacodec.c
modules/codec/omxil/mediacodec.c
+56
-45
No files found.
modules/codec/omxil/mediacodec.c
View file @
ebb8fafb
...
@@ -1140,14 +1140,15 @@ static int InsertInflightPicture(decoder_t *p_dec, picture_t *p_pic,
...
@@ -1140,14 +1140,15 @@ static int InsertInflightPicture(decoder_t *p_dec, picture_t *p_pic,
return
0
;
return
0
;
}
}
static
int
PutInput
(
decoder_t
*
p_dec
,
JNIEnv
*
env
,
const
void
*
p_buf
,
static
int
Jni
PutInput
(
decoder_t
*
p_dec
,
JNIEnv
*
env
,
const
void
*
p_buf
,
size_t
i_size
,
mtime_t
ts
,
jint
jflags
,
jlong
timeout
)
size_t
i_size
,
mtime_t
ts
,
bool
b_config
,
mtime_t
timeout
)
{
{
decoder_sys_t
*
p_sys
=
p_dec
->
p_sys
;
decoder_sys_t
*
p_sys
=
p_dec
->
p_sys
;
int
index
;
int
index
;
uint8_t
*
p_mc_buf
;
uint8_t
*
p_mc_buf
;
jobject
j_mc_buf
;
jobject
j_mc_buf
;
jsize
j_mc_size
;
jsize
j_mc_size
;
jint
jflags
=
b_config
?
BUFFER_FLAG_CODEC_CONFIG
:
0
;
index
=
(
*
env
)
->
CallIntMethod
(
env
,
p_sys
->
codec
,
index
=
(
*
env
)
->
CallIntMethod
(
env
,
p_sys
->
codec
,
jfields
.
dequeue_input_buffer
,
timeout
);
jfields
.
dequeue_input_buffer
,
timeout
);
...
@@ -1186,6 +1187,57 @@ static int PutInput(decoder_t *p_dec, JNIEnv *env, const void *p_buf,
...
@@ -1186,6 +1187,57 @@ static int PutInput(decoder_t *p_dec, JNIEnv *env, const void *p_buf,
return
1
;
return
1
;
}
}
static
int
PutInput
(
decoder_t
*
p_dec
,
JNIEnv
*
env
,
block_t
*
p_block
,
mtime_t
timeout
)
{
decoder_sys_t
*
p_sys
=
p_dec
->
p_sys
;
int
i_ret
;
const
void
*
p_buf
;
size_t
i_size
;
bool
b_config
=
false
;
mtime_t
i_ts
=
0
;
assert
(
p_sys
->
i_csd_send
<
p_sys
->
i_csd_count
||
p_block
);
if
(
p_sys
->
i_csd_send
<
p_sys
->
i_csd_count
)
{
/* Try to send Codec Specific Data */
p_buf
=
p_sys
->
p_csd
[
p_sys
->
i_csd_send
].
p_buf
;
i_size
=
p_sys
->
p_csd
[
p_sys
->
i_csd_send
].
i_size
;
b_config
=
true
;
}
else
{
/* Try to send p_block input buffer */
p_buf
=
p_block
->
p_buffer
;
i_size
=
p_block
->
i_buffer
;
i_ts
=
p_block
->
i_pts
;
if
(
!
i_ts
&&
p_block
->
i_dts
)
i_ts
=
p_block
->
i_dts
;
}
i_ret
=
JniPutInput
(
p_dec
,
env
,
p_buf
,
i_size
,
i_ts
,
b_config
,
timeout
);
if
(
i_ret
!=
1
)
return
i_ret
;
if
(
p_sys
->
i_csd_send
<
p_sys
->
i_csd_count
)
{
msg_Dbg
(
p_dec
,
"sent codec specific data(%d) of size %d "
"via BUFFER_FLAG_CODEC_CONFIG flag"
,
p_sys
->
i_csd_send
,
i_size
);
p_sys
->
i_csd_send
++
;
return
0
;
}
else
{
p_sys
->
decoded
=
true
;
if
(
p_block
->
i_flags
&
BLOCK_FLAG_PREROLL
)
p_sys
->
i_preroll_end
=
i_ts
;
timestamp_FifoPut
(
p_sys
->
timestamp_fifo
,
p_block
->
i_pts
?
VLC_TS_INVALID
:
p_block
->
i_dts
);
return
1
;
}
}
static
int
GetOutput
(
decoder_t
*
p_dec
,
JNIEnv
*
env
,
picture_t
*
p_pic
,
jlong
timeout
)
static
int
GetOutput
(
decoder_t
*
p_dec
,
JNIEnv
*
env
,
picture_t
*
p_pic
,
jlong
timeout
)
{
{
decoder_sys_t
*
p_sys
=
p_dec
->
p_sys
;
decoder_sys_t
*
p_sys
=
p_dec
->
p_sys
;
...
@@ -1525,51 +1577,10 @@ static picture_t *DecodeVideo(decoder_t *p_dec, block_t **pp_block)
...
@@ -1525,51 +1577,10 @@ static picture_t *DecodeVideo(decoder_t *p_dec, block_t **pp_block)
if
((
p_sys
->
i_csd_send
<
p_sys
->
i_csd_count
||
p_block
)
if
((
p_sys
->
i_csd_send
<
p_sys
->
i_csd_count
||
p_block
)
&&
i_input_ret
==
0
)
&&
i_input_ret
==
0
)
{
{
const
void
*
p_buf
;
i_input_ret
=
PutInput
(
p_dec
,
env
,
p_block
,
timeout
);
size_t
i_size
;
if
(
!
p_sys
->
decoded
)
jint
jflags
=
0
;
mtime_t
i_ts
=
0
;
if
(
p_sys
->
i_csd_send
<
p_sys
->
i_csd_count
)
{
/* Try to send Codec Specific Data */
p_buf
=
p_sys
->
p_csd
[
p_sys
->
i_csd_send
].
p_buf
;
i_size
=
p_sys
->
p_csd
[
p_sys
->
i_csd_send
].
i_size
;
jflags
=
BUFFER_FLAG_CODEC_CONFIG
;
}
else
{
/* Try to send p_block input buffer */
p_buf
=
p_block
->
p_buffer
;
i_size
=
p_block
->
i_buffer
;
i_ts
=
p_block
->
i_pts
;
if
(
!
i_ts
&&
p_block
->
i_dts
)
i_ts
=
p_block
->
i_dts
;
}
i_input_ret
=
PutInput
(
p_dec
,
env
,
p_buf
,
i_size
,
i_ts
,
jflags
,
timeout
);
if
(
i_input_ret
==
1
)
{
if
(
p_sys
->
i_csd_send
<
p_sys
->
i_csd_count
)
{
msg_Dbg
(
p_dec
,
"sent codec specific data(%d) of size %d "
"via BUFFER_FLAG_CODEC_CONFIG flag"
,
p_sys
->
i_csd_send
,
i_size
);
p_sys
->
i_csd_send
++
;
i_input_ret
=
0
;
continue
;
continue
;
}
}
else
{
p_sys
->
decoded
=
true
;
if
(
p_block
->
i_flags
&
BLOCK_FLAG_PREROLL
)
p_sys
->
i_preroll_end
=
i_ts
;
timestamp_FifoPut
(
p_sys
->
timestamp_fifo
,
p_block
->
i_pts
?
VLC_TS_INVALID
:
p_block
->
i_dts
);
}
}
}
if
(
i_input_ret
!=
-
1
&&
p_sys
->
decoded
&&
i_output_ret
==
0
)
if
(
i_input_ret
!=
-
1
&&
p_sys
->
decoded
&&
i_output_ret
==
0
)
{
{
...
...
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