Class VideoTimeCode
- All Implemented Interfaces:
Proxy
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.fpsN / config.fpsD
These values are NOT automatically normalized.
- Since:
- 1.10
-
Constructor Summary
ConstructorsConstructorDescriptionVideoTimeCode(int fpsN, int fpsD, DateTime latestDailyJam, Set<VideoTimeCodeFlags> flags, int hours, int minutes, int seconds, int frames, int fieldCount) fieldCountis 0 for progressive, 1 or 2 for interlaced.VideoTimeCode(int fpsN, int fpsD, DateTime latestDailyJam, VideoTimeCodeFlags flags, int hours, int minutes, int seconds, int frames, int fieldCount) fieldCountis 0 for progressive, 1 or 2 for interlaced.VideoTimeCode(MemorySegment address) Create a VideoTimeCode proxy instance for the provided memory address. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddFrames(long frames) Adds or subtractsframesamount of frames totc.tc needs to contain valid data, as verified by gst_video_time_code_is_valid().@Nullable VideoTimeCodeaddInterval(VideoTimeCodeInterval tcInter) This makes a component-wise addition oftcIntertotc.For example, adding ("01:02:03:04", "00:01:00:00") will return "01:03:03:04".voidclear()Initializes this VideoTimeCode with empty/zero/NULL values and frees any memory it might currently use.intcompare(VideoTimeCode tc2) Compares this VideoTimeCode andtc2.If both have latest daily jam information, it is taken into account.copy()static VideoTimeCodeempty()longvoidfree()Freestc.static VideoTimeCodefromDateTime(int fpsN, int fpsD, DateTime dt, Set<VideoTimeCodeFlags> flags, int fieldCount) The resulting config->latest_daily_jam is set to midnight, and timecode is set to the given time.static VideoTimeCodefromDateTime(int fpsN, int fpsD, DateTime dt, VideoTimeCodeFlags flags, int fieldCount) The resulting config->latest_daily_jam is set to midnight, and timecode is set to the given time.static VideoTimeCodefromDateTimeFull(int fpsN, int fpsD, DateTime dt, Set<VideoTimeCodeFlags> flags, int fieldCount) The resulting config->latest_daily_jam is set to midnight, and timecode is set to the given time.static @Nullable VideoTimeCodefromDateTimeFull(int fpsN, int fpsD, DateTime dt, VideoTimeCodeFlags flags, int fieldCount) The resulting config->latest_daily_jam is set to midnight, and timecode is set to the given time.static VideoTimeCodefromString(String tcStr) static MemoryLayoutThe memory layout of the native struct.static @Nullable TypegetType()Get the GType of the VideoTimeCode classvoidAdds one frame totc.voidinit(int fpsN, int fpsD, @Nullable DateTime latestDailyJam, Set<VideoTimeCodeFlags> flags, int hours, int minutes, int seconds, int frames, int fieldCount) fieldCountis 0 for progressive, 1 or 2 for interlaced.voidinit(int fpsN, int fpsD, @Nullable DateTime latestDailyJam, VideoTimeCodeFlags flags, int hours, int minutes, int seconds, int frames, int fieldCount) fieldCountis 0 for progressive, 1 or 2 for interlaced.voidinitFromDateTime(int fpsN, int fpsD, DateTime dt, Set<VideoTimeCodeFlags> flags, int fieldCount) The resulting config->latest_daily_jam is set to midnight, and timecode is set to the given time.voidinitFromDateTime(int fpsN, int fpsD, DateTime dt, VideoTimeCodeFlags flags, int fieldCount) The resulting config->latest_daily_jam is set to midnight, and timecode is set to the given time.booleaninitFromDateTimeFull(int fpsN, int fpsD, DateTime dt, Set<VideoTimeCodeFlags> flags, int fieldCount) The resulting config->latest_daily_jam is set to midnight, and timecode is set to the given time.booleaninitFromDateTimeFull(int fpsN, int fpsD, DateTime dt, VideoTimeCodeFlags flags, int fieldCount) The resulting config->latest_daily_jam is set to midnight, and timecode is set to the given time.booleanisValid()long@Nullable VideoTimeCodeConfigRead the value of the fieldconfig.intRead the value of the fieldfield_count.intRead the value of the fieldframes.intRead the value of the fieldhours.intRead the value of the fieldminutes.intRead the value of the fieldseconds.@Nullable DateTimeThetc.config>latestDailyJamis required to be non-NULL.toString()voidwriteConfig(@Nullable VideoTimeCodeConfig config) Write a value in the fieldconfig.voidwriteFieldCount(int fieldCount) Write a value in the fieldfield_count.voidwriteFrames(int frames) Write a value in the fieldframes.voidwriteHours(int hours) Write a value in the fieldhours.voidwriteMinutes(int minutes) Write a value in the fieldminutes.voidwriteSeconds(int seconds) Write a value in the fieldseconds.Methods inherited from class org.javagi.base.ProxyInstance
equals, handle, hashCode
-
Constructor Details
-
VideoTimeCode
Create a VideoTimeCode proxy instance for the provided memory address.- Parameters:
address- the memory address of the native object
-
VideoTimeCode
public VideoTimeCode(int fpsN, int fpsD, DateTime latestDailyJam, Set<VideoTimeCodeFlags> flags, int hours, int minutes, int seconds, int frames, int fieldCount) fieldCountis 0 for progressive, 1 or 2 for interlaced.latestDaiyJamreference is stolen from caller.- Parameters:
fpsN- Numerator of the frame ratefpsD- Denominator of the frame ratelatestDailyJam- The latest daily jam of theGstVideoTimeCodeflags-GstVideoTimeCodeFlagshours- the hours field ofGstVideoTimeCodeminutes- the minutes field ofGstVideoTimeCodeseconds- the seconds field ofGstVideoTimeCodeframes- the frames field ofGstVideoTimeCodefieldCount- Interlaced video field count- Since:
- 1.10
-
VideoTimeCode
public VideoTimeCode(int fpsN, int fpsD, DateTime latestDailyJam, VideoTimeCodeFlags flags, int hours, int minutes, int seconds, int frames, int fieldCount) fieldCountis 0 for progressive, 1 or 2 for interlaced.latestDaiyJamreference is stolen from caller.- Parameters:
fpsN- Numerator of the frame ratefpsD- Denominator of the frame ratelatestDailyJam- The latest daily jam of theGstVideoTimeCodeflags-GstVideoTimeCodeFlagshours- the hours field ofGstVideoTimeCodeminutes- the minutes field ofGstVideoTimeCodeseconds- the seconds field ofGstVideoTimeCodeframes- the frames field ofGstVideoTimeCodefieldCount- Interlaced video field count- Since:
- 1.10
-
-
Method Details
-
getType
-
getMemoryLayout
The memory layout of the native struct.- Returns:
- the memory layout
-
readConfig
Read the value of the fieldconfig.- Returns:
- The value of the field
config
-
writeConfig
Write a value in the fieldconfig.- Parameters:
config- The new value for the fieldconfig
-
readHours
public int readHours()Read the value of the fieldhours.- Returns:
- The value of the field
hours
-
writeHours
public void writeHours(int hours) Write a value in the fieldhours.- Parameters:
hours- The new value for the fieldhours
-
readMinutes
public int readMinutes()Read the value of the fieldminutes.- Returns:
- The value of the field
minutes
-
writeMinutes
public void writeMinutes(int minutes) Write a value in the fieldminutes.- Parameters:
minutes- The new value for the fieldminutes
-
readSeconds
public int readSeconds()Read the value of the fieldseconds.- Returns:
- The value of the field
seconds
-
writeSeconds
public void writeSeconds(int seconds) Write a value in the fieldseconds.- Parameters:
seconds- The new value for the fieldseconds
-
readFrames
public int readFrames()Read the value of the fieldframes.- Returns:
- The value of the field
frames
-
writeFrames
public void writeFrames(int frames) Write a value in the fieldframes.- Parameters:
frames- The new value for the fieldframes
-
readFieldCount
public int readFieldCount()Read the value of the fieldfield_count.- Returns:
- The value of the field
field_count
-
writeFieldCount
public void writeFieldCount(int fieldCount) Write a value in the fieldfield_count.- Parameters:
fieldCount- The new value for the fieldfield_count
-
empty
-
fromDateTime
public static VideoTimeCode fromDateTime(int fpsN, int fpsD, DateTime dt, Set<VideoTimeCodeFlags> flags, int fieldCount) 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 gst_video_time_code_new_from_date_time_full() to ensure that you would get
nullinstead in that case.- Parameters:
fpsN- Numerator of the frame ratefpsD- Denominator of the frame ratedt-GDateTimeto convertflags-GstVideoTimeCodeFlagsfieldCount- Interlaced video field count- Returns:
- the
GstVideoTimeCoderepresentation ofdt. - Since:
- 1.12
-
fromDateTime
public static VideoTimeCode fromDateTime(int fpsN, int fpsD, DateTime dt, VideoTimeCodeFlags flags, int fieldCount) 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 gst_video_time_code_new_from_date_time_full() to ensure that you would get
nullinstead in that case.- Parameters:
fpsN- Numerator of the frame ratefpsD- Denominator of the frame ratedt-GDateTimeto convertflags-GstVideoTimeCodeFlagsfieldCount- Interlaced video field count- Returns:
- the
GstVideoTimeCoderepresentation ofdt. - Since:
- 1.12
-
fromDateTimeFull
public static VideoTimeCode fromDateTimeFull(int fpsN, int fpsD, DateTime dt, Set<VideoTimeCodeFlags> flags, int fieldCount) The resulting config->latest_daily_jam is set to midnight, and timecode is set to the given time.- Parameters:
fpsN- Numerator of the frame ratefpsD- Denominator of the frame ratedt-GDateTimeto convertflags-GstVideoTimeCodeFlagsfieldCount- Interlaced video field count- Returns:
- the
GstVideoTimeCoderepresentation ofdt,ornullif no valid timecode could be created. - Since:
- 1.16
-
fromDateTimeFull
public static @Nullable VideoTimeCode fromDateTimeFull(int fpsN, int fpsD, DateTime dt, VideoTimeCodeFlags flags, int fieldCount) The resulting config->latest_daily_jam is set to midnight, and timecode is set to the given time.- Parameters:
fpsN- Numerator of the frame ratefpsD- Denominator of the frame ratedt-GDateTimeto convertflags-GstVideoTimeCodeFlagsfieldCount- Interlaced video field count- Returns:
- the
GstVideoTimeCoderepresentation ofdt,ornullif no valid timecode could be created. - Since:
- 1.16
-
fromString
-
addFrames
public void addFrames(long frames) Adds or subtractsframesamount of frames totc.tc needs to contain valid data, as verified by gst_video_time_code_is_valid().- Parameters:
frames- How many frames to add or subtract- Since:
- 1.10
-
addInterval
This makes a component-wise addition oftcIntertotc.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.- Parameters:
tcInter- TheGstVideoTimeCodeIntervalto add totc.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.- Returns:
- A new
GstVideoTimeCodewithtcInteradded ornullif the interval can't be added. - Since:
- 1.12
-
clear
public void clear()Initializes this VideoTimeCode with empty/zero/NULL values and frees any memory it might currently use.- Since:
- 1.10
-
compare
Compares this VideoTimeCode andtc2.If both have latest daily jam information, it is taken into account. Otherwise, it is assumed that the daily jam of both this VideoTimeCode andtc2was at the same time. Both time codes must be valid.- Parameters:
tc2- another validGstVideoTimeCode- Returns:
- 1 if this VideoTimeCode is after
tc2,-1 if this VideoTimeCode is beforetc2,0 otherwise. - Since:
- 1.10
-
copy
-
framesSinceDailyJam
public long framesSinceDailyJam() -
free
public void free()Freestc.- Since:
- 1.10
-
incrementFrame
public void incrementFrame()Adds one frame totc.- Since:
- 1.10
-
init
public void init(int fpsN, int fpsD, @Nullable DateTime latestDailyJam, Set<VideoTimeCodeFlags> flags, int hours, int minutes, int seconds, int frames, int fieldCount) fieldCountis 0 for progressive, 1 or 2 for interlaced.latestDaiyJamreference is stolen from caller.Initializes this 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 gst_video_time_code_is_valid().
- Parameters:
fpsN- Numerator of the frame ratefpsD- Denominator of the frame ratelatestDailyJam- The latest daily jam of theGstVideoTimeCodeflags-GstVideoTimeCodeFlagshours- the hours field ofGstVideoTimeCodeminutes- the minutes field ofGstVideoTimeCodeseconds- the seconds field ofGstVideoTimeCodeframes- the frames field ofGstVideoTimeCodefieldCount- Interlaced video field count- Since:
- 1.10
-
init
public void init(int fpsN, int fpsD, @Nullable DateTime latestDailyJam, VideoTimeCodeFlags flags, int hours, int minutes, int seconds, int frames, int fieldCount) fieldCountis 0 for progressive, 1 or 2 for interlaced.latestDaiyJamreference is stolen from caller.Initializes this 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 gst_video_time_code_is_valid().
- Parameters:
fpsN- Numerator of the frame ratefpsD- Denominator of the frame ratelatestDailyJam- The latest daily jam of theGstVideoTimeCodeflags-GstVideoTimeCodeFlagshours- the hours field ofGstVideoTimeCodeminutes- the minutes field ofGstVideoTimeCodeseconds- the seconds field ofGstVideoTimeCodeframes- the frames field ofGstVideoTimeCodefieldCount- Interlaced video field count- Since:
- 1.10
-
initFromDateTime
public void initFromDateTime(int fpsN, int fpsD, DateTime dt, Set<VideoTimeCodeFlags> flags, int fieldCount) The resulting config->latest_daily_jam is set to midnight, and timecode is set to the given time.Will assert on invalid parameters, use gst_video_time_code_init_from_date_time_full() for being able to handle invalid parameters.
- Parameters:
fpsN- Numerator of the frame ratefpsD- Denominator of the frame ratedt-GDateTimeto convertflags-GstVideoTimeCodeFlagsfieldCount- Interlaced video field count- Since:
- 1.12
-
initFromDateTime
public void initFromDateTime(int fpsN, int fpsD, DateTime dt, VideoTimeCodeFlags flags, int fieldCount) The resulting config->latest_daily_jam is set to midnight, and timecode is set to the given time.Will assert on invalid parameters, use gst_video_time_code_init_from_date_time_full() for being able to handle invalid parameters.
- Parameters:
fpsN- Numerator of the frame ratefpsD- Denominator of the frame ratedt-GDateTimeto convertflags-GstVideoTimeCodeFlagsfieldCount- Interlaced video field count- Since:
- 1.12
-
initFromDateTimeFull
public boolean initFromDateTimeFull(int fpsN, int fpsD, DateTime dt, Set<VideoTimeCodeFlags> flags, int fieldCount) The resulting config->latest_daily_jam is set to midnight, and timecode is set to the given time.- Parameters:
fpsN- Numerator of the frame ratefpsD- Denominator of the frame ratedt-GDateTimeto convertflags-GstVideoTimeCodeFlagsfieldCount- Interlaced video field count- Returns:
trueif this VideoTimeCode could be correctly initialized to a valid timecode- Since:
- 1.16
-
initFromDateTimeFull
public boolean initFromDateTimeFull(int fpsN, int fpsD, DateTime dt, VideoTimeCodeFlags flags, int fieldCount) The resulting config->latest_daily_jam is set to midnight, and timecode is set to the given time.- Parameters:
fpsN- Numerator of the frame ratefpsD- Denominator of the frame ratedt-GDateTimeto convertflags-GstVideoTimeCodeFlagsfieldCount- Interlaced video field count- Returns:
trueif this VideoTimeCode could be correctly initialized to a valid timecode- Since:
- 1.16
-
isValid
public boolean isValid() -
nsecSinceDailyJam
public long nsecSinceDailyJam() -
toDateTime
Thetc.config>latestDailyJamis required to be non-NULL.- Returns:
- the
GDateTimerepresentation of this VideoTimeCode ornullif this VideoTimeCode has no daily jam. - Since:
- 1.10
-
toString
-