gi-gstvideo-1.0.24: GStreamerVideo bindings
CopyrightWill Thompson Iñaki García Etxebarria and Jonas Platte
LicenseLGPL-2.1
MaintainerIñaki García Etxebarria
Safe HaskellSafe-Inferred
LanguageHaskell2010

GI.GstVideo.Structs.VideoTimeCode

Description

fieldCount must be 0 for progressive video and 1 or 2 for interlaced.

A representation of a SMPTE time code.

hours must be positive and less than 24. Will wrap around otherwise. minutes and seconds must be positive and less than 60. frames must be less than or equal to config.fps_n / config.fps_d These values are *NOT* automatically normalized.

Since: 1.10

Synopsis

Exported types

newtype VideoTimeCode Source #

Memory-managed wrapper type.

Constructors

VideoTimeCode (ManagedPtr VideoTimeCode) 

Instances

Instances details
Eq VideoTimeCode Source # 
Instance details

Defined in GI.GstVideo.Structs.VideoTimeCode

GBoxed VideoTimeCode Source # 
Instance details

Defined in GI.GstVideo.Structs.VideoTimeCode

ManagedPtrNewtype VideoTimeCode Source # 
Instance details

Defined in GI.GstVideo.Structs.VideoTimeCode

Methods

toManagedPtr :: VideoTimeCode -> ManagedPtr VideoTimeCode

TypedObject VideoTimeCode Source # 
Instance details

Defined in GI.GstVideo.Structs.VideoTimeCode

Methods

glibType :: IO GType

HasParentTypes VideoTimeCode Source # 
Instance details

Defined in GI.GstVideo.Structs.VideoTimeCode

tag ~ 'AttrSet => Constructible VideoTimeCode tag Source # 
Instance details

Defined in GI.GstVideo.Structs.VideoTimeCode

Methods

new :: MonadIO m => (ManagedPtr VideoTimeCode -> VideoTimeCode) -> [AttrOp VideoTimeCode tag] -> m VideoTimeCode

IsGValue (Maybe VideoTimeCode) Source #

Convert VideoTimeCode to and from GValue. See toGValue and fromGValue.

Instance details

Defined in GI.GstVideo.Structs.VideoTimeCode

Methods

gvalueGType_ :: IO GType

gvalueSet_ :: Ptr GValue -> Maybe VideoTimeCode -> IO ()

gvalueGet_ :: Ptr GValue -> IO (Maybe VideoTimeCode)

type ParentTypes VideoTimeCode Source # 
Instance details

Defined in GI.GstVideo.Structs.VideoTimeCode

type ParentTypes VideoTimeCode = '[] :: [Type]

newZeroVideoTimeCode :: MonadIO m => m VideoTimeCode Source #

Construct a VideoTimeCode struct initialized to zero.

Methods

Click to display all available methods, including inherited ones

Expand

Methods

addFrames, addInterval, clear, compare, copy, framesSinceDailyJam, free, incrementFrame, init, initFromDateTime, initFromDateTimeFull, isValid, nsecSinceDailyJam, toDateTime, toString.

Getters

None.

Setters

None.

addFrames

videoTimeCodeAddFrames Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> VideoTimeCode

tc: a valid VideoTimeCode

-> Int64

frames: How many frames to add or subtract

-> m () 

Adds or subtracts frames amount of frames to tc. tc needs to contain valid data, as verified by videoTimeCodeIsValid.

Since: 1.10

addInterval

videoTimeCodeAddInterval Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> VideoTimeCode

tc: The VideoTimeCode where the diff should be added. This must contain valid timecode values.

-> VideoTimeCodeInterval

tcInter: The VideoTimeCodeInterval to add to tc. The interval must contain valid values, except that for drop-frame timecode, it may also contain timecodes which would normally be dropped. These are then corrected to the next reasonable timecode.

-> m (Maybe VideoTimeCode)

Returns: A new VideoTimeCode with tcInter added or Nothing if the interval can't be added.

This makes a component-wise addition of tcInter to tc. For example, adding ("01:02:03:04", "00:01:00:00") will return "01:03:03:04". When it comes to drop-frame timecodes, adding ("00:00:00;00", "00:01:00:00") will return "00:01:00;02" because of drop-frame oddities. However, adding ("00:09:00;02", "00:01:00:00") will return "00:10:00;00" because this time we can have an exact minute.

Since: 1.12

clear

videoTimeCodeClear Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> VideoTimeCode

tc: a VideoTimeCode

-> m () 

Initializes tc with empty/zero/NULL values and frees any memory it might currently use.

Since: 1.10

compare

videoTimeCodeCompare Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> VideoTimeCode

tc1: a valid VideoTimeCode

-> VideoTimeCode

tc2: another valid VideoTimeCode

-> m Int32

Returns: 1 if tc1 is after tc2, -1 if tc1 is before tc2, 0 otherwise.

Compares tc1 and tc2. If both have latest daily jam information, it is taken into account. Otherwise, it is assumed that the daily jam of both tc1 and tc2 was at the same time. Both time codes must be valid.

