| 284 | |
| 285 | |
| 286 | ERR ilPKCodecFactory_CreateDecoderFromFile(PKImageDecode** ppDecoder) |
| 287 | { |
| 288 | ERR err = WMP_errSuccess; |
| 289 | |
| 290 | char *pExt = ".wdp"; // We are loading a WDP file, so we have to tell the library that with this extension. |
| 291 | PKIID* pIID = NULL; |
| 292 | |
| 293 | struct WMPStream* pStream = NULL; |
| 294 | PKImageDecode* pDecoder = NULL; |
| 295 | |
| 296 | // get decode PKIID |
| 297 | Call(GetImageDecodeIID(pExt, &pIID)); |
| 298 | |
| 299 | // create stream |
| 300 | Call(ilCreateWS_File(&pStream, NULL, "rb")); |
| 301 | |
| 302 | // Create decoder |
| 303 | Call(PKCodecFactory_CreateCodec(pIID, ppDecoder)); |
| 304 | pDecoder = *ppDecoder; |
| 305 | |
| 306 | // attach stream to decoder |
| 307 | Call(pDecoder->Initialize(pDecoder, pStream)); |
| 308 | pDecoder->fStreamOwner = !0; |
| 309 | |
| 310 | Cleanup: |
| 311 | return err; |
| 312 | } |
| 313 | |
| 314 | |
| 315 | ERR ilPKCreateFactory(PKFactory** ppFactory, U32 uVersion) |
no test coverage detected