gstpbutils

package
v0.0.0-...-ccbbe8a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 7, 2023 License: MPL-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const ENCODING_CATEGORY_CAPTURE = "capture"

ENCODING_CATEGORY_CAPTURE category for recording and capture. Targets within this category are optimized for low latency encoding.

View Source
const ENCODING_CATEGORY_DEVICE = "device"

ENCODING_CATEGORY_DEVICE category for device-specific targets. The name of the target will usually be the constructor and model of the device, and that target will contain EncodingProfiles suitable for that device.

View Source
const ENCODING_CATEGORY_FILE_EXTENSION = "file-extension"

ENCODING_CATEGORY_FILE_EXTENSION category for file extensions. The name of the target will be the name of the file extensions possible for a particular target. Those targets are defining like 'default' formats usually used for a particular file extension.

View Source
const ENCODING_CATEGORY_ONLINE_SERVICE = "online-service"

ENCODING_CATEGORY_ONLINE_SERVICE category for online-services. The name of the target will usually be the name of the online service and that target will contain EncodingProfiles suitable for that online service.

View Source
const ENCODING_CATEGORY_STORAGE_EDITING = "storage-editing"

ENCODING_CATEGORY_STORAGE_EDITING category for storage, archiving and editing targets. Those targets can be lossless and/or provide very fast random access content. The name of the target will usually be the container type or editing target, and that target will contain EncodingProfiles suitable for editing or storage.

View Source
const PLUGINS_BASE_VERSION_MAJOR = 1

PLUGINS_BASE_VERSION_MAJOR: major version of GStreamer's gst-plugins-base libraries at compile time.

View Source
const PLUGINS_BASE_VERSION_MICRO = 3

PLUGINS_BASE_VERSION_MICRO: micro version of GStreamer's gst-plugins-base libraries at compile time.

View Source
const PLUGINS_BASE_VERSION_MINOR = 20

PLUGINS_BASE_VERSION_MINOR: minor version of GStreamer's gst-plugins-base libraries at compile time.

View Source
const PLUGINS_BASE_VERSION_NANO = 0

PLUGINS_BASE_VERSION_NANO: nano version of GStreamer's gst-plugins-base libraries at compile time. Actual releases have 0, GIT versions have 1, prerelease versions have 2-...

Variables

View Source
var (
	GTypeEncodingAudioProfile     = coreglib.Type(C.gst_encoding_audio_profile_get_type())
	GTypeEncodingContainerProfile = coreglib.Type(C.gst_encoding_container_profile_get_type())
	GTypeEncodingProfile          = coreglib.Type(C.gst_encoding_profile_get_type())
	GTypeEncodingVideoProfile     = coreglib.Type(C.gst_encoding_video_profile_get_type())
)

GType values.

View Source
var (
	GTypeAudioVisualizerShader = coreglib.Type(C.gst_audio_visualizer_shader_get_type())
	GTypeAudioVisualizer       = coreglib.Type(C.gst_audio_visualizer_get_type())
)

GType values.

View Source
var (
	GTypeDiscovererResult        = coreglib.Type(C.gst_discoverer_result_get_type())
	GTypeDiscoverer              = coreglib.Type(C.gst_discoverer_get_type())
	GTypeDiscovererAudioInfo     = coreglib.Type(C.gst_discoverer_audio_info_get_type())
	GTypeDiscovererContainerInfo = coreglib.Type(C.gst_discoverer_container_info_get_type())
	GTypeDiscovererInfo          = coreglib.Type(C.gst_discoverer_info_get_type())
	GTypeDiscovererStreamInfo    = coreglib.Type(C.gst_discoverer_stream_info_get_type())
	GTypeDiscovererSubtitleInfo  = coreglib.Type(C.gst_discoverer_subtitle_info_get_type())
	GTypeDiscovererVideoInfo     = coreglib.Type(C.gst_discoverer_video_info_get_type())
)

GType values.

View Source
var (
	GTypeInstallPluginsReturn  = coreglib.Type(C.gst_install_plugins_return_get_type())
	GTypeInstallPluginsContext = coreglib.Type(C.gst_install_plugins_context_get_type())
)

GType values.

View Source
var (
	GTypeDiscovererSerializeFlags = coreglib.Type(C.gst_discoverer_serialize_flags_get_type())
)

GType values.

View Source
var (
	GTypeEncodingTarget = coreglib.Type(C.gst_encoding_target_get_type())
)

GType values.

View Source
var (
	GTypePbUtilsCapsDescriptionFlags = coreglib.Type(C.gst_pb_utils_caps_description_flags_get_type())
)

GType values.

Functions

func CodecUtilsAacCapsSetLevelAndProfile

func CodecUtilsAacCapsSetLevelAndProfile(caps *gst.Caps, audioConfig []byte) bool

CodecUtilsAacCapsSetLevelAndProfile sets the level and profile on caps if it can be determined from audio_config. See gst_codec_utils_aac_get_level() and gst_codec_utils_aac_get_profile() for more details on the parameters. caps must be audio/mpeg caps with an "mpegversion" field of either 2 or 4. If mpegversion is 4, the "base-profile" field is also set in caps.

The function takes the following parameters:

  • caps to which level and profile fields are to be added.
  • audioConfig: pointer to the AudioSpecificConfig as specified in the Elementary Stream Descriptor (esds) in ISO/IEC 14496-1. (See below for more details).

The function returns the following values:

  • ok: TRUE if the level and profile could be set, FALSE otherwise.

func CodecUtilsAacGetChannels

func CodecUtilsAacGetChannels(audioConfig []byte) uint

CodecUtilsAacGetChannels returns the channels of the given AAC stream.

The function takes the following parameters:

  • audioConfig: pointer to the AudioSpecificConfig as specified in the Elementary Stream Descriptor (esds) in ISO/IEC 14496-1.

The function returns the following values:

  • guint channels or 0 if the channel could not be determined.

func CodecUtilsAacGetIndexFromSampleRate

func CodecUtilsAacGetIndexFromSampleRate(rate uint) int

CodecUtilsAacGetIndexFromSampleRate translates the sample rate to the index corresponding to it in AAC spec.

The function takes the following parameters:

  • rate: sample rate.

The function returns the following values:

  • gint: AAC index for this sample rate, -1 if the rate is not a valid AAC sample rate.

func CodecUtilsAacGetLevel

func CodecUtilsAacGetLevel(audioConfig []byte) string

CodecUtilsAacGetLevel determines the level of a stream as defined in ISO/IEC 14496-3. For AAC LC streams, the constraints from the AAC audio profile are applied. For AAC Main, LTP, SSR and others, the Main profile is used.

The audio_config parameter follows the following format, starting from the most significant bit of the first byte:

  • Bit 0:4 contains the AudioObjectType (if this is 0x5, then the real AudioObjectType is carried after the rate and channel data)
  • Bit 5:8 contains the sample frequency index (if this is 0xf, then the next 24 bits define the actual sample frequency, and subsequent fields are appropriately shifted).
  • Bit 9:12 contains the channel configuration.

The function takes the following parameters:

  • audioConfig: pointer to the AudioSpecificConfig as specified in the Elementary Stream Descriptor (esds) in ISO/IEC 14496-1.

The function returns the following values:

  • utf8 (optional): level as a const string and NULL if the level could not be determined.

func CodecUtilsAacGetProfile

func CodecUtilsAacGetProfile(audioConfig []byte) string

CodecUtilsAacGetProfile returns the profile of the given AAC stream as a string. The profile is normally determined using the AudioObjectType field which is in the first 5 bits of audio_config.

The function takes the following parameters:

  • audioConfig: pointer to the AudioSpecificConfig as specified in the Elementary Stream Descriptor (esds) in ISO/IEC 14496-1.

The function returns the following values:

  • utf8 (optional): profile as a const string and NULL if the profile could not be determined.

func CodecUtilsAacGetSampleRate

func CodecUtilsAacGetSampleRate(audioConfig []byte) uint

CodecUtilsAacGetSampleRate translates the sample rate index found in AAC headers to the actual sample rate.

The function takes the following parameters:

  • audioConfig: pointer to the AudioSpecificConfig as specified in the Elementary Stream Descriptor (esds) in ISO/IEC 14496-1.

The function returns the following values:

  • guint: sample rate if sr_idx is valid, 0 otherwise.

func CodecUtilsAacGetSampleRateFromIndex

func CodecUtilsAacGetSampleRateFromIndex(srIdx uint) uint

CodecUtilsAacGetSampleRateFromIndex translates the sample rate index found in AAC headers to the actual sample rate.

The function takes the following parameters:

  • srIdx: sample rate index as from the AudioSpecificConfig (MPEG-4 container) or ADTS frame header.

The function returns the following values:

  • guint: sample rate if sr_idx is valid, 0 otherwise.

func CodecUtilsCapsGetMIMECodec

func CodecUtilsCapsGetMIMECodec(caps *gst.Caps) string

CodecUtilsCapsGetMIMECodec converts caps to a RFC 6381 compatible codec string if possible.

Useful for providing the 'codecs' field inside the 'Content-Type' HTTP header for containerized formats, such as mp4 or matroska.

Registered codecs can be found at http://mp4ra.org/#/codecs.

The function takes the following parameters:

  • caps to convert to mime codec.

The function returns the following values:

  • utf8 (optional): RFC 6381 compatible codec string or NULL.

func CodecUtilsH264CapsSetLevelAndProfile

func CodecUtilsH264CapsSetLevelAndProfile(caps *gst.Caps, sps []byte) bool

CodecUtilsH264CapsSetLevelAndProfile sets the level and profile in caps if it can be determined from sps. See gst_codec_utils_h264_get_level() and gst_codec_utils_h264_get_profile() for more details on the parameters.

The function takes the following parameters:

  • caps to which the level and profile are to be added.
  • sps: pointer to the sequence parameter set for the stream.

The function returns the following values:

  • ok: TRUE if the level and profile could be set, FALSE otherwise.

func CodecUtilsH264GetLevel

func CodecUtilsH264GetLevel(sps []byte) string

CodecUtilsH264GetLevel converts the level indication (level_idc) in the stream's sequence parameter set into a string. The SPS is expected to have the same format as for gst_codec_utils_h264_get_profile().

The function takes the following parameters:

  • sps: pointer to the sequence parameter set for the stream.

