Bound time to a clock, does not work too well
This commit is contained in:
1 parent
a7e528109a
commit
8fbe3f8501
7 files changed
+142
-2
No files matched your search
@@ -168,6 +168,7 @@
|
||||
<ClInclude Include="GstreamerVideoStream.h" />
|
||||
<ClInclude Include="stdafx.h" />
|
||||
<ClInclude Include="targetver.h" />
|
||||
<ClInclude Include="VocaluxeClock.h" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="dllmain.cpp">
|
||||
@@ -194,6 +195,7 @@
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='ReleaseWin|Win32'">Create</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='ReleaseWin|x64'">Create</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClCompile Include="VocaluxeClock.cpp" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
|
||||
@@ -33,6 +33,9 @@
|
||||
<ClInclude Include="GstreamerVideoStream.h">
|
||||
<Filter>Headerdateien</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="VocaluxeClock.h">
|
||||
<Filter>Headerdateien</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="stdafx.cpp">
|
||||
@@ -53,5 +56,8 @@
|
||||
<ClCompile Include="GstreamerVideoStream.cpp">
|
||||
<Filter>Quelldateien</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="VocaluxeClock.cpp">
|
||||
<Filter>Quelldateien</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
@@ -20,6 +20,7 @@ GstreamerVideoStream::GstreamerVideoStream(int ID)
|
||||
this->ID = ID;
|
||||
|
||||
g_main_loop_new(Context, false);
|
||||
Clock = vocaluxe_clock_new("external");
|
||||
|
||||
Loop = false;
|
||||
|
||||
@@ -65,8 +66,9 @@ int GstreamerVideoStream::LoadVideo(const wchar_t* Filename)
|
||||
NULL);
|
||||
|
||||
gst_app_sink_set_caps(Appsink, caps);
|
||||
gst_app_sink_set_max_buffers(Appsink, 1);
|
||||
gst_app_sink_set_max_buffers(Appsink, 5);
|
||||
|
||||
gst_pipeline_use_clock((GstPipeline *)Element, (GstClock*) Clock);
|
||||
gst_element_set_state(Element, GST_STATE_PLAYING);
|
||||
gst_element_set_state((GstElement*)Appsink, GST_STATE_PLAYING);
|
||||
gst_bus_timed_pop_filtered(Bus, -1, GST_MESSAGE_ASYNC_DONE);
|
||||
@@ -115,11 +117,13 @@ GstFlowReturn GstreamerVideoStream::NewBufferRecieved(GstAppSink *sink)
|
||||
gst_object_unref(BufferStructure);
|
||||
}
|
||||
|
||||
Mutex.lock();
|
||||
Frame.buffer = Mapinfo.data;
|
||||
Frame.height = Height;
|
||||
Frame.width = Width;
|
||||
Frame.size = Size;
|
||||
Frame.videotime = VideoTime;
|
||||
Mutex.unlock();
|
||||
|
||||
return GST_FLOW_OK;
|
||||
}
|
||||
@@ -172,6 +176,10 @@ bool GstreamerVideoStream::Skip(float Start, float Gap)
|
||||
|
||||
void GstreamerVideoStream::SetVideoLoop(bool Loop)
|
||||
{
|
||||
if(Loop)
|
||||
gst_pipeline_auto_clock((GstPipeline *)Element);
|
||||
else
|
||||
gst_pipeline_use_clock((GstPipeline *)Element, (GstClock*) Clock);
|
||||
this->Loop = Loop;
|
||||
}
|
||||
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
#include "gst/gst.h"
|
||||
#include "GstreamerVideo.h"
|
||||
#include "gst\app\gstappsink.h"
|
||||
#include "VocaluxeClock.h"
|
||||
|
||||
using namespace std;
|
||||
|
||||
@@ -31,9 +32,9 @@ public:
|
||||
bool IsFinished();
|
||||
|
||||
private:
|
||||
|
||||
GMainLoop *MainLoop;
|
||||
GMainContext *Context;
|
||||
VocaluxeClock *Clock;
|
||||
|
||||
GstAppSink *Appsink;
|
||||
GstElement *Element;
|
||||
|
||||
Reference in new issue
Block a user