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

bufferSrcCtx.Initialize with dictionary #124

Merged
merged 34 commits into from
Dec 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 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
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
8 changes: 6 additions & 2 deletions buffersrc_filter_context.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,12 @@ func (bfc *BuffersrcFilterContext) FilterContext() *FilterContext {
}

// https://ffmpeg.org/doxygen/7.0/group__lavfi.html#ga8c15af28902395399fe455f6f8236848
func (bfc *BuffersrcFilterContext) Initialize() error {
return newError(C.avfilter_init_dict(bfc.fc.c, nil))
func (bfc *BuffersrcFilterContext) Initialize(d *Dictionary) error {
var dc **C.AVDictionary
if d != nil {
dc = &d.c
}
return newError(C.avfilter_init_dict(bfc.fc.c, dc))
}

// https://ffmpeg.org/doxygen/7.0/group__lavfi__buffersrc.html#ga398cd2a84f8b4a588197ab9d90135048
Expand Down
16 changes: 16 additions & 0 deletions buffersrc_filter_context_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package astiav

import (
"github.com/stretchr/testify/require"
"testing"
)

func TestBuffersrcFilterContext(t *testing.T) {
fg := AllocFilterGraph()
filter := FindFilterByName("movie")
bufferSrcCtx, err := fg.NewBuffersrcFilterContext(filter, "movie")
require.NoError(t, err)
d := NewDictionary()
require.NoError(t, d.Set("filename", "testdata/video.mp4", 0))
require.NoError(t, bufferSrcCtx.Initialize(d))
}
2 changes: 1 addition & 1 deletion examples/filtering/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ func initFilter() (err error) {
}

// Initialize buffersrc context
if err = s.buffersrcContext.Initialize(); err != nil {
if err = s.buffersrcContext.Initialize(nil); err != nil {
err = fmt.Errorf("main: initializing buffersrc context failed: %w", err)
return
}
Expand Down
2 changes: 1 addition & 1 deletion examples/hardware_decoding_filtering/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ func initFilter() (err error) {
}

// Initialize buffersrc context
if err = buffersrcContext.Initialize(); err != nil {
if err = buffersrcContext.Initialize(nil); err != nil {
err = fmt.Errorf("main: initializing buffersrc context failed: %w", err)
return
}
Expand Down
2 changes: 1 addition & 1 deletion examples/transcoding/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,7 @@ func initFilters() (err error) {
}

// Initialize buffersrc context
if err = s.buffersrcContext.Initialize(); err != nil {
if err = s.buffersrcContext.Initialize(nil); err != nil {
err = fmt.Errorf("main: initializing buffersrc context failed: %w", err)
return
}
Expand Down
2 changes: 1 addition & 1 deletion filter_graph_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ func TestFilterGraph(t *testing.T) {
buffersrcContextParameters.SetWidth(src.width)
}
buffersrcContext.SetParameters(buffersrcContextParameters)
require.NoError(t, buffersrcContext.Initialize())
require.NoError(t, buffersrcContext.Initialize(nil))
buffersrcContexts = append(buffersrcContexts, buffersrcContext)

o := AllocFilterInOut()
Expand Down
Loading