The function returns the following values:

  • utf8 (optional): level as a const string, or NULL if there is an error.

func CodecUtilsH264GetLevelIdc

func CodecUtilsH264GetLevelIdc(level string) byte

CodecUtilsH264GetLevelIdc: transform a level string from the caps into the level_idc.

The function takes the following parameters:

  • level string from caps.

The function returns the following values:

  • guint8: level_idc or 0 if the level is unknown.

func CodecUtilsH264GetProfile

func CodecUtilsH264GetProfile(sps []byte) string

CodecUtilsH264GetProfile converts the profile indication (profile_idc) in the stream's sequence parameter set into a string. The SPS is expected to have the following format, as defined in the H.264 specification. The SPS is viewed as a bitstream here, with bit 0 being the most significant bit of the first byte.

* Bit 0:7 - Profile indication * Bit 8 - constraint_set0_flag * Bit 9 - constraint_set1_flag * Bit 10 - constraint_set2_flag * Bit 11 - constraint_set3_flag * Bit 12 - constraint_set3_flag * Bit 13:15 - Reserved * Bit 16:24 - Level indication.

The function takes the following parameters:

  • sps: pointer to the sequence parameter set for the stream.

The function returns the following values:

  • utf8 (optional): profile as a const string, or NULL if there is an error.

func CodecUtilsH264GetProfileFlagsLevel

func CodecUtilsH264GetProfileFlagsLevel(codecData []byte) (profile, flags, level byte, ok bool)

CodecUtilsH264GetProfileFlagsLevel parses profile, flags, and level from a H264 AVCC extradata/sequence_header. These are most commonly retrieved from a video/x-h264 caps with a codec_data buffer.

The format of H264 AVCC extradata/sequence_header is documented in the ITU-T H.264 specification section 7.3.2.1.1 as well as in ISO/IEC 14496-15 section 5.3.3.1.2.

The function takes the following parameters:

  • codecData: h264 AVCC extradata.

The function returns the following values:

  • profile (optional): return location for h264 profile_idc or NULL.
  • flags (optional): return location for h264 constraint set flags or NULL.
  • level (optional): return location h264 level_idc or NULL.
  • ok: TRUE on success, FALSE on failure.

func CodecUtilsH265CapsSetLevelTierAndProfile

func CodecUtilsH265CapsSetLevelTierAndProfile(caps *gst.Caps, profileTierLevel []byte) bool

CodecUtilsH265CapsSetLevelTierAndProfile sets the level, tier and profile in caps if it can be determined from profile_tier_level. See gst_codec_utils_h265_get_level(), gst_codec_utils_h265_get_tier() and gst_codec_utils_h265_get_profile() for more details on the parameters.

The function takes the following parameters:

  • caps to which the level, tier and profile are to be added.
  • profileTierLevel: pointer to the profile_tier_level struct.

The function returns the following values:

  • ok: TRUE if the level, tier, profile could be set, FALSE otherwise.

func CodecUtilsH265GetLevel

func CodecUtilsH265GetLevel(profileTierLevel []byte) string

CodecUtilsH265GetLevel converts the level indication (general_level_idc) in the stream's profile_tier_level structure into a string. The profiel_tier_level is expected to have the same format as for gst_codec_utils_h264_get_profile().

The function takes the following parameters:

  • profileTierLevel: pointer to the profile_tier_level for the stream.

The function returns the following values:

  • utf8 (optional): level as a const string, or NULL if there is an error.

func CodecUtilsH265GetLevelIdc

func CodecUtilsH265GetLevelIdc(level string) byte

CodecUtilsH265GetLevelIdc: transform a level string from the caps into the level_idc.

The function takes the following parameters:

  • level string from caps.

The function returns the following values:

  • guint8: level_idc or 0 if the level is unknown.

func CodecUtilsH265GetProfile

func CodecUtilsH265GetProfile(profileTierLevel []byte) string

CodecUtilsH265GetProfile converts the profile indication (general_profile_idc) in the stream's profile_level_tier structure into a string. The profile_tier_level is expected to have the following format, as defined in the H.265 specification. The profile_tier_level is viewed as a bitstream here, with bit 0 being the most significant bit of the first byte.

* Bit 0:1 - general_profile_space * Bit 2 - general_tier_flag * Bit 3:7 - general_profile_idc * Bit 8:39 - gernal_profile_compatibility_flags * Bit 40 - general_progressive_source_flag * Bit 41 - general_interlaced_source_flag * Bit 42 - general_non_packed_constraint_flag * Bit 43 - general_frame_only_constraint_flag * Bit 44:87 - See below * Bit 88:95 - general_level_idc.

The function takes the following parameters:

  • profileTierLevel: pointer to the profile_tier_level structure for the stream.

The function returns the following values:

  • utf8 (optional): profile as a const string, or NULL if there is an error.

func CodecUtilsH265GetTier

func CodecUtilsH265GetTier(profileTierLevel []byte) string

CodecUtilsH265GetTier converts the tier indication (general_tier_flag) in the stream's profile_tier_level structure into a string. The profile_tier_level is expected to have the same format as for gst_codec_utils_h264_get_profile().

The function takes the following parameters:

  • profileTierLevel: pointer to the profile_tier_level for the stream.

The function returns the following values:

  • utf8 (optional): tier as a const string, or NULL if there is an error.

func CodecUtilsMpeg4VideoCapsSetLevelAndProfile

func CodecUtilsMpeg4VideoCapsSetLevelAndProfile(caps *gst.Caps, visObjSeq []byte) bool

CodecUtilsMpeg4VideoCapsSetLevelAndProfile sets the level and profile in caps if it can be determined from vis_obj_seq. See gst_codec_utils_mpeg4video_get_level() and gst_codec_utils_mpeg4video_get_profile() for more details on the parameters.

The function takes the following parameters:

  • caps to which the level and profile are to be added.
  • visObjSeq: pointer to the visual object sequence for the stream.

The function returns the following values:

  • ok: TRUE if the level and profile could be set, FALSE otherwise.

func CodecUtilsMpeg4VideoGetLevel

func CodecUtilsMpeg4VideoGetLevel(visObjSeq []byte) string

CodecUtilsMpeg4VideoGetLevel converts the level indication in the stream's visual object sequence into a string. vis_obj_seq is expected to be the data following the visual object sequence start code. Only the first byte (profile_and_level_indication) is used.

The function takes the following parameters:

  • visObjSeq: pointer to the visual object sequence for the stream.

The function returns the following values:

  • utf8 (optional): level as a const string, or NULL if there is an error.

func CodecUtilsMpeg4VideoGetProfile

func CodecUtilsMpeg4VideoGetProfile(visObjSeq []byte) string

CodecUtilsMpeg4VideoGetProfile converts the profile indication in the stream's visual object sequence into a string. vis_obj_seq is expected to be the data following the visual object sequence start code. Only the first byte (profile_and_level_indication) is used.

The function takes the following parameters:

  • visObjSeq: pointer to the visual object sequence for the stream.

The function returns the following values:

  • utf8 (optional): profile as a const string, or NULL if there is an error.

func CodecUtilsOpusCreateCapsFromHeader

func CodecUtilsOpusCreateCapsFromHeader(header, comments *gst.Buffer) *gst.Caps

CodecUtilsOpusCreateCapsFromHeader creates Opus caps from the given OpusHead header and comment header comments.

The function takes the following parameters:

  • header: opusHead header.
  • comments (optional): comment header or NULL.

The function returns the following values:

  • caps: Caps.

func CodecUtilsOpusParseCaps

func CodecUtilsOpusParseCaps(caps *gst.Caps) (rate uint32, channels, channelMappingFamily, streamCount, coupledCount byte, channelMapping [256]byte, ok bool)

CodecUtilsOpusParseCaps parses Opus caps and fills the different fields with defaults if possible.

The function takes the following parameters:

  • caps to parse the data from.

The function returns the following values:

  • rate (optional): sample rate.
  • channels (optional): number of channels.
  • channelMappingFamily (optional): channel mapping family.
  • streamCount (optional): number of independent streams.
  • coupledCount (optional): number of stereo streams.
  • channelMapping (optional): mapping between the streams.
  • ok: TRUE if parsing was successful, FALSE otherwise.

func CodecUtilsOpusParseHeader

func CodecUtilsOpusParseHeader(header *gst.Buffer) (rate uint32, channels, channelMappingFamily, streamCount, coupledCount byte, channelMapping [256]byte, preSkip uint16, outputGain int16, ok bool)

CodecUtilsOpusParseHeader parses the OpusHead header.

The function takes the following parameters:

  • header: opusHead Buffer.

The function returns the following values:

  • rate (optional): sample rate.
  • channels (optional): number of channels.
  • channelMappingFamily (optional): channel mapping family.
  • streamCount (optional): number of independent streams.
  • coupledCount (optional): number of stereo streams.
  • channelMapping (optional): mapping between the streams.
  • preSkip (optional): pre-skip in 48kHz samples or 0.
  • outputGain (optional): output gain or 0.
  • ok: TRUE if parsing was successful, FALSE otherwise.

func EncodingListAvailableCategories

func EncodingListAvailableCategories() []string

EncodingListAvailableCategories lists all EncodingTarget categories present on disk.

The function returns the following values:

  • list: list of EncodingTarget categories.

func InstallPluginsInstallationInProgress

func InstallPluginsInstallationInProgress() bool

InstallPluginsInstallationInProgress checks whether plugin installation (initiated by this application only) is currently in progress.

The function returns the following values:

  • ok: TRUE if plugin installation is in progress, otherwise FALSE.

func InstallPluginsReturnGetName

func InstallPluginsReturnGetName(ret InstallPluginsReturn) string

InstallPluginsReturnGetName: convenience function to return the descriptive string associated with a status code. This function returns English strings and should not be used for user messages. It is here only to assist in debugging.

The function takes the following parameters:

  • ret: return status code.

The function returns the following values:

  • utf8: descriptive string for the status code in ret.

func InstallPluginsSupported

func InstallPluginsSupported() bool

InstallPluginsSupported checks whether plugin installation is likely to be supported by the current environment. This currently only checks whether the helper script that is to be provided by the distribution or operating system vendor exists.

The function returns the following values:

  • ok: TRUE if plugin installation is likely to be supported.

func IsMissingPluginMessage

func IsMissingPluginMessage(msg *gst.Message) bool

IsMissingPluginMessage checks whether msg is a missing plugins message.

