Skip to content

Commit 11bcb99

Browse files
authored
ignore common/useless logs (#411)
1 parent 875eef1 commit 11bcb99

File tree

1 file changed

+44
-9
lines changed

1 file changed

+44
-9
lines changed

pkg/pipeline/watch.go

Lines changed: 44 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,19 +19,36 @@ import (
1919
)
2020

2121
const (
22+
// watch errors
2223
msgClockProblem = "GStreamer error: clock problem."
2324
msgStreamingNotNegotiated = "streaming stopped, reason not-negotiated (-4)"
2425
msgMuxer = ":muxer"
25-
msgFragmentOpened = "splitmuxsink-fragment-opened"
26-
msgFragmentClosed = "splitmuxsink-fragment-closed"
27-
msgFirstSampleMetadata = "FirstSampleMetadata"
28-
29-
fragmentLocation = "location"
30-
fragmentRunningTime = "running-time"
3126

3227
elementGstRtmp2Sink = "GstRtmp2Sink"
3328
elementGstAppSrc = "GstAppSrc"
3429
elementSplitMuxSink = "GstSplitMuxSink"
30+
31+
// watch elements
32+
msgFirstSampleMetadata = "FirstSampleMetadata"
33+
msgFragmentOpened = "splitmuxsink-fragment-opened"
34+
msgFragmentClosed = "splitmuxsink-fragment-closed"
35+
36+
fragmentLocation = "location"
37+
fragmentRunningTime = "running-time"
38+
39+
// common gst errors
40+
msgWrongThread = "Called from wrong thread"
41+
42+
// common gst warnings
43+
msgKeyframe = "Could not request a keyframe. Files may not split at the exact location they should"
44+
msgLatencyQuery = "Latency query failed"
45+
msgTaps = "can't find exact taps"
46+
msgInputDisappeared = "Can't copy metadata because input buffer disappeared"
47+
48+
// common gst fixmes
49+
msgStreamStart = "stream-start event without group-id. Consider implementing group-id handling in the upstream elements"
50+
msgCreatingStream = "Creating random stream-id, consider implementing a deterministic way of creating a stream-id"
51+
msgAggregateSubclass = "Subclass should call gst_aggregator_selected_samples() from its aggregate implementation."
3552
)
3653

3754
func (p *Pipeline) gstLog(level gst.DebugLevel, file, function string, line int, obj *glib.Object, message string) {
@@ -40,11 +57,29 @@ func (p *Pipeline) gstLog(level gst.DebugLevel, file, function string, line int,
4057
case gst.LevelNone:
4158
lvl = "none"
4259
case gst.LevelError:
43-
lvl = "error"
60+
switch message {
61+
case msgWrongThread:
62+
// ignore
63+
return
64+
default:
65+
lvl = "error"
66+
}
4467
case gst.LevelWarning:
45-
lvl = "warning"
68+
switch message {
69+
case msgKeyframe, msgLatencyQuery, msgTaps, msgInputDisappeared:
70+
// ignore
71+
return
72+
default:
73+
lvl = "warning"
74+
}
4675
case gst.LevelFixMe:
47-
lvl = "fixme"
76+
switch message {
77+
case msgStreamStart, msgCreatingStream, msgAggregateSubclass:
78+
// ignore
79+
return
80+
default:
81+
lvl = "fixme"
82+
}
4883
case gst.LevelInfo:
4984
lvl = "info"
5085
case gst.LevelDebug:

0 commit comments

Comments
 (0)