2
0

gstclock.inc 8.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180
  1. {* GStreamer
  2. * Copyright (C) 1999,2000 Erik Walthinsen <[email protected]>
  3. * 2000 Wim Taymans <[email protected]>
  4. * 2005 Wim Taymans <[email protected]>
  5. *
  6. * gstclock.h: Header for clock subsystem
  7. *
  8. * This library is free software; you can redistribute it and/or
  9. * modify it under the terms of the GNU Library General Public
  10. * License as published by the Free Software Foundation; either
  11. * version 2 of the License, or (at your option) any later version.
  12. *
  13. * This library is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  16. * Library General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU Library General Public
  19. * License along with this library; if not, write to the
  20. * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
  21. * Boston, MA 02110-1301, USA.
  22. *}
  23. Type
  24. P_GstClock = ^T_GstClock;
  25. PPGstClock = ^P_GstClock;
  26. P_GstClockClass = ^T_GstClockClass;
  27. Pgdouble = ^Tgdouble;
  28. PGstClock_autoptr = ^TGstClock_autoptr;
  29. PGstClock_listautoptr = ^TGstClock_listautoptr;
  30. PGstClock_queueautoptr = ^TGstClock_queueautoptr;
  31. PGstClock_slistautoptr = ^TGstClock_slistautoptr;
  32. PGstClockEntry = ^TGstClockEntry;
  33. PGstClockFlags = ^TGstClockFlags;
  34. PGstClockTime = ^TGstClockTime;
  35. PGstClockTimeDiff = ^TGstClockTimeDiff;
  36. {$IFDEF FPC}
  37. {$PACKRECORDS C}
  38. {$ENDIF}
  39. TGstClockReturn = (
  40. GST_CLOCK_OK = 0,
  41. GST_CLOCK_EARLY = 1,
  42. GST_CLOCK_UNSCHEDULED = 2,
  43. GST_CLOCK_BUSY = 3,
  44. GST_CLOCK_BADTIME = 4,
  45. GST_CLOCK_ERROR = 5,
  46. GST_CLOCK_UNSUPPORTED = 6,
  47. GST_CLOCK_DONE = 7
  48. );
  49. TGstClockEntryType = (
  50. GST_CLOCK_ENTRY_SINGLE,
  51. GST_CLOCK_ENTRY_PERIODIC
  52. );
  53. TGstClockID = gpointer ;
  54. TGstClockCallback = function (clock : PGstClock; time : TGstClockTime; id : TGstClockID ; user_data : gpointer): gboolean; cdecl;
  55. T_GstClockEntry = record
  56. refcount : gint;
  57. clock : ^GstClock;
  58. _type : TGstClockEntryType;
  59. time : TGstClockTime;
  60. interval : TGstClockTime;
  61. status : TGstClockReturn;
  62. func : TGstClockCallback;
  63. user_data : gpointer;
  64. destroy_data : GDestroyNotify;
  65. unscheduled : gboolean;
  66. woken_up : gboolean;
  67. _gst_reserved : array[0..3] of gpointer;
  68. end;
  69. TGstClockEntry =T_GstClockEntry;
  70. TGstClockFlags = (
  71. GST_CLOCK_FLAG_CAN_DO_SINGLE_SYNC := GST_OBJECT_FLAG_LAST shl 0,
  72. GST_CLOCK_FLAG_CAN_DO_SINGLE_ASYNC := GST_OBJECT_FLAG_LAST shl 1,
  73. GST_CLOCK_FLAG_CAN_DO_PERIODIC_SYNC := GST_OBJECT_FLAG_LAST shl 2,
  74. GST_CLOCK_FLAG_CAN_DO_PERIODIC_ASYNC := GST_OBJECT_FLAG_LAST shl 3,
  75. GST_CLOCK_FLAG_CAN_SET_RESOLUTION := GST_OBJECT_FLAG_LAST shl 4,
  76. GST_CLOCK_FLAG_CAN_SET_MASTER := GST_OBJECT_FLAG_LAST shl 5,
  77. GST_CLOCK_FLAG_NEEDS_STARTUP_SYNC := GST_OBJECT_FLAG_LAST shl 6,
  78. GST_CLOCK_FLAG_LAST := GST_OBJECT_FLAG_LAST shl 8
  79. );
  80. T_GstClockClass = record
  81. parent_class : TGstObjectClass;
  82. change_resolution : function (clock:PGstClock; old_resolution:TGstClockTime; new_resolution:TGstClockTime):TGstClockTime;cdecl;
  83. get_resolution : function (clock:PGstClock):TGstClockTime;cdecl;
  84. get_internal_time : function (clock:PGstClock):TGstClockTime;cdecl;
  85. wait : function (clock:PGstClock; entry:PGstClockEntry; jitter:PGstClockTimeDiff):TGstClockReturn;cdecl;
  86. wait_async : function (clock:PGstClock; entry:PGstClockEntry):TGstClockReturn;cdecl;
  87. unschedule : procedure (clock:PGstClock; entry:PGstClockEntry);cdecl;
  88. _gst_reserved : array[0..3] of Tgpointer;
  89. end;
  90. TGstClockClass = T_GstClockClass;
  91. TGstClock_autoptr = PGstClock;
  92. TGstClock_listautoptr = PGList;
  93. TGstClock_slistautoptr = PGSList;
  94. TGstClock_queueautoptr = PGQueue;
  95. function gst_clock_get_type:TGType;cdecl;external gstreamerlib name 'gst_clock_get_type';
  96. function gst_clock_set_resolution(clock:PGstClock; resolution:TGstClockTime):TGstClockTime;cdecl;external gstreamerlib name 'gst_clock_set_resolution';
  97. function gst_clock_get_resolution(clock:PGstClock):TGstClockTime;cdecl;external gstreamerlib name 'gst_clock_get_resolution';
  98. function gst_clock_get_time(clock:PGstClock):TGstClockTime;cdecl;external gstreamerlib name 'gst_clock_get_time';
  99. procedure gst_clock_set_calibration(clock:PGstClock; internal:TGstClockTime; external:TGstClockTime; rate_num:TGstClockTime; rate_denom:TGstClockTime);cdecl;external gstreamerlib name 'gst_clock_set_calibration';
  100. procedure gst_clock_get_calibration(clock:PGstClock; internal:PGstClockTime; external:PGstClockTime; rate_num:PGstClockTime; rate_denom:PGstClockTime);cdecl;external gstreamerlib name 'gst_clock_get_calibration';
  101. function gst_clock_set_master(clock:PGstClock; master:PGstClock):Tgboolean;cdecl;external gstreamerlib name 'gst_clock_set_master';
  102. function gst_clock_get_master(clock:PGstClock):PGstClock;cdecl;external gstreamerlib name 'gst_clock_get_master';
  103. procedure gst_clock_set_timeout(clock:PGstClock; timeout:TGstClockTime);cdecl;external gstreamerlib name 'gst_clock_set_timeout';
  104. function gst_clock_get_timeout(clock:PGstClock):TGstClockTime;cdecl;external gstreamerlib name 'gst_clock_get_timeout';
  105. function gst_clock_add_observation(clock:PGstClock; slave:TGstClockTime; master:TGstClockTime; r_squared:Pgdouble):Tgboolean;cdecl;external gstreamerlib name 'gst_clock_add_observation';
  106. function gst_clock_add_observation_unapplied(clock:PGstClock; slave:TGstClockTime; master:TGstClockTime; r_squared:Pgdouble; internal:PGstClockTime;
  107. external:PGstClockTime; rate_num:PGstClockTime; rate_denom:PGstClockTime):Tgboolean;cdecl;external gstreamerlib name 'gst_clock_add_observation_unapplied';
  108. function gst_clock_get_internal_time(clock:PGstClock):TGstClockTime;cdecl;external gstreamerlib name 'gst_clock_get_internal_time';
  109. function gst_clock_adjust_unlocked(clock:PGstClock; internal:TGstClockTime):TGstClockTime;cdecl;external gstreamerlib name 'gst_clock_adjust_unlocked';
  110. function gst_clock_adjust_with_calibration(clock:PGstClock; internal_target:TGstClockTime; cinternal:TGstClockTime; cexternal:TGstClockTime; cnum:TGstClockTime;
  111. cdenom:TGstClockTime):TGstClockTime;cdecl;external gstreamerlib name 'gst_clock_adjust_with_calibration';
  112. function gst_clock_unadjust_with_calibration(clock:PGstClock; external_target:TGstClockTime; cinternal:TGstClockTime; cexternal:TGstClockTime; cnum:TGstClockTime;
  113. cdenom:TGstClockTime):TGstClockTime;cdecl;external gstreamerlib name 'gst_clock_unadjust_with_calibration';
  114. function gst_clock_unadjust_unlocked(clock:PGstClock; external:TGstClockTime):TGstClockTime;cdecl;external gstreamerlib name 'gst_clock_unadjust_unlocked';
  115. function gst_clock_wait_for_sync(clock:PGstClock; timeout:TGstClockTime):Tgboolean;cdecl;external gstreamerlib name 'gst_clock_wait_for_sync';
  116. function gst_clock_is_synced(clock:PGstClock):Tgboolean;cdecl;external gstreamerlib name 'gst_clock_is_synced';
  117. procedure gst_clock_set_synced(clock:PGstClock; synced:Tgboolean);cdecl;external gstreamerlib name 'gst_clock_set_synced';
  118. function gst_clock_new_single_shot_id(clock:PGstClock; time:TGstClockTime):TGstClockID;cdecl;external gstreamerlib name 'gst_clock_new_single_shot_id';
  119. function gst_clock_new_periodic_id(clock:PGstClock; start_time:TGstClockTime; interval:TGstClockTime):TGstClockID;cdecl;external gstreamerlib name 'gst_clock_new_periodic_id';
  120. function gst_clock_id_ref(id:TGstClockID):TGstClockID;cdecl;external gstreamerlib name 'gst_clock_id_ref';
  121. procedure gst_clock_id_unref(id:TGstClockID);cdecl;external gstreamerlib name 'gst_clock_id_unref';
  122. function gst_clock_id_compare_func(id1:Tgconstpointer; id2:Tgconstpointer):Tgint;cdecl;external gstreamerlib name 'gst_clock_id_compare_func';
  123. function gst_clock_id_get_clock(id:TGstClockID):PGstClock;cdecl;external gstreamerlib name 'gst_clock_id_get_clock';
  124. function gst_clock_id_uses_clock(id:TGstClockID; clock:PGstClock):Tgboolean;cdecl;external gstreamerlib name 'gst_clock_id_uses_clock';
  125. function gst_clock_id_get_time(id:TGstClockID):TGstClockTime;cdecl;external gstreamerlib name 'gst_clock_id_get_time';
  126. function gst_clock_id_wait(id:TGstClockID; jitter:PGstClockTimeDiff):TGstClockReturn;cdecl;external gstreamerlib name 'gst_clock_id_wait';
  127. function gst_clock_id_wait_async(id:TGstClockID; func:TGstClockCallback; user_data:Tgpointer; destroy_data:TGDestroyNotify):TGstClockReturn;cdecl;external gstreamerlib name 'gst_clock_id_wait_async';
  128. procedure gst_clock_id_unschedule(id:TGstClockID);cdecl;external gstreamerlib name 'gst_clock_id_unschedule';
  129. function gst_clock_single_shot_id_reinit(clock:PGstClock; id:TGstClockID; time:TGstClockTime):Tgboolean;cdecl;external gstreamerlib name 'gst_clock_single_shot_id_reinit';
  130. function gst_clock_periodic_id_reinit(clock:PGstClock; id:TGstClockID; start_time:TGstClockTime; interval:TGstClockTime):Tgboolean;cdecl;external gstreamerlib name 'gst_clock_periodic_id_reinit';