The function takes the following parameters:

  • msg: Message.

The function returns the following values:

  • ok: TRUE if msg is a missing-plugins message, otherwise FALSE.

func MissingPluginMessageGetDescription

func MissingPluginMessageGetDescription(msg *gst.Message) string

MissingPluginMessageGetDescription returns a localised string describing the missing feature, for use in error dialogs and the like. Should never return NULL unless msg is not a valid missing-plugin message.

This function is mainly for applications that need a human-readable string describing a missing plugin, given a previously collected missing-plugin message.

The function takes the following parameters:

  • msg: missing-plugin Message of type T_MESSAGE_ELEMENT.

The function returns the following values:

  • utf8: newly-allocated description string, or NULL on error. Free string with g_free() when not needed any longer.

func MissingPluginMessageGetInstallerDetail

func MissingPluginMessageGetInstallerDetail(msg *gst.Message) string

MissingPluginMessageGetInstallerDetail returns an opaque string containing all the details about the missing element to be passed to an external installer called via gst_install_plugins_async() or gst_install_plugins_sync().

This function is mainly for applications that call external plugin installation mechanisms using one of the two above-mentioned functions.

The function takes the following parameters:

  • msg: missing-plugin Message of type T_MESSAGE_ELEMENT.

The function returns the following values:

  • utf8: newly-allocated detail string, or NULL on error. Free string with g_free() when not needed any longer.

func NewMissingDecoderInstallerDetail

func NewMissingDecoderInstallerDetail(decodeCaps *gst.Caps) string

NewMissingDecoderInstallerDetail returns an opaque string containing all the details about the missing element to be passed to an external installer called via gst_install_plugins_async() or gst_install_plugins_sync().

This function is mainly for applications that call external plugin installation mechanisms using one of the two above-mentioned functions in the case where the application knows exactly what kind of plugin it is missing.

The function takes the following parameters:

  • decodeCaps: (fixed) caps for which a decoder element is needed.

The function returns the following values:

  • utf8: newly-allocated detail string, or NULL on error. Free string with g_free() when not needed any longer.

func NewMissingDecoderMessage

func NewMissingDecoderMessage(element gst.Elementer, decodeCaps *gst.Caps) *gst.Message

NewMissingDecoderMessage creates a missing-plugin message for element to notify the application that a decoder element for a particular set of (fixed) caps is missing. This function is mainly for use in plugins.

The function takes the following parameters:

  • element posting the message.
  • decodeCaps: (fixed) caps for which a decoder element is needed.

The function returns the following values:

  • message: new Message, or NULL on error.

func NewMissingElementInstallerDetail

func NewMissingElementInstallerDetail(factoryName string) string

NewMissingElementInstallerDetail returns an opaque string containing all the details about the missing element to be passed to an external installer called via gst_install_plugins_async() or gst_install_plugins_sync().

This function is mainly for applications that call external plugin installation mechanisms using one of the two above-mentioned functions in the case where the application knows exactly what kind of plugin it is missing.

The function takes the following parameters:

  • factoryName: name of the missing element (element factory), e.g. "videoscale" or "cdparanoiasrc".

The function returns the following values:

  • utf8: newly-allocated detail string, or NULL on error. Free string with g_free() when not needed any longer.

func NewMissingElementMessage

func NewMissingElementMessage(element gst.Elementer, factoryName string) *gst.Message

NewMissingElementMessage creates a missing-plugin message for element to notify the application that a certain required element is missing. This function is mainly for use in plugins.

The function takes the following parameters:

  • element posting the message.
  • factoryName: name of the missing element (element factory), e.g. "videoscale" or "cdparanoiasrc".

The function returns the following values:

  • message: new Message, or NULL on error.

func NewMissingEncoderInstallerDetail

func NewMissingEncoderInstallerDetail(encodeCaps *gst.Caps) string

NewMissingEncoderInstallerDetail returns an opaque string containing all the details about the missing element to be passed to an external installer called via gst_install_plugins_async() or gst_install_plugins_sync().

This function is mainly for applications that call external plugin installation mechanisms using one of the two above-mentioned functions in the case where the application knows exactly what kind of plugin it is missing.

The function takes the following parameters:

  • encodeCaps: (fixed) caps for which an encoder element is needed.

The function returns the following values:

  • utf8: newly-allocated detail string, or NULL on error. Free string with g_free() when not needed any longer.

func NewMissingEncoderMessage

func NewMissingEncoderMessage(element gst.Elementer, encodeCaps *gst.Caps) *gst.Message

NewMissingEncoderMessage creates a missing-plugin message for element to notify the application that an encoder element for a particular set of (fixed) caps is missing. This function is mainly for use in plugins.

The function takes the following parameters:

  • element posting the message.
  • encodeCaps: (fixed) caps for which an encoder element is needed.

The function returns the following values:

  • message: new Message, or NULL on error.

func NewMissingURISinkInstallerDetail

func NewMissingURISinkInstallerDetail(protocol string) string

NewMissingURISinkInstallerDetail returns an opaque string containing all the details about the missing element to be passed to an external installer called via gst_install_plugins_async() or gst_install_plugins_sync().

This function is mainly for applications that call external plugin installation mechanisms using one of the two above-mentioned functions in the case where the application knows exactly what kind of plugin it is missing.

The function takes the following parameters:

  • protocol: URI protocol the missing source needs to implement, e.g. "http" or "mms".

The function returns the following values:

  • utf8: newly-allocated detail string, or NULL on error. Free string with g_free() when not needed any longer.

func NewMissingURISinkMessage

func NewMissingURISinkMessage(element gst.Elementer, protocol string) *gst.Message

NewMissingURISinkMessage creates a missing-plugin message for element to notify the application that a sink element for a particular URI protocol is missing. This function is mainly for use in plugins.

The function takes the following parameters:

  • element posting the message.
  • protocol: URI protocol the missing sink needs to implement, e.g. "http" or "smb".

The function returns the following values:

  • message: new Message, or NULL on error.

func NewMissingURISourceInstallerDetail

func NewMissingURISourceInstallerDetail(protocol string) string

NewMissingURISourceInstallerDetail returns an opaque string containing all the details about the missing element to be passed to an external installer called via gst_install_plugins_async() or gst_install_plugins_sync().

This function is mainly for applications that call external plugin installation mechanisms using one of the two above-mentioned functions in the case where the application knows exactly what kind of plugin it is missing.

The function takes the following parameters:

  • protocol: URI protocol the missing source needs to implement, e.g. "http" or "mms".

The function returns the following values:

  • utf8: newly-allocated detail string, or NULL on error. Free string with g_free() when not needed any longer.

func NewMissingURISourceMessage

func NewMissingURISourceMessage(element gst.Elementer, protocol string) *gst.Message

NewMissingURISourceMessage creates a missing-plugin message for element to notify the application that a source element for a particular URI protocol is missing. This function is mainly for use in plugins.

The function takes the following parameters:

  • element posting the message.
  • protocol: URI protocol the missing source needs to implement, e.g. "http" or "mms".

The function returns the following values:

  • message: new Message, or NULL on error.

func PbUtilsGetCodecDescription

func PbUtilsGetCodecDescription(caps *gst.Caps) string

PbUtilsGetCodecDescription returns a localised (as far as this is possible) string describing the media format specified in caps, for use in error dialogs or other messages to be seen by the user. Should never return NULL unless caps is invalid.

Also see the convenience function gst_pb_utils_add_codec_description_to_tag_list().

The function takes the following parameters:

  • caps: (fixed) Caps for which an format description is needed.

The function returns the following values:

  • utf8: newly-allocated description string, or NULL on error. Free string with g_free() when not needed any longer.

func PbUtilsGetDecoderDescription

func PbUtilsGetDecoderDescription(caps *gst.Caps) string

PbUtilsGetDecoderDescription returns a localised string describing an decoder for the format specified in caps, for use in error dialogs or other messages to be seen by the user. Should never return NULL unless factory_name or caps are invalid.

This function is mainly for internal use, applications would typically use gst_missing_plugin_message_get_description() to get a description of a missing feature from a missing-plugin message.

The function takes the following parameters:

  • caps: (fixed) Caps for which an decoder description is needed.

The function returns the following values:

  • utf8: newly-allocated description string, or NULL on error. Free string with g_free() when not needed any longer.

func PbUtilsGetElementDescription

func PbUtilsGetElementDescription(factoryName string) string

PbUtilsGetElementDescription returns a localised string describing the given element, for use in error dialogs or other messages to be seen by the user. Should never return NULL unless factory_name is invalid.

This function is mainly for internal use, applications would typically use gst_missing_plugin_message_get_description() to get a description of a missing feature from a missing-plugin message.

The function takes the following parameters:

  • factoryName: name of the element, e.g. "giosrc".

The function returns the following values:

  • utf8: newly-allocated description string, or NULL on error. Free string with g_free() when not needed any longer.

func PbUtilsGetEncoderDescription

func PbUtilsGetEncoderDescription(caps *gst.Caps) string

PbUtilsGetEncoderDescription returns a localised string describing an encoder for the format specified in caps, for use in error dialogs or other messages to be seen by the user. Should never return NULL unless factory_name or caps are invalid.

This function is mainly for internal use, applications would typically use gst_missing_plugin_message_get_description() to get a description of a missing feature from a missing-plugin message.

The function takes the following parameters:

  • caps: (fixed) Caps for which an encoder description is needed.

The function returns the following values:

  • utf8: newly-allocated description string, or NULL on error. Free string with g_free() when not needed any longer.

func PbUtilsGetFileExtensionFromCaps

func PbUtilsGetFileExtensionFromCaps(caps *gst.Caps) string

PbUtilsGetFileExtensionFromCaps returns a possible file extension for the given caps, if known.

The function takes the following parameters:

  • caps: (fixed) Caps for which a file extension is needed.

The function returns the following values:

  • utf8 (optional): newly-allocated file extension string, or NULL on error. Free string with g_free() when not needed any longer.

func PbUtilsGetSinkDescription

func PbUtilsGetSinkDescription(protocol string) string

PbUtilsGetSinkDescription returns a localised string describing a sink element handling the protocol specified in protocol, for use in error dialogs or other messages to be seen by the user. Should never return NULL unless protocol is invalid.

This function is mainly for internal use, applications would typically use gst_missing_plugin_message_get_description() to get a description of a missing feature from a missing-plugin message.

