video.h 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  1. /* GStreamer
  2. * Copyright (C) <2011> Wim Taymans <[email protected]>
  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_VIDEO_H__
  20. #define __GST_VIDEO_H__
  21. #include <gst/gst.h>
  22. typedef struct _GstVideoAlignment GstVideoAlignment;
  23. #include <gst/video/video-format.h>
  24. #include <gst/video/video-color.h>
  25. #include <gst/video/video-info.h>
  26. #include <gst/video/video-frame.h>
  27. #include <gst/video/video-enumtypes.h>
  28. G_BEGIN_DECLS
  29. /**
  30. * GstVideoAlignment:
  31. * @padding_left: extra pixels on the left side
  32. * @padding_right: extra pixels on the right side
  33. * @padding_top: extra pixels on the top
  34. * @padding_bottom: extra pixels on the bottom
  35. * @stride_align: array with extra alignment requirements for the strides
  36. *
  37. * Extra alignment paramters for the memory of video buffers. This
  38. * structure is usually used to configure the bufferpool if it supports the
  39. * #GST_BUFFER_POOL_OPTION_VIDEO_ALIGNMENT.
  40. */
  41. struct _GstVideoAlignment
  42. {
  43. guint padding_top;
  44. guint padding_bottom;
  45. guint padding_left;
  46. guint padding_right;
  47. guint stride_align[GST_VIDEO_MAX_PLANES];
  48. };
  49. /* metadata macros */
  50. /**
  51. * GST_META_TAG_VIDEO_STR:
  52. *
  53. * This metadata is relevant for video streams.
  54. *
  55. * Since: 1.2
  56. */
  57. #define GST_META_TAG_VIDEO_STR "video"
  58. /**
  59. * GST_META_TAG_VIDEO_ORIENTATION_STR:
  60. *
  61. * This metadata stays relevant as long as video orientation is unchanged.
  62. *
  63. * Since: 1.2
  64. */
  65. #define GST_META_TAG_VIDEO_ORIENTATION_STR "orientation"
  66. /**
  67. * GST_META_TAG_VIDEO_SIZE_STR:
  68. *
  69. * This metadata stays relevant as long as video size is unchanged.
  70. *
  71. * Since: 1.2
  72. */
  73. #define GST_META_TAG_VIDEO_SIZE_STR "size"
  74. /**
  75. * GST_META_TAG_VIDEO_COLORSPACE_STR:
  76. *
  77. * This metadata stays relevant as long as video colorspace is unchanged.
  78. *
  79. * Since: 1.2
  80. */
  81. #define GST_META_TAG_VIDEO_COLORSPACE_STR "colorspace"
  82. void gst_video_alignment_reset (GstVideoAlignment *align);
  83. /* some helper functions */
  84. gboolean gst_video_calculate_display_ratio (guint * dar_n,
  85. guint * dar_d,
  86. guint video_width,
  87. guint video_height,
  88. guint video_par_n,
  89. guint video_par_d,
  90. guint display_par_n,
  91. guint display_par_d);
  92. /* convert/encode video sample from one format to another */
  93. typedef void (*GstVideoConvertSampleCallback) (GstSample * sample, GError *error, gpointer user_data);
  94. void gst_video_convert_sample_async (GstSample * sample,
  95. const GstCaps * to_caps,
  96. GstClockTime timeout,
  97. GstVideoConvertSampleCallback callback,
  98. gpointer user_data,
  99. GDestroyNotify destroy_notify);
  100. GstSample * gst_video_convert_sample (GstSample * sample,
  101. const GstCaps * to_caps,
  102. GstClockTime timeout,
  103. GError ** error);
  104. G_END_DECLS
  105. #include <gst/video/colorbalancechannel.h>
  106. #include <gst/video/colorbalance.h>
  107. #include <gst/video/gstvideodecoder.h>
  108. #include <gst/video/gstvideoencoder.h>
  109. #include <gst/video/gstvideofilter.h>
  110. #include <gst/video/gstvideometa.h>
  111. #include <gst/video/gstvideopool.h>
  112. #include <gst/video/gstvideosink.h>
  113. #include <gst/video/gstvideoutils.h>
  114. #include <gst/video/navigation.h>
  115. #include <gst/video/video-blend.h>
  116. #include <gst/video/video-event.h>
  117. #include <gst/video/videoorientation.h>
  118. #include <gst/video/video-overlay-composition.h>
  119. #include <gst/video/videooverlay.h>
  120. #endif /* __GST_VIDEO_H__ */