Merge plugin experimentation branch - GstBaseSrcs can now be implemented via the bindings but with very limited functionality still

This commit is contained in:
Avi Zimmerman
2021-01-06 22:50:03 +02:00
parent 7f4972677d
commit 26cf65f211
34 changed files with 1950 additions and 919 deletions

84
gst/gst_errors.go Normal file
View File

@@ -0,0 +1,84 @@
package gst
/*
#include "gst.go.h"
*/
import "C"
// Domain represents the different types of error domains.
type Domain string
// ErrorDomain castings
const (
DomainCore Domain = "CORE"
DomainLibrary Domain = "LIBRARY"
DomainResource Domain = "RESOURCE"
DomainStream Domain = "STREAM"
)
// ErrorCode represents GstGError codes.
type ErrorCode int
// Type castings of CoreErrors
const (
CoreErrorFailed ErrorCode = C.GST_CORE_ERROR_FAILED // (1) a general error which doesn't fit in any other category. Make sure you add a custom message to the error call.
CoreErrorTooLazy ErrorCode = C.GST_CORE_ERROR_TOO_LAZY // (2) do not use this except as a placeholder for deciding where to go while developing code.
CoreErrorNotImplemented ErrorCode = C.GST_CORE_ERROR_NOT_IMPLEMENTED // (3) use this when you do not want to implement this functionality yet.
CoreErrorStateChange ErrorCode = C.GST_CORE_ERROR_STATE_CHANGE // (4) used for state change errors.
CoreErrorPad ErrorCode = C.GST_CORE_ERROR_PAD // (5) used for pad-related errors.
CoreErrorThread ErrorCode = C.GST_CORE_ERROR_THREAD // (6) used for thread-related errors.
CoreErrorNegotiation ErrorCode = C.GST_CORE_ERROR_NEGOTIATION // (7) used for negotiation-related errors.
CoreErrorEvent ErrorCode = C.GST_CORE_ERROR_EVENT // (8) used for event-related errors.
CoreErrorSeek ErrorCode = C.GST_CORE_ERROR_SEEK // (9) used for seek-related errors.
CoreErrorCaps ErrorCode = C.GST_CORE_ERROR_CAPS // (10) used for caps-related errors.
CoreErrorTag ErrorCode = C.GST_CORE_ERROR_TAG // (11) used for negotiation-related errors.
CoreErrorMissingPlugin ErrorCode = C.GST_CORE_ERROR_MISSING_PLUGIN // (12) used if a plugin is missing.
CoreErrorClock ErrorCode = C.GST_CORE_ERROR_CLOCK // (13) used for clock related errors.
CoreErrorDisabled ErrorCode = C.GST_CORE_ERROR_DISABLED // (14) used if functionality has been disabled at compile time.
)
// Type castings for LibraryErrors
const (
LibraryErrorFailed ErrorCode = C.GST_LIBRARY_ERROR_FAILED // (1) a general error which doesn't fit in any other category. Make sure you add a custom message to the error call.
LibraryErrorTooLazy ErrorCode = C.GST_LIBRARY_ERROR_TOO_LAZY // (2) do not use this except as a placeholder for deciding where to go while developing code.
LibraryErrorInit ErrorCode = C.GST_LIBRARY_ERROR_INIT // (3) used when the library could not be opened.
LibraryErrorShutdown ErrorCode = C.GST_LIBRARY_ERROR_SHUTDOWN // (4) used when the library could not be closed.
LibraryErrorSettings ErrorCode = C.GST_LIBRARY_ERROR_SETTINGS // (5) used when the library doesn't accept settings.
LibraryErrorEncode ErrorCode = C.GST_LIBRARY_ERROR_ENCODE // (6) used when the library generated an encoding error.
)
// Type castings for ResourceErrors
const (
ResourceErrorFailed ErrorCode = C.GST_RESOURCE_ERROR_FAILED // (1) a general error which doesn't fit in any other category. Make sure you add a custom message to the error call.
ResourceErrorTooLazy ErrorCode = C.GST_RESOURCE_ERROR_TOO_LAZY // (2) do not use this except as a placeholder for deciding where to go while developing code.
ResourceErrorNotFound ErrorCode = C.GST_RESOURCE_ERROR_NOT_FOUND // (3) used when the resource could not be found.
ResourceErrorBusy ErrorCode = C.GST_RESOURCE_ERROR_BUSY // (4) used when resource is busy.
ResourceErrorOpenRead ErrorCode = C.GST_RESOURCE_ERROR_OPEN_READ // (5) used when resource fails to open for reading.
ResourceErrorOpenWrite ErrorCode = C.GST_RESOURCE_ERROR_OPEN_WRITE // (6) used when resource fails to open for writing.
ResourceErrorOpenReadWrite ErrorCode = C.GST_RESOURCE_ERROR_OPEN_READ_WRITE // (7) used when resource cannot be opened for both reading and writing, or either (but unspecified which).
ResourceErrorClose ErrorCode = C.GST_RESOURCE_ERROR_CLOSE // (8) used when the resource can't be closed.
ResourceErrorRead ErrorCode = C.GST_RESOURCE_ERROR_READ // (9) used when the resource can't be read from.
ResourceErrorWrite ErrorCode = C.GST_RESOURCE_ERROR_WRITE // (10) used when the resource can't be written to.
ResourceErrorSeek ErrorCode = C.GST_RESOURCE_ERROR_SEEK // (11) used when a seek on the resource fails.
ResourceErrorSync ErrorCode = C.GST_RESOURCE_ERROR_SYNC // (12) used when a synchronize on the resource fails.
ResourceErrorSettings ErrorCode = C.GST_RESOURCE_ERROR_SETTINGS // (13) used when settings can't be manipulated on.
ResourceErrorNoSpaceLeft ErrorCode = C.GST_RESOURCE_ERROR_NO_SPACE_LEFT // (14) used when the resource has no space left.
ResourceErrorNotAuthorized ErrorCode = C.GST_RESOURCE_ERROR_NOT_AUTHORIZED // (15) used when the resource can't be opened due to missing authorization. (Since: 1.2.4)
)
// Type castings for StreamErrors
const (
StreamErrorFailed ErrorCode = C.GST_STREAM_ERROR_FAILED // (1) a general error which doesn't fit in any other category. Make sure you add a custom message to the error call.
StreamErrorTooLazy ErrorCode = C.GST_STREAM_ERROR_TOO_LAZY // (2) do not use this except as a placeholder for deciding where to go while developing code.
StreamErrorNotImplemented ErrorCode = C.GST_STREAM_ERROR_NOT_IMPLEMENTED // (3) use this when you do not want to implement this functionality yet.
StreamErrorTypeNotFound ErrorCode = C.GST_STREAM_ERROR_TYPE_NOT_FOUND // (4) used when the element doesn't know the stream's type.
StreamErrorWrongType ErrorCode = C.GST_STREAM_ERROR_WRONG_TYPE // (5) used when the element doesn't handle this type of stream.
StreamErrorCodecNotFound ErrorCode = C.GST_STREAM_ERROR_CODEC_NOT_FOUND // (6) used when there's no codec to handle the stream's type.
StreamErrorDecode ErrorCode = C.GST_STREAM_ERROR_DECODE // (7) used when decoding fails.
StreamErrorEncode ErrorCode = C.GST_STREAM_ERROR_ENCODE // (8) used when encoding fails.
StreamErrorDemux ErrorCode = C.GST_STREAM_ERROR_DEMUX // (9) used when demuxing fails.
StreamErrorMux ErrorCode = C.GST_STREAM_ERROR_MUX // (10) used when muxing fails.
StreamErrorFormat ErrorCode = C.GST_STREAM_ERROR_FORMAT // (11) used when the stream is of the wrong format (for example, wrong caps).
StreamErrorDecrypt ErrorCode = C.GST_STREAM_ERROR_DECRYPT // (12) used when the stream is encrypted and can't be decrypted because this is not supported by the element.
StreamErrorDecryptNoKey ErrorCode = C.GST_STREAM_ERROR_DECRYPT_NOKEY // (13) used when the stream is encrypted and can't be decrypted because no suitable key is available.
)