Class VideoTimeCode

java.lang.Object
org.javagi.base.ProxyInstance
org.freedesktop.gstreamer.video.VideoTimeCode
All Implemented Interfaces:
Proxy

@Generated("org.javagi.JavaGI") public class VideoTimeCode extends ProxyInstance

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 Details

    • VideoTimeCode

      public VideoTimeCode(MemorySegment address)
      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)
      fieldCount is 0 for progressive, 1 or 2 for interlaced. latestDaiyJam reference is stolen from caller.
      Parameters:
      fpsN - Numerator of the frame rate
      fpsD - Denominator of the frame rate
      latestDailyJam - The latest daily jam of the GstVideoTimeCode
      flags - GstVideoTimeCodeFlags
      hours - the hours field of GstVideoTimeCode
      minutes - the minutes field of GstVideoTimeCode
      seconds - the seconds field of GstVideoTimeCode
      frames - the frames field of GstVideoTimeCode
      fieldCount - 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)
      fieldCount is 0 for progressive, 1 or 2 for interlaced. latestDaiyJam reference is stolen from caller.
      Parameters:
      fpsN - Numerator of the frame rate
      fpsD - Denominator of the frame rate
      latestDailyJam - The latest daily jam of the GstVideoTimeCode
      flags - GstVideoTimeCodeFlags
      hours - the hours field of GstVideoTimeCode
      minutes - the minutes field of GstVideoTimeCode
      seconds - the seconds field of GstVideoTimeCode
      frames - the frames field of GstVideoTimeCode
      fieldCount - Interlaced video field count
      Since:
      1.10
  • Method Details

    • getType

      public static @Nullable Type getType()
      Get the GType of the VideoTimeCode class.
      Returns:
      the GType
    • getMemoryLayout

      public static MemoryLayout getMemoryLayout()
      The memory layout of the native struct.
      Returns:
      the memory layout
    • readConfig

      public @Nullable VideoTimeCodeConfig readConfig()
      Read the value of the field config.
      Returns:
      The value of the field config
    • writeConfig

      public void writeConfig(@Nullable VideoTimeCodeConfig config)
      Write a value in the field config.
      Parameters:
      config - The new value for the field config
    • readHours

      public int readHours()
      Read the value of the field hours.
      Returns:
      The value of the field hours
    • writeHours

      public void writeHours(int hours)
      Write a value in the field hours.
      Parameters:
      hours - The new value for the field hours
    • readMinutes

      public int readMinutes()
      Read the value of the field minutes.
      Returns:
      The value of the field minutes
    • writeMinutes

      public void writeMinutes(int minutes)
      Write a value in the field minutes.
      Parameters:
      minutes - The new value for the field minutes
    • readSeconds

      public int readSeconds()
      Read the value of the field seconds.
      Returns:
      The value of the field seconds
    • writeSeconds

      public void writeSeconds(int seconds)
      Write a value in the field seconds.
      Parameters:
      seconds - The new value for the field seconds
    • readFrames

      public int readFrames()
      Read the value of the field frames.
      Returns:
      The value of the field frames
    • writeFrames

      public void writeFrames(int frames)
      Write a value in the field frames.
      Parameters:
      frames - The new value for the field frames
    • readFieldCount

      public int readFieldCount()
      Read the value of the field field_count.
      Returns:
      The value of the field field_count
    • writeFieldCount

      public void writeFieldCount(int fieldCount)
      Write a value in the field field_count.
      Parameters:
      fieldCount - The new value for the field field_count
    • empty

      public static VideoTimeCode 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 null instead in that case.

      Parameters:
      fpsN - Numerator of the frame rate
      fpsD - Denominator of the frame rate
      dt - GDateTime to convert
      flags - GstVideoTimeCodeFlags
      fieldCount - Interlaced video field count
      Returns:
      the GstVideoTimeCode representation of dt.
      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 null instead in that case.

      Parameters:
      fpsN - Numerator of the frame rate
      fpsD - Denominator of the frame rate
      dt - GDateTime to convert
      flags - GstVideoTimeCodeFlags
      fieldCount - Interlaced video field count
      Returns:
      the GstVideoTimeCode representation of dt.
      Since:
      1.12
    • fromDateTimeFull

      public static @Nullable 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 rate
      fpsD - Denominator of the frame rate
      dt - GDateTime to convert
      flags - GstVideoTimeCodeFlags
      fieldCount - Interlaced video field count
      Returns:
      the GstVideoTimeCode representation of dt, or null if 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 rate
      fpsD - Denominator of the frame rate
      dt - GDateTime to convert
      flags - GstVideoTimeCodeFlags
      fieldCount - Interlaced video field count
      Returns:
      the GstVideoTimeCode representation of dt, or null if no valid timecode could be created.
      Since:
      1.16
    • fromString

      public static @Nullable VideoTimeCode fromString(String tcStr)
    • addFrames

      public void addFrames(long frames)
      Adds or subtracts frames amount of frames to tc. 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

      public @Nullable VideoTimeCode addInterval(VideoTimeCodeInterval tcInter)
      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.
      Parameters:
      tcInter - The GstVideoTimeCodeInterval 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.
      Returns:
      A new GstVideoTimeCode with tcInter added or null if 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

      public int compare(VideoTimeCode tc2)
      Compares this VideoTimeCode and tc2. If both have latest daily jam information, it is taken into account. Otherwise, it is assumed that the daily jam of both this VideoTimeCode and tc2 was at the same time. Both time codes must be valid.
      Parameters:
      tc2 - another valid GstVideoTimeCode
      Returns:
      1 if this VideoTimeCode is after tc2, -1 if this VideoTimeCode is before tc2, 0 otherwise.
      Since:
      1.10
    • copy

      public VideoTimeCode copy()
    • framesSinceDailyJam

      public long framesSinceDailyJam()
    • free

      public void free()
      Frees tc.
      Since:
      1.10
    • incrementFrame

      public void incrementFrame()
      Adds one frame to tc.
      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)

      fieldCount is 0 for progressive, 1 or 2 for interlaced. latestDaiyJam reference 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 rate
      fpsD - Denominator of the frame rate
      latestDailyJam - The latest daily jam of the GstVideoTimeCode
      flags - GstVideoTimeCodeFlags
      hours - the hours field of GstVideoTimeCode
      minutes - the minutes field of GstVideoTimeCode
      seconds - the seconds field of GstVideoTimeCode
      frames - the frames field of GstVideoTimeCode
      fieldCount - 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)

      fieldCount is 0 for progressive, 1 or 2 for interlaced. latestDaiyJam reference 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 rate
      fpsD - Denominator of the frame rate
      latestDailyJam - The latest daily jam of the GstVideoTimeCode
      flags - GstVideoTimeCodeFlags
      hours - the hours field of GstVideoTimeCode
      minutes - the minutes field of GstVideoTimeCode
      seconds - the seconds field of GstVideoTimeCode
      frames - the frames field of GstVideoTimeCode
      fieldCount - 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 rate
      fpsD - Denominator of the frame rate
      dt - GDateTime to convert
      flags - GstVideoTimeCodeFlags
      fieldCount - 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 rate
      fpsD - Denominator of the frame rate
      dt - GDateTime to convert
      flags - GstVideoTimeCodeFlags
      fieldCount - 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 rate
      fpsD - Denominator of the frame rate
      dt - GDateTime to convert
      flags - GstVideoTimeCodeFlags
      fieldCount - Interlaced video field count
      Returns:
      true if 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 rate
      fpsD - Denominator of the frame rate
      dt - GDateTime to convert
      flags - GstVideoTimeCodeFlags
      fieldCount - Interlaced video field count
      Returns:
      true if this VideoTimeCode could be correctly initialized to a valid timecode
      Since:
      1.16
    • isValid

      public boolean isValid()
    • nsecSinceDailyJam

      public long nsecSinceDailyJam()
    • toDateTime

      public @Nullable DateTime toDateTime()
      The tc.config>latestDailyJam is required to be non-NULL.
      Returns:
      the GDateTime representation of this VideoTimeCode or null if this VideoTimeCode has no daily jam.
      Since:
      1.10
    • toString

      public String toString()
      Overrides:
      toString in class Object