gsttheadcamera.h 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. /* GStreamer
  2. * Copyright (C) <2021> Charles Lu <chongzhi.lcz@alibaba-inc.com>
  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. #pragma once
  20. #include <gst/gst.h>
  21. #include <gst/base/gstpushsrc.h>
  22. #include <gst/video/gstvideometa.h>
  23. #include <gst/video/gstvideopool.h>
  24. #include "thead_camera.h"
  25. G_BEGIN_DECLS
  26. #define GST_TYPE_THEAD_CAMERA \
  27. (gst_thead_camera_get_type())
  28. #define GST_THEAD_CAMERA(obj) \
  29. (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_THEAD_CAMERA,GstTHeadCamera))
  30. #define GST_THEAD_CAMERA_CLASS(klass) \
  31. (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_THEAD_CAMERA,GstTHeadCameraClass))
  32. #define GST_IS_THEAD_CAMERA(obj) \
  33. (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_THEAD_CAMERA))
  34. #define GST_IS_THEAD_CAMERA_CLASS(klass) \
  35. (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_THEAD_CAMERA))
  36. typedef struct _GstTHeadCamera GstTHeadCamera;
  37. typedef struct _GstTHeadCameraClass GstTHeadCameraClass;
  38. /**
  39. * GstTHeadCamera:
  40. *
  41. * Opaque data structure.
  42. */
  43. struct _GstTHeadCamera
  44. {
  45. GstPushSrc element;
  46. /* video state */
  47. GstVideoInfo info; /* protected by the object or stream lock */
  48. gboolean bayer;
  49. THeadCamera *theadCamera;
  50. /* running time and frames for current caps */
  51. GstClockTime running_time; // total running time
  52. gint64 timestamp_offset; // PROP_TIMESTAMP_OFFSET
  53. gint64 n_frames; // total frames sent
  54. gboolean reverse;
  55. /* previous caps running time and frames */
  56. GstClockTime accum_rtime; // accumulated running_time
  57. gint64 accum_frames; // accumulated frames
  58. };
  59. struct _GstTHeadCameraClass
  60. {
  61. GstPushSrcClass parent_class;
  62. };
  63. GType gst_thead_camera_get_type (void);
  64. G_END_DECLS