Commit baa97389 authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

mfplay: Create video output branches.

parent 78c35d34
...@@ -1043,29 +1043,23 @@ static HRESULT media_item_create_sink_node(IUnknown *sink, IMFTopologyNode **nod ...@@ -1043,29 +1043,23 @@ static HRESULT media_item_create_sink_node(IUnknown *sink, IMFTopologyNode **nod
static HRESULT media_item_create_topology(struct media_player *player, struct media_item *item, IMFTopology **out) static HRESULT media_item_create_topology(struct media_player *player, struct media_item *item, IMFTopology **out)
{ {
IMFTopologyNode *src_node, *sink_node; IMFTopologyNode *src_node, *sink_node;
BOOL selected, video_added = FALSE;
IMFStreamDescriptor *sd; IMFStreamDescriptor *sd;
IMFTopology *topology; IMFTopology *topology;
unsigned int idx; unsigned int idx;
IUnknown *sink; IUnknown *sink;
BOOL selected;
HRESULT hr; HRESULT hr;
GUID major; GUID major;
if (FAILED(hr = MFCreateTopology(&topology))) if (FAILED(hr = MFCreateTopology(&topology)))
return hr; return hr;
/* Use first stream if none selected. */
if (player->output_window)
{
FIXME("Video streams are not handled.\n");
}
/* Set up branches for all selected streams. */ /* Set up branches for all selected streams. */
idx = 0; idx = 0;
while (SUCCEEDED(IMFPresentationDescriptor_GetStreamDescriptorByIndex(item->pd, idx++, &selected, &sd))) while (SUCCEEDED(IMFPresentationDescriptor_GetStreamDescriptorByIndex(item->pd, idx++, &selected, &sd)))
{ {
if (!selected) if (!selected || FAILED(media_item_get_stream_type(sd, &major)))
{ {
IMFStreamDescriptor_Release(sd); IMFStreamDescriptor_Release(sd);
continue; continue;
...@@ -1077,11 +1071,17 @@ static HRESULT media_item_create_topology(struct media_player *player, struct me ...@@ -1077,11 +1071,17 @@ static HRESULT media_item_create_topology(struct media_player *player, struct me
{ {
/* User sink is attached as-is. */ /* User sink is attached as-is. */
} }
else if (SUCCEEDED(media_item_get_stream_type(sd, &major)) && IsEqualGUID(&major, &MFMediaType_Audio)) else if (IsEqualGUID(&major, &MFMediaType_Audio))
{ {
if (FAILED(hr = MFCreateAudioRendererActivate((IMFActivate **)&sink))) if (FAILED(hr = MFCreateAudioRendererActivate((IMFActivate **)&sink)))
WARN("Failed to create SAR activation object, hr %#x.\n", hr); WARN("Failed to create SAR activation object, hr %#x.\n", hr);
} }
else if (IsEqualGUID(&major, &MFMediaType_Video) && player->output_window && !video_added)
{
if (FAILED(hr = MFCreateVideoRendererActivate(player->output_window, (IMFActivate **)&sink)))
WARN("Failed to create EVR activation object, hr %#x.\n", hr);
video_added = SUCCEEDED(hr);
}
if (sink) if (sink)
{ {
......
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