First working gstreamer video output.

Frames are not in sync with the time provided in GetFrame! Need to implement a own GstClock for that first
This commit is contained in:
Stephan Sundermann committed 2013-02-12 16:13:06 +01:00
1 parent d66e47ff47
commit a7e528109a
7 files changed
+159 -43

No files matched your search

+17 -1
View File
@@ -1,9 +1,11 @@
#pragma once
#include <mutex>
#include "gst/gst.h"
#include "GstreamerVideo.h"
#include "gst\app\gstappsink.h"
using namespace std;
class GstreamerVideoStream
{
@@ -18,7 +20,7 @@ public:
bool CloseVideo();
float GetVideoLength();
guint8* GetFrame(float Time, float &VideoTime, int &Size, int &Width, int &Height);
struct ApplicationFrame GetFrame(float Time);
bool Skip(float Start, float Gap);
void SetVideoLoop(bool Loop);
void PauseVideo();
@@ -29,11 +31,22 @@ public:
bool IsFinished();
private:
GMainLoop *MainLoop;
GMainContext *Context;
GstAppSink *Appsink;
GstElement *Element;
GstBus *Bus;
GstMessage *Message;
ApplicationFrame Frame;
GstMapInfo Mapinfo;
GstSample *Sample;
GstBuffer *Buffer;
GstCaps *BufferCaps;
GstStructure *BufferStructure;
mutex Mutex;
gboolean Loop;
@@ -45,6 +58,9 @@ private:
gfloat Duration;
void RefreshDuration();
GstFlowReturn NewBufferRecieved(GstAppSink *Sink);
static GstFlowReturn fake_callback(GstAppSink *sink ,gpointer data);
};