Skip to content

Commit 70bc11b

Browse files
Exercise raw relay negotiation
Ultraworked with [omo](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: sisyphus-dev-ai <sisyphus-dev-ai@users.noreply.github.com>
1 parent ccb0aa7 commit 70bc11b

1 file changed

Lines changed: 20 additions & 0 deletions

File tree

internal/airplay/capture_test.go

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package airplay
22

33
import (
4+
"bytes"
45
"context"
56
"errors"
67
"os"
@@ -14,6 +15,25 @@ import (
1415
"github.com/godbus/dbus/v5"
1516
)
1617

18+
func TestRawVideoRelayCapsNegotiateWithInstalledParser(t *testing.T) {
19+
if _, err := exec.LookPath("gst-launch-1.0"); err != nil {
20+
t.Skip("gst-launch-1.0 is unavailable")
21+
}
22+
const width, height = 4, 2
23+
args := []string{
24+
"--quiet",
25+
"fdsrc", "fd=0",
26+
"!", "video/x-raw,format=NV12,width=4,height=2,framerate=30/1",
27+
"!", "rawvideoparse", "use-sink-caps=true",
28+
"!", "fakesink",
29+
}
30+
cmd := exec.Command("gst-launch-1.0", args...)
31+
cmd.Stdin = bytes.NewReader(make([]byte, width*height*3/2))
32+
if output, err := cmd.CombinedOutput(); err != nil {
33+
t.Fatalf("raw relay caps failed real GStreamer negotiation: %v\n%s", err, output)
34+
}
35+
}
36+
1737
func TestWaylandEncoderStartFailureClosesEveryPipeDescriptor(t *testing.T) {
1838
before := openDescriptorCount(t)
1939
for i := 0; i < 20; i++ {

0 commit comments

Comments
 (0)