This commit is contained in:
Ingo Oppermann
2025-01-06 16:05:25 +01:00
parent 25a332d783
commit 591eaffbed
3 changed files with 54 additions and 3 deletions

View File

@@ -92,7 +92,7 @@ func parseFramebufferDevice(data *bytes.Buffer) string {
format.roffset = parseFramebufferDeviceOffset(matches[1])
format.goffset = parseFramebufferDeviceOffset(matches[2])
format.boffset = parseFramebufferDeviceOffset(matches[3])
format.aoffset = parseFramebufferDeviceOffset(matches[4])
//format.aoffset = parseFramebufferDeviceOffset(matches[4])
}
}

View File

@@ -286,7 +286,7 @@ func formats(binary string) ffFormats {
func parseFormats(data []byte) ffFormats {
formats := ffFormats{}
re := regexp.MustCompile(`^\s([D ])([E ]) ([0-9A-Za-z_,]+)\s+(.*?)$`)
re := regexp.MustCompile(`^\s([D ])([E ])\s+([0-9A-Za-z_,]+)\s+(.*?)$`)
scanner := bufio.NewScanner(bytes.NewReader(data))
scanner.Split(bufio.ScanLines)

View File

@@ -345,7 +345,7 @@ func TestCodecs(t *testing.T) {
}, c)
}
func TestFormats(t *testing.T) {
func TestFormatsPre7(t *testing.T) {
data := ` DE mpeg MPEG-1 Systems / MPEG program stream
E mpeg1video raw MPEG-1 video
E mpeg2video raw MPEG-2 video
@@ -395,6 +395,57 @@ func TestFormats(t *testing.T) {
}, f)
}
func TestFormats(t *testing.T) {
data := ` DE mpeg MPEG-1 Systems / MPEG program stream
E mpeg1video raw MPEG-1 video
E mpeg2video raw MPEG-2 video
DE mpegts MPEG-TS (MPEG-2 Transport Stream)
D mpegtsraw raw MPEG-TS (MPEG-2 Transport Stream)
D mpegvideo raw MPEG video
D d x11grab X11 screen capture, using XCB`
f := parseFormats([]byte(data))
require.Equal(t, ffFormats{
Demuxers: []Format{
{
Id: "mpeg",
Name: "MPEG-1 Systems / MPEG program stream",
},
{
Id: "mpegts",
Name: "MPEG-TS (MPEG-2 Transport Stream)",
},
{
Id: "mpegtsraw",
Name: "raw MPEG-TS (MPEG-2 Transport Stream)",
},
{
Id: "mpegvideo",
Name: "raw MPEG video",
},
},
Muxers: []Format{
{
Id: "mpeg",
Name: "MPEG-1 Systems / MPEG program stream",
},
{
Id: "mpeg1video",
Name: "raw MPEG-1 video",
},
{
Id: "mpeg2video",
Name: "raw MPEG-2 video",
},
{
Id: "mpegts",
Name: "MPEG-TS (MPEG-2 Transport Stream)",
},
},
}, f)
}
func TestProtocols(t *testing.T) {
data := `Input:
async