mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-11 18:05:37 +00:00
parent
f5b298e3d7
commit
7ff9bdb456
5 changed files with 26 additions and 17 deletions
|
@ -1365,7 +1365,10 @@ translit(dnm, m, l) AM_CONDITIONAL(USE_ACM, true)
|
||||||
AG_GST_CHECK_FEATURE(ACM, [Windows ACM library], acm, [
|
AG_GST_CHECK_FEATURE(ACM, [Windows ACM library], acm, [
|
||||||
AC_MSG_CHECKING([Checking for ACM support])
|
AC_MSG_CHECKING([Checking for ACM support])
|
||||||
AC_CHECK_HEADERS([windows.h msacm.h],
|
AC_CHECK_HEADERS([windows.h msacm.h],
|
||||||
[HAVE_ACM="yes"], [HAVE_ACM="no"])
|
[HAVE_ACM="yes"
|
||||||
|
AC_SUBST(ACMENC_CFLAGS)
|
||||||
|
AC_SUBST(ACMMP3DEC_CFLAGS)
|
||||||
|
], [HAVE_ACM="no"])
|
||||||
])
|
])
|
||||||
|
|
||||||
else
|
else
|
||||||
|
|
|
@ -2,7 +2,7 @@ plugin_LTLIBRARIES = libgstacmencsink.la
|
||||||
|
|
||||||
libgstacmencsink_la_SOURCES = acmenc.c
|
libgstacmencsink_la_SOURCES = acmenc.c
|
||||||
libgstacmencsink_la_CFLAGS = $(GST_CFLAGS) $(GST_BASE_CFLAGS) \
|
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) \
|
libgstacmencsink_la_LIBADD = $(GST_BASE_LIBS) $(GST_PLUGINS_BASE_LIBS) \
|
||||||
-lgstriff-$(GST_MAJORMINOR) -lmsacm32
|
-lgstriff-$(GST_MAJORMINOR) -lmsacm32
|
||||||
libgstacmencsink_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS)
|
libgstacmencsink_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS)
|
||||||
|
|
|
@ -231,7 +231,7 @@ acmenc_setup (ACMEnc * enc)
|
||||||
enc->header.dwSrcUser = 0;
|
enc->header.dwSrcUser = 0;
|
||||||
|
|
||||||
/* Ask what buffer size we need to use for our output */
|
/* 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);
|
ACM_STREAMSIZEF_SOURCE);
|
||||||
enc->header.pbDst = (BYTE *) g_malloc (destBufferSize);
|
enc->header.pbDst = (BYTE *) g_malloc (destBufferSize);
|
||||||
enc->header.cbDstLength = destBufferSize;
|
enc->header.cbDstLength = destBufferSize;
|
||||||
|
@ -484,8 +484,12 @@ acmenc_base_init (ACMEncClass * klass)
|
||||||
if (res) {
|
if (res) {
|
||||||
GST_WARNING ("Could not get driver details: %d", res);
|
GST_WARNING ("Could not get driver details: %d", res);
|
||||||
}
|
}
|
||||||
shortname = g_utf16_to_utf8 (driverdetails.szShortName, -1, NULL, NULL, NULL);
|
shortname =
|
||||||
longname = g_utf16_to_utf8 (driverdetails.szLongName, -1, NULL, NULL, NULL);
|
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
|
details.longname = g_strdup_printf ("ACM Encoder: %s", (shortname
|
||||||
&& *shortname) ? shortname : params->name);
|
&& *shortname) ? shortname : params->name);
|
||||||
details.klass = "Codec/Encoder/Audio";
|
details.klass = "Codec/Encoder/Audio";
|
||||||
|
@ -503,13 +507,12 @@ acmenc_base_init (ACMEncClass * klass)
|
||||||
static ACMEncParams *
|
static ACMEncParams *
|
||||||
acmenc_open_driver (wchar_t * filename)
|
acmenc_open_driver (wchar_t * filename)
|
||||||
{
|
{
|
||||||
HACMDRIVER driver = NULL;
|
|
||||||
HACMDRIVERID driverid = NULL;
|
HACMDRIVERID driverid = NULL;
|
||||||
HMODULE mod = NULL;
|
HMODULE mod = NULL;
|
||||||
FARPROC func;
|
FARPROC func;
|
||||||
MMRESULT res;
|
MMRESULT res;
|
||||||
ACMEncParams *params;
|
ACMEncParams *params;
|
||||||
mod = LoadLibrary (filename);
|
mod = LoadLibraryW (filename);
|
||||||
if (!mod) {
|
if (!mod) {
|
||||||
GST_WARNING ("Failed to load ACM");
|
GST_WARNING ("Failed to load ACM");
|
||||||
goto done;
|
goto done;
|
||||||
|
@ -581,22 +584,24 @@ acmenc_register (GstPlugin * plugin)
|
||||||
{
|
{
|
||||||
int res;
|
int res;
|
||||||
wchar_t dirname[1024];
|
wchar_t dirname[1024];
|
||||||
WIN32_FIND_DATA filedata;
|
WIN32_FIND_DATAW filedata;
|
||||||
HANDLE find;
|
HANDLE find;
|
||||||
res = GetSystemDirectory (dirname, sizeof (dirname) / sizeof (wchar_t));
|
res = GetSystemDirectoryW (dirname, sizeof (dirname) / sizeof (wchar_t));
|
||||||
if (!res || res > 1000) {
|
if (!res || res > 1000) {
|
||||||
GST_WARNING ("Couldn't get system directory");
|
GST_WARNING ("Couldn't get system directory");
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
wcscat (dirname, L"\\*.acm");
|
wcscat (dirname, L"\\*.acm");
|
||||||
find = FindFirstFile (dirname, &filedata);
|
find = FindFirstFileW (dirname, &filedata);
|
||||||
if (find == INVALID_HANDLE_VALUE) {
|
if (find == INVALID_HANDLE_VALUE) {
|
||||||
GST_WARNING ("Failed to find ACM files: %x", GetLastError ());
|
GST_WARNING ("Failed to find ACM files: %x", GetLastError ());
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
do {
|
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);
|
GST_INFO ("Registering ACM filter from file %s", filename);
|
||||||
if (acmenc_register_file (plugin, filedata.cFileName))
|
if (acmenc_register_file (plugin, filedata.cFileName))
|
||||||
GST_INFO ("Loading filter from ACM '%s' succeeded", filename);
|
GST_INFO ("Loading filter from ACM '%s' succeeded", filename);
|
||||||
|
@ -604,7 +609,7 @@ acmenc_register (GstPlugin * plugin)
|
||||||
else
|
else
|
||||||
GST_WARNING ("Loading filter from ACM '%s' failed", filename);
|
GST_WARNING ("Loading filter from ACM '%s' failed", filename);
|
||||||
g_free (filename);
|
g_free (filename);
|
||||||
} while (FindNextFile (find, &filedata));
|
} while (FindNextFileW (find, &filedata));
|
||||||
FindClose (find);
|
FindClose (find);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,7 +2,7 @@ plugin_LTLIBRARIES = libgstacmmp3dec.la
|
||||||
|
|
||||||
libgstacmmp3dec_la_SOURCES = acmmp3dec.c
|
libgstacmmp3dec_la_SOURCES = acmmp3dec.c
|
||||||
libgstacmmp3dec_la_CFLAGS = $(GST_CFLAGS) $(GST_BASE_CFLAGS) \
|
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) \
|
libgstacmmp3dec_la_LIBADD = $(GST_BASE_LIBS) $(GST_PLUGINS_BASE_LIBS) \
|
||||||
-lgstriff-$(GST_MAJORMINOR) -lmsacm32
|
-lgstriff-$(GST_MAJORMINOR) -lmsacm32
|
||||||
libgstacmmp3dec_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS) $(DIRECTSOUND_LDFLAGS)
|
libgstacmmp3dec_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS) $(DIRECTSOUND_LDFLAGS)
|
||||||
|
|
|
@ -153,8 +153,9 @@ acmmp3dec_setup (ACMMP3Dec * dec)
|
||||||
acmmp3dec_set_input_format (dec);
|
acmmp3dec_set_input_format (dec);
|
||||||
acmmp3dec_set_output_format (dec);
|
acmmp3dec_set_output_format (dec);
|
||||||
|
|
||||||
res = acmStreamOpen (&dec->stream, NULL, &dec->infmt, &dec->outfmt,
|
res =
|
||||||
0, 0, 0, 0);
|
acmStreamOpen (&dec->stream, NULL, (LPWAVEFORMATEX) & dec->infmt,
|
||||||
|
&dec->outfmt, 0, 0, 0, 0);
|
||||||
if (res) {
|
if (res) {
|
||||||
GST_WARNING_OBJECT (dec, "Failed to open ACM stream: %d", res);
|
GST_WARNING_OBJECT (dec, "Failed to open ACM stream: %d", res);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
@ -171,7 +172,7 @@ acmmp3dec_setup (ACMMP3Dec * dec)
|
||||||
|
|
||||||
/* Ask what buffer size we need to use for our output */
|
/* Ask what buffer size we need to use for our output */
|
||||||
acmStreamSize (dec->stream, ACM_BUFFER_SIZE,
|
acmStreamSize (dec->stream, ACM_BUFFER_SIZE,
|
||||||
&destBufferSize, ACM_STREAMSIZEF_SOURCE);
|
(LPDWORD) & destBufferSize, ACM_STREAMSIZEF_SOURCE);
|
||||||
|
|
||||||
dec->header.pbDst = (BYTE *) g_malloc (destBufferSize);
|
dec->header.pbDst = (BYTE *) g_malloc (destBufferSize);
|
||||||
dec->header.cbDstLength = destBufferSize;
|
dec->header.cbDstLength = destBufferSize;
|
||||||
|
@ -404,7 +405,7 @@ acmmp3dec_class_init (ACMMP3DecClass * klass)
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
acmmp3dec_base_init (ACMMP3DecClass * klass)
|
acmmp3dec_base_init (gpointer klass)
|
||||||
{
|
{
|
||||||
GstElementClass *element_class = GST_ELEMENT_CLASS (klass);
|
GstElementClass *element_class = GST_ELEMENT_CLASS (klass);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue