summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorРуслан Ижбулатов <lrn1986@gmail.com>2009-03-26 11:37:28 +0100
committerSebastian Dröge <sebastian.droege@collabora.co.uk>2009-03-26 11:37:28 +0100
commit7ff9bdb45659fdfbc434a202c0588c6a271bef0a (patch)
treef4fd8dbee8bcae101320033b82e59266065cc108 /sys
parentf5b298e3d7687dbd349ff920eaa22d7f958a0653 (diff)
downloadgstreamer-plugins-bad-7ff9bdb45659fdfbc434a202c0588c6a271bef0a.tar.gz
acm: Port to MinGW
Fixes bug #573595.
Diffstat (limited to 'sys')
-rw-r--r--sys/acmenc/Makefile.am2
-rw-r--r--sys/acmenc/acmenc.c25
-rw-r--r--sys/acmmp3dec/Makefile.am2
-rw-r--r--sys/acmmp3dec/acmmp3dec.c9
4 files changed, 22 insertions, 16 deletions
diff --git a/sys/acmenc/Makefile.am b/sys/acmenc/Makefile.am
index 361ded6c2..587868bd5 100644
--- a/sys/acmenc/Makefile.am
+++ b/sys/acmenc/Makefile.am
@@ -2,7 +2,7 @@ plugin_LTLIBRARIES = libgstacmencsink.la
libgstacmencsink_la_SOURCES = acmenc.c
libgstacmencsink_la_CFLAGS = $(GST_CFLAGS) $(GST_BASE_CFLAGS) \
- $(GST_PLUGINS_BASE_CFLAGS)
+ $(GST_PLUGINS_BASE_CFLAGS) $(ACMENC_CFLAGS)
libgstacmencsink_la_LIBADD = $(GST_BASE_LIBS) $(GST_PLUGINS_BASE_LIBS) \
-lgstriff-$(GST_MAJORMINOR) -lmsacm32
libgstacmencsink_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS)
diff --git a/sys/acmenc/acmenc.c b/sys/acmenc/acmenc.c
index 7ba88fb67..c1da855c4 100644
--- a/sys/acmenc/acmenc.c
+++ b/sys/acmenc/acmenc.c
@@ -231,7 +231,7 @@ acmenc_setup (ACMEnc * enc)
enc->header.dwSrcUser = 0;
/* Ask what buffer size we need to use for our output */
- acmStreamSize (enc->stream, ACM_BUFFER_SIZE, &destBufferSize,
+ acmStreamSize (enc->stream, ACM_BUFFER_SIZE, (LPDWORD) & destBufferSize,
ACM_STREAMSIZEF_SOURCE);
enc->header.pbDst = (BYTE *) g_malloc (destBufferSize);
enc->header.cbDstLength = destBufferSize;
@@ -484,8 +484,12 @@ acmenc_base_init (ACMEncClass * klass)
if (res) {
GST_WARNING ("Could not get driver details: %d", res);
}
- shortname = g_utf16_to_utf8 (driverdetails.szShortName, -1, NULL, NULL, NULL);
- longname = g_utf16_to_utf8 (driverdetails.szLongName, -1, NULL, NULL, NULL);
+ shortname =
+ g_utf16_to_utf8 ((gunichar2 *) driverdetails.szShortName, -1, NULL, NULL,
+ NULL);
+ longname =
+ g_utf16_to_utf8 ((gunichar2 *) driverdetails.szLongName, -1, NULL, NULL,
+ NULL);
details.longname = g_strdup_printf ("ACM Encoder: %s", (shortname
&& *shortname) ? shortname : params->name);
details.klass = "Codec/Encoder/Audio";
@@ -503,13 +507,12 @@ acmenc_base_init (ACMEncClass * klass)
static ACMEncParams *
acmenc_open_driver (wchar_t * filename)
{
- HACMDRIVER driver = NULL;
HACMDRIVERID driverid = NULL;
HMODULE mod = NULL;
FARPROC func;
MMRESULT res;
ACMEncParams *params;
- mod = LoadLibrary (filename);
+ mod = LoadLibraryW (filename);
if (!mod) {
GST_WARNING ("Failed to load ACM");
goto done;
@@ -581,22 +584,24 @@ acmenc_register (GstPlugin * plugin)
{
int res;
wchar_t dirname[1024];
- WIN32_FIND_DATA filedata;
+ WIN32_FIND_DATAW filedata;
HANDLE find;
- res = GetSystemDirectory (dirname, sizeof (dirname) / sizeof (wchar_t));
+ res = GetSystemDirectoryW (dirname, sizeof (dirname) / sizeof (wchar_t));
if (!res || res > 1000) {
GST_WARNING ("Couldn't get system directory");
return FALSE;
}
wcscat (dirname, L"\\*.acm");
- find = FindFirstFile (dirname, &filedata);
+ find = FindFirstFileW (dirname, &filedata);
if (find == INVALID_HANDLE_VALUE) {
GST_WARNING ("Failed to find ACM files: %x", GetLastError ());
return FALSE;
}
do {
- char *filename = g_utf16_to_utf8 (filedata.cFileName, -1, NULL, NULL, NULL);
+ char *filename =
+ g_utf16_to_utf8 ((gunichar2 *) filedata.cFileName, -1, NULL, NULL,
+ NULL);
GST_INFO ("Registering ACM filter from file %s", filename);
if (acmenc_register_file (plugin, filedata.cFileName))
GST_INFO ("Loading filter from ACM '%s' succeeded", filename);
@@ -604,7 +609,7 @@ acmenc_register (GstPlugin * plugin)
else
GST_WARNING ("Loading filter from ACM '%s' failed", filename);
g_free (filename);
- } while (FindNextFile (find, &filedata));
+ } while (FindNextFileW (find, &filedata));
FindClose (find);
return TRUE;
}
diff --git a/sys/acmmp3dec/Makefile.am b/sys/acmmp3dec/Makefile.am
index 1f143de09..c1a28e75f 100644
--- a/sys/acmmp3dec/Makefile.am
+++ b/sys/acmmp3dec/Makefile.am
@@ -2,7 +2,7 @@ plugin_LTLIBRARIES = libgstacmmp3dec.la
libgstacmmp3dec_la_SOURCES = acmmp3dec.c
libgstacmmp3dec_la_CFLAGS = $(GST_CFLAGS) $(GST_BASE_CFLAGS) \
- $(GST_PLUGINS_BASE_CFLAGS)
+ $(GST_PLUGINS_BASE_CFLAGS) $(ACMMP3DEC_CFLAGS)
libgstacmmp3dec_la_LIBADD = $(GST_BASE_LIBS) $(GST_PLUGINS_BASE_LIBS) \
-lgstriff-$(GST_MAJORMINOR) -lmsacm32
libgstacmmp3dec_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS) $(DIRECTSOUND_LDFLAGS)
diff --git a/sys/acmmp3dec/acmmp3dec.c b/sys/acmmp3dec/acmmp3dec.c
index 9930e96d6..3a158f731 100644
--- a/sys/acmmp3dec/acmmp3dec.c
+++ b/sys/acmmp3dec/acmmp3dec.c
@@ -153,8 +153,9 @@ acmmp3dec_setup (ACMMP3Dec * dec)
acmmp3dec_set_input_format (dec);
acmmp3dec_set_output_format (dec);
- res = acmStreamOpen (&dec->stream, NULL, &dec->infmt, &dec->outfmt,
- 0, 0, 0, 0);
+ res =
+ acmStreamOpen (&dec->stream, NULL, (LPWAVEFORMATEX) & dec->infmt,
+ &dec->outfmt, 0, 0, 0, 0);
if (res) {
GST_WARNING_OBJECT (dec, "Failed to open ACM stream: %d", res);
return FALSE;
@@ -171,7 +172,7 @@ acmmp3dec_setup (ACMMP3Dec * dec)
/* Ask what buffer size we need to use for our output */
acmStreamSize (dec->stream, ACM_BUFFER_SIZE,
- &destBufferSize, ACM_STREAMSIZEF_SOURCE);
+ (LPDWORD) & destBufferSize, ACM_STREAMSIZEF_SOURCE);
dec->header.pbDst = (BYTE *) g_malloc (destBufferSize);
dec->header.cbDstLength = destBufferSize;
@@ -404,7 +405,7 @@ acmmp3dec_class_init (ACMMP3DecClass * klass)
}
static void
-acmmp3dec_base_init (ACMMP3DecClass * klass)
+acmmp3dec_base_init (gpointer klass)
{
GstElementClass *element_class = GST_ELEMENT_CLASS (klass);