Skip to content

Commit 046fe74

Browse files
media streaming can trigger between gpu/cpu
1 parent 99cbcf0 commit 046fe74

File tree

3 files changed

+34
-25
lines changed

3 files changed

+34
-25
lines changed

Samples/FNSCandyStyleTransfer/UWP/cs/MainPage.xaml

Lines changed: 20 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -212,24 +212,33 @@
212212
</StackPanel>
213213

214214
<Border x:Name="UIStatusBorder" Grid.Row="2">
215-
<RelativePanel Orientation="Horizontal">
215+
<StackPanel Orientation="Horizontal">
216216
<TextBlock
217217
x:Name="StatusBlock"
218-
Width="151"
219-
Margin="10,0,0,0"
220-
HorizontalAlignment="Left"
221-
VerticalAlignment="Center"
218+
Width="700"
219+
Margin="10,2,0,0"
222220
FontWeight="Bold"
223221
Text="Select a style to begin"
224222
TextWrapping="Wrap" />
225223
<TextBlock
226-
x:Name="StatusBlock_Copy"
227-
Width="Auto"
228-
VerticalAlignment="Center"
224+
Margin="10,2,0,0"
229225
FontWeight="Bold"
230-
TextAlignment="Center"
231-
TextWrapping="Wrap"><Run FontWeight="Bold" Text="Capture FPS" /></TextBlock>
232-
</RelativePanel>
226+
Text="Capture FPS" />
227+
<TextBlock
228+
x:Name="CaptureFPS"
229+
Margin="10,2,0,0"
230+
Text="0 fps"
231+
TextWrapping="Wrap" />
232+
<TextBlock
233+
Margin="10,2,0,0"
234+
FontWeight="Bold"
235+
Text="Render FPS" />
236+
<TextBlock
237+
x:Name="RenderFPS"
238+
Margin="10,2,0,0"
239+
Text="0 fps"
240+
TextWrapping="Wrap" />
241+
</StackPanel>
233242
</Border>
234243

235244
</Grid>

Samples/FNSCandyStyleTransfer/UWP/cs/MainPage.xaml.cs

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -584,22 +584,22 @@ private void UIStyleList_SelectionChanged(object sender, SelectionChangedEventAr
584584
_frameAquisitionLock.Release();
585585

586586
}).ContinueWith(async (antecedent) =>
587-
{
588-
if (antecedent.IsCompletedSuccessfully && _isReadyForEval)
589587
{
590-
await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
588+
if (antecedent.IsCompletedSuccessfully && _isReadyForEval)
591589
{
592-
NotifyUser($"Ready to stylize! ", NotifyType.StatusMessage);
593-
UIImageControls.IsEnabled = true;
594-
UIModelControls.IsEnabled = true;
595-
UIToggleInferenceDevice.IsEnabled = true;
596-
if (_isrocessingImages)
590+
await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
597591
{
598-
UIButtonFilePick_Click(null, null);
599-
}
600-
});
601-
}
602-
});
592+
NotifyUser($"Ready to stylize! ", NotifyType.StatusMessage);
593+
UIImageControls.IsEnabled = true;
594+
UIModelControls.IsEnabled = true;
595+
UIToggleInferenceDevice.IsEnabled = true;
596+
if (_isrocessingImages)
597+
{
598+
UIButtonFilePick_Click(null, null);
599+
}
600+
});
601+
}
602+
});
603603
}
604604

605605
/// <summary>

Samples/StyleTransfer/StyleTransferEffectComponent/StyleTransferVideoEffect.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ public IReadOnlyList<VideoEncodingProperties> SupportedEncodingProperties
5555
}
5656
}
5757
// TODO: Chagne to GpuAndCpu, or based on toggle value in UI
58-
public MediaMemoryTypes SupportedMemoryTypes { get { return MediaMemoryTypes.Cpu; } }
58+
public MediaMemoryTypes SupportedMemoryTypes { get { return MediaMemoryTypes.GpuAndCpu; } }
5959

6060
public bool TimeIndependent { get { return true; } }
6161

0 commit comments

Comments
 (0)