On Sat Mar 16 23:37:29 2024 +0000, Alistair Leslie-Hughes wrote:
> I currently don't have one.
> Through wine-staging patches for FreeThreadedXMLHTTP60 interface rely on
> this change.
Is fixing the headers undesirable, then?
Is it necessary in some way to implement FreeThreadedXMLHTTP60, or can that be done differently?
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/1060#note_65760
Since we are adding more and more media formats to wg_format, the current wg_format struct is getting ugly.
Everytime we add a video format, we need to duplicate width, height, fps. Everytime we add a audio format, we need to duplicate channels, rate. So it would be better if we could share width, height, fps fields between different video formats, also share channels and rate fields between different audio formats.
What makes me found the current wg_format is not in a good shape is when I was writting code for Proton, I found that I need to write some code like this if want to get width/height/fps from a wg_format:
```
static bool get_video_info_from_wg_format(struct wg_format *format,
int32_t *width, int32_t *height, uint32_t *fps_n, uint32_t *fps_d)
{
switch (format->major_type)
{
case WG_MAJOR_TYPE_VIDEO:
*width = format->u.video.width;
*height = format->u.video.height;
*fps_n = format->u.video.fps_n;
*fps_d = format->u.video.fps_d;
return true;
case WG_MAJOR_TYPE_VIDEO_CINEPAK:
*width = format->u.video_cinepak.width;
*height = format->u.video_cinepak.height;
*fps_n = format->u.video_cinepak.fps_n;
*fps_d = format->u.video_cinepak.fps_d;
return true;
case WG_MAJOR_TYPE_VIDEO_H264:
*width = format->u.video_h264.width;
*height = format->u.video_h264.height;
*fps_n = format->u.video_h264.fps_n;
*fps_d = format->u.video_h264.fps_d;
return true;
case WG_MAJOR_TYPE_VIDEO_WMV:
*width = format->u.video_wmv.width;
*height = format->u.video_wmv.height;
*fps_n = format->u.video_wmv.fps_n;
*fps_d = format->u.video_wmv.fps_d;
return true;
case WG_MAJOR_TYPE_VIDEO_INDEO:
*width = format->u.video_indeo.width;
*height = format->u.video_indeo.height;
*fps_n = format->u.video_indeo.fps_n;
*fps_d = format->u.video_indeo.fps_d;
return true;
case WG_MAJOR_TYPE_VIDEO_MPEG1:
*width = format->u.video_mpeg1.width;
*height = format->u.video_mpeg1.height;
*fps_n = format->u.video_mpeg1.fps_n;
*fps_d = format->u.video_mpeg1.fps_d;
return true;
default:
GST_ERROR("Type %d is not a video format.\n", format->major_type);
return false;
}
}
```
Apparently, the code above is ugly. By refactoring wg_format, we can avoid code like this.
This patch is a draft now, it only contains unixlib.h code.
Zeb, I'd like to confirm that if this refactoring would be acceptable for you. If do, I'll continue finishing the remaining parts.
--
v3: winegstreamer: Refactor wg_format.
https://gitlab.winehq.org/wine/wine/-/merge_requests/5369
Since we are adding more and more media formats to wg_format, the current wg_format struct is getting ugly.
Everytime we add a video format, we need to duplicate width, height, fps. Everytime we add a audio format, we need to duplicate channels, rate. So it would be better if we could share width, height, fps fields between different video formats, also share channels and rate fields between different audio formats.
What makes me found the current wg_format is not in a good shape is when I was writting code for Proton, I found that I need to write some code like this if want to get width/height/fps from a wg_format:
```
static bool get_video_info_from_wg_format(struct wg_format *format,
int32_t *width, int32_t *height, uint32_t *fps_n, uint32_t *fps_d)
{
switch (format->major_type)
{
case WG_MAJOR_TYPE_VIDEO:
*width = format->u.video.width;
*height = format->u.video.height;
*fps_n = format->u.video.fps_n;
*fps_d = format->u.video.fps_d;
return true;
case WG_MAJOR_TYPE_VIDEO_CINEPAK:
*width = format->u.video_cinepak.width;
*height = format->u.video_cinepak.height;
*fps_n = format->u.video_cinepak.fps_n;
*fps_d = format->u.video_cinepak.fps_d;
return true;
case WG_MAJOR_TYPE_VIDEO_H264:
*width = format->u.video_h264.width;
*height = format->u.video_h264.height;
*fps_n = format->u.video_h264.fps_n;
*fps_d = format->u.video_h264.fps_d;
return true;
case WG_MAJOR_TYPE_VIDEO_WMV:
*width = format->u.video_wmv.width;
*height = format->u.video_wmv.height;
*fps_n = format->u.video_wmv.fps_n;
*fps_d = format->u.video_wmv.fps_d;
return true;
case WG_MAJOR_TYPE_VIDEO_INDEO:
*width = format->u.video_indeo.width;
*height = format->u.video_indeo.height;
*fps_n = format->u.video_indeo.fps_n;
*fps_d = format->u.video_indeo.fps_d;
return true;
case WG_MAJOR_TYPE_VIDEO_MPEG1:
*width = format->u.video_mpeg1.width;
*height = format->u.video_mpeg1.height;
*fps_n = format->u.video_mpeg1.fps_n;
*fps_d = format->u.video_mpeg1.fps_d;
return true;
default:
GST_ERROR("Type %d is not a video format.\n", format->major_type);
return false;
}
}
```
Apparently, the code above is ugly. By refactoring wg_format, we can avoid code like this.
This patch is a draft now, it only contains unixlib.h code.
Zeb, I'd like to confirm that if this refactoring would be acceptable for you. If do, I'll continue finishing the remaining parts.
--
v2: winegstreamer: Refactor wg_format.
https://gitlab.winehq.org/wine/wine/-/merge_requests/5369
dlls/shell32/resources/ietoolbar.bmp is very similar to
dlls/ieframe/ietoolbar.bmp. In Windows XP, the IE toolbar icons were
only in shell32.dll, and there were 16 of them. Internet Explorer 7
added ieframe.dll that had the same 16 icons plus 7 more icons for a
total of 23. The 7 new icons were never added to shell32.dll, and in
Windows Vista and later, shell32.dll does not include the IE toolbar
bitmap resource at all.
dlls/shell32/resources/ietoolbar*.bmp was created with ImageMagick from
the public domain Tango icon theme using the following shell script:
ICONS='
actions/go-previous.png
actions/go-next.png
actions/process-stop.png
actions/view-refresh.png
actions/go-home.png
actions/system-search.png
emblems/emblem-favorite.png
actions/document-print.png
actions/format-text-bold.png
apps/accessories-text-editor.png
categories/preferences-system.png
mimetypes/audio-x-generic.png
apps/office-calendar.png
apps/internet-mail.png
actions/view-fullscreen.png
actions/document-new.png
'
pushd 32x32
convert +append $ICONS ietoolbar.bmp
popd
pushd 16x16
convert +append $ICONS ietoolbar_small.bmp
popd
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=40236
--
v4: shell32: Add Internet Explorer toolbar icons.
https://gitlab.winehq.org/wine/wine/-/merge_requests/4174