winehq.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2025
February
January
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
January
2003
December
November
October
September
August
July
June
May
April
March
February
January
2002
December
November
October
September
August
July
June
May
April
March
February
January
2001
December
November
October
September
August
July
June
May
April
March
February
List overview
wine-commits
August 2009
----- 2025 -----
February 2025
January 2025
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
January 2004
----- 2003 -----
December 2003
November 2003
October 2003
September 2003
August 2003
July 2003
June 2003
May 2003
April 2003
March 2003
February 2003
January 2003
----- 2002 -----
December 2002
November 2002
October 2002
September 2002
August 2002
July 2002
June 2002
May 2002
April 2002
March 2002
February 2002
January 2002
----- 2001 -----
December 2001
November 2001
October 2001
September 2001
August 2001
July 2001
June 2001
May 2001
April 2001
March 2001
February 2001
wine-commits@winehq.org
4 participants
1042 discussions
Start a n
N
ew thread
Vincent Povirk : windowscodecs: Print a FIXME when WICConvertBitmapSource fails.
by Alexandre Julliard
25 Aug '09
25 Aug '09
Module: wine Branch: master Commit: 341b6ffd714f5e35e57063371d34816648f840be URL:
http://source.winehq.org/git/wine.git/?a=commit;h=341b6ffd714f5e35e57063371…
Author: Vincent Povirk <vincent(a)codeweavers.com> Date: Mon Aug 24 13:11:08 2009 -0500 windowscodecs: Print a FIXME when WICConvertBitmapSource fails. --- dlls/windowscodecs/info.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/dlls/windowscodecs/info.c b/dlls/windowscodecs/info.c index a89759b..64c3855 100644 --- a/dlls/windowscodecs/info.c +++ b/dlls/windowscodecs/info.c @@ -1064,6 +1064,7 @@ HRESULT WINAPI WICConvertBitmapSource(REFWICPixelFormatGUID dstFormat, IWICBitma } else { + FIXME("cannot convert %s to %s\n", debugstr_guid(&srcFormat), debugstr_guid(dstFormat)); *ppIDst = NULL; return WINCODEC_ERR_COMPONENTNOTFOUND; }
1
0
0
0
Vincent Povirk : windowscodecs: Implement CopyPixels for the JPEG decoder.
by Alexandre Julliard
25 Aug '09
25 Aug '09
Module: wine Branch: master Commit: 529bdca8a85cf1803fb855cc221abcf5f036fab8 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=529bdca8a85cf1803fb855cc2…
Author: Vincent Povirk <vincent(a)codeweavers.com> Date: Mon Aug 24 13:08:30 2009 -0500 windowscodecs: Implement CopyPixels for the JPEG decoder. --- dlls/windowscodecs/jpegformat.c | 70 +++++++++++++++++++++++++++++++++++++- 1 files changed, 68 insertions(+), 2 deletions(-) diff --git a/dlls/windowscodecs/jpegformat.c b/dlls/windowscodecs/jpegformat.c index 50ee013..6f78821 100644 --- a/dlls/windowscodecs/jpegformat.c +++ b/dlls/windowscodecs/jpegformat.c @@ -63,6 +63,7 @@ static void *libjpeg_handle; MAKE_FUNCPTR(jpeg_CreateDecompress); MAKE_FUNCPTR(jpeg_destroy_decompress); MAKE_FUNCPTR(jpeg_read_header); +MAKE_FUNCPTR(jpeg_read_scanlines); MAKE_FUNCPTR(jpeg_resync_to_restart); MAKE_FUNCPTR(jpeg_start_decompress); MAKE_FUNCPTR(jpeg_std_error); @@ -81,6 +82,7 @@ static void *load_libjpeg(void) LOAD_FUNCPTR(jpeg_CreateDecompress); LOAD_FUNCPTR(jpeg_destroy_decompress); LOAD_FUNCPTR(jpeg_read_header); + LOAD_FUNCPTR(jpeg_read_scanlines); LOAD_FUNCPTR(jpeg_resync_to_restart); LOAD_FUNCPTR(jpeg_start_decompress); LOAD_FUNCPTR(jpeg_std_error); @@ -100,6 +102,7 @@ typedef struct { struct jpeg_error_mgr jerr; struct jpeg_source_mgr source_mgr; BYTE source_buffer[1024]; + BYTE *image_data; } JpegDecoder; static inline JpegDecoder *decoder_from_decompress(j_decompress_ptr decompress) @@ -155,6 +158,7 @@ static ULONG WINAPI JpegDecoder_Release(IWICBitmapDecoder *iface) { if (This->cinfo_initialized) pjpeg_destroy_decompress(&This->cinfo); if (This->stream) IStream_Release(This->stream); + HeapFree(GetProcessHeap(), 0, This->image_data); HeapFree(GetProcessHeap(), 0, This); } @@ -428,8 +432,69 @@ static HRESULT WINAPI JpegDecoder_Frame_CopyPalette(IWICBitmapFrameDecode *iface static HRESULT WINAPI JpegDecoder_Frame_CopyPixels(IWICBitmapFrameDecode *iface, const WICRect *prc, UINT cbStride, UINT cbBufferSize, BYTE *pbBuffer) { - FIXME("(%p,%p,%u,%u,%p): stub\n", iface, prc, cbStride, cbBufferSize, pbBuffer); - return E_NOTIMPL; + JpegDecoder *This = decoder_from_frame(iface); + UINT bpp; + UINT stride; + UINT data_size; + UINT max_row_needed; + TRACE("(%p,%p,%u,%u,%p)\n", iface, prc, cbStride, cbBufferSize, pbBuffer); + + if (This->cinfo.out_color_space == JCS_GRAYSCALE) bpp = 8; + else bpp = 24; + + stride = bpp * This->cinfo.output_width; + data_size = stride * This->cinfo.output_height; + + max_row_needed = prc->Y + prc->Height; + if (max_row_needed > This->cinfo.output_height) return E_INVALIDARG; + + if (!This->image_data) + { + This->image_data = HeapAlloc(GetProcessHeap(), 0, data_size); + if (!This->image_data) return E_OUTOFMEMORY; + } + + while (max_row_needed > This->cinfo.output_scanline) + { + UINT first_scanline = This->cinfo.output_scanline; + UINT max_rows; + JSAMPROW out_rows[4]; + UINT i, j; + JDIMENSION ret; + + max_rows = min(This->cinfo.output_height-first_scanline, 4); + for (i=0; i<max_rows; i++) + out_rows[i] = This->image_data + stride * (first_scanline+i); + + ret = pjpeg_read_scanlines(&This->cinfo, out_rows, max_rows); + + if (ret == 0) + { + ERR("read_scanlines failed\n"); + return E_FAIL; + } + + if (bpp == 24) + { + /* libjpeg gives us RGB data and we want BGR, so byteswap the data */ + for (i=first_scanline; i<This->cinfo.output_scanline; i++) + { + BYTE *pixel = This->image_data + stride * i; + for (j=0; j<This->cinfo.output_width; j++) + { + BYTE red=pixel[0]; + BYTE blue=pixel[2]; + pixel[0]=blue; + pixel[2]=red; + pixel+=3; + } + } + } + } + + return copy_pixels(bpp, This->image_data, + This->cinfo.output_width, This->cinfo.output_height, stride, + prc, cbStride, cbBufferSize, pbBuffer); } static HRESULT WINAPI JpegDecoder_Frame_GetMetadataQueryReader(IWICBitmapFrameDecode *iface, @@ -493,6 +558,7 @@ HRESULT JpegDecoder_CreateInstance(IUnknown *pUnkOuter, REFIID iid, void** ppv) This->initialized = FALSE; This->cinfo_initialized = FALSE; This->stream = NULL; + This->image_data = NULL; ret = IUnknown_QueryInterface((IUnknown*)This, iid, ppv); IUnknown_Release((IUnknown*)This);
1
0
0
0
Vincent Povirk : windowscodecs: Implement GetSize for the JPEG decoder.
by Alexandre Julliard
25 Aug '09
25 Aug '09
Module: wine Branch: master Commit: 7d63abc9ec61719849d753c7e713559f6a5ed7bb URL:
http://source.winehq.org/git/wine.git/?a=commit;h=7d63abc9ec61719849d753c7e…
Author: Vincent Povirk <vincent(a)codeweavers.com> Date: Mon Aug 24 12:35:51 2009 -0500 windowscodecs: Implement GetSize for the JPEG decoder. --- dlls/windowscodecs/jpegformat.c | 7 +++++-- 1 files changed, 5 insertions(+), 2 deletions(-) diff --git a/dlls/windowscodecs/jpegformat.c b/dlls/windowscodecs/jpegformat.c index 69a07db..50ee013 100644 --- a/dlls/windowscodecs/jpegformat.c +++ b/dlls/windowscodecs/jpegformat.c @@ -392,8 +392,11 @@ static ULONG WINAPI JpegDecoder_Frame_Release(IWICBitmapFrameDecode *iface) static HRESULT WINAPI JpegDecoder_Frame_GetSize(IWICBitmapFrameDecode *iface, UINT *puiWidth, UINT *puiHeight) { - FIXME("(%p,%p,%p)\n", iface, puiWidth, puiHeight); - return E_NOTIMPL; + JpegDecoder *This = decoder_from_frame(iface); + *puiWidth = This->cinfo.output_width; + *puiHeight = This->cinfo.output_height; + TRACE("(%p)->(%u,%u)\n", iface, *puiWidth, *puiHeight); + return S_OK; } static HRESULT WINAPI JpegDecoder_Frame_GetPixelFormat(IWICBitmapFrameDecode *iface,
1
0
0
0
Vincent Povirk : windowscodecs: Implement GetPixelFormat for the JPEG decoder.
by Alexandre Julliard
25 Aug '09
25 Aug '09
Module: wine Branch: master Commit: 0ab6e9853c4a3a2db2216daf4141519356169b58 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=0ab6e9853c4a3a2db2216daf4…
Author: Vincent Povirk <vincent(a)codeweavers.com> Date: Mon Aug 24 12:29:02 2009 -0500 windowscodecs: Implement GetPixelFormat for the JPEG decoder. --- dlls/windowscodecs/jpegformat.c | 9 +++++++-- 1 files changed, 7 insertions(+), 2 deletions(-) diff --git a/dlls/windowscodecs/jpegformat.c b/dlls/windowscodecs/jpegformat.c index 38292bd..69a07db 100644 --- a/dlls/windowscodecs/jpegformat.c +++ b/dlls/windowscodecs/jpegformat.c @@ -399,8 +399,13 @@ static HRESULT WINAPI JpegDecoder_Frame_GetSize(IWICBitmapFrameDecode *iface, static HRESULT WINAPI JpegDecoder_Frame_GetPixelFormat(IWICBitmapFrameDecode *iface, WICPixelFormatGUID *pPixelFormat) { - FIXME("(%p,%p)\n", iface, pPixelFormat); - return E_NOTIMPL; + JpegDecoder *This = decoder_from_frame(iface); + TRACE("(%p,%p)\n", iface, pPixelFormat); + if (This->cinfo.out_color_space == JCS_RGB) + memcpy(pPixelFormat, &GUID_WICPixelFormat24bppBGR, sizeof(GUID)); + else /* This->cinfo.out_color_space == JCS_GRAYSCALE */ + memcpy(pPixelFormat, &GUID_WICPixelFormat8bppGray, sizeof(GUID)); + return S_OK; } static HRESULT WINAPI JpegDecoder_Frame_GetResolution(IWICBitmapFrameDecode *iface,
1
0
0
0
Vincent Povirk : windowscodecs: Implement GetFrame for the JPEG decoder.
by Alexandre Julliard
25 Aug '09
25 Aug '09
Module: wine Branch: master Commit: 5ef3b51756bb2181a77e8748a3f4ec5b2c401bfe URL:
http://source.winehq.org/git/wine.git/?a=commit;h=5ef3b51756bb2181a77e8748a…
Author: Vincent Povirk <vincent(a)codeweavers.com> Date: Mon Aug 24 12:23:34 2009 -0500 windowscodecs: Implement GetFrame for the JPEG decoder. --- dlls/windowscodecs/jpegformat.c | 125 ++++++++++++++++++++++++++++++++++++++- 1 files changed, 123 insertions(+), 2 deletions(-) diff --git a/dlls/windowscodecs/jpegformat.c b/dlls/windowscodecs/jpegformat.c index 8759905..38292bd 100644 --- a/dlls/windowscodecs/jpegformat.c +++ b/dlls/windowscodecs/jpegformat.c @@ -91,6 +91,7 @@ static void *load_libjpeg(void) typedef struct { const IWICBitmapDecoderVtbl *lpVtbl; + const IWICBitmapFrameDecodeVtbl *lpFrameVtbl; LONG ref; BOOL initialized; BOOL cinfo_initialized; @@ -106,6 +107,11 @@ static inline JpegDecoder *decoder_from_decompress(j_decompress_ptr decompress) return CONTAINING_RECORD(decompress, JpegDecoder, cinfo); } +static inline JpegDecoder *decoder_from_frame(IWICBitmapFrameDecode *iface) +{ + return CONTAINING_RECORD(iface, JpegDecoder, lpFrameVtbl); +} + static HRESULT WINAPI JpegDecoder_QueryInterface(IWICBitmapDecoder *iface, REFIID iid, void **ppv) { @@ -318,8 +324,17 @@ static HRESULT WINAPI JpegDecoder_GetFrameCount(IWICBitmapDecoder *iface, static HRESULT WINAPI JpegDecoder_GetFrame(IWICBitmapDecoder *iface, UINT index, IWICBitmapFrameDecode **ppIBitmapFrame) { - FIXME("(%p,%u,%p): stub\n", iface, index, ppIBitmapFrame); - return E_NOTIMPL; + JpegDecoder *This = (JpegDecoder*)iface; + TRACE("(%p,%u,%p)\n", iface, index, ppIBitmapFrame); + + if (!This->initialized) return WINCODEC_ERR_NOTINITIALIZED; + + if (index != 0) return E_INVALIDARG; + + IWICBitmapDecoder_AddRef(iface); + *ppIBitmapFrame = (IWICBitmapFrameDecode*)&This->lpFrameVtbl; + + return S_OK; } static const IWICBitmapDecoderVtbl JpegDecoder_Vtbl = { @@ -339,6 +354,111 @@ static const IWICBitmapDecoderVtbl JpegDecoder_Vtbl = { JpegDecoder_GetFrame }; +static HRESULT WINAPI JpegDecoder_Frame_QueryInterface(IWICBitmapFrameDecode *iface, REFIID iid, + void **ppv) +{ + TRACE("(%p,%s,%p)\n", iface, debugstr_guid(iid), ppv); + + if (!ppv) return E_INVALIDARG; + + if (IsEqualIID(&IID_IUnknown, iid) || + IsEqualIID(&IID_IWICBitmapSource, iid) || + IsEqualIID(&IID_IWICBitmapFrameDecode, iid)) + { + *ppv = iface; + } + else + { + *ppv = NULL; + return E_NOINTERFACE; + } + + IUnknown_AddRef((IUnknown*)*ppv); + return S_OK; +} + +static ULONG WINAPI JpegDecoder_Frame_AddRef(IWICBitmapFrameDecode *iface) +{ + JpegDecoder *This = decoder_from_frame(iface); + return IUnknown_AddRef((IUnknown*)This); +} + +static ULONG WINAPI JpegDecoder_Frame_Release(IWICBitmapFrameDecode *iface) +{ + JpegDecoder *This = decoder_from_frame(iface); + return IUnknown_Release((IUnknown*)This); +} + +static HRESULT WINAPI JpegDecoder_Frame_GetSize(IWICBitmapFrameDecode *iface, + UINT *puiWidth, UINT *puiHeight) +{ + FIXME("(%p,%p,%p)\n", iface, puiWidth, puiHeight); + return E_NOTIMPL; +} + +static HRESULT WINAPI JpegDecoder_Frame_GetPixelFormat(IWICBitmapFrameDecode *iface, + WICPixelFormatGUID *pPixelFormat) +{ + FIXME("(%p,%p)\n", iface, pPixelFormat); + return E_NOTIMPL; +} + +static HRESULT WINAPI JpegDecoder_Frame_GetResolution(IWICBitmapFrameDecode *iface, + double *pDpiX, double *pDpiY) +{ + FIXME("(%p,%p,%p): stub\n", iface, pDpiX, pDpiY); + return E_NOTIMPL; +} + +static HRESULT WINAPI JpegDecoder_Frame_CopyPalette(IWICBitmapFrameDecode *iface, + IWICPalette *pIPalette) +{ + FIXME("(%p,%p): stub\n", iface, pIPalette); + return E_NOTIMPL; +} + +static HRESULT WINAPI JpegDecoder_Frame_CopyPixels(IWICBitmapFrameDecode *iface, + const WICRect *prc, UINT cbStride, UINT cbBufferSize, BYTE *pbBuffer) +{ + FIXME("(%p,%p,%u,%u,%p): stub\n", iface, prc, cbStride, cbBufferSize, pbBuffer); + return E_NOTIMPL; +} + +static HRESULT WINAPI JpegDecoder_Frame_GetMetadataQueryReader(IWICBitmapFrameDecode *iface, + IWICMetadataQueryReader **ppIMetadataQueryReader) +{ + FIXME("(%p,%p): stub\n", iface, ppIMetadataQueryReader); + return WINCODEC_ERR_UNSUPPORTEDOPERATION; +} + +static HRESULT WINAPI JpegDecoder_Frame_GetColorContexts(IWICBitmapFrameDecode *iface, + UINT cCount, IWICColorContext **ppIColorContexts, UINT *pcActualCount) +{ + FIXME("(%p,%u,%p,%p): stub\n", iface, cCount, ppIColorContexts, pcActualCount); + return WINCODEC_ERR_UNSUPPORTEDOPERATION; +} + +static HRESULT WINAPI JpegDecoder_Frame_GetThumbnail(IWICBitmapFrameDecode *iface, + IWICBitmapSource **ppIThumbnail) +{ + FIXME("(%p,%p): stub\n", iface, ppIThumbnail); + return WINCODEC_ERR_CODECNOTHUMBNAIL; +} + +static const IWICBitmapFrameDecodeVtbl JpegDecoder_Frame_Vtbl = { + JpegDecoder_Frame_QueryInterface, + JpegDecoder_Frame_AddRef, + JpegDecoder_Frame_Release, + JpegDecoder_Frame_GetSize, + JpegDecoder_Frame_GetPixelFormat, + JpegDecoder_Frame_GetResolution, + JpegDecoder_Frame_CopyPalette, + JpegDecoder_Frame_CopyPixels, + JpegDecoder_Frame_GetMetadataQueryReader, + JpegDecoder_Frame_GetColorContexts, + JpegDecoder_Frame_GetThumbnail +}; + HRESULT JpegDecoder_CreateInstance(IUnknown *pUnkOuter, REFIID iid, void** ppv) { JpegDecoder *This; @@ -360,6 +480,7 @@ HRESULT JpegDecoder_CreateInstance(IUnknown *pUnkOuter, REFIID iid, void** ppv) if (!This) return E_OUTOFMEMORY; This->lpVtbl = &JpegDecoder_Vtbl; + This->lpFrameVtbl = &JpegDecoder_Frame_Vtbl; This->ref = 1; This->initialized = FALSE; This->cinfo_initialized = FALSE;
1
0
0
0
Vincent Povirk : windowscodecs: Implement Initialize for the JPEG decoder.
by Alexandre Julliard
25 Aug '09
25 Aug '09
Module: wine Branch: master Commit: 4185c0d9fe5a8236f73a6ba8201ad09e98c60452 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=4185c0d9fe5a8236f73a6ba82…
Author: Vincent Povirk <vincent(a)codeweavers.com> Date: Mon Aug 24 11:45:46 2009 -0500 windowscodecs: Implement Initialize for the JPEG decoder. --- dlls/windowscodecs/jpegformat.c | 120 ++++++++++++++++++++++++++++++++++++++- 1 files changed, 118 insertions(+), 2 deletions(-) diff --git a/dlls/windowscodecs/jpegformat.c b/dlls/windowscodecs/jpegformat.c index ecbc167..8759905 100644 --- a/dlls/windowscodecs/jpegformat.c +++ b/dlls/windowscodecs/jpegformat.c @@ -60,6 +60,11 @@ WINE_DEFAULT_DEBUG_CHANNEL(wincodecs); static void *libjpeg_handle; #define MAKE_FUNCPTR(f) static typeof(f) * p##f +MAKE_FUNCPTR(jpeg_CreateDecompress); +MAKE_FUNCPTR(jpeg_destroy_decompress); +MAKE_FUNCPTR(jpeg_read_header); +MAKE_FUNCPTR(jpeg_resync_to_restart); +MAKE_FUNCPTR(jpeg_start_decompress); MAKE_FUNCPTR(jpeg_std_error); #undef MAKE_FUNCPTR @@ -73,6 +78,11 @@ static void *load_libjpeg(void) return NULL; \ } + LOAD_FUNCPTR(jpeg_CreateDecompress); + LOAD_FUNCPTR(jpeg_destroy_decompress); + LOAD_FUNCPTR(jpeg_read_header); + LOAD_FUNCPTR(jpeg_resync_to_restart); + LOAD_FUNCPTR(jpeg_start_decompress); LOAD_FUNCPTR(jpeg_std_error); #undef LOAD_FUNCPTR } @@ -82,8 +92,20 @@ static void *load_libjpeg(void) typedef struct { const IWICBitmapDecoderVtbl *lpVtbl; LONG ref; + BOOL initialized; + BOOL cinfo_initialized; + IStream *stream; + struct jpeg_decompress_struct cinfo; + struct jpeg_error_mgr jerr; + struct jpeg_source_mgr source_mgr; + BYTE source_buffer[1024]; } JpegDecoder; +static inline JpegDecoder *decoder_from_decompress(j_decompress_ptr decompress) +{ + return CONTAINING_RECORD(decompress, JpegDecoder, cinfo); +} + static HRESULT WINAPI JpegDecoder_QueryInterface(IWICBitmapDecoder *iface, REFIID iid, void **ppv) { @@ -125,6 +147,8 @@ static ULONG WINAPI JpegDecoder_Release(IWICBitmapDecoder *iface) if (ref == 0) { + if (This->cinfo_initialized) pjpeg_destroy_decompress(&This->cinfo); + if (This->stream) IStream_Release(This->stream); HeapFree(GetProcessHeap(), 0, This); } @@ -138,11 +162,100 @@ static HRESULT WINAPI JpegDecoder_QueryCapability(IWICBitmapDecoder *iface, IStr return E_NOTIMPL; } +static void source_mgr_init_source(j_decompress_ptr cinfo) +{ +} + +static jpeg_boolean source_mgr_fill_input_buffer(j_decompress_ptr cinfo) +{ + JpegDecoder *This = decoder_from_decompress(cinfo); + HRESULT hr; + ULONG bytesread; + + hr = IStream_Read(This->stream, This->source_buffer, 1024, &bytesread); + + if (hr != S_OK || bytesread == 0) + { + return FALSE; + } + else + { + This->source_mgr.next_input_byte = This->source_buffer; + This->source_mgr.bytes_in_buffer = bytesread; + return TRUE; + } +} + +static void source_mgr_skip_input_data(j_decompress_ptr cinfo, long num_bytes) +{ + JpegDecoder *This = decoder_from_decompress(cinfo); + LARGE_INTEGER seek; + + if (num_bytes > This->source_mgr.bytes_in_buffer) + { + seek.QuadPart = num_bytes - This->source_mgr.bytes_in_buffer; + IStream_Seek(This->stream, seek, STREAM_SEEK_CUR, NULL); + This->source_mgr.bytes_in_buffer = 0; + } + else if (num_bytes > 0) + { + This->source_mgr.next_input_byte += num_bytes; + This->source_mgr.bytes_in_buffer -= num_bytes; + } +} + +static void source_mgr_term_source(j_decompress_ptr cinfo) +{ +} + static HRESULT WINAPI JpegDecoder_Initialize(IWICBitmapDecoder *iface, IStream *pIStream, WICDecodeOptions cacheOptions) { - FIXME("(%p,%p,%u): stub\n", iface, pIStream, cacheOptions); - return E_NOTIMPL; + JpegDecoder *This = (JpegDecoder*)iface; + int ret; + TRACE("(%p,%p,%u)\n", iface, pIStream, cacheOptions); + + if (This->cinfo_initialized) return WINCODEC_ERR_WRONGSTATE; + + This->cinfo.err = pjpeg_std_error(&This->jerr); + + pjpeg_CreateDecompress(&This->cinfo, JPEG_LIB_VERSION, sizeof(struct jpeg_decompress_struct)); + + This->cinfo_initialized = TRUE; + + This->stream = pIStream; + IStream_AddRef(pIStream); + + This->source_mgr.bytes_in_buffer = 0; + This->source_mgr.init_source = source_mgr_init_source; + This->source_mgr.fill_input_buffer = source_mgr_fill_input_buffer; + This->source_mgr.skip_input_data = source_mgr_skip_input_data; + This->source_mgr.resync_to_restart = pjpeg_resync_to_restart; + This->source_mgr.term_source = source_mgr_term_source; + + This->cinfo.src = &This->source_mgr; + + ret = pjpeg_read_header(&This->cinfo, TRUE); + + if (ret != JPEG_HEADER_OK) { + WARN("Jpeg image in stream has bad format, read header returned %d.\n",ret); + return E_FAIL; + } + + if (This->cinfo.jpeg_color_space == JCS_GRAYSCALE) + This->cinfo.out_color_space = JCS_GRAYSCALE; + else + This->cinfo.out_color_space = JCS_RGB; + + if (!pjpeg_start_decompress(&This->cinfo)) + { + ERR("jpeg_start_decompress failed\n"); + return E_FAIL; + } + + This->initialized = TRUE; + + return S_OK; } static HRESULT WINAPI JpegDecoder_GetContainerFormat(IWICBitmapDecoder *iface, @@ -248,6 +361,9 @@ HRESULT JpegDecoder_CreateInstance(IUnknown *pUnkOuter, REFIID iid, void** ppv) This->lpVtbl = &JpegDecoder_Vtbl; This->ref = 1; + This->initialized = FALSE; + This->cinfo_initialized = FALSE; + This->stream = NULL; ret = IUnknown_QueryInterface((IUnknown*)This, iid, ppv); IUnknown_Release((IUnknown*)This);
1
0
0
0
Vincent Povirk : windowscodecs: Add stub JPEG decoder.
by Alexandre Julliard
25 Aug '09
25 Aug '09
Module: wine Branch: master Commit: bec465e467b9d502abb3ed0ca83196b0a7f8b861 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=bec465e467b9d502abb3ed0ca…
Author: Vincent Povirk <vincent(a)codeweavers.com> Date: Mon Aug 24 10:19:37 2009 -0500 windowscodecs: Add stub JPEG decoder. --- dlls/windowscodecs/Makefile.in | 1 + dlls/windowscodecs/clsfactory.c | 1 + dlls/windowscodecs/jpegformat.c | 266 ++++++++++++++++++++++++++++++++ dlls/windowscodecs/regsvr.c | 29 ++++ dlls/windowscodecs/wincodecs_private.h | 1 + 5 files changed, 298 insertions(+), 0 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=bec465e467b9d502abb3e…
1
0
0
0
Vincent Povirk : include: Add 8-bit grayscale pixel format.
by Alexandre Julliard
25 Aug '09
25 Aug '09
Module: wine Branch: master Commit: 79292ea1c14fb7af9fdef81f5b1fb38f75812ff8 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=79292ea1c14fb7af9fdef81f5…
Author: Vincent Povirk <vincent(a)codeweavers.com> Date: Mon Aug 24 10:19:50 2009 -0500 include: Add 8-bit grayscale pixel format. --- include/wincodec.idl | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/include/wincodec.idl b/include/wincodec.idl index 80601c1..b2d7cff 100644 --- a/include/wincodec.idl +++ b/include/wincodec.idl @@ -126,6 +126,8 @@ cpp_quote("DEFINE_GUID(GUID_WICPixelFormat2bppIndexed, 0x6fddc324,0x4e03,0x4bfe, cpp_quote("DEFINE_GUID(GUID_WICPixelFormat4bppIndexed, 0x6fddc324,0x4e03,0x4bfe,0xb1,0x85,0x3d,0x77,0x76,0x8d,0xc9,0x03);") cpp_quote("DEFINE_GUID(GUID_WICPixelFormat8bppIndexed, 0x6fddc324,0x4e03,0x4bfe,0xb1,0x85,0x3d,0x77,0x76,0x8d,0xc9,0x04);") +cpp_quote("DEFINE_GUID(GUID_WICPixelFormat8bppGray, 0x6fddc324,0x4e03,0x4bfe,0xb1,0x85,0x3d,0x77,0x76,0x8d,0xc9,0x08);") + cpp_quote("DEFINE_GUID(GUID_WICPixelFormat16bppBGR555, 0x6fddc324,0x4e03,0x4bfe,0xb1,0x85,0x3d,0x77,0x76,0x8d,0xc9,0x09);") cpp_quote("DEFINE_GUID(GUID_WICPixelFormat16bppBGR565, 0x6fddc324,0x4e03,0x4bfe,0xb1,0x85,0x3d,0x77,0x76,0x8d,0xc9,0x0a);") cpp_quote("DEFINE_GUID(GUID_WICPixelFormat24bppBGR, 0x6fddc324,0x4e03,0x4bfe,0xb1,0x85,0x3d,0x77,0x76,0x8d,0xc9,0x0c);")
1
0
0
0
Andrew Eikum : gdiplus: Support regions of more than one rectangle in GdipCreateRegionHrgn.
by Alexandre Julliard
25 Aug '09
25 Aug '09
Module: wine Branch: master Commit: 9ec5f9ad6fb97deaa443ce68ce4ca67c4b2f7298 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=9ec5f9ad6fb97deaa443ce68c…
Author: Andrew Eikum <aeikum(a)codeweavers.com> Date: Mon Aug 24 16:49:31 2009 -0500 gdiplus: Support regions of more than one rectangle in GdipCreateRegionHrgn. --- dlls/gdiplus/region.c | 66 +++++++++++++++++++++++++----------------- dlls/gdiplus/tests/region.c | 14 ++++----- 2 files changed, 45 insertions(+), 35 deletions(-) diff --git a/dlls/gdiplus/region.c b/dlls/gdiplus/region.c index 039e789..ce6b60d 100644 --- a/dlls/gdiplus/region.c +++ b/dlls/gdiplus/region.c @@ -579,51 +579,63 @@ GpStatus WINGDIPAPI GdipCreateRegionRgnData(GDIPCONST BYTE *data, INT size, GpRe */ GpStatus WINGDIPAPI GdipCreateRegionHrgn(HRGN hrgn, GpRegion **region) { - union { - RGNDATA data; - char buf[sizeof(RGNDATAHEADER) + sizeof(RECT)]; - } rdata; DWORD size; - GpRectF rectf; - GpPath *path; + LPRGNDATA buf; + LPRECT rect; GpStatus stat; + GpPath* path; + GpRegion* local; + int i; TRACE("(%p, %p)\n", hrgn, region); if(!region || !(size = GetRegionData(hrgn, 0, NULL))) return InvalidParameter; - if(size > sizeof(RGNDATAHEADER) + sizeof(RECT)){ - FIXME("Only simple rect regions supported.\n"); - *region = NULL; - return NotImplemented; - } + buf = GdipAlloc(size); + if(!buf) + return OutOfMemory; - if(!GetRegionData(hrgn, sizeof(rdata), &rdata.data)) + if(!GetRegionData(hrgn, size, buf)){ + GdipFree(buf); return GenericError; - - /* return empty region */ - if(IsRectEmpty(&rdata.data.rdh.rcBound)){ - stat = GdipCreateRegion(region); - if(stat == Ok) - GdipSetEmpty(*region); - return stat; } - rectf.X = (REAL)rdata.data.rdh.rcBound.left; - rectf.Y = (REAL)rdata.data.rdh.rcBound.top; - rectf.Width = (REAL)rdata.data.rdh.rcBound.right - rectf.X; - rectf.Height = (REAL)rdata.data.rdh.rcBound.bottom - rectf.Y; + if(buf->rdh.nCount == 0){ + if((stat = GdipCreateRegion(&local)) != Ok){ + GdipFree(buf); + return stat; + } + if((stat = GdipSetEmpty(local)) != Ok){ + GdipFree(buf); + GdipDeleteRegion(local); + return stat; + } + *region = local; + GdipFree(buf); + return Ok; + } - stat = GdipCreatePath(FillModeAlternate, &path); - if(stat != Ok) + if((stat = GdipCreatePath(FillModeAlternate, &path)) != Ok){ + GdipFree(buf); return stat; + } - GdipAddPathRectangle(path, rectf.X, rectf.Y, rectf.Width, rectf.Height); + rect = (LPRECT)buf->Buffer; + for(i = 0; i < buf->rdh.nCount; i++){ + if((stat = GdipAddPathRectangle(path, (REAL)rect->left, (REAL)rect->top, + (REAL)(rect->right - rect->left), (REAL)(rect->bottom - rect->top))) != Ok){ + GdipFree(buf); + GdipDeletePath(path); + return stat; + } + rect++; + } stat = GdipCreateRegionPath(path, region); - GdipDeletePath(path); + GdipFree(buf); + GdipDeletePath(path); return stat; } diff --git a/dlls/gdiplus/tests/region.c b/dlls/gdiplus/tests/region.c index 8b1b04e..fddceb3 100644 --- a/dlls/gdiplus/tests/region.c +++ b/dlls/gdiplus/tests/region.c @@ -704,7 +704,7 @@ static void test_combinereplace(void) static void test_fromhrgn(void) { GpStatus status; - GpRegion *region; + GpRegion *region = (GpRegion*)0xabcdef01; HRGN hrgn; UINT needed; DWORD buf[220]; @@ -720,6 +720,7 @@ static void test_fromhrgn(void) expect(InvalidParameter, status); status = GdipCreateRegionHrgn((HRGN)0xdeadbeef, ®ion); expect(InvalidParameter, status); + ok(region == (GpRegion*)0xabcdef01, "Expected region not to be created\n"); /* empty rectangle */ hrgn = CreateRectRgn(0, 0, 0, 0); @@ -788,21 +789,19 @@ static void test_fromhrgn(void) /* ellipse */ hrgn = CreateEllipticRgn(0, 0, 100, 10); status = GdipCreateRegionHrgn(hrgn, ®ion); - todo_wine expect(Ok, status); + expect(Ok, status); status = GdipGetRegionDataSize(region, &needed); -todo_wine{ expect(Ok, status); ok(needed == 216 || needed == 196, /* win98 */ "Got %.8x\n", needed); -} + status = GdipGetRegionData(region, (BYTE*)buf, sizeof(buf), &needed); - todo_wine expect(Ok, status); + expect(Ok, status); if(status == Ok && needed == 216) /* Don't try to test win98 layout */ { -todo_wine{ expect(Ok, status); expect(216, needed); expect_dword(buf, 208); @@ -812,8 +811,7 @@ todo_wine{ expect_dword(buf + 5, 0x000000C0); expect_magic((DWORD*)(buf + 6)); expect_dword(buf + 7, 0x00000024); - expect_dword(buf + 8, 0x00006000); /* ?? */ -} + todo_wine expect_dword(buf + 8, 0x00006000); /* ?? */ } GdipDeleteRegion(region);
1
0
0
0
Ge van Geldorp : ntdll/tests: Pass properly aligned buffers.
by Alexandre Julliard
25 Aug '09
25 Aug '09
Module: wine Branch: master Commit: cf5e2938a9c15e2fb4a3e62861ae5d25589eaa2c URL:
http://source.winehq.org/git/wine.git/?a=commit;h=cf5e2938a9c15e2fb4a3e6286…
Author: Ge van Geldorp <ggeldorp(a)vmware.com> Date: Mon Aug 24 21:26:25 2009 +0200 ntdll/tests: Pass properly aligned buffers. --- dlls/ntdll/tests/info.c | 14 +++++++++----- 1 files changed, 9 insertions(+), 5 deletions(-) diff --git a/dlls/ntdll/tests/info.c b/dlls/ntdll/tests/info.c index 6e3851d..f09acc9 100644 --- a/dlls/ntdll/tests/info.c +++ b/dlls/ntdll/tests/info.c @@ -124,18 +124,22 @@ static void test_query_performance(void) ULONG FullLength; ULONG ReturnLength; SYSTEM_PERFORMANCE_INFORMATION spi; - BYTE Buffer[sizeof(SYSTEM_PERFORMANCE_INFORMATION) + 2]; + struct SPI_PLUS_EXTRA + { + SYSTEM_PERFORMANCE_INFORMATION spi; + BYTE extra[2]; + } spi_plus_extra; - status = pNtQuerySystemInformation(SystemPerformanceInformation, Buffer, 0, &FullLength); + status = pNtQuerySystemInformation(SystemPerformanceInformation, &spi, 0, &FullLength); ok( status == STATUS_INFO_LENGTH_MISMATCH, "Expected STATUS_INFO_LENGTH_MISMATCH, got %08x\n", status); - status = pNtQuerySystemInformation(SystemPerformanceInformation, Buffer, sizeof(spi), &ReturnLength); + status = pNtQuerySystemInformation(SystemPerformanceInformation, &spi, sizeof(spi), &ReturnLength); ok( status == STATUS_SUCCESS, "Expected STATUS_SUCCESS, got %08x\n", status); ok( sizeof(spi) == ReturnLength, "Inconsistent length %d\n", ReturnLength); - status = pNtQuerySystemInformation(SystemPerformanceInformation, &Buffer, sizeof(Buffer), &ReturnLength); + status = pNtQuerySystemInformation(SystemPerformanceInformation, &spi_plus_extra, sizeof(spi_plus_extra), &ReturnLength); ok( status == STATUS_SUCCESS, "Expected STATUS_SUCCESS, got %08x\n", status); - ok( ReturnLength == min(FullLength, sizeof(Buffer)), "Inconsistent length %d\n", ReturnLength); + ok( ReturnLength == min(FullLength, sizeof(spi_plus_extra)), "Inconsistent length %d\n", ReturnLength); /* Not return values yet, as struct members are unknown */ }
1
0
0
0
← Newer
1
...
23
24
25
26
27
28
29
...
105
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
Results per page:
10
25
50
100
200