summaryrefslogtreecommitdiff
path: root/sys/acmenc
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/acmenc
parentf5b298e3d7687dbd349ff920eaa22d7f958a0653 (diff)
downloadgstreamer-plugins-bad-7ff9bdb45659fdfbc434a202c0588c6a271bef0a.tar.gz
acm: Port to MinGW
Fixes bug #573595.
Diffstat (limited to 'sys/acmenc')
-rw-r--r--sys/acmenc/Makefile.am2
-rw-r--r--sys/acmenc/acmenc.c25
2 files changed, 16 insertions, 11 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;
}