TrackPrivateBaseGStreamer.h [plain text]
#ifndef TrackPrivateBaseGStreamer_h
#define TrackPrivateBaseGStreamer_h
#if ENABLE(VIDEO) && USE(GSTREAMER) && ENABLE(VIDEO_TRACK)
#include "GRefPtrGStreamer.h"
#include "MainThreadNotifier.h"
#include <wtf/Lock.h>
#include <wtf/ThreadingPrimitives.h>
#include <wtf/text/WTFString.h>
namespace WebCore {
class TrackPrivateBase;
class TrackPrivateBaseGStreamer {
public:
virtual ~TrackPrivateBaseGStreamer();
GstPad* pad() const { return m_pad.get(); }
virtual void disconnect();
virtual void setActive(bool) { }
void setIndex(int index) { m_index = index; }
protected:
TrackPrivateBaseGStreamer(TrackPrivateBase* owner, gint index, GRefPtr<GstPad>);
void notifyTrackOfActiveChanged();
void notifyTrackOfTagsChanged();
enum MainThreadNotification {
ActiveChanged = 1 << 0,
TagsChanged = 1 << 1,
NewSample = 1 << 2,
StreamChanged = 1 << 3
};
MainThreadNotifier<MainThreadNotification> m_notifier;
gint m_index;
AtomicString m_label;
AtomicString m_language;
GRefPtr<GstPad> m_pad;
private:
bool getLanguageCode(GstTagList* tags, AtomicString& value);
template<class StringType>
bool getTag(GstTagList* tags, const gchar* tagName, StringType& value);
static void activeChangedCallback(TrackPrivateBaseGStreamer*);
static void tagsChangedCallback(TrackPrivateBaseGStreamer*);
void tagsChanged();
TrackPrivateBase* m_owner;
Lock m_tagMutex;
GRefPtr<GstTagList> m_tags;
};
}
#endif // ENABLE(VIDEO) && USE(GSTREAMER) && ENABLE(VIDEO_TRACK)
#endif // TrackPrivateBaseGStreamer_h