Since: 1.10

copy

videoTimeCodeCopy Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> VideoTimeCode

tc: a VideoTimeCode

-> m VideoTimeCode

Returns: a new VideoTimeCode with the same values as tc.

No description available in the introspection data.

Since: 1.10

framesSinceDailyJam

videoTimeCodeFramesSinceDailyJam Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> VideoTimeCode

tc: a valid VideoTimeCode

-> m Word64

Returns: how many frames have passed since the daily jam of tc.

No description available in the introspection data.

Since: 1.10

free

videoTimeCodeFree Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> VideoTimeCode

tc: a VideoTimeCode

-> m () 

Frees tc.

Since: 1.10

incrementFrame

videoTimeCodeIncrementFrame Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> VideoTimeCode

tc: a valid VideoTimeCode

-> m () 

Adds one frame to tc.

Since: 1.10

init

videoTimeCodeInit Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> VideoTimeCode

tc: a VideoTimeCode

-> Word32

fpsN: Numerator of the frame rate

-> Word32

fpsD: Denominator of the frame rate

-> Maybe DateTime

latestDailyJam: The latest daily jam of the VideoTimeCode

-> [VideoTimeCodeFlags]

flags: VideoTimeCodeFlags

-> Word32

hours: the hours field of VideoTimeCode

-> Word32

minutes: the minutes field of VideoTimeCode

-> Word32

seconds: the seconds field of VideoTimeCode

-> Word32

frames: the frames field of VideoTimeCode

-> Word32

fieldCount: Interlaced video field count

-> m () 

fieldCount is 0 for progressive, 1 or 2 for interlaced. latestDaiyJam reference is stolen from caller.

Initializes tc with the given values. The values are not checked for being in a valid range. To see if your timecode actually has valid content, use videoTimeCodeIsValid.

Since: 1.10

initFromDateTime

videoTimeCodeInitFromDateTime Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> VideoTimeCode

tc: an uninitialized VideoTimeCode

-> Word32

fpsN: Numerator of the frame rate

-> Word32

fpsD: Denominator of the frame rate

-> DateTime

dt: DateTime to convert

-> [VideoTimeCodeFlags]

flags: VideoTimeCodeFlags

-> Word32

fieldCount: Interlaced video field count

-> m () 

The resulting config->latest_daily_jam is set to midnight, and timecode is set to the given time.

Will assert on invalid parameters, use videoTimeCodeInitFromDateTimeFull for being able to handle invalid parameters.

Since: 1.12

initFromDateTimeFull

videoTimeCodeInitFromDateTimeFull Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> VideoTimeCode

tc: a VideoTimeCode

-> Word32

fpsN: Numerator of the frame rate

-> Word32

fpsD: Denominator of the frame rate

-> DateTime

dt: DateTime to convert

-> [VideoTimeCodeFlags]

flags: VideoTimeCodeFlags

-> Word32

fieldCount: Interlaced video field count

-> m Bool

Returns: True if tc could be correctly initialized to a valid timecode

The resulting config->latest_daily_jam is set to midnight, and timecode is set to the given time.

Since: 1.16

isValid

videoTimeCodeIsValid Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> VideoTimeCode

tc: VideoTimeCode to check

-> m Bool

Returns: whether tc is a valid timecode (supported frame rate, hours/minutes/seconds/frames not overflowing)

No description available in the introspection data.

Since: 1.10

new

videoTimeCodeNew Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Word32

fpsN: Numerator of the frame rate

-> Word32

fpsD: Denominator of the frame rate

-> DateTime

latestDailyJam: The latest daily jam of the VideoTimeCode

-> [VideoTimeCodeFlags]

flags: VideoTimeCodeFlags

-> Word32

hours: the hours field of VideoTimeCode

-> Word32

minutes: the minutes field of VideoTimeCode

-> Word32

seconds: the seconds field of VideoTimeCode

-> Word32

frames: the frames field of VideoTimeCode

-> Word32

fieldCount: Interlaced video field count

-> m VideoTimeCode

Returns: a new VideoTimeCode with the given values. The values are not checked for being in a valid range. To see if your timecode actually has valid content, use videoTimeCodeIsValid.

fieldCount is 0 for progressive, 1 or 2 for interlaced. latestDaiyJam reference is stolen from caller.

Since: 1.10

newEmpty

videoTimeCodeNewEmpty Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> m VideoTimeCode

Returns: a new empty, invalid VideoTimeCode

No description available in the introspection data.

Since: 1.10

newFromDateTime

videoTimeCodeNewFromDateTime Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Word32

fpsN: Numerator of the frame rate

-> Word32

fpsD: Denominator of the frame rate

-> DateTime

dt: DateTime to convert

-> [VideoTimeCodeFlags]

flags: VideoTimeCodeFlags

-> Word32

fieldCount: Interlaced video field count

-> m VideoTimeCode

Returns: the VideoTimeCode representation of dt.

