Documentation
¶
Index ¶
Constants ¶
View Source
const ( // NvPipeH264 H264 Codec NvPipeH264 = NvPipeCodec(C.NVPIPE_H264) // NvPipeHEVC HEVC/H265 Codec NvPipeHEVC = NvPipeCodec(C.NVPIPE_HEVC) )
View Source
const ( // NvPipeLossy ... NvPipeLossy = NvPipeCompression(C.NVPIPE_LOSSY) // NvPipeLossless produces larger output. NvPipeLossless = NvPipeCompression(C.NVPIPE_LOSSLESS) )
View Source
const ( // NvPipeRGBA32 RGBA32 format NvPipeRGBA32 = NvPipeFormat(C.NVPIPE_RGBA32) // NvPipeUInt4 uint4 format NvPipeUInt4 = NvPipeFormat(C.NVPIPE_UINT4) // NvPipeUInt8 uint8 format NvPipeUInt8 = NvPipeFormat(C.NVPIPE_UINT8) // NvPipeUInt16 uint16 format NvPipeUInt16 = NvPipeFormat(C.NVPIPE_UINT16) // NvPipeUInt32 uint32 format NvPipeUInt32 = NvPipeFormat(C.NVPIPE_UINT32) )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Decoder ¶
type Decoder struct {
// contains filtered or unexported fields
}
Decoder ...
func NewDecoder ¶
func NewDecoder(format NvPipeFormat, codec NvPipeCodec, width int, height int) *Decoder
NewDecoder Create a new decoder instance. *
- @param format Format of output frame.
- @param codec Possible codecs are H.264 and HEVC if available.
- @param width Initial width of the decoder.
- @param height Initial height of the decoder.
- @return NULL on error.
func (*Decoder) Decode ¶
Decode a single frame to device or host memory. *
- @param nvp Decoder instance.
- @param src Compressed frame data in host memory.
- @param srcSize Size of compressed data.
- @param dst Device or host memory pointer.
- @param width Width of frame in pixels.
- @param height Height of frame in pixels.
- @return Size of decoded data in bytes or 0 on error.
type Encoder ¶
type Encoder struct {
// contains filtered or unexported fields
}
Encoder ...
func NewEncoder ¶
func NewEncoder(format NvPipeFormat, codec NvPipeCodec, compression NvPipeCompression, bitrateMbps int, targetFPS int, width int, height int) *Encoder
NewEncoder Creates a new encoder instance. *
- @param format Format of input frame.
- @param codec Possible codecs are H.264 and HEVC if available.
- @param compression Lossy or lossless compression.
- @param bitrate Bitrate in bit per second, e.g., 32 * 1000 * 1000 = 32 Mbps (for lossy compression only).
- @param targetFrameRate At this frame rate the effective data rate approximately equals the bitrate (for lossy compression only).
- @param width Initial width of the encoder.
- @param height Initial height of the encoder.
- @return NULL on error.
func (*Encoder) Encode ¶
Encode a single frame from device or host memory. *
- @param nvp Encoder instance.
- @param src Device or host memory pointer.
- @param srcPitch Pitch of source memory.
- @param dst Host memory pointer for compressed output.
- @param dstSize Available space for compressed output.
- @param width Width of input frame in pixels.
- @param height Height of input frame in pixels.
- @param forceIFrame Enforces an I-frame instead of a P-frame.
- @return Size of encoded data in bytes or 0 on error.
func (*Encoder) GetError ¶
GetError Returns an error message for the last error that occured. *
- @return Returned string must not be deleted.
func (*Encoder) SetBitrate ¶
SetBitrate Reconfigures the encoder with a new bitrate and target frame rate. *
- @param nvp Encoder instance.
- @param bitrate Bitrate in bit per second, e.g., 32 * 1000 * 1000 = 32 Mbps (for lossy compression only).
- @param targetFrameRate At this frame rate the effective data rate approximately equals the bitrate (for lossy compression only).
type NvPipeCompression ¶
type NvPipeCompression int
NvPipeCompression Compression type used for encoding.
Click to show internal directories.
Click to hide internal directories.