Skip to content

Commit

Permalink
Added filter flags
Browse files Browse the repository at this point in the history
  • Loading branch information
asticode committed Dec 23, 2024
1 parent b099236 commit 25626ad
Show file tree
Hide file tree
Showing 6 changed files with 54 additions and 0 deletions.
5 changes: 5 additions & 0 deletions filter.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ func FindFilterByName(n string) *Filter {
return newFilterFromC(C.avfilter_get_by_name(cn))
}

// https://ffmpeg.org/doxygen/7.0/structAVFilter.html#a632c76418742ad4f4dccbd4db40badd0
func (f *Filter) Flags() FilterFlags {
return FilterFlags(f.c.flags)
}

// https://ffmpeg.org/doxygen/7.0/structAVFilter.html#a28a4776f344f91055f42a4c2a1b15c0c
func (f *Filter) Name() string {
return C.GoString(f.c.name)
Expand Down
18 changes: 18 additions & 0 deletions filter_flag.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package astiav

//#include <libavfilter/avfilter.h>
import "C"

// https://ffmpeg.org/doxygen/7.0/group__lavfi.html#gae6ed6c10a03508829bdf17560e3e10e5
type FilterFlag int64

const (
FilterFlagDynamicInputs = FilterFlag(C.AVFILTER_FLAG_DYNAMIC_INPUTS)
FilterFlagDynamicOutputs = FilterFlag(C.AVFILTER_FLAG_DYNAMIC_OUTPUTS)
FilterFlagSliceThreads = FilterFlag(C.AVFILTER_FLAG_SLICE_THREADS)
FilterFlagMetadataOnly = FilterFlag(C.AVFILTER_FLAG_METADATA_ONLY)
FilterFlagHardwareDevice = FilterFlag(C.AVFILTER_FLAG_HWDEVICE)
FilterFlagSupportTimelineGeneric = FilterFlag(C.AVFILTER_FLAG_SUPPORT_TIMELINE_GENERIC)
FilterFlagSupportTimelineInternal = FilterFlag(C.AVFILTER_FLAG_SUPPORT_TIMELINE_INTERNAL)
FilterFlagSupportTimeline = FilterFlag(C.AVFILTER_FLAG_SUPPORT_TIMELINE)
)
1 change: 1 addition & 0 deletions filter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,5 @@ func TestFilter(t *testing.T) {
require.NotNil(t, f)
require.Equal(t, "format", f.Name())
require.Equal(t, "format", f.String())
require.True(t, f.Flags().Has(FilterFlagMetadataOnly))
}
20 changes: 20 additions & 0 deletions flags.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions flags_test.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions internal/cmd/flags/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ var list = []listItem{
{Name: "CodecContext", Suffix: "2"},
{Name: "CodecHardwareConfigMethod"},
{Name: "Dictionary"},
{Name: "Filter"},
{Name: "FilterCommand"},
{Name: "FormatContext"},
{Name: "FormatContextCtx"},
Expand Down

0 comments on commit 25626ad

Please sign in to comment.