Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Frame.Copy(dst *Frame) #127

Merged
merged 45 commits into from
Jan 7, 2025
Merged
Show file tree
Hide file tree
Changes from 43 commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
ce9d0b5
OpenIOContextWithDictionary
oldma3095 Dec 10, 2024
7aed9ec
OpenIOContext
oldma3095 Dec 11, 2024
314f10a
Merge branch 'asticode:master' into master
oldma3095 Dec 11, 2024
27d143e
OpenIOContext
oldma3095 Dec 11, 2024
12d7b00
Merge branch 'asticode:master' into master
oldma3095 Dec 12, 2024
e4f6abc
IOInterrupterCB
oldma3095 Dec 12, 2024
7bf889d
Merge remote-tracking branch 'origin/master'
oldma3095 Dec 12, 2024
a3c8b86
OpenIOContext(filename string, flags IOContextFlags, ii *IOInterrupte…
oldma3095 Dec 12, 2024
37d482b
Merge branch 'asticode:master' into master
oldma3095 Dec 13, 2024
9894cd7
Program and Discard
oldma3095 Dec 13, 2024
385462d
Program and Discard
oldma3095 Dec 13, 2024
e80f3cc
Program and Discard
oldma3095 Dec 13, 2024
ffb44b5
Program and Discard
oldma3095 Dec 13, 2024
64a05c0
Program and Discard
oldma3095 Dec 14, 2024
213eb46
Program and Discard
oldma3095 Dec 14, 2024
a24d493
CodecContext
oldma3095 Dec 16, 2024
6750680
another pr
oldma3095 Dec 17, 2024
5bcf207
delete Flags()
oldma3095 Dec 17, 2024
cf06f77
delete Flags()
oldma3095 Dec 17, 2024
c0e22af
delete Flags()
oldma3095 Dec 17, 2024
4fb268f
delete PmtVersion()
oldma3095 Dec 17, 2024
13bb060
SetStreamIndex
oldma3095 Dec 18, 2024
dec5570
SetStreamIndex
oldma3095 Dec 18, 2024
08409f4
Merge remote-tracking branch 'origin/master'
oldma3095 Dec 18, 2024
a27bb0f
MaxBFrames()
oldma3095 Dec 18, 2024
eb4cba6
rename rate control methods
oldma3095 Dec 19, 2024
882e8d8
test passed
oldma3095 Dec 19, 2024
0b0a9f0
Merge branch 'asticode:master' into master
oldma3095 Dec 20, 2024
843ae8d
Merge branch 'asticode:master' into master
oldma3095 Dec 20, 2024
b46e692
Merge branch 'asticode:master' into master
oldma3095 Dec 23, 2024
2b1c488
bufferSrcCtx initialize with dictionary
oldma3095 Dec 23, 2024
a5aeb81
bufferSrcCtx initialize with dictionary
oldma3095 Dec 23, 2024
f827411
SetHardwareDeviceContext
oldma3095 Dec 23, 2024
5271cbc
SetHardwareDeviceContext
oldma3095 Dec 23, 2024
6359aba
Merge remote-tracking branch 'origin/master'
oldma3095 Dec 23, 2024
144ff0b
FilterGraph.NbFilters()
oldma3095 Dec 23, 2024
9a24afc
filter_graph_test
oldma3095 Dec 24, 2024
1540ebf
Merge remote-tracking branch 'origin/master'
oldma3095 Dec 24, 2024
876caa5
FilterGraph.Dump
oldma3095 Dec 24, 2024
3e0bc8f
FilterGraph.Dump
oldma3095 Dec 24, 2024
3304eea
remove FilterGraph.Dump
oldma3095 Dec 24, 2024
cb8eb0b
Merge branch 'asticode:master' into master
oldma3095 Jan 3, 2025
ff1f7c8
Frame.Copy(dst *Frame)
oldma3095 Jan 6, 2025
0d6736f
test fail
oldma3095 Jan 7, 2025
882509f
frame.Copy test pass
oldma3095 Jan 7, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions frame.go
Original file line number Diff line number Diff line change
Expand Up @@ -312,3 +312,8 @@ func (f *Frame) IsWritable() bool {
func (f *Frame) MakeWritable() error {
return newError(C.av_frame_make_writable(f.c))
}

// https://ffmpeg.org/doxygen/7.0/group__lavu__frame.html#gaec4e92f6e1e75ffaf76e07586fb0c9ed
func (f *Frame) Copy(dst *Frame) error {
return newError(C.av_frame_copy(dst.c, f.c))
}
10 changes: 9 additions & 1 deletion frame_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,19 @@ func TestFrame(t *testing.T) {
defer f3.Free()
require.Equal(t, 180, f3.Height())

f33 := f3.Clone()
oldma3095 marked this conversation as resolved.
Show resolved Hide resolved
err = f3.Copy(f33)
require.NoError(t, err)
defer f33.Free()

err = f2.AllocBuffer(0)
require.NoError(t, err)
err = f3.Ref(f2)
require.NoError(t, err)
require.Equal(t, 2, f3.Height())
oldma3095 marked this conversation as resolved.
Show resolved Hide resolved
require.Contains(t, [][8]int{
oldma3095 marked this conversation as resolved.
Show resolved Hide resolved
{384, 192, 192, 0, 0, 0, 0, 0},
{320, 160, 160, 0, 0, 0, 0, 0},
}, f33.Linesize())

f3.MoveRef(f1)
require.Equal(t, 180, f3.Height())
Expand Down
Loading