Documentation ¶
Index ¶
- Constants
- func AvBuffersinkGetFrame(ctx *CAVFilterContext, frame *avutil.CAVFrame) int
- func AvBuffersrcAddFrame(buffer_src *CAVFilterContext, frame *avutil.CAVFrame) int
- func AvBuffersrcAddFrameFlags(buffer_src *CAVFilterContext, frame *avutil.CAVFrame, flags int) int
- func AvBuffersrcWriteFrame(ctx *CAVFilterContext, frame *avutil.CAVFrame) int
- func AvfilterGraphConfig(graphctx *CAVFilterGraph, log_ctx unsafe.Pointer) int
- func AvfilterGraphCreateFilter(filt_ctx **CAVFilterContext, filt *CAVFilter, name string, args string, ...) int
- func AvfilterGraphFree(graph **CAVFilterGraph)
- func AvfilterGraphParsePtr(graph *CAVFilterGraph, filters string, inputs **CAVFilterInOut, ...) int
- func AvfilterInoutFree(inout **CAVFilterInOut)
- type CAVFilter
- type CAVFilterContext
- func (filtCtx *CAVFilterContext) GetAvClass() *avutil.CAVClass
- func (filtCtx *CAVFilterContext) GetFilter() *CAVFilter
- func (filtCtx *CAVFilterContext) GetInputs() **CAVFilterLink
- func (filtCtx *CAVFilterContext) GetName() string
- func (filtCtx *CAVFilterContext) GetNbInputs() uint
- func (filtCtx *CAVFilterContext) GetNbOutputs() uint
- func (filtCtx *CAVFilterContext) GetOutputs() **CAVFilterLink
- type CAVFilterGraph
- type CAVFilterInOut
- func (inout *CAVFilterInOut) GetFilterCtx() *CAVFilterContext
- func (inout *CAVFilterInOut) GetName() string
- func (inout *CAVFilterInOut) GetNext() *CAVFilterInOut
- func (inout *CAVFilterInOut) GetPadIdx() int
- func (inout *CAVFilterInOut) SetFilterCtx(filterCtx *CAVFilterContext)
- func (inout *CAVFilterInOut) SetName(name string)
- func (inout *CAVFilterInOut) SetNext(next *CAVFilterInOut)
- func (inout *CAVFilterInOut) SetPadIdx(padIdx int)
- type CAVFilterLink
Constants ¶
const ( /** * Do not check for format changes. */ AV_BUFFERSRC_FLAG_NO_CHECK_FORMAT = C.AV_BUFFERSRC_FLAG_NO_CHECK_FORMAT /** * Immediately push the frame to the output. */ AV_BUFFERSRC_FLAG_PUSH = C.AV_BUFFERSRC_FLAG_PUSH /** * Keep a reference to the frame. * If the frame if reference-counted, create a new reference; otherwise * copy the frame data. */ AV_BUFFERSRC_FLAG_KEEP_REF = C.AV_BUFFERSRC_FLAG_KEEP_REF )
const ( LIBAVFILTER_IDENT = C.LIBAVFILTER_IDENT LIBAVFILTER_VERSION_INT = C.LIBAVFILTER_VERSION_INT )
Variables ¶
This section is empty.
Functions ¶
func AvBuffersinkGetFrame ¶
func AvBuffersinkGetFrame(ctx *CAVFilterContext, frame *avutil.CAVFrame) int
*
- Get a frame with filtered data from sink and put it in frame. *
- @param ctx pointer to a context of a buffersink or abuffersink AVFilter.
- @param frame pointer to an allocated frame that will be filled with data.
- The data must be freed using av_frame_unref() / av_frame_free() *
- @return
- - >= 0 if a frame was successfully returned.
- - AVERROR(EAGAIN) if no frames are available at this point; more
- input frames must be added to the filtergraph to get more output.
- - AVERROR_EOF if there will be no more output frames on this sink.
- - A different negative AVERROR code in other failure cases.
func AvBuffersrcAddFrame ¶
func AvBuffersrcAddFrame(buffer_src *CAVFilterContext, frame *avutil.CAVFrame) int
*
- Add a frame to the buffer source. *
- @param ctx an instance of the buffersrc filter
- @param frame frame to be added. If the frame is reference counted, this
- function will take ownership of the reference(s) and reset the frame.
- Otherwise the frame data will be copied. If this function returns an error,
- the input frame is not touched. *
- @return 0 on success, a negative AVERROR on error. *
- @note the difference between this function and av_buffersrc_write_frame() is
- that av_buffersrc_write_frame() creates a new reference to the input frame,
- while this function takes ownership of the reference passed to it. *
- This function is equivalent to av_buffersrc_add_frame_flags() without the
- AV_BUFFERSRC_FLAG_KEEP_REF flag.
func AvBuffersrcAddFrameFlags ¶
func AvBuffersrcAddFrameFlags(buffer_src *CAVFilterContext, frame *avutil.CAVFrame, flags int) int
*
- Add a frame to the buffer source. *
- By default, if the frame is reference-counted, this function will take
- ownership of the reference(s) and reset the frame. This can be controlled
- using the flags. *
- If this function returns an error, the input frame is not touched. *
- @param buffer_src pointer to a buffer source context
- @param frame a frame, or NULL to mark EOF
- @param flags a combination of AV_BUFFERSRC_FLAG_*
- @return >= 0 in case of success, a negative AVERROR code
- in case of failure
func AvBuffersrcWriteFrame ¶
func AvBuffersrcWriteFrame(ctx *CAVFilterContext, frame *avutil.CAVFrame) int
*
- Add a frame to the buffer source. *
- @param ctx an instance of the buffersrc filter
- @param frame frame to be added. If the frame is reference counted, this
- function will make a new reference to it. Otherwise the frame data will be
- copied. *
- @return 0 on success, a negative AVERROR on error *
- This function is equivalent to av_buffersrc_add_frame_flags() with the
- AV_BUFFERSRC_FLAG_KEEP_REF flag.
func AvfilterGraphConfig ¶
func AvfilterGraphConfig(graphctx *CAVFilterGraph, log_ctx unsafe.Pointer) int
*
- Check validity and configure all the links and formats in the graph. *
- @param graphctx the filter graph
- @param log_ctx context used for logging
- @return >= 0 in case of success, a negative AVERROR code otherwise
func AvfilterGraphCreateFilter ¶
func AvfilterGraphCreateFilter(filt_ctx **CAVFilterContext, filt *CAVFilter, name string, args string, opaque unsafe.Pointer, graph_ctx *CAVFilterGraph) int
*
- Create and add a filter instance into an existing graph.
- The filter instance is created from the filter filt and inited
- with the parameter args. opaque is currently ignored. *
- In case of success put in *filt_ctx the pointer to the created
- filter instance, otherwise set *filt_ctx to NULL. *
- @param name the instance name to give to the created filter instance
- @param graph_ctx the filter graph
- @return a negative AVERROR error code in case of failure, a non
- negative value otherwise
func AvfilterGraphFree ¶
func AvfilterGraphFree(graph **CAVFilterGraph)
*
- Free a graph, destroy its links, and set *graph to NULL.
- If *graph is NULL, do nothing.
func AvfilterGraphParsePtr ¶
func AvfilterGraphParsePtr(graph *CAVFilterGraph, filters string, inputs **CAVFilterInOut, outputs **CAVFilterInOut, log_ctx unsafe.Pointer) int
*
- Add a graph described by a string to a graph. *
- In the graph filters description, if the input label of the first
- filter is not specified, "in" is assumed; if the output label of
- the last filter is not specified, "out" is assumed. *
- @param graph the filter graph where to link the parsed graph context
- @param filters string to be parsed
- @param inputs pointer to a linked list to the inputs of the graph, may be NULL.
- If non-NULL, *inputs is updated to contain the list of open inputs
- after the parsing, should be freed with avfilter_inout_free().
- @param outputs pointer to a linked list to the outputs of the graph, may be NULL.
- If non-NULL, *outputs is updated to contain the list of open outputs
- after the parsing, should be freed with avfilter_inout_free().
- @return non negative on success, a negative AVERROR code on error
func AvfilterInoutFree ¶
func AvfilterInoutFree(inout **CAVFilterInOut)
*
- Free the supplied list of AVFilterInOut and set *inout to NULL.
- If *inout is NULL, do nothing.
Types ¶
type CAVFilter ¶
*
- Filter definition. This defines the pads a filter contains, and all the
- callback functions used to interact with the filter.
func AvfilterGetByName ¶
/**
- Get a filter definition matching the given name. *
- @param name the filter name to find
- @return the filter definition, if any matching one is registered.
- NULL if none found. */
type CAVFilterContext ¶
type CAVFilterContext C.AVFilterContext
* An instance of a filter
func (*CAVFilterContext) GetAvClass ¶
func (filtCtx *CAVFilterContext) GetAvClass() *avutil.CAVClass
/< needed for av_log() and filters common options
func (*CAVFilterContext) GetFilter ¶
func (filtCtx *CAVFilterContext) GetFilter() *CAVFilter
/< the AVFilter of which this is an instance
func (*CAVFilterContext) GetInputs ¶
func (filtCtx *CAVFilterContext) GetInputs() **CAVFilterLink
/< array of pointers to input links
func (*CAVFilterContext) GetName ¶
func (filtCtx *CAVFilterContext) GetName() string
/< name of this filter instance
func (*CAVFilterContext) GetNbInputs ¶
func (filtCtx *CAVFilterContext) GetNbInputs() uint
/< number of input pads
func (*CAVFilterContext) GetNbOutputs ¶
func (filtCtx *CAVFilterContext) GetNbOutputs() uint
/< number of output pads
func (*CAVFilterContext) GetOutputs ¶
func (filtCtx *CAVFilterContext) GetOutputs() **CAVFilterLink
/< array of pointers to output links
type CAVFilterGraph ¶
type CAVFilterGraph C.AVFilterGraph
func AvfilterGraphAlloc ¶
func AvfilterGraphAlloc() *CAVFilterGraph
*
- Allocate a filter graph. *
- @return the allocated filter graph on success or NULL.
type CAVFilterInOut ¶
type CAVFilterInOut C.AVFilterInOut
*
- A linked-list of the inputs/outputs of the filter chain. *
- This is mainly useful for avfilter_graph_parse() / avfilter_graph_parse2(),
- where it is used to communicate open (unlinked) inputs and outputs from and
- to the caller.
- This struct specifies, per each not connected pad contained in the graph, the
- filter context and the pad index required for establishing a link.
func AvfilterInoutAlloc ¶
func AvfilterInoutAlloc() *CAVFilterInOut
*
- Allocate a single AVFilterInOut entry.
- Must be freed with avfilter_inout_free().
- @return allocated AVFilterInOut on success, NULL on failure.
func (*CAVFilterInOut) GetFilterCtx ¶
func (inout *CAVFilterInOut) GetFilterCtx() *CAVFilterContext
* filter context associated to this input/output
func (*CAVFilterInOut) GetName ¶
func (inout *CAVFilterInOut) GetName() string
* unique name for this input/output in the list
func (*CAVFilterInOut) GetNext ¶
func (inout *CAVFilterInOut) GetNext() *CAVFilterInOut
* next input/input in the list, NULL if this is the last
func (*CAVFilterInOut) GetPadIdx ¶
func (inout *CAVFilterInOut) GetPadIdx() int
* index of the filt_ctx pad to use for linking
func (*CAVFilterInOut) SetFilterCtx ¶
func (inout *CAVFilterInOut) SetFilterCtx(filterCtx *CAVFilterContext)
* filter context associated to this input/output
func (*CAVFilterInOut) SetName ¶
func (inout *CAVFilterInOut) SetName(name string)
* unique name for this input/output in the list
func (*CAVFilterInOut) SetNext ¶
func (inout *CAVFilterInOut) SetNext(next *CAVFilterInOut)
* next input/input in the list, NULL if this is the last
func (*CAVFilterInOut) SetPadIdx ¶
func (inout *CAVFilterInOut) SetPadIdx(padIdx int)
* index of the filt_ctx pad to use for linking
type CAVFilterLink ¶
type CAVFilterLink C.AVFilterLink
*
- A link between two filters. This contains pointers to the source and
- destination filters between which this link exists, and the indexes of
- the pads involved. In addition, this link also contains the parameters
- which have been negotiated and agreed upon between the filter, such as
- image dimensions, format, etc. *
- Applications must not normally access the link structure directly.
- Use the buffersrc and buffersink API instead.
- In the future, access to the header may be reserved for filters
- implementation.
func (*CAVFilterLink) GetTimeBase ¶
func (l *CAVFilterLink) GetTimeBase() avutil.CAVRational
*
- Define the time base used by the PTS of the frames/samples
- which will pass through this link.
- During the configuration stage, each filter is supposed to
- change only the output timebase, while the timebase of the
- input link is assumed to be an unchangeable property.