00001
00023 #ifndef GSTSHVIDEODEC_H
00024 #define GSTSHVIDEODEC_H
00025
00026 #include <gst/gst.h>
00027 #include <gst/video/gstvideosink.h>
00028 #include <gst/gstelement.h>
00029 #include <semaphore.h>
00030
00031 G_BEGIN_DECLS
00032 #define GST_TYPE_SH_VIDEO_DEC \
00033 (gst_sh_video_dec_get_type())
00034 #define GST_SH_VIDEO_DEC(obj) \
00035 (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_SH_VIDEO_DEC,GstSHVideoDec))
00036 #define GST_SH_VIDEO_DEC_CLASS(klass) \
00037 (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_SH_VIDEO_DEC,GstSHVideoDec))
00038 #define GST_IS_SH_VIDEO_DEC(obj) \
00039 (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_SH_VIDEO_DEC))
00040 #define GST_IS_SH_VIDEO_DEC_CLASS(obj) \
00041 (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_SH_VIDEO_DEC))
00042 typedef struct _GstSHVideoDec GstSHVideoDec;
00043 typedef struct _GstSHVideoDecClass GstSHVideoDecClass;
00044
00045 #include <shcodecs/shcodecs_decoder.h>
00046
00066 struct _GstSHVideoDec
00067 {
00068 GstElement element;
00069
00070 GstPad *sinkpad;
00071 GstPad *srcpad;
00072
00073 SHCodecs_Format format;
00074 gint width;
00075 gint height;
00076 gint fps_numerator;
00077 gint fps_denominator;
00078 SHCodecs_Decoder * decoder;
00079
00080 gboolean caps_set;
00081 gboolean end;
00082
00083 GstBuffer* buffer;
00084 GstBuffer* push_buf;
00085
00086 pthread_t push_thread;
00087
00088 sem_t dec_sem;
00089 sem_t push_sem;
00090
00091 gboolean codec_data_present;
00092 gboolean codec_data_present_first;
00093 guint num_sps;
00094 guint sps_size;
00095 GstBuffer *codec_data_sps_buf;
00096 guint num_pps;
00097 guint pps_size;
00098 GstBuffer *codec_data_pps_buf;
00099 };
00100
00106 struct _GstSHVideoDecClass
00107 {
00108 GstElementClass parent;
00109 };
00110
00114 GType gst_sh_video_dec_get_type (void);
00115
00116 G_END_DECLS
00117 #endif