Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
ioppermann committed Jan 6, 2025
1 parent 25a332d commit 591eaff
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 3 deletions.
2 changes: 1 addition & 1 deletion ffmpeg/skills/framebuffer.go
Original file line number Diff line number Diff line change
Expand Up @@ -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])
}
}

Expand Down
2 changes: 1 addition & 1 deletion ffmpeg/skills/skills.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
53 changes: 52 additions & 1 deletion ffmpeg/skills/skills_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 591eaff

Please sign in to comment.