It's great to hear that you want to contribute to the project! So let's get you started.
Before you report an issue, please read the Troubleshooting Guide. It contains a step-by-step guide on how to solve your issue and even includes a FAQ for you to read through. If you request a certain feature, make sure that it is actually possible to implement this feature.
The first step to starting off is to get the project building so that you can actually test your changes yourself.
- CMake Build Tool
- Visual Studio® 2013, Visual Studio® 2015 or newer
- Open Broadcaster Software Studio
- AMDs Advanced Media Framework SDK
- Windows 10 SDK (Version 10586 or better) [Windows Only]
- Optional: InnoSetup for building a Standalone Installer
This is necessary so the plugin itself has something to link against. Simply build OBS Studio with the same configuration (or do a Batch Build for all configurations) and you are good to go.
- Point CMake at the Source Code and tell it to put binaries in /build32 (32-Bit) or /build64 (64-bit).
- Configure the Project
- Set PATH_AMDAMFSDK to where you cloned the AMD Advanced Media Framework SDK to.
- Set PATH_OBSStudio to where you cloned Open Broadcaster Software Studio to.
- Generate the Project files
- You should now have a Solution file in the /build32 or /build64 folder.
To verify that everything worked right you should now attempt to build the project with the generated solution file. If something did not work right, make sure that you have all prerequisites and start again from step 1. Once the building is complete you will notice a new folder called /#Build. This folder will always contain the latest files from a build, no matter the configuration.
Copy the files from /#Build to a OBS Studio installation (Portable or Static) and try to use your changes.
Version Control plays a large role in managing things and keeping in touch with changes.
The plugin itself is made up of several sub-modules:
- AMF: amf.cpp, amf.h, amf-capabilities.cpp, amf-capabilities.h
- Encoder: amf-encoder.cpp, amf-encoder.h
- H264: amf-encoder-h264.cpp, amf-encoder-h264.h, enc-h264.cpp, enc-h264.h
- H265: amf-encoder-h265.cpp, amf-encoder-h265.h, enc-h265.cpp, enc-h265.h
- API: api-base.cpp, api-base.h
- API-OpenGL: api-opengl.cpp, api-opengl.h
- API-Direct3D9: api-d3d9.cpp, api-d3d9.h
- API-Direct3D11: api-d3d11.cpp, api-d3d11.h
- API-Host: api-host.cpp, api-host.h
- Plugin: plugin.cpp, plugin.h, CMakeLists.txt
- Utilities: utility.cpp, utility.h
- Locale: strings.h, Any locale files
- Resources: Any resource files
Commits should ideally only contain one group of changes. For example if you change how the H264 Color Format is called, that change would be prefixed by H264 and contain all the files this changes.
The first line of a message should not be longer than 80 characters and be prefixed by the module it changes. If it changes more than one separate them by comma. If it changes all of them use the prefix 'project'.
Pull Request titles should follow the guidelines for committing changes and also have a short description of what the change does.
The entire Project is written in C++ and as such follows common C++ writing practices.
Namespaces should be named in Pascal Case. You may create a nested namespace that is 3 levels deep, not more.
Structures and Classes should be named using Pascal Case and should be inside a namespace. A structure or class not in a namespace must have relevance to the entire code.
Methods should be named in Pascal Case and always reside in the class it belongs to.
Members should be prefixed by 'm_' and then use a Pascal Case name. There is no special prefix per-type, per-usage or per-source.
Enumerations should be named in Pascal Case and be inside a namespace or class.
Enumeration Constants should always be prefixed by the enumeration name so no ambiguity exists.
Functions should be named in Pascal Case and should always be inside a namespace or class. Ideally your function should be either inlinable or have parameters passed by reference for optimization.
Variables should be named in camel Case.