mirror of
https://github.com/aler9/gortsplib
synced 2025-10-08 16:40:09 +08:00
fix gstreamer tests
This commit is contained in:
@@ -294,11 +294,13 @@ func TestServerPublishReadTCP(t *testing.T) {
|
||||
|
||||
case "gstreamer":
|
||||
cnt1, err := newContainer("gstreamer", "publish", []string{
|
||||
"filesrc location=emptyvideo.ts ! tsdemux ! queue ! video/x-h264 ! h264parse config-interval=1 ! rtspclientsink " +
|
||||
"filesrc location=emptyvideo.ts ! tsdemux ! video/x-h264 ! rtspclientsink " +
|
||||
"location=" + proto + "://127.0.0.1:8554/teststream protocols=tcp tls-validation-flags=0 latency=0 timeout=0 rtx-time=0",
|
||||
})
|
||||
require.NoError(t, err)
|
||||
defer cnt1.close()
|
||||
|
||||
time.Sleep(1 * time.Second)
|
||||
}
|
||||
|
||||
time.Sleep(1 * time.Second)
|
||||
|
@@ -195,6 +195,15 @@ func (sc *ServerConn) backgroundRead(handlers ServerConnReadHandlers, done chan
|
||||
}, fmt.Errorf("transport header: %s", err)
|
||||
}
|
||||
|
||||
// workaround to prevent a bug in rtspclientsink
|
||||
// that makes impossible for the client to receive the response
|
||||
// and send frames.
|
||||
// this was causing problems during unit tests.
|
||||
if ua, ok := req.Header["User-Agent"]; ok && len(ua) == 1 &&
|
||||
strings.HasPrefix(ua[0], "GStreamer") {
|
||||
time.Sleep(1 * time.Second)
|
||||
}
|
||||
|
||||
return handlers.OnSetup(req, th)
|
||||
}
|
||||
|
||||
|
@@ -1,5 +1,5 @@
|
||||
######################################
|
||||
FROM ubuntu:20.04 AS exitafterframe
|
||||
FROM ubuntu:20.04 AS build
|
||||
|
||||
RUN apt update && apt install -y --no-install-recommends \
|
||||
pkg-config \
|
||||
@@ -36,7 +36,7 @@ RUN apt update && apt install -y --no-install-recommends \
|
||||
gstreamer1.0-libav \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
COPY --from=exitafterframe /usr/lib/x86_64-linux-gnu/gstreamer-1.0/libexitafterframe.so /usr/lib/x86_64-linux-gnu/gstreamer-1.0/
|
||||
COPY --from=build /usr/lib/x86_64-linux-gnu/gstreamer-1.0/libexitafterframe.so /usr/lib/x86_64-linux-gnu/gstreamer-1.0/
|
||||
|
||||
COPY emptyvideo.ts /
|
||||
|
||||
|
Reference in New Issue
Block a user