The function takes the following parameters:

  • protocol the sink element needs to handle, e.g. "http".

The function returns the following values:

  • utf8: newly-allocated description string, or NULL on error. Free string with g_free() when not needed any longer.

func PbUtilsGetSourceDescription

func PbUtilsGetSourceDescription(protocol string) string

PbUtilsGetSourceDescription returns a localised string describing a source element handling the protocol specified in protocol, for use in error dialogs or other messages to be seen by the user. Should never return NULL unless protocol is invalid.

This function is mainly for internal use, applications would typically use gst_missing_plugin_message_get_description() to get a description of a missing feature from a missing-plugin message.

The function takes the following parameters:

  • protocol the source element needs to handle, e.g. "http".

The function returns the following values:

  • utf8: newly-allocated description string, or NULL on error. Free string with g_free() when not needed any longer.

func PbUtilsInit

func PbUtilsInit()

PbUtilsInit initialises the base utils support library. This function is not thread-safe. Applications should call it after calling gst_init(), plugins should call it from their plugin_init function.

This function may be called multiple times. It will do nothing if the library has already been initialised.

func PluginsBaseVersion

func PluginsBaseVersion() (major, minor, micro, nano uint)

PluginsBaseVersion gets the version number of the GStreamer Plugins Base libraries.

The function returns the following values:

  • major: pointer to a guint to store the major version number, or NULL.
  • minor: pointer to a guint to store the minor version number, or NULL.
  • micro: pointer to a guint to store the micro version number, or NULL.
  • nano: pointer to a guint to store the nano version number, or NULL.

func PluginsBaseVersionString

func PluginsBaseVersionString() string

PluginsBaseVersionString: this function returns a string that is useful for describing this version of GStreamer's gst-plugins-base libraries to the outside world: user agent strings, logging, about dialogs ...

The function returns the following values:

  • utf8: newly allocated string describing this version of gst-plugins-base.

Types

type AudioVisualizer

type AudioVisualizer struct {
	gst.Element
	// contains filtered or unexported fields
}

AudioVisualizer baseclass for scopes (visualizers). It takes care of re-fitting the audio-rate to video-rate and handles renegotiation (downstream video size changes).

It also provides several background shading effects. These effects are applied to a previous picture before the render() implementation can draw a new frame.

func BaseAudioVisualizer

func BaseAudioVisualizer(obj AudioVisualizerer) *AudioVisualizer

BaseAudioVisualizer returns the underlying base object.

type AudioVisualizerClass

type AudioVisualizerClass struct {
	// contains filtered or unexported fields
}

AudioVisualizerClass: instance of this type is always passed by reference.

type AudioVisualizerOverrides

type AudioVisualizerOverrides struct {
	// The function takes the following parameters:
	//
	// The function returns the following values:
	//
	DecideAllocation func(query *gst.Query) bool
	// The function takes the following parameters:
	//
	//    - audio
	//    - video
	//
	// The function returns the following values:
	//
	Render func(audio *gst.Buffer, video *gstvideo.VideoFrame) bool
	// The function returns the following values:
	//
	Setup func() bool
}

AudioVisualizerOverrides contains methods that are overridable.

type AudioVisualizerShader

type AudioVisualizerShader C.gint

AudioVisualizerShader: different types of supported background shading functions.

const (
	// AudioVisualizerShaderNone: no shading.
	AudioVisualizerShaderNone AudioVisualizerShader = iota
	// AudioVisualizerShaderFade: plain fading.
	AudioVisualizerShaderFade
	// AudioVisualizerShaderFadeAndMoveUp: fade and move up.
	AudioVisualizerShaderFadeAndMoveUp
	// AudioVisualizerShaderFadeAndMoveDown: fade and move down.
	AudioVisualizerShaderFadeAndMoveDown
	// AudioVisualizerShaderFadeAndMoveLeft: fade and move left.
	AudioVisualizerShaderFadeAndMoveLeft
	// AudioVisualizerShaderFadeAndMoveRight: fade and move right.
	AudioVisualizerShaderFadeAndMoveRight
	// AudioVisualizerShaderFadeAndMoveHorizOut: fade and move horizontally out.
	AudioVisualizerShaderFadeAndMoveHorizOut
	// AudioVisualizerShaderFadeAndMoveHorizIn: fade and move horizontally in.
	AudioVisualizerShaderFadeAndMoveHorizIn
	// AudioVisualizerShaderFadeAndMoveVertOut: fade and move vertically out.
	AudioVisualizerShaderFadeAndMoveVertOut
	// AudioVisualizerShaderFadeAndMoveVertIn: fade and move vertically in.
	AudioVisualizerShaderFadeAndMoveVertIn
)

func (AudioVisualizerShader) String

func (a AudioVisualizerShader) String() string

String returns the name in string for AudioVisualizerShader.

type AudioVisualizerer

type AudioVisualizerer interface {
	coreglib.Objector
	// contains filtered or unexported methods
}

AudioVisualizerer describes types inherited from class AudioVisualizer.

To get the original type, the caller must assert this to an interface or another type.

type Discoverer

type Discoverer struct {
	*coreglib.Object
	// contains filtered or unexported fields
}

Discoverer is a utility object which allows to get as much information as possible from one or many URIs.

It provides two APIs, allowing usage in blocking or non-blocking mode.

The blocking mode just requires calling gst_discoverer_discover_uri() with the URI one wishes to discover.

The non-blocking mode requires a running Loop iterating a Context, where one connects to the various signals, appends the URIs to be processed (through gst_discoverer_discover_uri_async()) and then asks for the discovery to begin (through gst_discoverer_start()). By default this will use the GLib default main context unless you have set a custom context using g_main_context_push_thread_default().

All the information is returned in a DiscovererInfo structure.

func NewDiscoverer

func NewDiscoverer(timeout gst.ClockTime) (*Discoverer, error)

NewDiscoverer creates a new Discoverer with the provided timeout.

The function takes the following parameters:

  • timeout per file, in nanoseconds. Allowed are values between one second (T_SECOND) and one hour (3600 * T_SECOND).

The function returns the following values:

  • discoverer: new Discoverer. If an error occurred when creating the discoverer, err will be set accordingly and NULL will be returned. If err is set, the caller must free it when no longer needed using g_error_free().

func (*Discoverer) ConnectDiscovered

func (discoverer *Discoverer) ConnectDiscovered(f func(info *DiscovererInfo, err error)) coreglib.SignalHandle

ConnectDiscovered will be emitted in async mode when all information on a URI could be discovered, or an error occurred.

When an error occurs, info might still contain some partial information, depending on the circumstances of the error.

func (*Discoverer) ConnectFinished

func (discoverer *Discoverer) ConnectFinished(f func()) coreglib.SignalHandle

ConnectFinished will be emitted in async mode when all pending URIs have been processed.

func (*Discoverer) ConnectSourceSetup

func (discoverer *Discoverer) ConnectSourceSetup(f func(source gst.Elementer)) coreglib.SignalHandle

ConnectSourceSetup: this signal is emitted after the source element has been created for, so the URI being discovered, so it can be configured by setting additional properties (e.g. set a proxy server for an http source, or set the device and read speed for an audio cd source).

This signal is usually emitted from the context of a GStreamer streaming thread.

func (*Discoverer) ConnectStarting

func (discoverer *Discoverer) ConnectStarting(f func()) coreglib.SignalHandle

ConnectStarting will be emitted when the discover starts analyzing the pending URIs.

func (*Discoverer) DiscoverURI

func (discoverer *Discoverer) DiscoverURI(uri string) (*DiscovererInfo, error)

DiscoverURI: synchronously discovers the given uri.

A copy of uri will be made internally, so the caller can safely g_free() afterwards.

The function takes the following parameters:

  • uri: URI to run on.

The function returns the following values:

  • discovererInfo: result of the scanning. Can be NULL if an error occurred.

func (*Discoverer) DiscoverURIAsync

func (discoverer *Discoverer) DiscoverURIAsync(uri string) bool

DiscoverURIAsync appends the given uri to the list of URIs to discoverer. The actual discovery of the uri will only take place if gst_discoverer_start() has been called.

A copy of uri will be made internally, so the caller can safely g_free() afterwards.

The function takes the following parameters:

  • uri: URI to add.

The function returns the following values:

  • ok: TRUE if the uri was successfully appended to the list of pending uris, else FALSE.

func (*Discoverer) Start

func (discoverer *Discoverer) Start()

Start: allow asynchronous discovering of URIs to take place. A Loop must be available for Discoverer to properly work in asynchronous mode.

func (*Discoverer) Stop

func (discoverer *Discoverer) Stop()

Stop the discovery of any pending URIs and clears the list of pending URIS (if any).

type DiscovererAudioInfo

type DiscovererAudioInfo struct {
	DiscovererStreamInfo
	// contains filtered or unexported fields
}

DiscovererAudioInfo specific to audio streams.

func (*DiscovererAudioInfo) Bitrate

func (info *DiscovererAudioInfo) Bitrate() uint

The function returns the following values:

  • guint: average or nominal bitrate of the stream in bits/second.

func (*DiscovererAudioInfo) ChannelMask

func (info *DiscovererAudioInfo) ChannelMask() uint64

The function returns the following values:

  • guint64: channel-mask of the stream, refer to gst_audio_channel_positions_from_mask() for more information.

func (*DiscovererAudioInfo) Channels

func (info *DiscovererAudioInfo) Channels() uint

The function returns the following values:

  • guint: number of channels in the stream.

func (*DiscovererAudioInfo) Depth

func (info *DiscovererAudioInfo) Depth() uint

The function returns the following values:

  • guint: number of bits used per sample in each channel.

func (*DiscovererAudioInfo) Language

func (info *DiscovererAudioInfo) Language() string

The function returns the following values:

  • utf8: language of the stream, or NULL if unknown.

func (*DiscovererAudioInfo) MaxBitrate

func (info *DiscovererAudioInfo) MaxBitrate() uint

The function returns the following values:

  • guint: maximum bitrate of the stream in bits/second.

func (*DiscovererAudioInfo) SampleRate

func (info *DiscovererAudioInfo) SampleRate() uint

The function returns the following values:

  • guint: sample rate of the stream in Hertz.

type DiscovererClass

type DiscovererClass struct {
	// contains filtered or unexported fields
}

