<pre class="bz_comment_text" id="comment_text_0" style="white-space:pre-wrap;width:50em;background-color:rgb(255,255,255)">Is it possible to incorporate gstreamer SDK into a DLL that can be called from
a .NET app?
There was no problem compiling the application code along with the some of the
gstreamer DLLs
into a library. __declspec(dllexport) was added to expose the external
calling interface
for a DLL.
#include <stdio.h>
#include "stdafx.h"
#include "testProto.h"
extern "C"
{
__declspec(dllexport) int Sum(int a, int b)
{
return CTestProto::SetVideoCaps( a, b );
}
}
The header file looked like this:
#pragma once
class CTestProto
{
public:
CTestProto();
static void TestThis();
static int SetVideoCaps( int nWidth, int nHeight ) ;
};
This code sample worked when called from a WPF .net application
int CTestProto::SetVideoCaps( int nWidth, int nHeight )
{
GstCaps *caps;
return nWidth + nHeight;
}
This DID NOT!!!
When the sample was modified by adding gst_video_format_new_caps(...), failure
occurred during run-time.
void CTestProto::SetVideoCaps( int nWidth, int nHeight )
{
GstCaps *caps;
caps = gst_video_format_new_caps (GST_VIDEO_FORMAT_RGB, nWidth, nHeight, 0,
1, 3, 3);
}
An error appears : BadImageFormatException was unhandled
An attempt was made to load a program with an incorrect format. ( Exception
from HRESULT: 0x8007000B )
The GUI-based code will be WPF-based, I was planning to pass the Window Handle
of the WPF application to the Gstreamer pipeline written in Native C++ code.
Is it possible to wrap the gst... calls so that the DLL can be used?
If the only option is the use of the gstreamer-sharp wrapper, I am unsure how
to proceed.</pre>