Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
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-2-2
Commits
aebbde86
Commit
aebbde86
authored
Dec 16, 2013
by
Rafaël Carré
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
x265: update to API 4
parent
1cd26526
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
19 deletions
+19
-19
configure.ac
configure.ac
+2
-2
modules/codec/x265.c
modules/codec/x265.c
+17
-17
No files found.
configure.ac
View file @
aebbde86
...
@@ -2744,11 +2744,11 @@ AC_ARG_ENABLE(x265,
...
@@ -2744,11 +2744,11 @@ AC_ARG_ENABLE(x265,
AS_IF( [test "${enable_x265}" != "no"],[
AS_IF( [test "${enable_x265}" != "no"],[
AC_PREPROC_IFELSE([AC_LANG_SOURCE([
AC_PREPROC_IFELSE([AC_LANG_SOURCE([
#include <x265.h>
#include <x265.h>
#if X265_BUILD !=
1
#if X265_BUILD !=
4
# error Fail
# error Fail
#endif
#endif
])], [
])], [
AC_CHECK_LIB([x265],[x265_encoder_open_
1
], [
AC_CHECK_LIB([x265],[x265_encoder_open_
4
], [
VLC_ADD_PLUGIN([x265])
VLC_ADD_PLUGIN([x265])
VLC_ADD_LIBS([x265], [-lx265 -lstdc++ -lm -lpthread])
VLC_ADD_LIBS([x265], [-lx265 -lstdc++ -lm -lpthread])
], [
], [
...
...
modules/codec/x265.c
View file @
aebbde86
...
@@ -51,8 +51,8 @@ vlc_module_end ()
...
@@ -51,8 +51,8 @@ vlc_module_end ()
struct
encoder_sys_t
struct
encoder_sys_t
{
{
x265_
t
*
h
;
x265_
encoder
*
h
;
x265_param
_t
param
;
x265_param
param
;
bool
write_headers
;
bool
write_headers
;
...
@@ -68,7 +68,7 @@ struct encoder_sys_t
...
@@ -68,7 +68,7 @@ struct encoder_sys_t
static
block_t
*
Encode
(
encoder_t
*
p_enc
,
picture_t
*
p_pict
)
static
block_t
*
Encode
(
encoder_t
*
p_enc
,
picture_t
*
p_pict
)
{
{
encoder_sys_t
*
p_sys
=
p_enc
->
p_sys
;
encoder_sys_t
*
p_sys
=
p_enc
->
p_sys
;
x265_picture
_t
pic
;
x265_picture
pic
;
x265_picture_init
(
&
p_sys
->
param
,
&
pic
);
x265_picture_init
(
&
p_sys
->
param
,
&
pic
);
...
@@ -86,8 +86,8 @@ static block_t *Encode(encoder_t *p_enc, picture_t *p_pict)
...
@@ -86,8 +86,8 @@ static block_t *Encode(encoder_t *p_enc, picture_t *p_pict)
}
}
}
}
x265_nal
_t
*
nal
;
x265_nal
*
nal
;
in
t
i_nal
=
0
;
uint32_
t
i_nal
=
0
;
x265_encoder_encode
(
p_sys
->
h
,
&
nal
,
&
i_nal
,
x265_encoder_encode
(
p_sys
->
h
,
&
nal
,
&
i_nal
,
likely
(
p_pict
)
?
&
pic
:
NULL
,
&
pic
);
likely
(
p_pict
)
?
&
pic
:
NULL
,
&
pic
);
...
@@ -95,8 +95,8 @@ static block_t *Encode(encoder_t *p_enc, picture_t *p_pict)
...
@@ -95,8 +95,8 @@ static block_t *Encode(encoder_t *p_enc, picture_t *p_pict)
return
NULL
;
return
NULL
;
int
i_out
=
0
;
int
i_out
=
0
;
for
(
in
t
i
=
0
;
i
<
i_nal
;
i
++
)
for
(
uint32_
t
i
=
0
;
i
<
i_nal
;
i
++
)
i_out
+=
nal
[
i
].
i_payload
;
i_out
+=
nal
[
i
].
sizeBytes
;
int
i_extra
=
0
;
int
i_extra
=
0
;
if
(
unlikely
(
p_sys
->
write_headers
))
{
if
(
unlikely
(
p_sys
->
write_headers
))
{
...
@@ -112,7 +112,7 @@ static block_t *Encode(encoder_t *p_enc, picture_t *p_pict)
...
@@ -112,7 +112,7 @@ static block_t *Encode(encoder_t *p_enc, picture_t *p_pict)
memcpy
(
p_block
->
p_buffer
,
p_enc
->
fmt_out
.
p_extra
,
i_extra
);
memcpy
(
p_block
->
p_buffer
,
p_enc
->
fmt_out
.
p_extra
,
i_extra
);
/* all payloads are sequentially laid out in memory */
/* all payloads are sequentially laid out in memory */
memcpy
(
p_block
->
p_buffer
+
i_extra
,
nal
[
0
].
p
_p
ayload
,
i_out
);
memcpy
(
p_block
->
p_buffer
+
i_extra
,
nal
[
0
].
payload
,
i_out
);
/* This isn't really valid for streams with B-frames */
/* This isn't really valid for streams with B-frames */
p_block
->
i_length
=
CLOCK_FREQ
*
p_block
->
i_length
=
CLOCK_FREQ
*
...
@@ -159,7 +159,7 @@ static int Open (vlc_object_t *p_this)
...
@@ -159,7 +159,7 @@ static int Open (vlc_object_t *p_this)
p_enc
->
fmt_in
.
i_codec
=
VLC_CODEC_I420
;
p_enc
->
fmt_in
.
i_codec
=
VLC_CODEC_I420
;
x265_param
_t
*
param
=
&
p_sys
->
param
;
x265_param
*
param
=
&
p_sys
->
param
;
x265_param_default
(
param
);
x265_param_default
(
param
);
param
->
frameNumThreads
=
vlc_GetCPUCount
();
param
->
frameNumThreads
=
vlc_GetCPUCount
();
...
@@ -195,8 +195,8 @@ static int Open (vlc_object_t *p_this)
...
@@ -195,8 +195,8 @@ static int Open (vlc_object_t *p_this)
return
VLC_EGENERIC
;
return
VLC_EGENERIC
;
}
}
x265_nal
_t
*
nal
;
x265_nal
*
nal
;
in
t
i_nal
;
uint32_
t
i_nal
;
if
(
x265_encoder_headers
(
p_sys
->
h
,
&
nal
,
&
i_nal
))
{
if
(
x265_encoder_headers
(
p_sys
->
h
,
&
nal
,
&
i_nal
))
{
msg_Err
(
p_enc
,
"cannot get x265 headers"
);
msg_Err
(
p_enc
,
"cannot get x265 headers"
);
Close
(
VLC_OBJECT
(
p_enc
));
Close
(
VLC_OBJECT
(
p_enc
));
...
@@ -204,8 +204,8 @@ static int Open (vlc_object_t *p_this)
...
@@ -204,8 +204,8 @@ static int Open (vlc_object_t *p_this)
}
}
size_t
i_extra
=
0
;
size_t
i_extra
=
0
;
for
(
in
t
i
=
0
;
i
<
i_nal
;
i
++
)
for
(
uint32_
t
i
=
0
;
i
<
i_nal
;
i
++
)
i_extra
+=
nal
[
i
].
i_payload
;
i_extra
+=
nal
[
i
].
sizeBytes
;
p_enc
->
fmt_out
.
i_extra
=
i_extra
;
p_enc
->
fmt_out
.
i_extra
=
i_extra
;
...
@@ -215,9 +215,9 @@ static int Open (vlc_object_t *p_this)
...
@@ -215,9 +215,9 @@ static int Open (vlc_object_t *p_this)
return
VLC_ENOMEM
;
return
VLC_ENOMEM
;
}
}
for
(
in
t
i
=
0
;
i
<
i_nal
;
i
++
)
{
for
(
uint32_
t
i
=
0
;
i
<
i_nal
;
i
++
)
{
memcpy
(
p_extra
,
nal
[
i
].
p
_payload
,
nal
[
i
].
i_payload
);
memcpy
(
p_extra
,
nal
[
i
].
p
ayload
,
nal
[
i
].
sizeBytes
);
p_extra
+=
nal
[
i
].
i_payload
;
p_extra
+=
nal
[
i
].
sizeBytes
;
}
}
p_sys
->
dts
=
0
;
p_sys
->
dts
=
0
;
...
@@ -236,7 +236,7 @@ static void Close(vlc_object_t *p_this)
...
@@ -236,7 +236,7 @@ static void Close(vlc_object_t *p_this)
encoder_t
*
p_enc
=
(
encoder_t
*
)
p_this
;
encoder_t
*
p_enc
=
(
encoder_t
*
)
p_this
;
encoder_sys_t
*
p_sys
=
p_enc
->
p_sys
;
encoder_sys_t
*
p_sys
=
p_enc
->
p_sys
;
x265_encoder_close
(
p_sys
->
h
,
NULL
);
x265_encoder_close
(
p_sys
->
h
);
free
(
p_sys
);
free
(
p_sys
);
}
}
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