DiscovererClass: instance of this type is always passed by reference.

func (*DiscovererClass) Reserved

func (d *DiscovererClass) Reserved() [4]unsafe.Pointer

type DiscovererContainerInfo

type DiscovererContainerInfo struct {
	DiscovererStreamInfo
	// contains filtered or unexported fields
}

DiscovererContainerInfo specific to container streams.

func (*DiscovererContainerInfo) Streams

func (info *DiscovererContainerInfo) Streams() []*DiscovererStreamInfo

The function returns the following values:

  • list of DiscovererStreamInfo this container stream offers. Free with gst_discoverer_stream_info_list_free() after usage.

type DiscovererInfo

type DiscovererInfo struct {
	*coreglib.Object
	// contains filtered or unexported fields
}

DiscovererInfo: structure containing the information of a URI analyzed by Discoverer.

func DiscovererInfoFromVariant

func DiscovererInfoFromVariant(variant *glib.Variant) *DiscovererInfo

DiscovererInfoFromVariant parses a #GVariant as produced by gst_discoverer_info_to_variant() back to a DiscovererInfo.

The function takes the following parameters:

  • variant to deserialize into a DiscovererInfo.

The function returns the following values:

  • discovererInfo: newly-allocated DiscovererInfo.

func (*DiscovererInfo) AudioStreams

func (info *DiscovererInfo) AudioStreams() []*DiscovererStreamInfo

AudioStreams finds all the DiscovererAudioInfo contained in info.

The function returns the following values:

  • list of matching DiscovererStreamInfo. The caller should free it with gst_discoverer_stream_info_list_free().

func (*DiscovererInfo) ContainerStreams

func (info *DiscovererInfo) ContainerStreams() []*DiscovererStreamInfo

ContainerStreams finds all the DiscovererContainerInfo contained in info.

The function returns the following values:

  • list of matching DiscovererStreamInfo. The caller should free it with gst_discoverer_stream_info_list_free().

func (*DiscovererInfo) Copy

func (ptr *DiscovererInfo) Copy() *DiscovererInfo

The function returns the following values:

  • discovererInfo: copy of the DiscovererInfo.

func (*DiscovererInfo) Duration

func (info *DiscovererInfo) Duration() gst.ClockTime

The function returns the following values:

  • clockTime: duration of the URI in ClockTime (nanoseconds).

func (*DiscovererInfo) Live

func (info *DiscovererInfo) Live() bool

The function returns the following values:

  • ok: whether the URI is live.

func (*DiscovererInfo) Misc

func (info *DiscovererInfo) Misc() *gst.Structure

Misc: deprecated: This functions is deprecated since version 1.4, use #gst_discoverer_info_get_missing_elements_installer_details.

The function returns the following values:

  • structure miscellaneous information stored as a Structure (for example: information about missing plugins). If you wish to use the Structure after the life-time of info, you will need to copy it.

func (*DiscovererInfo) MissingElementsInstallerDetails

func (info *DiscovererInfo) MissingElementsInstallerDetails() []string

MissingElementsInstallerDetails: get the installer details for missing elements.

The function returns the following values:

  • utf8s: array of strings containing information about how to install the various missing elements for info to be usable. If you wish to use the strings after the life-time of info, you will need to copy them.

func (*DiscovererInfo) Result

func (info *DiscovererInfo) Result() DiscovererResult

The function returns the following values:

  • discovererResult: result of the discovery as a DiscovererResult.

func (*DiscovererInfo) Seekable

func (info *DiscovererInfo) Seekable() bool

The function returns the following values:

  • ok: whether the URI is seekable.

func (*DiscovererInfo) StreamInfo

func (info *DiscovererInfo) StreamInfo() *DiscovererStreamInfo

The function returns the following values:

  • discovererStreamInfo: structure (or topology) of the URI as a DiscovererStreamInfo. This structure can be traversed to see the original hierarchy. Unref with gst_discoverer_stream_info_unref() after usage.

func (*DiscovererInfo) StreamList

func (info *DiscovererInfo) StreamList() []*DiscovererStreamInfo

The function returns the following values:

  • list of all streams contained in the #info. Free after usage with gst_discoverer_stream_info_list_free().

func (*DiscovererInfo) Streams

func (info *DiscovererInfo) Streams(streamtype coreglib.Type) []*DiscovererStreamInfo

Streams finds the DiscovererStreamInfo contained in info that match the given streamtype.

The function takes the following parameters:

  • streamtype derived from DiscovererStreamInfo.

The function returns the following values:

  • list of matching DiscovererStreamInfo. The caller should free it with gst_discoverer_stream_info_list_free().

func (*DiscovererInfo) SubtitleStreams

func (info *DiscovererInfo) SubtitleStreams() []*DiscovererStreamInfo

SubtitleStreams finds all the DiscovererSubtitleInfo contained in info.

The function returns the following values:

  • list of matching DiscovererStreamInfo. The caller should free it with gst_discoverer_stream_info_list_free().

func (*DiscovererInfo) ToVariant

func (info *DiscovererInfo) ToVariant(flags DiscovererSerializeFlags) *glib.Variant

ToVariant serializes info to a #GVariant that can be parsed again through gst_discoverer_info_from_variant().

Note that any Toc (s) that might have been discovered will not be serialized for now.

The function takes the following parameters:

  • flags: combination of DiscovererSerializeFlags to specify what needs to be serialized.

The function returns the following values:

  • variant: newly-allocated #GVariant representing info.

func (*DiscovererInfo) Toc

func (info *DiscovererInfo) Toc() *gst.Toc

The function returns the following values:

  • toc: TOC contained in the URI. If you wish to use the TOC after the life-time of info, you will need to copy it.

func (*DiscovererInfo) URI

func (info *DiscovererInfo) URI() string

The function returns the following values:

  • utf8: URI to which this information corresponds to. Copy it if you wish to use it after the life-time of info.

func (*DiscovererInfo) VideoStreams

func (info *DiscovererInfo) VideoStreams() []*DiscovererStreamInfo

VideoStreams finds all the DiscovererVideoInfo contained in info.

The function returns the following values:

  • list of matching DiscovererStreamInfo. The caller should free it with gst_discoverer_stream_info_list_free().

type DiscovererOverrides

type DiscovererOverrides struct {
	// The function takes the following parameters:
	//
	//    - info
	//    - err
	//
	Discovered func(info *DiscovererInfo, err error)
	Finished   func()
	// The function takes the following parameters:
	//
	SourceSetup func(source gst.Elementer)
	Starting    func()
}

DiscovererOverrides contains methods that are overridable.

type DiscovererResult

type DiscovererResult C.gint

DiscovererResult: result values for the discovery process.

const (
	// DiscovererOK: discovery was successful.
	DiscovererOK DiscovererResult = iota
	// DiscovererURIInvalid: URI is invalid.
	DiscovererURIInvalid
	// DiscovererError: error happened and the GError is set.
	DiscovererError
	// DiscovererTimeout: discovery timed-out.
	DiscovererTimeout
	// DiscovererBusy: discoverer was already discovering a file.
	DiscovererBusy
	// DiscovererMissingPlugins: some plugins are missing for full discovery.
	DiscovererMissingPlugins
)

func (DiscovererResult) String

func (d DiscovererResult) String() string

String returns the name in string for DiscovererResult.

type DiscovererSerializeFlags

type DiscovererSerializeFlags C.guint

DiscovererSerializeFlags: you can use these flags to control what is serialized by gst_discoverer_info_to_variant().

const (
	// DiscovererSerializeBasic: serialize only basic information, excluding
	// caps, tags and miscellaneous information.
	DiscovererSerializeBasic DiscovererSerializeFlags = 0b0
	// DiscovererSerializeCaps: serialize the caps for each stream.
	DiscovererSerializeCaps DiscovererSerializeFlags = 0b1
	// DiscovererSerializeTags: serialize the tags for each stream.
	DiscovererSerializeTags DiscovererSerializeFlags = 0b10
	// DiscovererSerializeMisc: serialize miscellaneous information for each
	// stream.
	DiscovererSerializeMisc DiscovererSerializeFlags = 0b100
	// DiscovererSerializeAll: serialize all the available info, including caps,
	// tags and miscellaneous information.
	DiscovererSerializeAll DiscovererSerializeFlags = 0b111
)

func (DiscovererSerializeFlags) Has

Has returns true if d contains other.

func (DiscovererSerializeFlags) String

func (d DiscovererSerializeFlags) String() string

String returns the names in string for DiscovererSerializeFlags.

type DiscovererStreamInfo

type DiscovererStreamInfo struct {
	*coreglib.Object
	// contains filtered or unexported fields
}

DiscovererStreamInfo: base structure for information concerning a media stream. Depending on the stream type, one can find more media-specific information in DiscovererAudioInfo, DiscovererVideoInfo, and DiscovererContainerInfo.

The DiscovererStreamInfo represents the topology of the stream. Siblings can be iterated over with gst_discoverer_stream_info_get_next() and gst_discoverer_stream_info_get_previous(). Children (sub-streams) of a stream can be accessed using the DiscovererContainerInfo API.

As a simple example, if you run Discoverer on an AVI file with one audio and one video stream, you will get a DiscovererContainerInfo corresponding to the AVI container, which in turn will have a DiscovererAudioInfo sub-stream and a DiscovererVideoInfo sub-stream for the audio and video streams respectively.

func (*DiscovererStreamInfo) Caps

func (info *DiscovererStreamInfo) Caps() *gst.Caps

The function returns the following values:

  • caps of the stream. Unref with #gst_caps_unref after usage.

func (*DiscovererStreamInfo) Misc

func (info *DiscovererStreamInfo) Misc() *gst.Structure

Misc: deprecated: This functions is deprecated since version 1.4, use #gst_discoverer_info_get_missing_elements_installer_details.

The function returns the following values:

  • structure: additional information regarding the stream (for example codec version, profile, etc..). If you wish to use the Structure after the life-time of info you will need to copy it.

func (*DiscovererStreamInfo) Next

The function returns the following values:

  • discovererStreamInfo: next DiscovererStreamInfo in a chain. NULL for final streams. Unref with #gst_discoverer_stream_info_unref after usage.

func (*DiscovererStreamInfo) Previous

func (info *DiscovererStreamInfo) Previous() *DiscovererStreamInfo

