Skip to content

Commit

Permalink
Samples onboarding
Browse files Browse the repository at this point in the history
  • Loading branch information
Windows classic samples committed Jul 2, 2020
1 parent 1ed3025 commit 340d6c8
Show file tree
Hide file tree
Showing 14 changed files with 797 additions and 4 deletions.
6 changes: 2 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,14 @@ If you cannot get a sample to work as expected,
it might have platform, version, or SKU-specific requirements.
If you have any issues with the samples, please provide feedback using the Issues list.

To get a copy of Windows, go to
[Downloads and tools](http://go.microsoft.com/fwlink/p/?linkid=301696).

To get a copy of Visual Studio, go to
[Visual Studio Downloads](http://go.microsoft.com/fwlink/p/?linkid=301697).

Other samples repos:
Other samples:

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

This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/).
For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/)
Expand Down
54 changes: 54 additions & 0 deletions Samples/Win7Samples/multimedia/mediafoundation/AudioClip/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
---
page_type: sample
languages:
- cpp
products:
- windows-api-win32
name: AudioClip sample
urlFragment: audioclip
extendedZipContent:
- path: LICENSE
target: LICENSE
description: This sample demonstrates using the IMFSourceReader API to get uncompressed media data from a media file.
---

# AudioClip sample

Demonstrates using the IMFSourceReader API to get uncompressed media data from a media file.

This sample application reads audio data from a media file and writes the uncompressed audio to a WAVE file.

## Sample Language Implementations

C++

## Files

AudioClip.sln
AudioClip.vcproj
main.cpp
readme.txt

## To build the sample using the command prompt

1. Open the Command Prompt window and navigate to the AudioClip directory.
2. Type `msbuild AudioClip.sln`.

## To build the sample using Visual Studio (preferred method)

1. Open Windows Explorer and navigate to the AudioClip directory.
2. Double-click the icon for the AudioClip.sln file to open the file in Visual Studio.
3. In the Build menu, select Build Solution. The application will be built in the default \Debug or \Release directory.

## To run the sample

This sample is a command-line application.

It uses the following command-line arguments:

audioclip.exe inputfile outputfile.wav

where

inputfile: The name of a file that contains an audio stream.
outputfile.wav: The name of the WAVE file to write.
119 changes: 119 additions & 0 deletions Samples/Win7Samples/multimedia/mediafoundation/DXVA_HD/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
---
page_type: sample
languages:
- cpp
products:
- windows-api-win32
name: DXVA-HD sample
urlFragment: dxva-hd
extendedZipContent:
- path: LICENSE
target: LICENSE
description: This sample demonstrates DirectX Video Acceleration High Definition. DXVA-HD is a low-level video processing API.
---

# DXVA-HD sample

This sample demonstrates DirectX Video Acceleration High Definition (DXVA-HD). DXVA-HD is a low-level video processing API.

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.

DXVA-HD has additional capabilities that make it more powerful for video processing than the original DXVA-VP APIs introduced in Windows Vista:

- Any stream can be either RGB or YUV.
- Any stream can be either progressive or interlaced.
- The background color can be RGB.
- Luma keying.
- The device can switch between blend, bob, and adaptive deinterlacing.
- Mandatory output formats: X8R8G8B8 and A8R8G8B8
- Mandatory input formats: X8R8G8B8, A8R8G8B8, YUY2 and AYUV

## Sample language implementations

C++

## Files

Application.cpp
Application.h
D3DHelper.cpp
D3DHelper.h
DXVA2_HD.rc
DXVAHD_Sample.h
dxvahd_utils.cpp
dxvahd_utils.h
DXVA_HD.sln
DXVA_HD.vcproj
readme.txt
resource.h
settings.h
stdafx.h
substream.bmp
utils.h
video.cpp
video.h
winmain.cpp

## To build the sample using the command prompt

1. Open the Command Prompt window and navigate to the DXVA_HD directory.
2. Type msbuild DXVA_HD.sln.

## To build the sample using Visual Studio (preferred method)

1. Open Windows Explorer and navigate to the DXVA_HD directory.
2. Double-click the icon for the DXVA_HD.sln file to open the file in Visual Studio.
3. In the Build menu, select Build Solution. The application will be built in the default \Debug or \Release directory.

## To run the sample

1. Navigate to the directory that contains the new executable, using the command prompt or Windows Explorer.
2. Type DXVA_HD.exe at the command line, or double-click the icon for DXVA_HD.exe to launch it from Windows Explorer.

Command line options:

```cmd
-hh : Hardware Direct3D device and hardware DXVA-HD device.
-hs : Hardware Direct3D device and software DXVA-HD device.
-ss : Software Direct3D device and software DXVA-HD device.
```

## Modes

The user can toggle between different modes by pressing the F1 through F9 keys.

The arrow keys control different settings in each mode:

F1 : Alpha values.

- UP/DOWN: Main video planar alpha
- LEFT/RIGHT: Substream pixel alpha

F2 : Resize the main video source rectangle.

F3 : Move the main video source rectangle.

F4 : Resize the main video destination rectangle.

F5 : Move the main video destination rectangle.

F6 : Change the background color or extended color information.

- UP/DOWN: Change YCbCr standard and RGB color range.
- LEFT/RIGHT: Cycle through background colors.

