Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
gstlal
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Duncan Macleod
gstlal
Commits
40a13a8e
Commit
40a13a8e
authored
5 years ago
by
Cody Messick
Browse files
Options
Downloads
Patches
Plain Diff
itacac: Simplified "waiting" logic, removed waiting member from
GSTLALItacac struct (GSTLALItacacPad still has a waiting member)
parent
161aa5a2
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
gstlal-inspiral/gst/lal/gstlal_itacac.c
+21
-47
21 additions, 47 deletions
gstlal-inspiral/gst/lal/gstlal_itacac.c
gstlal-inspiral/gst/lal/gstlal_itacac.h
+0
-1
0 additions, 1 deletion
gstlal-inspiral/gst/lal/gstlal_itacac.h
with
21 additions
and
48 deletions
gstlal-inspiral/gst/lal/gstlal_itacac.c
+
21
−
47
View file @
40a13a8e
...
...
@@ -1195,63 +1195,38 @@ static GstFlowReturn aggregate(GstAggregator *aggregator, gboolean timeout)
}
if
(
itacac
->
waiting
)
{
// Check if timestamps of all sinkpads are the same, if not,
// take the earliest timestamp as the next output timestamp and
// start processing samples from sinkpads that have that
// timestamp
// Find earliest timestamp between all of the pads if we don't have the
// first output timestamp, which means itacac hasn't pushed any buffers yet
if
(
itacac
->
next_output_timestamp
==
GST_CLOCK_TIME_NONE
)
{
for
(
padlist
=
GST_ELEMENT
(
aggregator
)
->
sinkpads
;
padlist
!=
NULL
;
padlist
=
padlist
->
next
)
{
GSTLALItacacPad
*
itacacpad
=
GSTLAL_ITACAC_PAD
(
padlist
->
data
);
if
(
gst_audioadapter_available_samples
(
itacacpad
->
adapter
)
==
0
)
continue
;
if
(
padlist
==
GST_ELEMENT
(
aggregator
)
->
sinkpads
)
itacac
->
next_output_timestamp
=
itacacpad
->
initial_timestamp
;
else
itacac
->
next_output_timestamp
=
itacac
->
next_output_timestamp
<=
itacacpad
->
initial_timestamp
?
itacac
->
next_output_timestamp
:
itacacpad
->
initial_timestamp
;
}
if
(
itacac
->
next_output_timestamp
!=
GST_CLOCK_TIME_NONE
)
{
for
(
padlist
=
GST_ELEMENT
(
aggregator
)
->
sinkpads
;
padlist
!=
NULL
;
padlist
=
padlist
->
next
)
{
GSTLALItacacPad
*
itacacpad
=
GSTLAL_ITACAC_PAD
(
padlist
->
data
);
if
(
itacacpad
->
initial_timestamp
==
itacac
->
next_output_timestamp
&&
gst_audioadapter_available_samples
(
itacacpad
->
adapter
)
>
0
)
{
itacacpad
->
waiting
=
FALSE
;
if
(
itacac
->
waiting
)
itacac
->
waiting
=
FALSE
;
}
}
if
(
!
itacac
->
waiting
)
result
=
process
(
itacac
);
itacac
->
next_output_timestamp
=
itacac
->
next_output_timestamp
==
GST_CLOCK_TIME_NONE
?
itacacpad
->
initial_timestamp
:
itacac
->
next_output_timestamp
<=
itacacpad
->
initial_timestamp
?
itacac
->
next_output_timestamp
:
itacacpad
->
initial_timestamp
;
}
}
}
else
{
if
(
itacac
->
next_output_timestamp
==
GST_CLOCK_TIME_NONE
)
{
for
(
padlist
=
GST_ELEMENT
(
aggregator
)
->
sinkpads
;
padlist
!=
NULL
;
padlist
=
padlist
->
next
)
{
GSTLALItacacPad
*
itacacpad
=
GSTLAL_ITACAC_PAD
(
padlist
->
data
);
if
(
padlist
==
GST_ELEMENT
(
aggregator
)
->
sinkpads
)
itacac
->
next_output_timestamp
=
itacacpad
->
initial_timestamp
;
else
itacac
->
next_output_timestamp
=
itacac
->
next_output_timestamp
<=
itacacpad
->
initial_timestamp
?
itacac
->
next_output_timestamp
:
itacacpad
->
initial_timestamp
;
}
}
// Figure out if we can start taking data from each pad that is still waiting
for
(
padlist
=
GST_ELEMENT
(
aggregator
)
->
sinkpads
;
padlist
!=
NULL
;
padlist
=
padlist
->
next
)
{
GSTLALItacacPad
*
itacacpad
=
GSTLAL_ITACAC_PAD
(
padlist
->
data
);
if
(
!
itacacpad
->
waiting
||
itacacpad
->
initial_timestamp
>
itacac
->
next_output_timestamp
)
continue
;
// Determine if we can start taking data from each pad that is still waiting (if any)
for
(
padlist
=
GST_ELEMENT
(
aggregator
)
->
sinkpads
;
padlist
!=
NULL
;
padlist
=
padlist
->
next
)
{
if
(
itacac
->
next_output_timestamp
==
GST_CLOCK_TIME_NONE
)
// We're at the beginning and don't have any data yet (for reaons I don't understand, itacac receives empty buffers at start up)
return
result
;
// FIXME Assumes n is the same for all detectors
guint
num_samples_behind
=
(
guint
)
((
itacac
->
next_output_timestamp
-
itacacpad
->
initial_timestamp
)
/
(
1000000000
/
itacac
->
rate
));
if
(
num_samples_behind
>
itacacpad
->
maxdata
->
pad
)
gst_audioadapter_flush_samples
(
itacacpad
->
adapter
,
MIN
(
num_samples_behind
-
itacacpad
->
maxdata
->
pad
,
gst_audioadapter_available_samples
(
itacacpad
->
adapter
)));
itacacpad
->
samples_available_for_padding
=
num_samples_behind
>
itacacpad
->
maxdata
->
pad
?
itacacpad
->
maxdata
->
pad
:
num_samples_behind
;
GSTLALItacacPad
*
itacacpad
=
GSTLAL_ITACAC_PAD
(
padlist
->
data
);
if
(
!
itacacpad
->
waiting
||
itacacpad
->
initial_timestamp
>
itacac
->
next_output_timestamp
)
continue
;
itacacpad
->
waiting
=
FALSE
;
}
// FIXME Assumes n is the same for all detectors
guint
num_samples_behind
=
(
guint
)
((
itacac
->
next_output_timestamp
-
itacacpad
->
initial_timestamp
)
/
(
1000000000
/
itacac
->
rate
));
if
(
num_samples_behind
>
itacacpad
->
maxdata
->
pad
)
gst_audioadapter_flush_samples
(
itacacpad
->
adapter
,
MIN
(
num_samples_behind
-
itacacpad
->
maxdata
->
pad
,
gst_audioadapter_available_samples
(
itacacpad
->
adapter
)));
itacacpad
->
samples_available_for_padding
=
num_samples_behind
>
itacacpad
->
maxdata
->
pad
?
itacacpad
->
maxdata
->
pad
:
num_samples_behind
;
result
=
process
(
itacac
)
;
itacacpad
->
waiting
=
FALSE
;
}
result
=
process
(
itacac
);
return
result
;
}
...
...
@@ -1545,7 +1520,6 @@ static void gstlal_itacac_init(GSTLALItacac *itacac)
reset_time_and_offset
(
itacac
);
itacac
->
EOS
=
FALSE
;
itacac
->
waiting
=
TRUE
;
itacac
->
H1_itacacpad
=
NULL
;
itacac
->
K1_itacacpad
=
NULL
;
itacac
->
L1_itacacpad
=
NULL
;
...
...
This diff is collapsed.
Click to expand it.
gstlal-inspiral/gst/lal/gstlal_itacac.h
+
0
−
1
View file @
40a13a8e
...
...
@@ -128,7 +128,6 @@ typedef struct {
GstClockTime
next_output_timestamp
;
GstClockTimeDiff
difftime
;
gboolean
EOS
;
gboolean
waiting
;
GSTLALItacacPad
*
H1_itacacpad
,
*
K1_itacacpad
,
*
L1_itacacpad
,
*
V1_itacacpad
;
GMutex
caps_lock
;
...
...
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