The function returns the following values:

  • discovererStreamInfo previous DiscovererStreamInfo in a chain. NULL for starting points. Unref with #gst_discoverer_stream_info_unref after usage.

func (*DiscovererStreamInfo) StreamID

func (info *DiscovererStreamInfo) StreamID() string

The function returns the following values:

  • utf8: stream ID of this stream. If you wish to use the stream ID after the life-time of info you will need to copy it.

func (*DiscovererStreamInfo) StreamNumber

func (info *DiscovererStreamInfo) StreamNumber() int

The function returns the following values:

  • gint: stream number, -1 if no index could be determined. This property acts as a unique identifier as a 'int' for the stream.

func (*DiscovererStreamInfo) StreamTypeNick

func (info *DiscovererStreamInfo) StreamTypeNick() string

The function returns the following values:

  • utf8: human readable name for the stream type of the given info (ex : "audio", "container",...).

func (*DiscovererStreamInfo) Toc

func (info *DiscovererStreamInfo) Toc() *gst.Toc

The function returns the following values:

  • toc: TOC contained in this stream. If you wish to use the TOC after the life-time of info you will need to copy it.

type DiscovererSubtitleInfo

type DiscovererSubtitleInfo struct {
	DiscovererStreamInfo
	// contains filtered or unexported fields
}

DiscovererSubtitleInfo specific to subtitle streams (this includes text and image based ones).

func (*DiscovererSubtitleInfo) Language

func (info *DiscovererSubtitleInfo) Language() string

The function returns the following values:

  • utf8: language of the stream, or NULL if unknown.

type DiscovererVideoInfo

type DiscovererVideoInfo struct {
	DiscovererStreamInfo
	// contains filtered or unexported fields
}

DiscovererVideoInfo specific to video streams (this includes images).

func (*DiscovererVideoInfo) Bitrate

func (info *DiscovererVideoInfo) Bitrate() uint

The function returns the following values:

  • guint: average or nominal bitrate of the video stream in bits/second.

func (*DiscovererVideoInfo) Depth

func (info *DiscovererVideoInfo) Depth() uint

The function returns the following values:

  • guint: depth in bits of the video stream.

func (*DiscovererVideoInfo) FramerateDenom

func (info *DiscovererVideoInfo) FramerateDenom() uint

The function returns the following values:

  • guint: framerate of the video stream (denominator).

func (*DiscovererVideoInfo) FramerateNum

func (info *DiscovererVideoInfo) FramerateNum() uint

The function returns the following values:

  • guint: framerate of the video stream (numerator).

func (*DiscovererVideoInfo) Height

func (info *DiscovererVideoInfo) Height() uint

The function returns the following values:

  • guint: height of the video stream in pixels.

func (*DiscovererVideoInfo) IsImage

func (info *DiscovererVideoInfo) IsImage() bool

The function returns the following values:

  • ok: TRUE if the video stream corresponds to an image (i.e. only contains one frame).

func (*DiscovererVideoInfo) IsInterlaced

func (info *DiscovererVideoInfo) IsInterlaced() bool

The function returns the following values:

  • ok: TRUE if the stream is interlaced, else FALSE.

func (*DiscovererVideoInfo) MaxBitrate

func (info *DiscovererVideoInfo) MaxBitrate() uint

The function returns the following values:

  • guint: maximum bitrate of the video stream in bits/second.

func (*DiscovererVideoInfo) ParDenom

func (info *DiscovererVideoInfo) ParDenom() uint

The function returns the following values:

  • guint: pixel Aspect Ratio (PAR) of the video stream (denominator).

func (*DiscovererVideoInfo) ParNum

func (info *DiscovererVideoInfo) ParNum() uint

The function returns the following values:

  • guint: pixel Aspect Ratio (PAR) of the video stream (numerator).

func (*DiscovererVideoInfo) Width

func (info *DiscovererVideoInfo) Width() uint

The function returns the following values:

  • guint: width of the video stream in pixels.

type EncodingAudioProfile

type EncodingAudioProfile struct {
	EncodingProfile
	// contains filtered or unexported fields
}

EncodingAudioProfile: variant of EncodingProfile for audio streams.

func NewEncodingAudioProfile

func NewEncodingAudioProfile(format *gst.Caps, preset string, restriction *gst.Caps, presence uint) *EncodingAudioProfile

NewEncodingAudioProfile creates a new EncodingAudioProfile

All provided allocatable arguments will be internally copied, so can be safely freed/unreferenced after calling this method.

The function takes the following parameters:

  • format: Caps.
  • preset (optional): preset(s) to use on the encoder, can be NULL.
  • restriction (optional) used to restrict the input to the encoder, can be NULL. See gst_encoding_profile_get_restriction() for more details.
  • presence: number of time this stream must be used. 0 means any number of times (including never).

The function returns the following values:

  • encodingAudioProfile: newly created EncodingAudioProfile.

type EncodingContainerProfile

type EncodingContainerProfile struct {
	EncodingProfile
	// contains filtered or unexported fields
}

EncodingContainerProfile: encoding profiles for containers. Keeps track of a list of EncodingProfile.

func NewEncodingContainerProfile

func NewEncodingContainerProfile(name, description string, format *gst.Caps, preset string) *EncodingContainerProfile

NewEncodingContainerProfile creates a new EncodingContainerProfile.

The function takes the following parameters:

  • name (optional) of the container profile, can be NULL.
  • description (optional) of the container profile, can be NULL.
  • format to use for this profile.
  • preset (optional) to use for this profile.

The function returns the following values:

  • encodingContainerProfile: newly created EncodingContainerProfile.

func (*EncodingContainerProfile) AddProfile

func (container *EncodingContainerProfile) AddProfile(profile *EncodingProfile) bool

AddProfile: add a EncodingProfile to the list of profiles handled by container.

No copy of profile will be made, if you wish to use it elsewhere after this method you should increment its reference count.

The function takes the following parameters:

  • profile to add.

The function returns the following values:

  • ok: TRUE if the stream was properly added, else FALSE.

func (*EncodingContainerProfile) ContainsProfile

func (container *EncodingContainerProfile) ContainsProfile(profile *EncodingProfile) bool

ContainsProfile checks if container contains a EncodingProfile identical to profile.

The function takes the following parameters:

  • profile: EncodingProfile.

The function returns the following values:

  • ok: TRUE if container contains a EncodingProfile identical to profile, else FALSE.

func (*EncodingContainerProfile) Profiles

func (profile *EncodingContainerProfile) Profiles() []*EncodingProfile

The function returns the following values:

  • list: the list of contained EncodingProfile.

type EncodingProfile

type EncodingProfile struct {
	*coreglib.Object
	// contains filtered or unexported fields
}

EncodingProfile: opaque base class object for all encoding profiles. This contains generic information like name, description, format and preset.

func EncodingProfileFind

func EncodingProfileFind(targetname, profilename, category string) *EncodingProfile

EncodingProfileFind: find the EncodingProfile with the specified name and category.

The function takes the following parameters:

  • targetname: name of the target.
  • profilename (optional): name of the profile, if NULL provided, it will default to the encoding profile called default.
  • category (optional): target category. Can be NULL.

The function returns the following values:

  • encodingProfile: matching EncodingProfile or NULL.

func EncodingProfileFromDiscoverer

func EncodingProfileFromDiscoverer(info *DiscovererInfo) *EncodingProfile

EncodingProfileFromDiscoverer creates a EncodingProfile matching the formats from the given DiscovererInfo. Streams other than audio or video (eg, subtitles), are currently ignored.

The function takes the following parameters:

  • info to read from.

The function returns the following values:

  • encodingProfile: new EncodingProfile or NULL.

func (*EncodingProfile) AllowDynamicOutput

func (profile *EncodingProfile) AllowDynamicOutput() bool

AllowDynamicOutput: get whether the format that has been negotiated in at some point can be renegotiated later during the encoding.

The function returns the following values:

func (*EncodingProfile) Copy

func (self *EncodingProfile) Copy() *EncodingProfile

Copy makes a deep copy of self.

The function returns the following values:

  • encodingProfile: copy of self.

func (*EncodingProfile) Description

func (profile *EncodingProfile) Description() string

The function returns the following values:

  • utf8: description of the profile, can be NULL.

func (*EncodingProfile) ElementProperties

func (self *EncodingProfile) ElementProperties() *gst.Structure

The function returns the following values:

  • structure (optional) properties that are going to be set on the underlying element.

func (*EncodingProfile) FileExtension

func (profile *EncodingProfile) FileExtension() string

The function returns the following values:

  • utf8: suitable file extension for profile, or NULL.

func (*EncodingProfile) Format

func (profile *EncodingProfile) Format() *gst.Caps

The function returns the following values:

  • caps corresponding to the media format used in the profile. Unref after usage.

func (*EncodingProfile) InputCaps

func (profile *EncodingProfile) InputCaps() *gst.Caps

InputCaps computes the full output caps that this profile will be able to consume.

The function returns the following values:

  • caps: full caps the given profile can consume. Call gst_caps_unref() when you are done with the caps.

func (*EncodingProfile) IsEnabled

func (profile *EncodingProfile) IsEnabled() bool

The function returns the following values:

func (*EncodingProfile) IsEqual

func (a *EncodingProfile) IsEqual(b *EncodingProfile) bool

IsEqual checks whether the two EncodingProfile are equal.

The function takes the following parameters:

  • b: EncodingProfile.

The function returns the following values:

  • ok: TRUE if a and b are equal, else FALSE.

func (*EncodingProfile) Name

func (profile *EncodingProfile) Name() string

The function returns the following values:

  • utf8: name of the profile, can be NULL.

func (*EncodingProfile) Presence

func (profile *EncodingProfile) Presence() uint

The function returns the following values:

  • guint: number of times the profile is used in its parent container profile. If 0, it is not a mandatory stream.

func (*EncodingProfile) Preset

func (profile *EncodingProfile) Preset() string

The function returns the following values:

  • utf8: name of the Preset to be used in the profile. This is the name that has been set when saving the preset.

func (*EncodingProfile) PresetName

func (profile *EncodingProfile) PresetName() string

The function returns the following values:

  • utf8: name of the Preset factory to be used in the profile.

func (*EncodingProfile) Restriction

func (profile *EncodingProfile) Restriction() *gst.Caps

