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
08916947
Commit
08916947
authored
Nov 06, 2015
by
Thomas Guillem
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mediacodec: psz_name and psz_name are now visible by sub modules
parent
df1e8379
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
35 additions
and
35 deletions
+35
-35
modules/codec/omxil/mediacodec.c
modules/codec/omxil/mediacodec.c
+23
-24
modules/codec/omxil/mediacodec.h
modules/codec/omxil/mediacodec.h
+4
-2
modules/codec/omxil/mediacodec_jni.c
modules/codec/omxil/mediacodec_jni.c
+3
-4
modules/codec/omxil/mediacodec_ndk.c
modules/codec/omxil/mediacodec_ndk.c
+5
-5
No files found.
modules/codec/omxil/mediacodec.c
View file @
08916947
...
@@ -82,9 +82,6 @@ typedef int (*dec_process_output_cb)(decoder_t *, mc_api_out *, picture_t **, bl
...
@@ -82,9 +82,6 @@ typedef int (*dec_process_output_cb)(decoder_t *, mc_api_out *, picture_t **, bl
struct
decoder_sys_t
struct
decoder_sys_t
{
{
mc_api
*
api
;
mc_api
*
api
;
char
*
psz_name
;
const
char
*
mime
;
/* Codec Specific Data buffer: sent in PutInput after a start or a flush
/* Codec Specific Data buffer: sent in PutInput after a start or a flush
* with the BUFFER_FLAG_CODEC_CONFIG flag.*/
* with the BUFFER_FLAG_CODEC_CONFIG flag.*/
...
@@ -401,11 +398,11 @@ static int StartMediaCodec(decoder_t *p_dec)
...
@@ -401,11 +398,11 @@ static int StartMediaCodec(decoder_t *p_dec)
&
p_sys
->
u
.
video
.
i_h264_profile
,
NULL
,
NULL
);
&
p_sys
->
u
.
video
.
i_h264_profile
,
NULL
,
NULL
);
if
(
p_sys
->
u
.
video
.
i_h264_profile
)
if
(
p_sys
->
u
.
video
.
i_h264_profile
)
{
{
free
(
p_sys
->
psz_name
);
free
(
p_sys
->
api
->
psz_name
);
p_sys
->
psz_name
=
MediaCodec_GetName
(
VLC_OBJECT
(
p_dec
),
p_sys
->
api
->
psz_name
=
MediaCodec_GetName
(
VLC_OBJECT
(
p_dec
),
p_sys
->
mime
,
p_sys
->
api
->
psz_
mime
,
p_sys
->
u
.
video
.
i_h264_profile
);
p_sys
->
u
.
video
.
i_h264_profile
);
if
(
!
p_sys
->
psz_name
)
if
(
!
p_sys
->
api
->
psz_name
)
return
VLC_EGENERIC
;
return
VLC_EGENERIC
;
}
}
}
}
...
@@ -442,7 +439,7 @@ static int StartMediaCodec(decoder_t *p_dec)
...
@@ -442,7 +439,7 @@ static int StartMediaCodec(decoder_t *p_dec)
args
.
audio
.
i_channel_count
=
p_dec
->
p_sys
->
u
.
audio
.
i_channels
;
args
.
audio
.
i_channel_count
=
p_dec
->
p_sys
->
u
.
audio
.
i_channels
;
}
}
return
p_sys
->
api
->
start
(
p_sys
->
api
,
p_sys
->
psz_name
,
p_sys
->
mime
,
&
args
);
return
p_sys
->
api
->
start
(
p_sys
->
api
,
&
args
);
}
}
/*****************************************************************************
/*****************************************************************************
...
@@ -560,8 +557,8 @@ static int OpenDecoder(vlc_object_t *p_this, pf_MediaCodecApi_init pf_init)
...
@@ -560,8 +557,8 @@ static int OpenDecoder(vlc_object_t *p_this, pf_MediaCodecApi_init pf_init)
p_dec
->
fmt_out
.
i_cat
=
p_dec
->
fmt_in
.
i_cat
;
p_dec
->
fmt_out
.
i_cat
=
p_dec
->
fmt_in
.
i_cat
;
p_dec
->
fmt_out
.
video
=
p_dec
->
fmt_in
.
video
;
p_dec
->
fmt_out
.
video
=
p_dec
->
fmt_in
.
video
;
p_dec
->
fmt_out
.
audio
=
p_dec
->
fmt_in
.
audio
;
p_dec
->
fmt_out
.
audio
=
p_dec
->
fmt_in
.
audio
;
p_sys
->
mime
=
mime
;
p_sys
->
b_new_block
=
true
;
p_sys
->
b_new_block
=
true
;
p_sys
->
api
->
psz_mime
=
mime
;
if
(
p_dec
->
fmt_in
.
i_cat
==
VIDEO_ES
)
if
(
p_dec
->
fmt_in
.
i_cat
==
VIDEO_ES
)
{
{
...
@@ -581,15 +578,16 @@ static int OpenDecoder(vlc_object_t *p_this, pf_MediaCodecApi_init pf_init)
...
@@ -581,15 +578,16 @@ static int OpenDecoder(vlc_object_t *p_this, pf_MediaCodecApi_init pf_init)
h264_get_profile_level
(
&
p_dec
->
fmt_in
,
h264_get_profile_level
(
&
p_dec
->
fmt_in
,
&
p_sys
->
u
.
video
.
i_h264_profile
,
NULL
,
NULL
);
&
p_sys
->
u
.
video
.
i_h264_profile
,
NULL
,
NULL
);
p_sys
->
psz_name
=
MediaCodec_GetName
(
VLC_OBJECT
(
p_dec
),
p_sys
->
mime
,
p_sys
->
api
->
psz_name
=
MediaCodec_GetName
(
VLC_OBJECT
(
p_dec
),
p_sys
->
u
.
video
.
i_h264_profile
);
p_sys
->
api
->
psz_mime
,
if
(
!
p_sys
->
psz_name
)
p_sys
->
u
.
video
.
i_h264_profile
);
if
(
!
p_sys
->
api
->
psz_name
)
goto
bailout
;
goto
bailout
;
p_sys
->
i_quirks
=
OMXCodec_GetQuirks
(
VIDEO_ES
,
p_sys
->
i_quirks
=
OMXCodec_GetQuirks
(
VIDEO_ES
,
p_dec
->
fmt_in
.
i_codec
,
p_dec
->
fmt_in
.
i_codec
,
p_sys
->
psz_name
,
p_sys
->
api
->
psz_name
,
strlen
(
p_sys
->
psz_name
)
);
strlen
(
p_sys
->
api
->
psz_name
)
);
if
((
p_sys
->
i_quirks
&
OMXCODEC_VIDEO_QUIRKS_NEED_SIZE
)
if
((
p_sys
->
i_quirks
&
OMXCODEC_VIDEO_QUIRKS_NEED_SIZE
)
&&
(
!
p_sys
->
u
.
video
.
i_width
||
!
p_sys
->
u
.
video
.
i_height
))
&&
(
!
p_sys
->
u
.
video
.
i_width
||
!
p_sys
->
u
.
video
.
i_height
))
...
@@ -606,14 +604,15 @@ static int OpenDecoder(vlc_object_t *p_this, pf_MediaCodecApi_init pf_init)
...
@@ -606,14 +604,15 @@ static int OpenDecoder(vlc_object_t *p_this, pf_MediaCodecApi_init pf_init)
p_sys
->
pf_process_output
=
Audio_ProcessOutput
;
p_sys
->
pf_process_output
=
Audio_ProcessOutput
;
p_sys
->
u
.
audio
.
i_channels
=
p_dec
->
fmt_in
.
audio
.
i_channels
;
p_sys
->
u
.
audio
.
i_channels
=
p_dec
->
fmt_in
.
audio
.
i_channels
;
p_sys
->
psz_name
=
MediaCodec_GetName
(
VLC_OBJECT
(
p_dec
),
p_sys
->
mime
,
0
);
p_sys
->
api
->
psz_name
=
MediaCodec_GetName
(
VLC_OBJECT
(
p_dec
),
if
(
!
p_sys
->
psz_name
)
p_sys
->
api
->
psz_mime
,
0
);
if
(
!
p_sys
->
api
->
psz_name
)
goto
bailout
;
goto
bailout
;
p_sys
->
i_quirks
=
OMXCodec_GetQuirks
(
AUDIO_ES
,
p_sys
->
i_quirks
=
OMXCodec_GetQuirks
(
AUDIO_ES
,
p_dec
->
fmt_in
.
i_codec
,
p_dec
->
fmt_in
.
i_codec
,
p_sys
->
psz_name
,
p_sys
->
api
->
psz_name
,
strlen
(
p_sys
->
psz_name
)
);
strlen
(
p_sys
->
api
->
psz_name
)
);
if
((
p_sys
->
i_quirks
&
OMXCODEC_AUDIO_QUIRKS_NEED_CHANNELS
)
if
((
p_sys
->
i_quirks
&
OMXCODEC_AUDIO_QUIRKS_NEED_CHANNELS
)
&&
!
p_sys
->
u
.
audio
.
i_channels
)
&&
!
p_sys
->
u
.
audio
.
i_channels
)
{
{
...
@@ -678,8 +677,8 @@ static void CloseDecoder(vlc_object_t *p_this)
...
@@ -678,8 +677,8 @@ static void CloseDecoder(vlc_object_t *p_this)
if
(
p_sys
->
u
.
video
.
p_awh
)
if
(
p_sys
->
u
.
video
.
p_awh
)
AWindowHandler_destroy
(
p_sys
->
u
.
video
.
p_awh
);
AWindowHandler_destroy
(
p_sys
->
u
.
video
.
p_awh
);
}
}
free
(
p_sys
->
api
->
psz_name
);
free
(
p_sys
->
api
);
free
(
p_sys
->
api
);
free
(
p_sys
->
psz_name
);
free
(
p_sys
);
free
(
p_sys
);
}
}
...
...
modules/codec/omxil/mediacodec.h
View file @
08916947
...
@@ -100,14 +100,16 @@ struct mc_api
...
@@ -100,14 +100,16 @@ struct mc_api
mc_api_sys
*
p_sys
;
mc_api_sys
*
p_sys
;
char
*
psz_name
;
const
char
*
psz_mime
;
bool
b_started
;
bool
b_started
;
bool
b_video
;
bool
b_video
;
bool
b_direct_rendering
;
bool
b_direct_rendering
;
bool
b_support_interlaced
;
bool
b_support_interlaced
;
void
(
*
clean
)(
mc_api
*
);
void
(
*
clean
)(
mc_api
*
);
int
(
*
start
)(
mc_api
*
,
const
char
*
psz_name
,
const
char
*
psz_mime
,
int
(
*
start
)(
mc_api
*
,
union
mc_api_args
*
p_args
);
union
mc_api_args
*
p_args
);
int
(
*
stop
)(
mc_api
*
);
int
(
*
stop
)(
mc_api
*
);
int
(
*
flush
)(
mc_api
*
);
int
(
*
flush
)(
mc_api
*
);
...
...
modules/codec/omxil/mediacodec_jni.c
View file @
08916947
...
@@ -467,8 +467,7 @@ static int Stop(mc_api *api)
...
@@ -467,8 +467,7 @@ static int Stop(mc_api *api)
/*****************************************************************************
/*****************************************************************************
* Start
* Start
*****************************************************************************/
*****************************************************************************/
static
int
Start
(
mc_api
*
api
,
const
char
*
psz_name
,
const
char
*
psz_mime
,
static
int
Start
(
mc_api
*
api
,
union
mc_api_args
*
p_args
)
union
mc_api_args
*
p_args
)
{
{
mc_api_sys
*
p_sys
=
api
->
p_sys
;
mc_api_sys
*
p_sys
=
api
->
p_sys
;
JNIEnv
*
env
=
NULL
;
JNIEnv
*
env
=
NULL
;
...
@@ -487,8 +486,8 @@ static int Start(mc_api *api, const char *psz_name, const char *psz_mime,
...
@@ -487,8 +486,8 @@ static int Start(mc_api *api, const char *psz_name, const char *psz_mime,
GET_ENV
();
GET_ENV
();
jmime
=
(
*
env
)
->
NewStringUTF
(
env
,
psz_mime
);
jmime
=
(
*
env
)
->
NewStringUTF
(
env
,
api
->
psz_mime
);
jcodec_name
=
(
*
env
)
->
NewStringUTF
(
env
,
psz_name
);
jcodec_name
=
(
*
env
)
->
NewStringUTF
(
env
,
api
->
psz_name
);
if
(
!
jmime
||
!
jcodec_name
)
if
(
!
jmime
||
!
jcodec_name
)
goto
error
;
goto
error
;
...
...
modules/codec/omxil/mediacodec_ndk.c
View file @
08916947
...
@@ -297,17 +297,17 @@ static int Stop(mc_api *api)
...
@@ -297,17 +297,17 @@ static int Stop(mc_api *api)
/*****************************************************************************
/*****************************************************************************
* Start
* Start
*****************************************************************************/
*****************************************************************************/
static
int
Start
(
mc_api
*
api
,
const
char
*
psz_name
,
const
char
*
psz_mime
,
static
int
Start
(
mc_api
*
api
,
union
mc_api_args
*
p_args
)
union
mc_api_args
*
p_args
)
{
{
mc_api_sys
*
p_sys
=
api
->
p_sys
;
mc_api_sys
*
p_sys
=
api
->
p_sys
;
int
i_ret
=
MC_API_ERROR
;
int
i_ret
=
MC_API_ERROR
;
ANativeWindow
*
p_anw
=
NULL
;
ANativeWindow
*
p_anw
=
NULL
;
p_sys
->
p_codec
=
syms
.
AMediaCodec
.
createCodecByName
(
psz_name
);
p_sys
->
p_codec
=
syms
.
AMediaCodec
.
createCodecByName
(
api
->
psz_name
);
if
(
!
p_sys
->
p_codec
)
if
(
!
p_sys
->
p_codec
)
{
{
msg_Err
(
api
->
p_obj
,
"AMediaCodec.createCodecByName for %s failed"
,
psz_name
);
msg_Err
(
api
->
p_obj
,
"AMediaCodec.createCodecByName for %s failed"
,
api
->
psz_name
);
goto
error
;
goto
error
;
}
}
...
@@ -319,7 +319,7 @@ static int Start(mc_api *api, const char *psz_name, const char *psz_mime,
...
@@ -319,7 +319,7 @@ static int Start(mc_api *api, const char *psz_name, const char *psz_mime,
}
}
syms
.
AMediaFormat
.
setInt32
(
p_sys
->
p_format
,
"encoder"
,
0
);
syms
.
AMediaFormat
.
setInt32
(
p_sys
->
p_format
,
"encoder"
,
0
);
syms
.
AMediaFormat
.
setString
(
p_sys
->
p_format
,
"mime"
,
psz_mime
);
syms
.
AMediaFormat
.
setString
(
p_sys
->
p_format
,
"mime"
,
api
->
psz_mime
);
/* No limits for input size */
/* No limits for input size */
syms
.
AMediaFormat
.
setInt32
(
p_sys
->
p_format
,
"max-input-size"
,
0
);
syms
.
AMediaFormat
.
setInt32
(
p_sys
->
p_format
,
"max-input-size"
,
0
);
if
(
api
->
b_video
)
if
(
api
->
b_video
)
...
...
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