mfplay: Create video output branches.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
78c35d34e8
commit
baa9738910
|
@ -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
|
||||||
{
|
{
|
||||||
/* 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)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue