Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
VLC
Manage
Activity
Members
Labels
Plan
Issues
4k
Issue boards
Milestones
Code
Merge requests
450
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Analyze
Contributor analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
VideoLAN
VLC
Commits
bd2be7d8
Commit
bd2be7d8
authored
2 years ago
by
Tristan Matthews
Committed by
François Cartegnie
2 years ago
Browse files
Options
Downloads
Patches
Plain Diff
codec: rav1e: use opaque pointer for storing pts
parent
4f9b8695
No related branches found
Branches containing commit
No related tags found
1 merge request
!3126
codec: rav1e: use opaque pointer for storing pts
Pipeline
#305508
passed with stage
Stage:
in 12 minutes and 51 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
modules/codec/rav1e.c
+20
-13
20 additions, 13 deletions
modules/codec/rav1e.c
with
20 additions
and
13 deletions
modules/codec/rav1e.c
+
20
−
13
View file @
bd2be7d8
...
...
@@ -32,11 +32,14 @@
#define SOUT_CFG_PREFIX "sout-rav1e-"
struct
frame_priv_s
{
vlc_tick_t
pts
;
};
typedef
struct
{
struct
RaContext
*
ra_context
;
date_t
date
;
bool
date_set
;
}
encoder_sys_t
;
static
block_t
*
Encode
(
encoder_t
*
enc
,
picture_t
*
p_pict
)
...
...
@@ -46,13 +49,14 @@ static block_t *Encode(encoder_t *enc, picture_t *p_pict)
block_t
*
p_out
=
NULL
;
RaFrame
*
frame
;
struct
frame_priv_s
*
frame_priv
=
NULL
;
if
(
p_pict
!=
NULL
)
{
if
(
!
sys
->
date_set
&&
p_pict
->
date
!=
VLC_TICK_INVALID
)
{
date_Set
(
&
sys
->
date
,
p_pict
->
date
)
;
sys
->
date_set
=
true
;
}
frame_priv
=
malloc
(
sizeof
(
*
frame_priv
));
if
(
!
frame_priv
)
goto
error
;
frame_priv
->
pts
=
p_pict
->
date
;
frame
=
rav1e_frame_new
(
ctx
);
if
(
frame
==
NULL
)
{
...
...
@@ -60,12 +64,14 @@ static block_t *Encode(encoder_t *enc, picture_t *p_pict)
goto
error
;
}
for
(
int
idx
=
0
;
idx
<
p_pict
->
i_planes
;
idx
++
)
for
(
int
idx
=
0
;
idx
<
p_pict
->
i_planes
;
idx
++
)
{
rav1e_frame_fill_plane
(
frame
,
idx
,
p_pict
->
p
[
idx
].
p_pixels
,
p_pict
->
p
[
idx
].
i_pitch
*
p_pict
->
p
[
idx
].
i_visible_lines
,
p_pict
->
p
[
idx
].
i_pitch
,
p_pict
->
p
[
idx
].
i_pixel_pitch
);
}
rav1e_frame_set_opaque
(
frame
,
frame_priv
,
free
);
}
else
frame
=
NULL
;
/* Drain with a NULL frame */
...
...
@@ -98,7 +104,11 @@ static block_t *Encode(encoder_t *enc, picture_t *p_pict)
}
memcpy
(
p_block
->
p_buffer
,
pkt
->
data
,
pkt
->
len
);
p_block
->
i_dts
=
p_block
->
i_pts
=
date_Get
(
&
sys
->
date
);
/* Reordered frames are always muxed together in the same packet with the
next visible frame, and visible frames always come out in order. Therefore
dts and pts will always be equal for any given packet. */
p_block
->
i_dts
=
p_block
->
i_pts
=
((
struct
frame_priv_s
*
)
pkt
->
opaque
)
->
pts
;
free
(
pkt
->
opaque
);
if
(
pkt
->
frame_type
==
RA_FRAME_TYPE_KEY
)
p_block
->
i_flags
|=
BLOCK_FLAG_TYPE_I
;
...
...
@@ -123,6 +133,7 @@ static block_t *Encode(encoder_t *enc, picture_t *p_pict)
return
p_out
;
error:
free
(
frame_priv
);
free
(
p_out
);
return
NULL
;
}
...
...
@@ -265,10 +276,6 @@ static int OpenEncoder(vlc_object_t *this)
}
rav1e_config_unref
(
ra_config
);
date_Init
(
&
sys
->
date
,
enc
->
fmt_out
.
video
.
i_frame_rate
,
enc
->
fmt_out
.
video
.
i_frame_rate_base
);
sys
->
date_set
=
false
;
static
const
struct
vlc_encoder_operations
ops
=
{
.
close
=
CloseEncoder
,
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment