31 #ifndef PTLIB_GSTREMER_H
32 #define PTLIB_GSTREMER_H
50 class PGBaseObject :
public PObject
57 PGBaseObject(const PGBaseObject &) { }
58 void operator=(
const PGBaseObject &) { }
63 template<
typename T> T * As()
const {
return reinterpret_cast<T *
>(m_object); }
64 void * Ptr()
const {
return m_object; }
65 operator bool()
const {
return m_object != NULL; }
66 bool operator!()
const {
return m_object == NULL; }
68 virtual bool IsValid()
const;
69 virtual bool Attach(
void *
object);
74 virtual void Unreference() = 0;
84 class PGObject :
public PGBaseObject
89 PGObject(
const PGObject & other);
90 void operator=(
const PGObject &);
93 ~PGObject() { SetNULL(); }
96 virtual void Unreference();
99 virtual bool IsValid()
const;
102 const char * attribute,
106 const char * attribute,
115 class PGstMiniObject :
public PGBaseObject
120 PGstMiniObject(
const PGstMiniObject & other);
121 void operator=(
const PGstMiniObject &);
124 ~PGstMiniObject() { SetNULL(); }
126 virtual bool IsValid()
const;
129 virtual void Unreference();
136 class PGstObject :
public PGObject
148 class PGstPluginFeature : public PGstObject
154 enum InspectSearchField {
162 InspectSearchField searchField,
168 ) {
return Inspect(regex, ByKlass, detailed); }
175 class PGstElementFactory :
public PGstPluginFeature
177 PCLASSINFO(PGstElementFactory, PGstPluginFeature)
180 const
char * factoryName = NULL
184 PString GetDescription() const;
191 class PGstElement : public PGstObject
197 const char * factoryName,
202 bool SetName(
const PString & name);
205 const PGstElement & dest
222 StateResult SetState(
226 StateResult GetState(
229 StateResult GetPendingState(
232 StateResult WaitStateChange();
233 StateResult WaitStateChange(
242 class PGstBaseIterator :
public PGBaseObject
246 ~PGstBaseIterator() { SetNULL(); }
248 virtual bool Attach(
void *
object);
256 Result operator++() {
return InternalNext(); }
258 Result GetLastResult()
const {
return m_lastResult; }
263 PGstBaseIterator(PGBaseObject & valueRef);
265 virtual void Unreference();
266 Result InternalNext();
268 PGBaseObject & m_valueRef;
274 class PGstIterator :
public PGstBaseIterator
278 PGstIterator() : PGstBaseIterator(m_value) { }
279 const T * operator->()
const {
return &m_value; }
280 const T & operator*()
const {
return m_value; }
289 class PGstBin :
public PGstElement
294 const PGstElement & element
299 PGstElement & element
303 PGstIterator<PGstElement> & iterator,
304 bool recursive = false
312 class PGstAppSrc : public PGstElement
327 void SetType(Types type);
328 Types GetType()
const;
342 class PGstAppSink :
public PGstElement
364 class PGstPipeline :
public PGstBin
369 const
char * name = NULL
373 const
char * description
381 class PGstMessage : public PGstMiniObject
388 void PrintOn(ostream & strm) const;
395 class PGstBus : public PGstObject
401 const PGstPipeline & pipeline
405 bool Peek(PGstMessage & message);
406 bool Pop(PGstMessage & message);
410 #define PDECLARE_GstBusNotifier(cls, fn) PDECLARE_NOTIFIER2(PGstBus, cls, fn, PGstMessage)
411 #define PDECLARE_ASYNC_GstBusNotifier(cls, fn) PDECLARE_ASYNC_NOTIFIER2(PGstBus, cls, fn, PGstMessage)
412 #define PCREATE_GstBusNotifier(fn) PCREATE_NOTIFIER2(fn, PGstMessage)
420 #endif // P_GSTREAMER
422 #endif // PTLIB_GSTREMER_H