Fix GStreamer Video (IDs+include)
This commit is contained in:
1 parent
c07526e195
commit
2195af6700
2 files changed
+8
-15
No files matched your search
@@ -3,7 +3,7 @@
|
|||||||
#include "GstreamerVideoStream.h"
|
#include "GstreamerVideoStream.h"
|
||||||
|
|
||||||
map<int, GstreamerVideoStream*> VideoStreams;
|
map<int, GstreamerVideoStream*> VideoStreams;
|
||||||
queue<int> VideoIDs;
|
int NextID;
|
||||||
|
|
||||||
DllExport void SetVideoLogCallback (LogCallback Callback)
|
DllExport void SetVideoLogCallback (LogCallback Callback)
|
||||||
{
|
{
|
||||||
@@ -12,15 +12,7 @@ DllExport void SetVideoLogCallback (LogCallback Callback)
|
|||||||
|
|
||||||
DllExport bool InitVideo()
|
DllExport bool InitVideo()
|
||||||
{
|
{
|
||||||
for(int i = 0; i < 1000; i++)
|
NextID = 0;
|
||||||
{
|
|
||||||
VideoIDs.push(i);
|
|
||||||
}
|
|
||||||
#if _WIN64
|
|
||||||
SetDllDirectory(L".\\x64\\gstreamer");
|
|
||||||
#else
|
|
||||||
SetDllDirectory(L".\\x86\\gstreamer");
|
|
||||||
#endif
|
|
||||||
|
|
||||||
gst_init(NULL, NULL);
|
gst_init(NULL, NULL);
|
||||||
|
|
||||||
@@ -28,8 +20,10 @@ DllExport bool InitVideo()
|
|||||||
|
|
||||||
#if _WIN64
|
#if _WIN64
|
||||||
gst_registry_scan_path(registry, ".\\x64\\gstreamer");
|
gst_registry_scan_path(registry, ".\\x64\\gstreamer");
|
||||||
#else
|
#elif _WIN32
|
||||||
gst_registry_scan_path(registry, ".\\x86\\gstreamer");
|
gst_registry_scan_path(registry, ".\\x86\\gstreamer");
|
||||||
|
#else
|
||||||
|
#error Define either _WIN64 or _WIN32!
|
||||||
#endif
|
#endif
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -45,9 +39,8 @@ DllExport void CloseAllVideos(void)
|
|||||||
|
|
||||||
DllExport int LoadVideo(const wchar_t* Media)
|
DllExport int LoadVideo(const wchar_t* Media)
|
||||||
{
|
{
|
||||||
GstreamerVideoStream *s = new GstreamerVideoStream(VideoIDs.front());
|
GstreamerVideoStream *s = new GstreamerVideoStream(NextID++);
|
||||||
VideoStreams.insert(pair<int, GstreamerVideoStream*> (VideoIDs.front(), s));
|
VideoStreams.insert(pair<int, GstreamerVideoStream*> (s->ID, s));
|
||||||
VideoIDs.pop();
|
|
||||||
return s->LoadVideo(Media);
|
return s->LoadVideo(Media);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
#include <thread>
|
#include <thread>
|
||||||
#include "gst/gst.h"
|
#include "gst/gst.h"
|
||||||
#include "GstreamerVideo.h"
|
#include "GstreamerVideo.h"
|
||||||
#include "gst\app\gstappsink.h"
|
#include "gst/app/gstappsink.h"
|
||||||
#include "VocaluxeClock.h"
|
#include "VocaluxeClock.h"
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|||||||
Reference in new issue
Block a user