F7 : Ajust brightness and contrast.

- UP/DOWN: Brightness
- LEFT/RIGHT: Contrast

F8 : Adjust hue and saturation.

- UP/DOWN: Hue
- LEFT/RIGHT: Saturation

F9: Resize the target rectangle.

HOME : Resets all mode settings to their default values.

ALT + ENTER: Switch between windowed and full-screen mode.
51 changes: 51 additions & 0 deletions Samples/Win7Samples/multimedia/mediafoundation/Decoder/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
---
page_type: sample
languages:
- cpp
products:
- windows-api-win32
name: Decoder sample
urlFragment: decoder
extendedZipContent:
- path: LICENSE
target: LICENSE
description: This sample demonstrates how to implement a decoder in Media Foundation.
---

# Decoder sample

Demonstrates how to implement a decoder in Media Foundation.

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.

NOTE: An earlier version of this sample was built into the MPEG1Source sample.

## Sample Language Implementations

C++

## To build the sample using the command prompt

1. Open the Command Prompt window and navigate to the Transcode directory.
2. Type msbuild Decoder.sln.

## To build the sample using Visual Studio (preferred method)

1. Open Windows Explorer and navigate to the Decoder directory.
2. Double-click the icon for the Decoder.sln file to open the file in Visual Studio.
3. In the Build menu, select Build Solution. The application will be built in the default \Debug or \Release directory.

## To run the sample

This sample builds a DLL that must be registered.

To register the DLL:

1. Open an elevated command prompt.
2. Naviage to the Debug or Release directory.
3. Type "regsvr32 decoder.dll".

To unegister the DLL, type "regsvr32 /u decoder.dll"

You can use the decoder DLL with the MPEG1Source sample to play an
MPEG-1 video file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
---
page_type: sample
languages:
- cpp
products:
- windows-api-win32
name: MFCaptureToFile sample
urlFragment: mfcapturetofile
extendedZipContent:
- path: LICENSE
target: LICENSE
description: This sample demonstrates how to capture video from camera to a file.
---

# MFCaptureToFile sample

Demonstrates how to capture video from camera to a file.

## Sample Language Implementations

C++

## Files

capture.cpp
capture.h
maindialog.cpp
maindialog.h
MFCaptureToFile.rc
MFCaptureToFile.sln
MFCaptureToFile.vcproj
readme.txt
resource.h
stdafx.h
winmain.cpp

## To build the sample using the command prompt

1. Open the Command Prompt window and navigate to the MFCaptureToFile directory.
2. Type msbuild MFCaptureToFile.sln.

## To build the sample using Visual Studio (preferred method)

1. Open Windows Explorer and navigate to the MFCaptureToFile directory.
2. Double-click the icon for the MFCaptureToFile.sln file to open the file in Visual Studio.
3. In the Build menu, select Build Solution. The application will be built in the default \Debug or \Release directory.

## To run the sample

1. Navigate to the directory that contains the new executable using the command prompt or Windows Explorer.
2. Type MFCaptureToFile.exe at the command line, or double-click the icon for MFCaptureToFile.exe to launch it from Windows Explorer.
76 changes: 76 additions & 0 deletions Samples/Win7Samples/multimedia/mediafoundation/MFPlayer2/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
---
page_type: sample
languages:
- cpp
products:
- windows-api-win32
name: MFPlayer2 sample
urlFragment: mfplayer2
extendedZipContent:
- path: LICENSE
target: LICENSE
description: Demonstrates how to use the IMFPMediaPlayer API to perform media playback
---

# MFPlayer2 sample

Demonstrates how to use the IMFPMediaPlayer API to perform media playback.

This sample implements the following playback features:

- Play, pause, stop
- Fast-forward and rewind
- Frame stepping
- Seeking
- Volume and mute
- Metadata
- Video zoom
- Video effects

For a more basic example of using IMFPMediaPlayer, see the SimplePlay
sample.

## Sample Language Implementations

C++

Files:

AudioSessionVolume.cpp
AudioSessionVolume.h
MainDialog.cpp
MainDialog.h
MFPlayer.h
MFPlayer.rc
MFPlayer.sln
MFPlayer.vcproj
Player2.cpp
Player2.h
readme.txt
resource.h
winmain.cpp
images\mute.bmp
images\play.bmp
images\slider.bmp
images\volume.bmp
WinUI\Slider.cpp
WinUI\Slider.h
WinUI\ThemedButton.cpp
WinUI\ThemedButton.h
WinUI\utils.h

## To build the sample using the command prompt

1. Open the Command Prompt window and navigate to the MFPlayer2 directory.
2. Type msbuild MFPlayer.sln.

## To build the sample using Visual Studio (preferred method)

1. Open Windows Explorer and navigate to the MFPlayer2 directory.
2. Double-click the icon for the MFPlayer.sln file to open the file in Visual Studio.
3. In the Build menu, select Build Solution. The application will be built in the default \Debug or \Release directory.

## To run the sample

1. Navigate to the directory that contains the new executable, using the command prompt or Windows Explorer.
2. Type MFPlayer.exe at the command line, or double-click the icon for MFPlayer.exe to launch it from Windows Explorer.
Loading

0 comments on commit 340d6c8

Please sign in to comment.