The resulting config->latest_daily_jam is set to midnight, and timecode is set to the given time.

This might return a completely invalid timecode, use videoTimeCodeNewFromDateTimeFull to ensure that you would get Nothing instead in that case.

Since: 1.12

newFromDateTimeFull

videoTimeCodeNewFromDateTimeFull Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Word32

fpsN: Numerator of the frame rate

-> Word32

fpsD: Denominator of the frame rate

-> DateTime

dt: DateTime to convert

-> [VideoTimeCodeFlags]

flags: VideoTimeCodeFlags

-> Word32

fieldCount: Interlaced video field count

-> m VideoTimeCode

Returns: the VideoTimeCode representation of dt, or Nothing if no valid timecode could be created.

The resulting config->latest_daily_jam is set to midnight, and timecode is set to the given time.

Since: 1.16

newFromString

videoTimeCodeNewFromString Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Text

tcStr: The string that represents the VideoTimeCode

-> m (Maybe VideoTimeCode)

Returns: a new VideoTimeCode from the given string or Nothing if the string could not be passed.

No description available in the introspection data.

Since: 1.12

nsecSinceDailyJam

videoTimeCodeNsecSinceDailyJam Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> VideoTimeCode

tc: a valid VideoTimeCode

-> m Word64

Returns: how many nsec have passed since the daily jam of tc.

No description available in the introspection data.

Since: 1.10

toDateTime

videoTimeCodeToDateTime Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> VideoTimeCode

tc: A valid VideoTimeCode to convert

-> m (Maybe DateTime)

Returns: the DateTime representation of tc or Nothing if tc has no daily jam.

The tc.config->latest_daily_jam is required to be non-NULL.

Since: 1.10

toString

videoTimeCodeToString Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> VideoTimeCode

tc: A VideoTimeCode to convert

-> m Text

Returns: the SMPTE ST 2059-1:2015 string representation of tc. That will take the form hh:mm:ss:ff. The last separator (between seconds and frames) may vary:

';' for drop-frame, non-interlaced content and for drop-frame interlaced field 2 ',' for drop-frame interlaced field 1 ':' for non-drop-frame, non-interlaced content and for non-drop-frame interlaced field 2 '.' for non-drop-frame interlaced field 1

No description available in the introspection data.

Since: 1.10

Properties

config

the corresponding VideoTimeCodeConfig

getVideoTimeCodeConfig :: MonadIO m => VideoTimeCode -> m VideoTimeCodeConfig Source #

Get the value of the “config” field. When overloading is enabled, this is equivalent to

get videoTimeCode #config

fieldCount

Interlaced video field count

getVideoTimeCodeFieldCount :: MonadIO m => VideoTimeCode -> m Word32 Source #

Get the value of the “field_count” field. When overloading is enabled, this is equivalent to

get videoTimeCode #fieldCount

setVideoTimeCodeFieldCount :: MonadIO m => VideoTimeCode -> Word32 -> m () Source #

Set the value of the “field_count” field. When overloading is enabled, this is equivalent to

set videoTimeCode [ #fieldCount := value ]

frames

the frames field of VideoTimeCode

getVideoTimeCodeFrames :: MonadIO m => VideoTimeCode -> m Word32 Source #

Get the value of the “frames” field. When overloading is enabled, this is equivalent to

get videoTimeCode #frames

setVideoTimeCodeFrames :: MonadIO m => VideoTimeCode -> Word32 -> m () Source #

Set the value of the “frames” field. When overloading is enabled, this is equivalent to

set videoTimeCode [ #frames := value ]

hours

the hours field of VideoTimeCode

getVideoTimeCodeHours :: MonadIO m => VideoTimeCode -> m Word32 Source #

Get the value of the “hours” field. When overloading is enabled, this is equivalent to

get videoTimeCode #hours

setVideoTimeCodeHours :: MonadIO m => VideoTimeCode -> Word32 -> m () Source #

Set the value of the “hours” field. When overloading is enabled, this is equivalent to

set videoTimeCode [ #hours := value ]

minutes

the minutes field of VideoTimeCode

getVideoTimeCodeMinutes :: MonadIO m => VideoTimeCode -> m Word32 Source #

Get the value of the “minutes” field. When overloading is enabled, this is equivalent to

get videoTimeCode #minutes

setVideoTimeCodeMinutes :: MonadIO m => VideoTimeCode -> Word32 -> m () Source #

Set the value of the “minutes” field. When overloading is enabled, this is equivalent to

set videoTimeCode [ #minutes := value ]

seconds

the seconds field of VideoTimeCode

getVideoTimeCodeSeconds :: MonadIO m => VideoTimeCode -> m Word32 Source #

Get the value of the “seconds” field. When overloading is enabled, this is equivalent to

get videoTimeCode #seconds

setVideoTimeCodeSeconds :: MonadIO m => VideoTimeCode -> Word32 -> m () Source #

Set the value of the “seconds” field. When overloading is enabled, this is equivalent to

set videoTimeCode [ #seconds := value ]