The function returns the following values:

  • caps: restriction Caps to apply before the encoder that will be used in the profile. The fields present in restriction caps are properties of the raw stream (that is before encoding), such as height and width for video and depth and sampling rate for audio. Does not apply to EncodingContainerProfile (since there is no corresponding raw stream). Can be NULL. Unref after usage.

func (*EncodingProfile) SetAllowDynamicOutput

func (profile *EncodingProfile) SetAllowDynamicOutput(allowDynamicOutput bool)

SetAllowDynamicOutput sets whether the format that has been negotiated in at some point can be renegotiated later during the encoding.

The function takes the following parameters:

  • allowDynamicOutput: whether the format that has been negotiated first can be renegotiated during the encoding.

func (*EncodingProfile) SetDescription

func (profile *EncodingProfile) SetDescription(description string)

SetDescription: set description as the given description for the profile. A copy of description will be made internally.

The function takes the following parameters:

  • description (optional) to set on the profile.

func (*EncodingProfile) SetElementProperties

func (self *EncodingProfile) SetElementProperties(elementProperties *gst.Structure)

SetElementProperties: this allows setting the muxing/encoding element properties.

**Set properties generically**

` properties [element-properties, boolean-prop=true, string-prop="hi"]

  **Mapping properties with well known element factories**

properties

element-properties-map, map = {

    [openh264enc, gop-size=32, ],
    [x264enc, key-int-max=32, tune=zerolatency],
}

`.

The function takes the following parameters:

  • elementProperties defining the properties to be set to the element the profile represents.

func (*EncodingProfile) SetEnabled

func (profile *EncodingProfile) SetEnabled(enabled bool)

SetEnabled: set whether the profile should be used or not.

The function takes the following parameters:

  • enabled: FALSE to disable profile, TRUE to enable it.

func (*EncodingProfile) SetFormat

func (profile *EncodingProfile) SetFormat(format *gst.Caps)

SetFormat sets the media format used in the profile.

The function takes the following parameters:

  • format: media format to use in the profile.

func (*EncodingProfile) SetName

func (profile *EncodingProfile) SetName(name string)

SetName: set name as the given name for the profile. A copy of name will be made internally.

The function takes the following parameters:

  • name (optional) to set on the profile.

func (*EncodingProfile) SetPresence

func (profile *EncodingProfile) SetPresence(presence uint)

SetPresence: set the number of time the profile is used in its parent container profile. If 0, it is not a mandatory stream.

The function takes the following parameters:

  • presence: number of time the profile can be used.

func (*EncodingProfile) SetPreset

func (profile *EncodingProfile) SetPreset(preset string)

SetPreset sets the name of the Element that implements the Preset interface to use for the profile. This is the name that has been set when saving the preset.

The function takes the following parameters:

  • preset (optional): element preset to use.

func (*EncodingProfile) SetPresetName

func (profile *EncodingProfile) SetPresetName(presetName string)

SetPresetName sets the name of the Preset's factory to be used in the profile.

The function takes the following parameters:

  • presetName (optional): name of the preset to use in this profile.

func (*EncodingProfile) SetRestriction

func (profile *EncodingProfile) SetRestriction(restriction *gst.Caps)

SetRestriction: set the restriction Caps to apply before the encoder that will be used in the profile. See gst_encoding_profile_get_restriction() for more about restrictions. Does not apply to EncodingContainerProfile.

The function takes the following parameters:

  • restriction (optional) to apply.

func (*EncodingProfile) SetSingleSegment

func (profile *EncodingProfile) SetSingleSegment(singleSegment bool)

SetSingleSegment: if using a single segment, buffers will be retimestamped and segments will be eat so as to appear as one segment.

> *NOTE*: Single segment is not property supported when using > #encodebin:avoid-reencoding.

The function takes the following parameters:

  • singleSegment if the stream represented by profile should use a single segment before the encoder, LSE otherwise.

func (*EncodingProfile) SingleSegment

func (profile *EncodingProfile) SingleSegment() bool

The function returns the following values:

  • ok if the stream represented by profile should use a single segment before the encoder, LSE otherwise. This means that buffers will be retimestamped and segments will be eat so as to appear as one segment.

func (*EncodingProfile) TypeNick

func (profile *EncodingProfile) TypeNick() string

The function returns the following values:

  • utf8: human-readable name of the type of profile.

type EncodingTarget

type EncodingTarget struct {
	*coreglib.Object
	// contains filtered or unexported fields
}

EncodingTarget: collection of EncodingProfile for a specific target or use-case.

When being stored/loaded, targets come from a specific category, like T_ENCODING_CATEGORY_DEVICE.

func EncodingListAllTargets

func EncodingListAllTargets(categoryname string) []*EncodingTarget

EncodingListAllTargets: list all available EncodingTarget for the specified category, or all categories if categoryname is NULL.

The function takes the following parameters:

  • categoryname (optional): category, for ex: T_ENCODING_CATEGORY_DEVICE. Can be NULL.

The function returns the following values:

  • list of EncodingTarget.

func EncodingTargetLoad

func EncodingTargetLoad(name, category string) (*EncodingTarget, error)

EncodingTargetLoad searches for the EncodingTarget with the given name, loads it and returns it.

If the category name is specified only targets from that category will be searched for.

The function takes the following parameters:

  • name of the EncodingTarget to load (automatically converted to lower case internally as capital letters are not valid for target names).
  • category (optional): name of the target category, like T_ENCODING_CATEGORY_DEVICE. Can be NULL.

The function returns the following values:

  • encodingTarget if available, else NULL.

func EncodingTargetLoadFromFile

func EncodingTargetLoadFromFile(filepath string) (*EncodingTarget, error)

EncodingTargetLoadFromFile opens the provided file and returns the contained EncodingTarget.

The function takes the following parameters:

  • filepath: file location to load the EncodingTarget from.

The function returns the following values:

  • encodingTarget contained in the file, else NULL.

func NewEncodingTarget

func NewEncodingTarget(name, category, description string, profiles []*EncodingProfile) *EncodingTarget

NewEncodingTarget creates a new EncodingTarget.

The name and category can only consist of lowercase ASCII letters for the first character, followed by either lowercase ASCII letters, digits or hyphens ('-').

The category *should* be one of the existing well-defined categories, like T_ENCODING_CATEGORY_DEVICE, but it *can* be a application or user specific category if needed.

The function takes the following parameters:

  • name of the target.
  • category: name of the category to which this target belongs. For example: T_ENCODING_CATEGORY_DEVICE.
  • description of EncodingTarget in the current locale.
  • profiles: #GList of EncodingProfile.

The function returns the following values:

  • encodingTarget: newly created EncodingTarget or NULL if there was an error.

func (*EncodingTarget) AddProfile

func (target *EncodingTarget) AddProfile(profile *EncodingProfile) bool

AddProfile adds the given profile to the target. Each added profile must have a unique name within the profile.

The target will steal a reference to the profile. If you wish to use the profile after calling this method, you should increase its reference count.

The function takes the following parameters:

  • profile to add.

The function returns the following values:

  • ok: TRUE if the profile was added, else FALSE.

func (*EncodingTarget) Category

func (target *EncodingTarget) Category() string

The function returns the following values:

  • utf8: category of the target. For example: T_ENCODING_CATEGORY_DEVICE.

func (*EncodingTarget) Description

func (target *EncodingTarget) Description() string

The function returns the following values:

  • utf8: description of the target.

func (*EncodingTarget) Name

func (target *EncodingTarget) Name() string

The function returns the following values:

  • utf8: name of the target.

func (*EncodingTarget) Path

func (target *EncodingTarget) Path() string

The function returns the following values:

  • utf8: path to the target file.

func (*EncodingTarget) Profile

func (target *EncodingTarget) Profile(name string) *EncodingProfile

The function takes the following parameters:

  • name of the profile to retrieve.

The function returns the following values:

  • encodingProfile: matching EncodingProfile, or NULL.

func (*EncodingTarget) Profiles

func (target *EncodingTarget) Profiles() []*EncodingProfile

The function returns the following values:

  • list of EncodingProfile(s) this target handles.

func (*EncodingTarget) Save

func (target *EncodingTarget) Save() error

Save saves the target to a default user-local directory.

func (*EncodingTarget) SaveToFile

func (target *EncodingTarget) SaveToFile(filepath string) error

SaveToFile saves the target to the provided file location.

The function takes the following parameters:

  • filepath: location to store the target at.

type EncodingVideoProfile

type EncodingVideoProfile struct {
	EncodingProfile
	// contains filtered or unexported fields
}

EncodingVideoProfile: variant of EncodingProfile for video streams, allows specifying the pass.

func NewEncodingVideoProfile

func NewEncodingVideoProfile(format *gst.Caps, preset string, restriction *gst.Caps, presence uint) *EncodingVideoProfile

NewEncodingVideoProfile creates a new EncodingVideoProfile

All provided allocatable arguments will be internally copied, so can be safely freed/unreferenced after calling this method.

If you wish to control the pass number (in case of multi-pass scenarios), please refer to the gst_encoding_video_profile_set_pass() documentation.

If you wish to use/force a constant framerate please refer to the gst_encoding_video_profile_set_variableframerate() documentation.

The function takes the following parameters:

  • format: Caps.
  • preset (optional): preset(s) to use on the encoder, can be NULL.
  • restriction (optional) used to restrict the input to the encoder, can be NULL. See gst_encoding_profile_get_restriction() for more details.
  • presence: number of time this stream must be used. 0 means any number of times (including never).

The function returns the following values:

  • encodingVideoProfile: newly created EncodingVideoProfile.

func (*EncodingVideoProfile) Pass

func (prof *EncodingVideoProfile) Pass() uint

Pass: get the pass number if this is part of a multi-pass profile.

The function returns the following values:

  • guint pass number. Starts at 1 for multi-pass. 0 if this is not a multi-pass profile.

func (*EncodingVideoProfile) SetPass

func (prof *EncodingVideoProfile) SetPass(pass uint)

SetPass sets the pass number of this video profile. The first pass profile should have this value set to 1. If this video profile isn't part of a multi-pass profile, you may set it to 0 (the default value).

The function takes the following parameters:

  • pass number for this profile.

func (*EncodingVideoProfile) SetVariableframerate

func (prof *EncodingVideoProfile) SetVariableframerate(variableframerate bool)

SetVariableframerate: if set to TRUE, then the incoming stream will be allowed to have non-constant framerate. If set to FALSE (default value), then the incoming stream will be normalized by dropping/duplicating frames in order to produce a constance framerate.

