gstmessage_impl.inc 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. function gst_message_ref (msg : PGstMessage) : PGstmessage;
  2. begin
  3. Result:=pGstMessage(gst_mini_object_ref(PGstMiniObject(msg)));
  4. end;
  5. procedure gst_message_unref (msg : PGstMessage);
  6. begin
  7. gst_mini_object_unref(PGstMiniObject(msg));
  8. end;
  9. procedure gst_clear_message (msg_ptr : PPGstMessage);
  10. var
  11. PP : PPGstMiniObject absolute msg_ptr;
  12. begin
  13. if (msg_ptr<>Nil) then
  14. if PP^<>Nil then
  15. gst_mini_object_unref(PP^);
  16. end;
  17. function gst_message_copy (msg : PGstMessage) : PGstMessage;
  18. begin
  19. Result:=PGstMessage(gst_mini_object_copy(PGstMiniObject(msg)));
  20. end;
  21. function gst_message_replace (old_message : PPGstMessage; new_message : PGstMessage) : gboolean;
  22. begin
  23. Result:=gst_mini_object_replace (PPGstMiniObject(old_message), PGstMiniObject(new_message));
  24. end;
  25. Function gst_message_take (old_message : PPGstMessage; new_message : PGstMessage) :gboolean;
  26. begin
  27. Result:=gst_mini_object_take(PPGstMiniObject(old_message),PGstMiniObject(new_message));
  28. end;
  29. Function GST_TYPE_MESSAGE : TGType;
  30. begin
  31. Result:=_gst_message_type;
  32. end;
  33. function GST_IS_MESSAGE(obj : Pointer) : boolean;
  34. begin
  35. Result:=G_TYPE_CHECK_INSTANCE_TYPE (obj, GST_TYPE_MESSAGE);
  36. end;
  37. Function GST_MESSAGE_CAST(obj : Pointer) : PGstMessage;
  38. begin
  39. Result:=PGstMessage(obj)
  40. end;
  41. Function GST_MESSAGE(obj : Pointer) : PGstMessage;
  42. begin
  43. Result:=GST_MESSAGE_CAST(obj);
  44. end;
  45. function GST_MESSAGE_GET_LOCK(message : PGstmessage): PGMutex;
  46. begin
  47. Result:=@message^.lock;
  48. end;
  49. procedure GST_MESSAGE_LOCK(message : PGstMessage);
  50. begin
  51. g_mutex_lock(GST_MESSAGE_GET_LOCK(message));
  52. end;
  53. procedure GST_MESSAGE_UNLOCK(message : PGstMessage);
  54. begin
  55. g_mutex_unlock(GST_MESSAGE_GET_LOCK(message));
  56. end;
  57. function GST_MESSAGE_GET_COND(message : PGstmessage): PGCond;
  58. begin
  59. Result:=@message^.cond;
  60. end;
  61. procedure GST_MESSAGE_WAIT(message : PGstMessage);
  62. begin
  63. g_cond_wait(GST_MESSAGE_GET_COND(message),GST_MESSAGE_GET_LOCK(message))
  64. end;
  65. procedure GST_MESSAGE_SIGNAL(message : PGSTMessage);
  66. begin
  67. g_cond_signal(GST_MESSAGE_GET_COND(message))
  68. end;
  69. Function GST_MESSAGE_TYPE(message : PGStMessage) : TGstMessageType;
  70. begin
  71. Result:=message^._type;
  72. end;