30 |
|
|
31 |
#include <windows.h> |
#include <windows.h> |
32 |
#include <vfw.h> |
#include <vfw.h> |
33 |
|
#include "vfwext.h" |
34 |
|
|
35 |
#include "debug.h" |
#include "debug.h" |
36 |
#include "codec.h" |
#include "codec.h" |
37 |
#include "config.h" |
#include "config.h" |
38 |
|
#include "status.h" |
39 |
#include "resource.h" |
#include "resource.h" |
40 |
|
|
41 |
|
|
89 |
return 0; |
return 0; |
90 |
} |
} |
91 |
|
|
92 |
|
|
93 |
|
codec->status.hDlg = NULL; |
94 |
|
codec->config.ci_valid = 0; |
95 |
codec->ehandle = codec->dhandle = NULL; |
codec->ehandle = codec->dhandle = NULL; |
96 |
codec->fbase = 25; |
codec->fbase = 25; |
97 |
codec->fincr = 1; |
codec->fincr = 1; |
98 |
config_reg_get(&codec->config); |
config_reg_get(&codec->config); |
99 |
|
|
100 |
/* bad things happen if this is uncommented |
#if 0 |
101 |
|
/* bad things happen if this piece of code is activated */ |
102 |
if (lstrcmp(XVID_BUILD, codec->config.build)) |
if (lstrcmp(XVID_BUILD, codec->config.build)) |
103 |
{ |
{ |
104 |
config_reg_default(&codec->config); |
config_reg_default(&codec->config); |
105 |
} |
} |
106 |
*/ |
#endif |
107 |
|
|
108 |
if (icopen != NULL) |
if (icopen != NULL) |
109 |
{ |
{ |
114 |
|
|
115 |
case DRV_CLOSE : |
case DRV_CLOSE : |
116 |
DPRINTF("DRV_CLOSE"); |
DPRINTF("DRV_CLOSE"); |
117 |
// compress_end/decompress_end don't always get called |
/* compress_end/decompress_end don't always get called */ |
118 |
compress_end(codec); |
compress_end(codec); |
119 |
decompress_end(codec); |
decompress_end(codec); |
120 |
|
status_destroy_always(&codec->status); |
121 |
free(codec); |
free(codec); |
122 |
return DRV_OK; |
return DRV_OK; |
123 |
|
|
201 |
return 0; |
return 0; |
202 |
} |
} |
203 |
memcpy(&codec->config,(void*)lParam1, sizeof(CONFIG)); |
memcpy(&codec->config,(void*)lParam1, sizeof(CONFIG)); |
204 |
return 0; // sizeof(CONFIG); |
return 0; /* sizeof(CONFIG); */ |
205 |
|
|
206 |
/* not sure the difference, private/public data? */ |
/* not sure the difference, private/public data? */ |
207 |
|
|
280 |
case ICM_DECOMPRESSEX: |
case ICM_DECOMPRESSEX: |
281 |
return ICERR_UNSUPPORTED; |
return ICERR_UNSUPPORTED; |
282 |
|
|
283 |
|
/* VFWEXT entry point */ |
284 |
|
case ICM_USER+0x0fff : |
285 |
|
if (lParam1 == VFWEXT_CONFIGURE_INFO) { |
286 |
|
VFWEXT_CONFIGURE_INFO_T * info = (VFWEXT_CONFIGURE_INFO_T*)lParam2; |
287 |
|
DPRINTF("%i %i %i %i %i %i", |
288 |
|
info->ciWidth, info->ciHeight, |
289 |
|
info->ciRate, info->ciScale, |
290 |
|
info->ciActiveFrame, info->ciFrameCount); |
291 |
|
|
292 |
|
codec->config.ci_valid = 1; |
293 |
|
memcpy(&codec->config.ci, (void*)lParam2, sizeof(VFWEXT_CONFIGURE_INFO_T)); |
294 |
|
return ICERR_OK; |
295 |
|
} |
296 |
|
return ICERR_UNSUPPORTED; |
297 |
|
|
298 |
default: |
default: |
299 |
return DefDriverProc(dwDriverId, hDriver, uMsg, lParam1, lParam2); |
return DefDriverProc(dwDriverId, hDriver, uMsg, lParam1, lParam2); |
300 |
} |
} |
308 |
dwDriverId = DriverProc(0, 0, DRV_OPEN, 0, 0); |
dwDriverId = DriverProc(0, 0, DRV_OPEN, 0, 0); |
309 |
if (dwDriverId != (DWORD)NULL) |
if (dwDriverId != (DWORD)NULL) |
310 |
{ |
{ |
311 |
DriverProc(dwDriverId, 0, ICM_CONFIGURE, 0, 0); |
DriverProc(dwDriverId, 0, ICM_CONFIGURE, (LPARAM)GetDesktopWindow(), 0); |
312 |
DriverProc(dwDriverId, 0, DRV_CLOSE, 0, 0); |
DriverProc(dwDriverId, 0, DRV_CLOSE, 0, 0); |
313 |
} |
} |
314 |
} |
} |