gstdspvenc.h 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. /*
  2. * Copyright (C) 2009-2010 Felipe Contreras
  3. *
  4. * Author: Felipe Contreras <felipe.contreras@gmail.com>
  5. *
  6. * This file may be used under the terms of the GNU Lesser General Public
  7. * License version 2.1, a copy of which is found in LICENSE included in the
  8. * packaging of this file.
  9. */
  10. #ifndef GST_DSP_VENC_H
  11. #define GST_DSP_VENC_H
  12. #include <gst/gst.h>
  13. G_BEGIN_DECLS
  14. #define GST_DSP_VENC(obj) (GstDspVEnc *)(obj)
  15. #define GST_DSP_VENC_TYPE (gst_dsp_venc_get_type())
  16. #define GST_DSP_VENC_CLASS(obj) (GstDspVEncClass *)(obj)
  17. typedef struct _GstDspVEnc GstDspVEnc;
  18. typedef struct _GstDspVEncClass GstDspVEncClass;
  19. #include "gstdspbase.h"
  20. union venc_priv_data {
  21. struct {
  22. gboolean bytestream;
  23. gboolean sps_received, pps_received, codec_data_done;
  24. GstBuffer *sps, *pps, *codec_data;
  25. } h264;
  26. struct {
  27. gboolean codec_data_done;
  28. } mpeg4;
  29. };
  30. struct gstdsp_codec_level {
  31. gint id;
  32. gint mbpf; /* macroblock per frame */
  33. gint mbps; /* macroblocks per second */
  34. gint bitrate;
  35. };
  36. enum {
  37. GSTDSP_JPEGENC,
  38. GSTDSP_H263ENC,
  39. GSTDSP_MP4VENC,
  40. GSTDSP_H264ENC,
  41. };
  42. struct _GstDspVEnc {
  43. GstDspBase element;
  44. gint width, height;
  45. guint32 color_format;
  46. gint max_bitrate;
  47. gint bitrate;
  48. gint user_max_bitrate;
  49. gint framerate;
  50. gint quality;
  51. struct gstdsp_codec_level *supported_levels;
  52. guint nr_supported_levels;
  53. union venc_priv_data priv;
  54. gint frame_index;
  55. GstEvent *keyframe_event;
  56. GMutex *keyframe_mutex;
  57. gint mode;
  58. gint keyframe_interval;
  59. gboolean intra_refresh;
  60. bool intra_refresh_set;
  61. gint level;
  62. };
  63. struct _GstDspVEncClass {
  64. GstDspBaseClass parent_class;
  65. };
  66. GType gst_dsp_venc_get_type(void);
  67. G_END_DECLS
  68. #endif /* GST_DSP_VENC_H */