AVBSFContext
public final class AVBSFContext
The bitstream filter state.
-
Get null/pass-through bitstream filter.
Declaration
Swift
public init()
-
Allocate a context for a given bitstream filter. The caller must fill in the context parameters as described in the documentation and then call
initialize()
before sending any data to the filter.Declaration
Swift
public init(filter: AVBitStreamFilter)
Parameters
filter
the filter for which to allocate an instance.
-
Parse string describing list of bitstream filters and create single
AVBSFContext
describing the whole chain of bitstream filters.Declaration
Swift
public init(str: String)
Parameters
str
String describing chain of bitstream filters in format
bsf1[=opt1=val1:opt2=val2][,bsf2]
. -
Prepare the filter for use, after all the parameters and options have been set.
Declaration
Swift
public func initialize() throws
-
Submit a packet for filtering.
After sending each packet, the filter must be completely drained by calling
receivePacket(_:)
repeatedly until it returnsAVError.tryAgain
orAVError.eof
.Throws
AVErrorDeclaration
Swift
public func sendPacket(_ packet: AVPacket?) throws
Parameters
packet
the packet to filter. The bitstream filter will take ownership of the packet and reset the contents of pkt. pkt is not touched if an error occurs. This parameter may be
nil
, which signals the end of the stream (i.e. no more packets will be sent). That will cause the filter to output any packets it may have buffered internally. -
Retrieve a filtered packet.
Note
one input packet may result in several output packets, so after sending a packet with
sendPacket(_:)
, this function needs to be called repeatedly until it stops returning 0. It is also possible for a filter to output fewer packets than were sent to it, so this function may returnAVError.tryAgain
immediately after a successfulsendPacket(_:)
call.Throws
AVError
Throws
Throws:
AVError.tryAgain
if more packets need to be sent to the filter (usingsendPacket(_:)
) to get more output.AVError.eof
if there will be no further output from the filter.- othrer errors.
Declaration
Swift
public func receivePacket(_ packet: AVPacket) throws
Parameters
packet
this struct will be filled with the contents of the filtered packet. It is owned by the caller and must be freed using
AVPacket.unref()
when it is no longer needed. This parameter should beclean
(i.e. freshly allocated withAVPacket.init()
or unreffed withAVPacket.unref()
) when this function is called. If this function returns successfully, the contents of pkt will be completely overwritten by the returned data. On failure, pkt is not touched. -
Reset the internal bitstream filter state / flush internal buffers.
Declaration
Swift
public func flush()
-
Undocumented
Declaration
Swift
public static let `class`: AVClass
-
Undocumented
Declaration
Swift
public func withUnsafeClassObjectPointer<T>(_ body: (UnsafeMutableRawPointer) throws -> T) rethrows -> T
-
Undocumented
Declaration
Swift
public func withUnsafeObjectPointer<T>(_ body: (UnsafeMutableRawPointer) throws -> T) rethrows -> T