From: Eric Pouech eric.pouech@gmail.com
Signed-off-by: Eric Pouech eric.pouech@gmail.com Signed-off-by: Nikolay Sivov nsivov@codeweavers.com --- dlls/mf/copier.c | 4 ++-- dlls/mf/evr.c | 4 ++-- dlls/mf/main.c | 3 ++- dlls/mf/sar.c | 7 ++++--- dlls/mf/session.c | 31 +++++++++++++++++-------------- dlls/mf/topology.c | 11 ++++++----- 6 files changed, 33 insertions(+), 27 deletions(-)
diff --git a/dlls/mf/copier.c b/dlls/mf/copier.c index b05ae3383ab..fe5664ee4c7 100644 --- a/dlls/mf/copier.c +++ b/dlls/mf/copier.c @@ -247,7 +247,7 @@ static HRESULT WINAPI sample_copier_transform_GetOutputAvailableType(IMFTransfor return hr; }
-static HRESULT sample_copier_get_buffer_size(IMFMediaType *type, DWORD *size) +static HRESULT sample_copier_get_buffer_size(IMFMediaType *type, UINT32 *size) { GUID major, subtype; UINT64 frame_size; @@ -281,7 +281,7 @@ static HRESULT sample_copier_get_buffer_size(IMFMediaType *type, DWORD *size) static HRESULT sample_copier_set_media_type(struct sample_copier *transform, BOOL input, DWORD id, IMFMediaType *type, DWORD flags) { - DWORD buffer_size; + UINT32 buffer_size; HRESULT hr = S_OK;
if (id) diff --git a/dlls/mf/evr.c b/dlls/mf/evr.c index 9552990006d..5e8b559af04 100644 --- a/dlls/mf/evr.c +++ b/dlls/mf/evr.c @@ -1633,8 +1633,8 @@ static HRESULT video_renderer_configure_mixer(struct video_renderer *renderer)
if (SUCCEEDED(hr)) { - unsigned int input_count, output_count; - unsigned int *ids, *oids; + DWORD input_count, output_count; + DWORD *ids, *oids; size_t i;
/* Create stream sinks for inputs that mixer already has by default. */ diff --git a/dlls/mf/main.c b/dlls/mf/main.c index acbb8377e52..50451170275 100644 --- a/dlls/mf/main.c +++ b/dlls/mf/main.c @@ -1072,10 +1072,11 @@ static int __cdecl qsort_string_compare(const void *a, const void *b) static HRESULT mf_get_handler_strings(const WCHAR *path, WCHAR filter, unsigned int maxlen, PROPVARIANT *dst) { static const HKEY hkey_roots[2] = { HKEY_CURRENT_USER, HKEY_LOCAL_MACHINE }; - unsigned int capacity = 0, count, size; + unsigned int capacity = 0, count; HRESULT hr = S_OK; int i, index; WCHAR *buffW; + DWORD size;
if (!(buffW = calloc(maxlen, sizeof(*buffW)))) return E_OUTOFMEMORY; diff --git a/dlls/mf/sar.c b/dlls/mf/sar.c index f6f2b32dd2d..3c9bac90c9f 100644 --- a/dlls/mf/sar.c +++ b/dlls/mf/sar.c @@ -1493,7 +1493,7 @@ static HRESULT WINAPI audio_renderer_stream_type_handler_IsMediaTypeSupported(IM IMFMediaType *in_type, IMFMediaType **out_type) { struct audio_renderer *renderer = impl_from_IMFMediaTypeHandler(iface); - unsigned int flags; + DWORD flags; HRESULT hr;
TRACE("%p, %p, %p.\n", iface, in_type, out_type); @@ -1618,8 +1618,8 @@ static HRESULT WINAPI audio_renderer_stream_type_handler_SetCurrentMediaType(IMF struct audio_renderer *renderer = impl_from_IMFMediaTypeHandler(iface); const unsigned int test_flags = MF_MEDIATYPE_EQUAL_MAJOR_TYPES | MF_MEDIATYPE_EQUAL_FORMAT_TYPES; BOOL compare_result; - unsigned int flags; HRESULT hr = S_OK; + DWORD flags;
TRACE("%p, %p.\n", iface, media_type);
@@ -1777,11 +1777,12 @@ static HRESULT WINAPI audio_renderer_render_callback_GetParameters(IMFAsyncCallb
static void audio_renderer_render(struct audio_renderer *renderer, IMFAsyncResult *result) { - unsigned int src_frames, dst_frames, max_frames, pad_frames, src_len; + unsigned int src_frames, dst_frames, max_frames, pad_frames; struct queued_object *obj, *obj2; BOOL keep_sample = FALSE; IMFMediaBuffer *buffer; BYTE *dst, *src; + DWORD src_len; HRESULT hr;
LIST_FOR_EACH_ENTRY_SAFE(obj, obj2, &renderer->queue, struct queued_object, entry) diff --git a/dlls/mf/session.c b/dlls/mf/session.c index 66009b1fff2..756ef381373 100644 --- a/dlls/mf/session.c +++ b/dlls/mf/session.c @@ -185,7 +185,7 @@ struct topo_node struct { IMFMediaSource *source; - unsigned int stream_id; + DWORD stream_id; } source; struct { @@ -197,11 +197,11 @@ struct topo_node struct { struct transform_stream *inputs; - unsigned int *input_map; + DWORD *input_map; unsigned int input_count;
struct transform_stream *outputs; - unsigned int *output_map; + DWORD *output_map; unsigned int output_count; } transform; } u; @@ -867,8 +867,9 @@ static void session_start(struct media_session *session, const GUID *time_format static void session_set_started(struct media_session *session) { struct media_source *source; - unsigned int caps, flags; IMFMediaEvent *event; + unsigned int caps; + DWORD flags;
session->state = SESSION_STATE_STARTED;
@@ -1181,17 +1182,18 @@ static HRESULT session_add_media_sink(struct media_session *session, IMFTopology return S_OK; }
-static unsigned int transform_node_get_stream_id(struct topo_node *node, BOOL output, unsigned int index) +static DWORD transform_node_get_stream_id(struct topo_node *node, BOOL output, unsigned int index) { - unsigned int *map = output ? node->u.transform.output_map : node->u.transform.input_map; + DWORD *map = output ? node->u.transform.output_map : node->u.transform.input_map; return map ? map[index] : index; }
static HRESULT session_set_transform_stream_info(struct topo_node *node) { - unsigned int *input_map = NULL, *output_map = NULL; - unsigned int i, input_count, output_count, block_alignment; + DWORD *input_map = NULL, *output_map = NULL; + DWORD i, input_count, output_count; struct transform_stream *streams; + unsigned int block_alignment; IMFMediaType *media_type; GUID major = { 0 }; HRESULT hr; @@ -2132,7 +2134,7 @@ static HRESULT WINAPI session_commands_callback_Invoke(IMFAsyncCallback *iface, struct media_session *session = impl_from_commands_callback_IMFAsyncCallback(iface); struct topo_node *topo_node; IMFTopologyNode *upstream_node; - unsigned int upstream_output; + DWORD upstream_output;
EnterCriticalSection(&session->cs);
@@ -2462,8 +2464,8 @@ static void session_set_source_object_state(struct media_session *session, IUnkn struct media_sink *sink; enum object_state state; struct topo_node *node; - unsigned int i, count; BOOL changed = FALSE; + DWORD i, count; HRESULT hr;
if ((state = session_get_object_state_for_event(event_type)) == OBJ_STATE_INVALID) @@ -2668,10 +2670,11 @@ static struct sample *transform_create_sample(IMFSample *sample) static HRESULT transform_get_external_output_sample(const struct media_session *session, struct topo_node *transform, unsigned int output_index, const MFT_OUTPUT_STREAM_INFO *stream_info, IMFSample **sample) { - unsigned int buffer_size, downstream_input; IMFTopologyNode *downstream_node; IMFMediaBuffer *buffer = NULL; struct topo_node *topo_node; + unsigned int buffer_size; + DWORD downstream_input; TOPOID node_id; HRESULT hr;
@@ -2713,9 +2716,9 @@ static HRESULT transform_node_pull_samples(const struct media_session *session, MFT_OUTPUT_STREAM_INFO stream_info; MFT_OUTPUT_DATA_BUFFER *buffers; struct sample *queued_sample; + HRESULT hr = E_UNEXPECTED; DWORD status = 0; unsigned int i; - HRESULT hr = E_UNEXPECTED;
if (!(buffers = calloc(node->u.transform.output_count, sizeof(*buffers)))) return E_OUTOFMEMORY; @@ -2888,7 +2891,7 @@ static void session_deliver_sample_to_node(struct media_session *session, IMFTop static HRESULT session_request_sample_from_node(struct media_session *session, IMFTopologyNode *node, DWORD output) { IMFTopologyNode *downstream_node, *upstream_node; - unsigned int downstream_input, upstream_output; + DWORD downstream_input, upstream_output; struct topo_node *topo_node; MF_TOPOLOGY_TYPE node_type; struct sample *sample; @@ -3537,8 +3540,8 @@ static HRESULT session_is_presentation_rate_supported(struct media_session *sess struct media_source *source; struct media_sink *sink; float value = 0.0f, tmp; - unsigned int flags; HRESULT hr = S_OK; + DWORD flags;
if (!nearest_rate) nearest_rate = &tmp;
diff --git a/dlls/mf/topology.c b/dlls/mf/topology.c index f97c0cc75d3..8eb1b763e64 100644 --- a/dlls/mf/topology.c +++ b/dlls/mf/topology.c @@ -2381,8 +2381,9 @@ static HRESULT topology_loader_resolve_branch(struct topoloader_context *context static HRESULT topology_loader_resolve_nodes(struct topoloader_context *context, unsigned int *layer_size) { IMFTopologyNode *downstream_node, *node, *orig_node; - unsigned int input_index, size = 0; MF_TOPOLOGY_TYPE node_type; + unsigned int size = 0; + DWORD input_index; HRESULT hr = S_OK; TOPOID id;
@@ -2444,7 +2445,7 @@ static BOOL topology_loader_is_node_d3d_aware(IMFTopologyNode *node) return !!d3d_aware; }
-static HRESULT topology_loader_create_copier(IMFTopologyNode *upstream_node, unsigned int upstream_output, +static HRESULT topology_loader_create_copier(IMFTopologyNode *upstream_node, DWORD upstream_output, IMFTopologyNode *downstream_node, unsigned int downstream_input, IMFTransform **copier) { IMFMediaType *input_type = NULL, *output_type = NULL; @@ -2483,7 +2484,7 @@ static HRESULT topology_loader_create_copier(IMFTopologyNode *upstream_node, uns }
static HRESULT topology_loader_connect_copier(struct topoloader_context *context, IMFTopologyNode *upstream_node, - unsigned int upstream_output, IMFTopologyNode *downstream_node, unsigned int downstream_input, IMFTransform *copier) + DWORD upstream_output, IMFTopologyNode *downstream_node, DWORD downstream_input, IMFTransform *copier) { IMFTopologyNode *copier_node; HRESULT hr; @@ -2506,9 +2507,9 @@ static HRESULT topology_loader_connect_d3d_aware_input(struct topoloader_context IMFTopologyNode *node) { IMFTopologyNode *upstream_node; - unsigned int upstream_output; - IMFStreamSink *stream_sink; IMFTransform *copier = NULL; + IMFStreamSink *stream_sink; + DWORD upstream_output; HRESULT hr;
if (FAILED(hr = topology_node_get_object(node, &IID_IMFStreamSink, (void **)&stream_sink)))