llmediaimplgstreamervidplug.h

Go to the documentation of this file.
00001 
00032 #ifndef __GST_SLVIDEO_H__
00033 #define __GST_SLVIDEO_H__
00034 
00035 #if LL_GSTREAMER_ENABLED
00036 
00037 extern "C" {
00038 #include <gst/gst.h>
00039 #include <gst/video/video.h>
00040 #include <gst/video/gstvideosink.h>
00041 }
00042 
00043 G_BEGIN_DECLS
00044 
00045 /* #defines don't like whitespacey bits */
00046 #define GST_TYPE_SLVIDEO \
00047   (gst_slvideo_get_type())
00048 #define GST_SLVIDEO(obj) \
00049   (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_SLVIDEO,GstSLVideo))
00050 #define GST_SLVIDEO_CLASS(klass) \
00051   (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_SLVIDEO,GstSLVideoClass))
00052 #define GST_IS_SLVIDEO(obj) \
00053   (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_SLVIDEO))
00054 #define GST_IS_SLVIDEO_CLASS(klass) \
00055   (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_SLVIDEO))
00056 
00057 typedef struct _GstSLVideo      GstSLVideo;
00058 typedef struct _GstSLVideoClass GstSLVideoClass;
00059 
00060 typedef enum {
00061         SLV_PF_UNKNOWN = 0,
00062         SLV_PF_RGBX    = 1,
00063         SLV_PF_BGRX    = 2,
00064         SLV__END       = 3
00065 } SLVPixelFormat;
00066 const int SLVPixelFormatBytes[SLV__END] = {1, 4, 4};
00067 
00068 struct _GstSLVideo
00069 {
00070         GstVideoSink video_sink;
00071 
00072         GstCaps *caps;
00073 
00074         int fps_n, fps_d;
00075         int par_n, par_d;
00076         int height, width;
00077         SLVPixelFormat format;
00078 
00079         // SHARED WITH APPLICATION:
00080         // Access to the following should be protected by GST_OBJECT_LOCK() on
00081         // the GstSLVideo object, and should be totally consistent upon UNLOCK
00082         // (i.e. all written at once to reflect the current retained frame info
00083         // when the retained frame is updated.)
00084         bool retained_frame_ready; // new frame ready since flag last reset. (*TODO: could get the writer to wait on a semaphore instead of having the reader poll, potentially making dropped frames somewhat cheaper.)
00085         U8*  retained_frame_data;
00086         int  retained_frame_allocbytes;
00087         int  retained_frame_width, retained_frame_height;
00088         SLVPixelFormat retained_frame_format;
00089 };
00090 
00091 struct _GstSLVideoClass 
00092 {
00093         GstVideoSink parent_class;
00094 };
00095 
00096 GType gst_slvideo_get_type (void);
00097 
00098 void gst_slvideo_init_class (void);
00099 
00100 G_END_DECLS
00101 
00102 #endif // LL_GSTREAMER_ENABLED
00103 
00104 #endif /* __GST_SLVIDEO_H__ */

Generated on Thu Jul 1 06:08:51 2010 for Second Life Viewer by  doxygen 1.4.7