Skip to content

Commit 340d6c8

Browse files
author
Windows classic samples
committed
Samples onboarding
1 parent 1ed3025 commit 340d6c8

File tree

14 files changed

+797
-4
lines changed

14 files changed

+797
-4
lines changed

README.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,16 +23,14 @@ If you cannot get a sample to work as expected,
2323
it might have platform, version, or SKU-specific requirements.
2424
If you have any issues with the samples, please provide feedback using the Issues list.
2525

26-
To get a copy of Windows, go to
27-
[Downloads and tools](http://go.microsoft.com/fwlink/p/?linkid=301696).
28-
2926
To get a copy of Visual Studio, go to
3027
[Visual Studio Downloads](http://go.microsoft.com/fwlink/p/?linkid=301697).
3128

32-
Other samples repos:
29+
Other samples:
3330

3431
- [Windows Universal Samples (UWP)](https://github.com/Microsoft/Windows-universal-samples)
3532
- [Desktop Bridge to Universal Windows Platform (UWP)](https://github.com/Microsoft/DesktopBridgeToUWP-Samples)
33+
- [Code samples browser](https://docs.microsoft.com/samples/)
3634

3735
This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/).
3836
For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/)
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
---
2+
page_type: sample
3+
languages:
4+
- cpp
5+
products:
6+
- windows-api-win32
7+
name: AudioClip sample
8+
urlFragment: audioclip
9+
extendedZipContent:
10+
- path: LICENSE
11+
target: LICENSE
12+
description: This sample demonstrates using the IMFSourceReader API to get uncompressed media data from a media file.
13+
---
14+
15+
# AudioClip sample
16+
17+
Demonstrates using the IMFSourceReader API to get uncompressed media data from a media file.
18+
19+
This sample application reads audio data from a media file and writes the uncompressed audio to a WAVE file.
20+
21+
## Sample Language Implementations
22+
23+
C++
24+
25+
## Files
26+
27+
AudioClip.sln
28+
AudioClip.vcproj
29+
main.cpp
30+
readme.txt
31+
32+
## To build the sample using the command prompt
33+
34+
1. Open the Command Prompt window and navigate to the AudioClip directory.
35+
2. Type `msbuild AudioClip.sln`.
36+
37+
## To build the sample using Visual Studio (preferred method)
38+
39+
1. Open Windows Explorer and navigate to the AudioClip directory.
40+
2. Double-click the icon for the AudioClip.sln file to open the file in Visual Studio.
41+
3. In the Build menu, select Build Solution. The application will be built in the default \Debug or \Release directory.
42+
43+
## To run the sample
44+
45+
This sample is a command-line application.
46+
47+
It uses the following command-line arguments:
48+
49+
audioclip.exe inputfile outputfile.wav
50+
51+
where
52+
53+
inputfile: The name of a file that contains an audio stream.
54+
outputfile.wav: The name of the WAVE file to write.
Lines changed: 119 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,119 @@
1+
---
2+
page_type: sample
3+
languages:
4+
- cpp
5+
products:
6+
- windows-api-win32
7+
name: DXVA-HD sample
8+
urlFragment: dxva-hd
9+
extendedZipContent:
10+
- path: LICENSE
11+
target: LICENSE
12+
description: This sample demonstrates DirectX Video Acceleration High Definition. DXVA-HD is a low-level video processing API.
13+
---
14+
15+
# DXVA-HD sample
16+
17+
This sample demonstrates DirectX Video Acceleration High Definition (DXVA-HD). DXVA-HD is a low-level video processing API.
18+
19+
This sample is essentially a port of the DXVA2_VideoProc sample to use the DXVA-HD interfaces. It has the same basic functionality, and most of the keyboard commands are the same.
20+
21+
DXVA-HD has additional capabilities that make it more powerful for video processing than the original DXVA-VP APIs introduced in Windows Vista:
22+
23+
- Any stream can be either RGB or YUV.
24+
- Any stream can be either progressive or interlaced.
25+
- The background color can be RGB.
26+
- Luma keying.
27+
- The device can switch between blend, bob, and adaptive deinterlacing.
28+
- Mandatory output formats: X8R8G8B8 and A8R8G8B8
29+
- Mandatory input formats: X8R8G8B8, A8R8G8B8, YUY2 and AYUV
30+
31+
## Sample language implementations
32+
33+
C++
34+
35+
## Files
36+
37+
Application.cpp
38+
Application.h
39+
D3DHelper.cpp
40+
D3DHelper.h
41+
DXVA2_HD.rc
42+
DXVAHD_Sample.h
43+
dxvahd_utils.cpp
44+
dxvahd_utils.h
45+
DXVA_HD.sln
46+
DXVA_HD.vcproj
47+
readme.txt
48+
resource.h
49+
settings.h
50+
stdafx.h
51+
substream.bmp
52+
utils.h
53+
video.cpp
54+
video.h
55+
winmain.cpp
56+
57+
## To build the sample using the command prompt
58+
59+
1. Open the Command Prompt window and navigate to the DXVA_HD directory.
60+
2. Type msbuild DXVA_HD.sln.
61+
62+
## To build the sample using Visual Studio (preferred method)
63+
64+
1. Open Windows Explorer and navigate to the DXVA_HD directory.
65+
2. Double-click the icon for the DXVA_HD.sln file to open the file in Visual Studio.
66+
3. In the Build menu, select Build Solution. The application will be built in the default \Debug or \Release directory.
67+
68+
## To run the sample
69+
70+
1. Navigate to the directory that contains the new executable, using the command prompt or Windows Explorer.
71+
2. Type DXVA_HD.exe at the command line, or double-click the icon for DXVA_HD.exe to launch it from Windows Explorer.
72+
73+
Command line options:
74+
75+
```cmd
76+
-hh : Hardware Direct3D device and hardware DXVA-HD device.
77+
-hs : Hardware Direct3D device and software DXVA-HD device.
78+
-ss : Software Direct3D device and software DXVA-HD device.
79+
```
80+
81+
## Modes
82+
83+
The user can toggle between different modes by pressing the F1 through F9 keys.
84+
85+
The arrow keys control different settings in each mode:
86+
87+
F1 : Alpha values.
88+
89+
- UP/DOWN: Main video planar alpha
90+
- LEFT/RIGHT: Substream pixel alpha
91+
92+
F2 : Resize the main video source rectangle.
93+
94+
F3 : Move the main video source rectangle.
95+
96+
F4 : Resize the main video destination rectangle.
97+
98+
F5 : Move the main video destination rectangle.
99+
100+
F6 : Change the background color or extended color information.
101+
102+
- UP/DOWN: Change YCbCr standard and RGB color range.
103+
- LEFT/RIGHT: Cycle through background colors.
104+
105+
F7 : Ajust brightness and contrast.
106+
107+
- UP/DOWN: Brightness
108+
- LEFT/RIGHT: Contrast
109+
110+
F8 : Adjust hue and saturation.
111+
112+
- UP/DOWN: Hue
113+
- LEFT/RIGHT: Saturation
114+
115+
F9: Resize the target rectangle.
116+
117+
HOME : Resets all mode settings to their default values.
118+
119+
ALT + ENTER: Switch between windowed and full-screen mode.
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
---
2+
page_type: sample
3+
languages:
4+
- cpp
5+
products:
6+
- windows-api-win32
7+
name: Decoder sample
8+
urlFragment: decoder
9+
extendedZipContent:
10+
- path: LICENSE
11+
target: LICENSE
12+
description: This sample demonstrates how to implement a decoder in Media Foundation.
13+
---
14+
15+
# Decoder sample
16+
17+
Demonstrates how to implement a decoder in Media Foundation.
18+
19+
This sample implements a "fake" MPEG-1 decoder. The decoder does not actually decode the video streqam. Instead, it simply scans the bitstream for start codes. Then it finds the time code for each payload and outputs a blank video frame with the time code.
20+
21+
NOTE: An earlier version of this sample was built into the MPEG1Source sample.
22+
23+
## Sample Language Implementations
24+
25+
C++
26+
27+
## To build the sample using the command prompt
28+
29+
1. Open the Command Prompt window and navigate to the Transcode directory.
30+
2. Type msbuild Decoder.sln.
31+
32+
## To build the sample using Visual Studio (preferred method)
33+
34+
1. Open Windows Explorer and navigate to the Decoder directory.
35+
2. Double-click the icon for the Decoder.sln file to open the file in Visual Studio.
36+
3. In the Build menu, select Build Solution. The application will be built in the default \Debug or \Release directory.
37+
38+
## To run the sample
39+
40+
This sample builds a DLL that must be registered.
41+
42+
To register the DLL:
43+
44+
1. Open an elevated command prompt.
45+
2. Naviage to the Debug or Release directory.
46+
3. Type "regsvr32 decoder.dll".
47+
48+
To unegister the DLL, type "regsvr32 /u decoder.dll"
49+
50+
You can use the decoder DLL with the MPEG1Source sample to play an
51+
MPEG-1 video file.
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
---
2+
page_type: sample
3+
languages:
4+
- cpp
5+
products:
6+
- windows-api-win32
7+
name: MFCaptureToFile sample
8+
urlFragment: mfcapturetofile
9+
extendedZipContent:
10+
- path: LICENSE
11+
target: LICENSE
12+
description: This sample demonstrates how to capture video from camera to a file.
13+
---
14+
15+
# MFCaptureToFile sample
16+
17+
Demonstrates how to capture video from camera to a file.
18+
19+
## Sample Language Implementations
20+
21+
C++
22+
23+
## Files
24+
25+
capture.cpp
26+
capture.h
27+
maindialog.cpp
28+
maindialog.h
29+
MFCaptureToFile.rc
30+
MFCaptureToFile.sln
31+
MFCaptureToFile.vcproj
32+
readme.txt
33+
resource.h
34+
stdafx.h
35+
winmain.cpp
36+
37+
## To build the sample using the command prompt
38+
39+
1. Open the Command Prompt window and navigate to the MFCaptureToFile directory.
40+
2. Type msbuild MFCaptureToFile.sln.
41+
42+
## To build the sample using Visual Studio (preferred method)
43+
44+
1. Open Windows Explorer and navigate to the MFCaptureToFile directory.
45+
2. Double-click the icon for the MFCaptureToFile.sln file to open the file in Visual Studio.
46+
3. In the Build menu, select Build Solution. The application will be built in the default \Debug or \Release directory.
47+
48+
## To run the sample
49+
50+
1. Navigate to the directory that contains the new executable using the command prompt or Windows Explorer.
51+
2. Type MFCaptureToFile.exe at the command line, or double-click the icon for MFCaptureToFile.exe to launch it from Windows Explorer.
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
---
2+
page_type: sample
3+
languages:
4+
- cpp
5+
products:
6+
- windows-api-win32
7+
name: MFPlayer2 sample
8+
urlFragment: mfplayer2
9+
extendedZipContent:
10+
- path: LICENSE
11+
target: LICENSE
12+
description: Demonstrates how to use the IMFPMediaPlayer API to perform media playback
13+
---
14+
15+
# MFPlayer2 sample
16+
17+
Demonstrates how to use the IMFPMediaPlayer API to perform media playback.
18+
19+
This sample implements the following playback features:
20+
21+
- Play, pause, stop
22+
- Fast-forward and rewind
23+
- Frame stepping
24+
- Seeking
25+
- Volume and mute
26+
- Metadata
27+
- Video zoom
28+
- Video effects
29+
30+
For a more basic example of using IMFPMediaPlayer, see the SimplePlay
31+
sample.
32+
33+
## Sample Language Implementations
34+
35+
C++
36+
37+
Files:
38+
39+
AudioSessionVolume.cpp
40+
AudioSessionVolume.h
41+
MainDialog.cpp
42+
MainDialog.h
43+
MFPlayer.h
44+
MFPlayer.rc
45+
MFPlayer.sln
46+
MFPlayer.vcproj
47+
Player2.cpp
48+
Player2.h
49+
readme.txt
50+
resource.h
51+
winmain.cpp
52+
images\mute.bmp
53+
images\play.bmp
54+
images\slider.bmp
55+
images\volume.bmp
56+
WinUI\Slider.cpp
57+
WinUI\Slider.h
58+
WinUI\ThemedButton.cpp
59+
WinUI\ThemedButton.h
60+
WinUI\utils.h
61+
62+
## To build the sample using the command prompt
63+
64+
1. Open the Command Prompt window and navigate to the MFPlayer2 directory.
65+
2. Type msbuild MFPlayer.sln.
66+
67+
## To build the sample using Visual Studio (preferred method)
68+
69+
1. Open Windows Explorer and navigate to the MFPlayer2 directory.
70+
2. Double-click the icon for the MFPlayer.sln file to open the file in Visual Studio.
71+
3. In the Build menu, select Build Solution. The application will be built in the default \Debug or \Release directory.
72+
73+
## To run the sample
74+
75+
1. Navigate to the directory that contains the new executable, using the command prompt or Windows Explorer.
76+
2. Type MFPlayer.exe at the command line, or double-click the icon for MFPlayer.exe to launch it from Windows Explorer.

0 commit comments

Comments
 (0)