From 4fb268faadcaf22bca53f9ca3f23b1947da6ab29 Mon Sep 17 00:00:00 2001 From: ma3315865 Date: Tue, 17 Dec 2024 18:47:50 +0800 Subject: [PATCH] delete PmtVersion() --- program.go | 20 ++++++++++++++++++++ program_test.go | 4 ++++ 2 files changed, 24 insertions(+) diff --git a/program.go b/program.go index bf9fd70..60b3dcc 100644 --- a/program.go +++ b/program.go @@ -95,6 +95,26 @@ func (p *Program) SetProgramNumber(n int) { p.c.program_num = C.int(n) } +// https://ffmpeg.org/doxygen/7.0/structAVProgram.html#a02011963a63c291c6dc6d4eefa56cd69 +func (p *Program) PmtPid() int { + return int(p.c.pmt_pid) +} + +// https://ffmpeg.org/doxygen/7.0/structAVProgram.html#a02011963a63c291c6dc6d4eefa56cd69 +func (p *Program) SetPmtPid(n int) { + p.c.pmt_pid = C.int(n) +} + +// https://ffmpeg.org/doxygen/7.0/structAVProgram.html#a7e026323df87e84a72ec5e5c8ce341a5 +func (p *Program) PcrPid() int { + return int(p.c.pcr_pid) +} + +// https://ffmpeg.org/doxygen/7.0/structAVProgram.html#a7e026323df87e84a72ec5e5c8ce341a5 +func (p *Program) SetPcrPid(n int) { + p.c.pcr_pid = C.int(n) +} + // https://ffmpeg.org/doxygen/7.0/structAVProgram.html#a2276db4d51695120664d527f20b7c532 func (p *Program) StartTime() int64 { return int64(p.c.start_time) diff --git a/program_test.go b/program_test.go index d62c051..50a604d 100644 --- a/program_test.go +++ b/program_test.go @@ -23,6 +23,10 @@ func TestProgram(t *testing.T) { require.Equal(t, p.Metadata().Get("service_name", nil, 0).Value(), "test_service_name") p.SetProgramNumber(101) require.Equal(t, 101, p.ProgramNumber()) + p.SetPmtPid(201) + require.Equal(t, 201, p.PmtPid()) + p.SetPcrPid(301) + require.Equal(t, 301, p.PcrPid()) require.Equal(t, p.StartTime(), int64(-9223372036854775808)) require.Equal(t, p.EndTime(), int64(-9223372036854775808)) require.Equal(t, p.PtsWrapReference(), int64(-9223372036854775808))