The function takes the following parameters:

  • variableframerate: boolean.

func (*EncodingVideoProfile) Variableframerate

func (prof *EncodingVideoProfile) Variableframerate() bool

Variableframerate: > *NOTE*: Fixed framerate won't be enforced when #encodebin:avoid-reencoding > is set.

The function returns the following values:

  • ok: whether non-constant video framerate is allowed for encoding.

type InstallPluginsContext

type InstallPluginsContext struct {
	// contains filtered or unexported fields
}

InstallPluginsContext: opaque context structure for the plugin installation. Use the provided API to set details on it.

An instance of this type is always passed by reference.

func NewInstallPluginsContext

func NewInstallPluginsContext() *InstallPluginsContext

NewInstallPluginsContext constructs a struct InstallPluginsContext.

func (*InstallPluginsContext) Copy

Copy copies a InstallPluginsContext.

The function returns the following values:

  • installPluginsContext: copy of ctx.

func (*InstallPluginsContext) SetConfirmSearch

func (ctx *InstallPluginsContext) SetConfirmSearch(confirmSearch bool)

SetConfirmSearch: this function is used to tell the external installer process whether it should ask for confirmation or not before searching for missing plugins.

If set, this option will be passed to the installer via a --interaction=[show-confirm-search|hide-confirm-search] command line option.

The function takes the following parameters:

  • confirmSearch: whether to ask for confirmation before searching for plugins.

func (*InstallPluginsContext) SetDesktopID

func (ctx *InstallPluginsContext) SetDesktopID(desktopId string)

SetDesktopID: this function is used to pass the calling application's desktop file ID to the external installer process.

A desktop file ID is the basename of the desktop file, including the .desktop extension.

If set, the desktop file ID will be passed to the installer via a --desktop-id= command line option.

The function takes the following parameters:

  • desktopId: desktop file ID of the calling application.

func (*InstallPluginsContext) SetStartupNotificationID

func (ctx *InstallPluginsContext) SetStartupNotificationID(startupId string)

SetStartupNotificationID sets the startup notification ID for the launched process.

This is typically used to to pass the current X11 event timestamp to the external installer process.

Startup notification IDs are defined in the FreeDesktop.Org Startup Notifications standard (http://standards.freedesktop.org/startup-notification-spec/startup-notification-latest.txt).

If set, the ID will be passed to the installer via a --startup-notification-id= command line option.

GTK+/GNOME applications should be able to create a startup notification ID like this:

  timestamp = gtk_get_current_event_time ();
  startup_id = g_strdup_printf ("_TIMEu", timestamp);
...

The function takes the following parameters:

  • startupId: startup notification ID.

func (*InstallPluginsContext) SetXid

func (ctx *InstallPluginsContext) SetXid(xid uint)

SetXid: this function is for X11-based applications (such as most Gtk/Qt applications on linux/unix) only. You can use it to tell the external installer the XID of your main application window. That way the installer can make its own window transient to your application window during the installation.

If set, the XID will be passed to the installer via a --transient-for=XID command line option.

Gtk+/Gnome application should be able to obtain the XID of the top-level window like this:

##include <gtk/gtk.h>
##ifdef GDK_WINDOWING_X11
##include <gdk/gdkx.h>
##endif
...
##ifdef GDK_WINDOWING_X11
  xid = GDK_WINDOW_XWINDOW (GTK_WIDGET (application_window)->window);
##endif
...

The function takes the following parameters:

  • xid: XWindow ID (XID) of the top-level application.

type InstallPluginsResultFunc

type InstallPluginsResultFunc func(result InstallPluginsReturn)

InstallPluginsResultFunc: prototype of the callback function that will be called once the external plugin installer program has returned. You only need to provide a callback function if you are using the asynchronous interface.

type InstallPluginsReturn

type InstallPluginsReturn C.gint

InstallPluginsReturn: result codes returned by gst_install_plugins_async() and gst_install_plugins_sync(), and also the result code passed to the InstallPluginsResultFunc specified with gst_install_plugins_async().

These codes indicate success or failure of starting an external installer program and to what extent the requested plugins could be installed.

const (
	// InstallPluginsSuccess: all of the requested plugins could be installed.
	InstallPluginsSuccess InstallPluginsReturn = 0
	// InstallPluginsNotFound: no appropriate installation candidate for any of
	// the requested plugins could be found. Only return this if nothing has
	// been installed. Return T_INSTALL_PLUGINS_PARTIAL_SUCCESS if some (but not
	// all) of the requested plugins could be installed.
	InstallPluginsNotFound InstallPluginsReturn = 1
	// InstallPluginsError: error occurred during the installation. If this
	// happens, the user has already seen an error message and another one
	// should not be displayed.
	InstallPluginsError InstallPluginsReturn = 2
	// InstallPluginsPartialSuccess: some of the requested plugins could be
	// installed, but not all.
	InstallPluginsPartialSuccess InstallPluginsReturn = 3
	// InstallPluginsUserAbort: user has aborted the installation.
	InstallPluginsUserAbort InstallPluginsReturn = 4
	// InstallPluginsCrashed: installer had an unclean exit code (ie. death by
	// signal).
	InstallPluginsCrashed InstallPluginsReturn = 100
	// InstallPluginsInvalid: helper returned an invalid status code.
	InstallPluginsInvalid InstallPluginsReturn = 101
	// InstallPluginsStartedOK: returned by gst_install_plugins_async() to
	// indicate that everything went fine so far and the provided callback will
	// be called with the result of the installation later.
	InstallPluginsStartedOK InstallPluginsReturn = 200
	// InstallPluginsInternalFailure: some internal failure has occurred when
	// trying to start the installer.
	InstallPluginsInternalFailure InstallPluginsReturn = 201
	// InstallPluginsHelperMissing: helper script to call the actual installer
	// is not installed.
	InstallPluginsHelperMissing InstallPluginsReturn = 202
	// InstallPluginsInstallInProgress: previously-started plugin installation
	// is still in progress, try again later.
	InstallPluginsInstallInProgress InstallPluginsReturn = 203
)

func InstallPluginsAsync

func InstallPluginsAsync(details []string, ctx *InstallPluginsContext, fn InstallPluginsResultFunc) InstallPluginsReturn

InstallPluginsAsync requests plugin installation without blocking. Once the plugins have been installed or installation has failed, func will be called with the result of the installation and your provided user_data pointer.

This function requires a running GLib/Gtk main loop. If you are not running a GLib/Gtk main loop, make sure to regularly call g_main_context_iteration(NULL,FALSE).

The installer strings that make up detail are typically obtained by calling gst_missing_plugin_message_get_installer_detail() on missing-plugin messages that have been caught on a pipeline's bus or created by the application via the provided API, such as gst_missing_element_message_new().

It is possible to request the installation of multiple missing plugins in one go (as might be required if there is a demuxer for a certain format installed but no suitable video decoder and no suitable audio decoder).

The function takes the following parameters:

  • details: NULL-terminated array of installer string details (see below).
  • ctx (optional) or NULL.
  • fn: function to call when the installer program returns.

The function returns the following values:

  • installPluginsReturn: result code whether an external installer could be started.

func InstallPluginsSync

func InstallPluginsSync(details []string, ctx *InstallPluginsContext) InstallPluginsReturn

InstallPluginsSync requests plugin installation and block until the plugins have been installed or installation has failed.

This function should almost never be used, it only exists for cases where a non-GLib main loop is running and the user wants to run it in a separate thread and marshal the result back asynchronously into the main thread using the other non-GLib main loop. You should almost always use gst_install_plugins_async() instead of this function.

The function takes the following parameters:

  • details: NULL-terminated array of installer string details.
  • ctx (optional) or NULL.

The function returns the following values:

  • installPluginsReturn: result of the installation.

func (InstallPluginsReturn) String

func (i InstallPluginsReturn) String() string

String returns the name in string for InstallPluginsReturn.

type PbUtilsCapsDescriptionFlags

type PbUtilsCapsDescriptionFlags C.guint

PbUtilsCapsDescriptionFlags flags that are returned by gst_pb_utils_get_caps_description_flags() and describe the format of the caps.

const (
	// PbutilsCapsDescriptionFlagContainer caps describe a container format.
	PbutilsCapsDescriptionFlagContainer PbUtilsCapsDescriptionFlags = 0b1
	// PbutilsCapsDescriptionFlagAudio caps describe an audio format, or a
	// container format that can store audio.
	PbutilsCapsDescriptionFlagAudio PbUtilsCapsDescriptionFlags = 0b10
	// PbutilsCapsDescriptionFlagVideo caps describe an video format, or a
	// container format that can store video.
	PbutilsCapsDescriptionFlagVideo PbUtilsCapsDescriptionFlags = 0b100
	// PbutilsCapsDescriptionFlagImage caps describe an image format, or a
	// container format that can store image.
	PbutilsCapsDescriptionFlagImage PbUtilsCapsDescriptionFlags = 0b1000
	// PbutilsCapsDescriptionFlagSubtitle caps describe an subtitle format, or a
	// container format that can store subtitles.
	PbutilsCapsDescriptionFlagSubtitle PbUtilsCapsDescriptionFlags = 0b10000
	// PbutilsCapsDescriptionFlagTag: container format is a tags container.
	PbutilsCapsDescriptionFlagTag PbUtilsCapsDescriptionFlags = 0b100000
	// PbutilsCapsDescriptionFlagGeneric: container format can store any kind of
	// stream type.
	PbutilsCapsDescriptionFlagGeneric PbUtilsCapsDescriptionFlags = 0b1000000
)

func PbUtilsGetCapsDescriptionFlags

func PbUtilsGetCapsDescriptionFlags(caps *gst.Caps) PbUtilsCapsDescriptionFlags

PbUtilsGetCapsDescriptionFlags returns flags that describe the format of the caps if known. No flags are set for unknown caps.

The function takes the following parameters:

  • caps: (fixed) Caps for which flags are requested.

The function returns the following values:

  • pbUtilsCapsDescriptionFlags that describe caps, or no flags if the caps are unknown.

func (PbUtilsCapsDescriptionFlags) Has

Has returns true if p contains other.

func (PbUtilsCapsDescriptionFlags) String

String returns the names in string for PbUtilsCapsDescriptionFlags.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL