gstrtpbaseaudiopayload.h 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. /* GStreamer
  2. * Copyright (C) <2006> Philippe Khalaf <philippe.kalaf@collabora.co.uk>
  3. *
  4. * This library is free software; you can redistribute it and/or
  5. * modify it under the terms of the GNU Library General Public
  6. * License as published by the Free Software Foundation; either
  7. * version 2 of the License, or (at your option) any later version.
  8. *
  9. * This library is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  12. * Library General Public License for more details.
  13. *
  14. * You should have received a copy of the GNU Library General Public
  15. * License along with this library; if not, write to the
  16. * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
  17. * Boston, MA 02110-1301, USA.
  18. */
  19. #ifndef __GST_RTP_BASE_AUDIO_PAYLOAD_H__
  20. #define __GST_RTP_BASE_AUDIO_PAYLOAD_H__
  21. #include <gst/gst.h>
  22. #include <gst/rtp/gstrtpbasepayload.h>
  23. #include <gst/base/gstadapter.h>
  24. G_BEGIN_DECLS
  25. typedef struct _GstRTPBaseAudioPayload GstRTPBaseAudioPayload;
  26. typedef struct _GstRTPBaseAudioPayloadClass GstRTPBaseAudioPayloadClass;
  27. typedef struct _GstRTPBaseAudioPayloadPrivate GstRTPBaseAudioPayloadPrivate;
  28. #define GST_TYPE_RTP_BASE_AUDIO_PAYLOAD \
  29. (gst_rtp_base_audio_payload_get_type())
  30. #define GST_RTP_BASE_AUDIO_PAYLOAD(obj) \
  31. (G_TYPE_CHECK_INSTANCE_CAST((obj), \
  32. GST_TYPE_RTP_BASE_AUDIO_PAYLOAD,GstRTPBaseAudioPayload))
  33. #define GST_RTP_BASE_AUDIO_PAYLOAD_CLASS(klass) \
  34. (G_TYPE_CHECK_CLASS_CAST((klass), \
  35. GST_TYPE_RTP_BASE_AUDIO_PAYLOAD,GstRTPBaseAudioPayloadClass))
  36. #define GST_IS_RTP_BASE_AUDIO_PAYLOAD(obj) \
  37. (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_RTP_BASE_AUDIO_PAYLOAD))
  38. #define GST_IS_RTP_BASE_AUDIO_PAYLOAD_CLASS(klass) \
  39. (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_RTP_BASE_AUDIO_PAYLOAD))
  40. #define GST_RTP_BASE_AUDIO_PAYLOAD_CAST(obj) \
  41. ((GstRTPBaseAudioPayload *) (obj))
  42. struct _GstRTPBaseAudioPayload
  43. {
  44. GstRTPBasePayload payload;
  45. GstRTPBaseAudioPayloadPrivate *priv;
  46. GstClockTime base_ts;
  47. gint frame_size;
  48. gint frame_duration;
  49. gint sample_size;
  50. /*< private >*/
  51. gpointer _gst_reserved[GST_PADDING];
  52. };
  53. /**
  54. * GstRTPBaseAudioPayloadClass:
  55. * @parent_class: the parent class
  56. *
  57. * Base class for audio RTP payloader.
  58. */
  59. struct _GstRTPBaseAudioPayloadClass
  60. {
  61. GstRTPBasePayloadClass parent_class;
  62. /*< private >*/
  63. gpointer _gst_reserved[GST_PADDING];
  64. };
  65. GType gst_rtp_base_audio_payload_get_type (void);
  66. /* configure frame based */
  67. void gst_rtp_base_audio_payload_set_frame_based (GstRTPBaseAudioPayload *rtpbaseaudiopayload);
  68. void gst_rtp_base_audio_payload_set_frame_options (GstRTPBaseAudioPayload *rtpbaseaudiopayload,
  69. gint frame_duration, gint frame_size);
  70. /* configure sample based */
  71. void gst_rtp_base_audio_payload_set_sample_based (GstRTPBaseAudioPayload *rtpbaseaudiopayload);
  72. void gst_rtp_base_audio_payload_set_sample_options (GstRTPBaseAudioPayload *rtpbaseaudiopayload,
  73. gint sample_size);
  74. void gst_rtp_base_audio_payload_set_samplebits_options (GstRTPBaseAudioPayload *rtpbaseaudiopayload,
  75. gint sample_size);
  76. /* get the internal adapter */
  77. GstAdapter* gst_rtp_base_audio_payload_get_adapter (GstRTPBaseAudioPayload *rtpbaseaudiopayload);
  78. /* push and flushing data */
  79. GstFlowReturn gst_rtp_base_audio_payload_push (GstRTPBaseAudioPayload * baseaudiopayload,
  80. const guint8 * data, guint payload_len,
  81. GstClockTime timestamp);
  82. GstFlowReturn gst_rtp_base_audio_payload_flush (GstRTPBaseAudioPayload * baseaudiopayload,
  83. guint payload_len, GstClockTime timestamp);
  84. #ifdef G_DEFINE_AUTOPTR_CLEANUP_FUNC
  85. G_DEFINE_AUTOPTR_CLEANUP_FUNC(GstRTPBaseAudioPayload, gst_object_unref)
  86. #endif
  87. G_END_DECLS
  88. #endif /* __GST_RTP_BASE_AUDIO_PAYLOAD_H__ */