Commit 7dbc8d59 authored by Alfred Agrell's avatar Alfred Agrell Committed by Alexandre Julliard

winegstreamer: Fill in a few more pieces of WMV format handling.

parent 703a82a7
...@@ -400,6 +400,10 @@ unsigned int wg_format_get_max_size(const struct wg_format *format) ...@@ -400,6 +400,10 @@ unsigned int wg_format_get_max_size(const struct wg_format *format)
return wg_format_get_max_size_video_raw(WG_VIDEO_FORMAT_YV12, return wg_format_get_max_size_video_raw(WG_VIDEO_FORMAT_YV12,
format->u.video_mpeg1.width, format->u.video_mpeg1.height); format->u.video_mpeg1.width, format->u.video_mpeg1.height);
case WG_MAJOR_TYPE_VIDEO_WMV:
return wg_format_get_max_size_video_raw(WG_VIDEO_FORMAT_YV12,
format->u.video_wmv.width, format->u.video_wmv.height);
case WG_MAJOR_TYPE_AUDIO: case WG_MAJOR_TYPE_AUDIO:
{ {
unsigned int rate = format->u.audio.rate, channels = format->u.audio.channels; unsigned int rate = format->u.audio.rate, channels = format->u.audio.channels;
...@@ -454,7 +458,6 @@ unsigned int wg_format_get_max_size(const struct wg_format *format) ...@@ -454,7 +458,6 @@ unsigned int wg_format_get_max_size(const struct wg_format *format)
case WG_MAJOR_TYPE_AUDIO_MPEG4: case WG_MAJOR_TYPE_AUDIO_MPEG4:
case WG_MAJOR_TYPE_VIDEO_H264: case WG_MAJOR_TYPE_VIDEO_H264:
case WG_MAJOR_TYPE_VIDEO_WMV:
case WG_MAJOR_TYPE_VIDEO_INDEO: case WG_MAJOR_TYPE_VIDEO_INDEO:
FIXME("Format %u not implemented!\n", format->major_type); FIXME("Format %u not implemented!\n", format->major_type);
return 0; return 0;
...@@ -664,11 +667,13 @@ static bool amt_from_wg_format_video_wmv(AM_MEDIA_TYPE *mt, const struct wg_form ...@@ -664,11 +667,13 @@ static bool amt_from_wg_format_video_wmv(AM_MEDIA_TYPE *mt, const struct wg_form
video_format->rcTarget = video_format->rcSource; video_format->rcTarget = video_format->rcSource;
if ((frame_time = MulDiv(10000000, format->u.video_wmv.fps_d, format->u.video_wmv.fps_n)) != -1) if ((frame_time = MulDiv(10000000, format->u.video_wmv.fps_d, format->u.video_wmv.fps_n)) != -1)
video_format->AvgTimePerFrame = frame_time; video_format->AvgTimePerFrame = frame_time;
video_format->bmiHeader.biSize = sizeof(BITMAPINFOHEADER); video_format->bmiHeader.biSize = sizeof(BITMAPINFOHEADER) + format->u.video_wmv.codec_data_len;
video_format->bmiHeader.biWidth = format->u.video_wmv.width; video_format->bmiHeader.biWidth = format->u.video_wmv.width;
video_format->bmiHeader.biHeight = format->u.video_wmv.height; video_format->bmiHeader.biHeight = format->u.video_wmv.height;
video_format->bmiHeader.biPlanes = 1; video_format->bmiHeader.biPlanes = 1;
video_format->bmiHeader.biCompression = mt->subtype.Data1; video_format->bmiHeader.biCompression = mt->subtype.Data1;
video_format->bmiHeader.biBitCount = 24;
video_format->dwBitRate = 0;
memcpy(video_format+1, format->u.video_wmv.codec_data, format->u.video_wmv.codec_data_len); memcpy(video_format+1, format->u.video_wmv.codec_data, format->u.video_wmv.codec_data_len);
return true; return true;
......
...@@ -893,7 +893,6 @@ bool wg_format_compare(const struct wg_format *a, const struct wg_format *b) ...@@ -893,7 +893,6 @@ bool wg_format_compare(const struct wg_format *a, const struct wg_format *b)
case WG_MAJOR_TYPE_AUDIO_MPEG4: case WG_MAJOR_TYPE_AUDIO_MPEG4:
case WG_MAJOR_TYPE_AUDIO_WMA: case WG_MAJOR_TYPE_AUDIO_WMA:
case WG_MAJOR_TYPE_VIDEO_H264: case WG_MAJOR_TYPE_VIDEO_H264:
case WG_MAJOR_TYPE_VIDEO_WMV:
case WG_MAJOR_TYPE_VIDEO_INDEO: case WG_MAJOR_TYPE_VIDEO_INDEO:
case WG_MAJOR_TYPE_VIDEO_MPEG1: case WG_MAJOR_TYPE_VIDEO_MPEG1:
GST_FIXME("Format %u not implemented!", a->major_type); GST_FIXME("Format %u not implemented!", a->major_type);
...@@ -917,6 +916,12 @@ bool wg_format_compare(const struct wg_format *a, const struct wg_format *b) ...@@ -917,6 +916,12 @@ bool wg_format_compare(const struct wg_format *a, const struct wg_format *b)
/* Do not compare FPS. */ /* Do not compare FPS. */
return a->u.video_cinepak.width == b->u.video_cinepak.width return a->u.video_cinepak.width == b->u.video_cinepak.width
&& a->u.video_cinepak.height == b->u.video_cinepak.height; && a->u.video_cinepak.height == b->u.video_cinepak.height;
case WG_MAJOR_TYPE_VIDEO_WMV:
/* Do not compare FPS. */
return a->u.video_wmv.format == b->u.video_wmv.format
&& a->u.video_wmv.width == b->u.video_wmv.width
&& a->u.video_wmv.height == b->u.video_wmv.height;
} }
assert(0); assert(0);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment