Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gst-plugins-base
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
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
Seungha Yang
gst-plugins-base
Commits
d0c36826
Commit
d0c36826
authored
Apr 14, 2009
by
Olivier Crete
Committed by
Wim Taymans
Apr 14, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
theoraenc: factor out keyframe forcing
See #578656
parent
9f23b82b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
13 deletions
+17
-13
ext/theora/theoraenc.c
ext/theora/theoraenc.c
+17
-13
No files found.
ext/theora/theoraenc.c
View file @
d0c36826
...
...
@@ -590,6 +590,21 @@ theora_enc_get_ogg_packet_end_time (GstTheoraEnc * enc, ogg_packet * op)
return
theora_granule_time
(
&
enc
->
state
,
end_granule
)
*
GST_SECOND
;
}
static
void
theora_enc_force_keyframe
(
GstTheoraEnc
*
enc
)
{
GstClockTime
next_ts
;
/* make sure timestamps increment after resetting the decoder */
next_ts
=
enc
->
next_ts
+
enc
->
timestamp_offset
;
theora_enc_reset
(
enc
);
enc
->
granulepos_offset
=
gst_util_uint64_scale
(
next_ts
,
enc
->
fps_n
,
GST_SECOND
*
enc
->
fps_d
);
enc
->
timestamp_offset
=
next_ts
;
enc
->
next_ts
=
0
;
}
static
gboolean
theora_enc_sink_event
(
GstPad
*
pad
,
GstEvent
*
event
)
{
...
...
@@ -640,19 +655,8 @@ theora_enc_sink_event (GstPad * pad, GstEvent * event)
s
=
gst_event_get_structure
(
event
);
if
(
gst_structure_has_name
(
s
,
"GstForceKeyUnit"
))
{
GstClockTime
next_ts
;
/* make sure timestamps increment after resetting the decoder */
next_ts
=
enc
->
next_ts
+
enc
->
timestamp_offset
;
theora_enc_reset
(
enc
);
enc
->
granulepos_offset
=
gst_util_uint64_scale
(
next_ts
,
enc
->
fps_n
,
GST_SECOND
*
enc
->
fps_d
);
enc
->
timestamp_offset
=
next_ts
;
enc
->
next_ts
=
0
;
}
if
(
gst_structure_has_name
(
s
,
"GstForceKeyUnit"
))
theora_enc_force_keyframe
(
enc
);
res
=
gst_pad_push_event
(
enc
->
srcpad
,
event
);
break
;
}
...
...
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