Update on-windows.md: fix formatting around environment variables, improve wording, split excessively long lines.

This commit is contained in:
R Kh 2019-01-24 20:10:22 +00:00 committed by Olivier Crête
parent d4a370967a
commit aefb043139

View file

@ -13,24 +13,24 @@ To develop applications using GStreamer for Windows we recommend using
[Windows 7](http://windows.microsoft.com/en-us/windows7/products/home)
or later. Windows Vista may also work but it is not supported.
GStreamer binaries includes C headers (`.h`) and library files (`.lib`)
GStreamer package includes C headers (`.h`) and library files (`.lib`)
valid for any version of [Microsoft Visual
Studio](http://www.microsoft.com/visualstudio). For convenience,
property pages (`.props`) are also included which extremely simplify
creating new projects. These property pages, though, only work with
[Microsoft Visual
Studio 2010](http://www.microsoft.com/visualstudio/en-us/products/2010-editions)
(including the free [Visual C++ Express
and newer (including the free [Visual C++ Express
edition](http://www.microsoft.com/visualstudio/en-us/products/2010-editions/visual-cpp-express)).
The recommended system is
[Windows 7](http://windows.microsoft.com/en-us/windows7/products/home)
[Windows 7](http://windows.microsoft.com/en-us/windows7/products/home) or newer
with [Microsoft Visual
Studio 2010](http://www.microsoft.com/visualstudio/en-us/products/2010-editions) (Take
a look at its [system
Studio 2010](http://www.microsoft.com/visualstudio/en-us/products/2010-editions)
or newer. Take a look at its [system
requirements](http://www.microsoft.com/visualstudio/en-us/products/2010-editions/visual-cpp-express)).
Installing GStreamer for 32-bits platforms requires approximately 286MB of
Installing GStreamer for 32-bit platforms requires approximately 286MB of
free disk space for the runtime and 207MB for the development files.
Installing GStreamer for 64-bits platforms requires approximately 340MB of
@ -60,17 +60,18 @@ Execute the installers and choose an installation folder. The suggested
default is usually OK.
> ![Warning](images/icons/emoticons/warning.svg)
>`If you plan to use Visual Studio, **close it before installing GStreamer**. The installer will define new environment variables which will not be picked up by Visual Studio if it is open.
> If you plan to use Visual Studio, **close it before installing GStreamer**.
> The installer will define new environment variables which will not be picked up by Visual Studio if it is open.
> On **Windows 8** and **Windows 10**, it might be necessary to log out and log back in to your account after the installation for the newly defined environment variables to be picked up by Visual Studio.
> On **Windows 8** and **Windows 10**, it might be necessary to log out and log back in to your account
> after the installation for the newly defined environment variables to be picked up by Visual Studio.
It is the application's responsibility to ensure that, at runtime,
GStreamer can access its libraries and plugins. It can be done by adding
`%GSTREAMER_ROOT_X86%\bin` to the `%PATH%` environment variable, or
`%GSTREAMER_ROOT_X86%\bin` to the `PATH` environment variable, or
by running the application from this same folder.
At runtime, GStreamer will look for its plugins in the following
folders:
At runtime, GStreamer will look for its plugins in the following folders:
- `%HOMEDRIVE%%HOMEFOLDER%/.gstreamer-1.0/plugins`
- `C:\gstreamer\1.0\x86\lib\gstreamer-1.0`
@ -80,20 +81,18 @@ folders:
So, typically, if your application can find `libgstreamer-1.0-0.dll`,
it will find the GStreamer plugins, as long as the installation folder
structure is unmodified. If you do change this structure in your
application, then you can use the `%GST_PLUGIN_PATH%` environment
application, then you can use the `GST_PLUGIN_PATH` environment
variable to point GStreamer to its plugins. The plugins are initially
found at `%GSTREAMER_ROOT_X86%\lib\gstreamer-1.0`.
Additionally, if you want to prevent GStreamer from looking in all the
default folders listed above, you can set the
`%GST_PLUGIN_SYSTEM_PATH%` environment variable to point where the
plugins are located.
default folders listed above, you can set the `GST_PLUGIN_SYSTEM_PATH`
environment variable to point where the plugins are located.
## Configure your development environment
### Building the tutorials
The tutorials code, along with project files and a solution file for
Visual Studio 2010, are in the
[gst-docs](https://gitlab.freedesktop.org/gstreamer/gst-docs/) in the
@ -107,15 +106,15 @@ liking, and work from there.
> ![Information](images/icons/emoticons/information.svg)
> **64-bit Users**
>
>Use `%GSTREAMER_ROOT_X86_64%` if you have installed GStreamer binaries for 64-bit platforms. Both GStreamer binaries (32 and 64-bit) can be installed simultaneously, and hence the separate environment variables.
> Use the `GSTREAMER_ROOT_X86_64` environment variable if you have installed GStreamer binaries for 64-bit platforms.
> Both GStreamer packages (32 and 64-bit) can be installed simultaneously, hence the separate environment variables.
>
>Make sure you select the Solution Configuration that matches GStreamer that you have installed: `Win32` for 32 bits or `x64` for 64 bits.
> Make sure you select the Solution Configuration that matches GStreamer that you have installed: `Win32` for 32-bit or `x64` for 64-bit.
>
> ![Windows Install Configuration](images/WindowsInstall-Configuration.png)
You can fire up Visual Studio 2010 and load your copy of the
`tutorials.sln` solution file (Click on the screen shots to enlarge
them).
You can launch Visual Studio 2010 and load your copy of the
`tutorials.sln` solution file (Click on the screen shots to enlarge them).
![](images/WindowsInstall2.png)
@ -128,16 +127,16 @@ Build Solution. All projects should build without problems.
### Running the tutorials
In order to run the tutorials, we will set the current working directory
to `%GSTREAMER_ROOT_X86%`\\`bin` in the Debugging section of the
to `%GSTREAMER_ROOT_X86%\bin` in the Debugging section of the
project properties. **This property is not stored in the project files,
so you will need to manually add it to every tutorial you want to run
from within Visual Studio**. Right click on a project in the Solution
Explorer, Properties → Debugging → Working Directory, and type
`$(GSTREAMER_ROOT_X86)`\\`bin`
`$(GSTREAMER_ROOT_X86)\bin`.
(The `$(...)` notation is required to access environment variables
from within Visual Studio. You use the `%...%` notation from Windows
Explorer)
from within Visual Studio property pages. You use the `%...%` notation in Windows
Explorer and in CMD scripts.)
You should now be able to run the tutorials.
@ -158,8 +157,7 @@ Existing Property Sheet...”.
> In Visual Studio 2017, the property manager can be found in
> View→Other Windows→Property Manager
Navigate to `%GSTREAMER_ROOT_X86%`\\`share\vs\2010\libs` and
load `gstreamer-1.0.props `
Navigate to `%GSTREAMER_ROOT_X86%\share\vs\2010\libs` and load `gstreamer-1.0.props`.
This property sheet contains the directories where the headers and
libraries are located, and the necessary options for the compiler and
@ -173,9 +171,11 @@ default.
![](images/WindowsInstall10.png)
> ![Warning](images/icons/emoticons/warning.svg)
> **Depending on the GStreamer libraries you need to use, you will have to add more property pages, besides `gstreamer-1.0`** (each property page corresponds to one GStreamer library).
> **Depending on the GStreamer libraries you need to use, you will have to add more property pages,
> besides `gstreamer-1.0`** (each property page corresponds to one GStreamer library).
>
> The tutorial's project files already contain all necessary property pages. When developing your own applications, the GStreamer documentation will tell you what library a function belongs to, and therefore, what property pages you need to add.
> The tutorial's project files already contain all necessary property pages. When developing your own applications,
> the GStreamer documentation will tell you what library a function belongs to, and therefore, what property pages you need to add.
#### Remove the dependency with the Visual Studio runtime
@ -185,8 +185,7 @@ running the tutorials. However, there is a last step remaining.
Applications built with Visual C++ 2010 depend on the Visual C++ 2010
Runtime, which is a DLL that gets installed when you install Visual
Studio. If you were to distribute your application, you would need to
distribute this DLL with it (What is known as the [Visual C++ 2010
Redistributable
distribute this DLL with it (e.g. via the [Visual C++ 2010 Redistributable
Package](http://www.microsoft.com/download/en/details.aspx?id=5555)).
This happens with every version of Visual Studio, and the Runtime DLL is
different for every version of Visual Studio.
@ -209,14 +208,21 @@ was a regular compressed file (you will need decompression software that
understands the ISO format).
Then, add the `x86.props` or `x86_64.props` (for 32 or 64 bits) property
sheet found in `%GSTREAMER_ROOT_X86%``\``share\vs\2010\msvc` to your
sheet found in `%GSTREAMER_ROOT_X86%\share\vs\2010\msvc` to your
project. This will make your application use the ubiquitous
`MSVCRT.DLL` saving you some troubles in the future.
`MSVCRT.DLL` saving you from some troubles in the future.
> ![Information](images/icons/emoticons/information.svg)
> If you did not install the WinDDK to the standard path `C:\WinDDK\7600.16385.1`, you will need to tell Visual Studio where it is. Unfortunately, there is no automated way to do this. Once you have added the `x86.props` or `x86_64.props` to your project, go to the Property Manager, expand your project and its subfolders until you find the property sheet called `config`. Double click to edit it, and select the section called “User Macros” in the list on the left. You should see a macro called `WINDOWS_DRIVER_KIT`. Double click to edit it, and set its value to the root folder where you installed the DDK. This is the folder containing a file called `samples.txt`.
> If you did not install the WinDDK to the standard path `C:\WinDDK\7600.16385.1`,
> you will need to tell Visual Studio where it is. Unfortunately, there is no automated way to do this.
> Once you have added the `x86.props` or `x86_64.props` to your project, go to the Property Manager,
> expand your project and its subfolders until you find the property sheet called `config`.
> Double click to edit it, and select the section called “User Macros” in the list on the left.
> You should see a macro called `WINDOWS_DRIVER_KIT`. Double click to edit it, and set its value to
> the root folder where you installed the DDK. This is the folder containing a file called `samples.txt`.
>
>That's it. Accept the changes, right click on the `config` property sheet and select “Save”. The path to the DDK is now stored in `config.props` and you do not need to perform this operation anymore.
> That's it. Accept the changes, right click on the `config` property sheet and select “Save”.
> The path to the DDK is now stored in `config.props` and you do not need to perform this operation anymore.
### Creating new projects using the wizard