Experimental AVFoundation renderer

This commit is contained in:
Cameron Gutman
2018-07-17 22:57:15 -07:00
parent a89cadc520
commit 57137412b5
5 changed files with 554 additions and 12 deletions

View File

@@ -5,6 +5,10 @@
#include <SDL.h>
#include "utils.h"
#ifdef __APPLE__
#include "video/avfoundation.h"
#endif
#include "video/ffmpeg.h"
#include <QRandomGenerator>
@@ -82,6 +86,21 @@ bool Session::chooseDecoder(StreamingPreferences::VideoDecoderSelection vds,
SDL_Window* window, int videoFormat, int width, int height,
int frameRate, IVideoDecoder*& chosenDecoder)
{
#ifdef __APPLE__
chosenDecoder = AVFoundationDecoderFactory::createDecoder();
if (chosenDecoder->initialize(vds, window, videoFormat, width, height, frameRate)) {
SDL_LogInfo(SDL_LOG_CATEGORY_APPLICATION,
"AVFoundation-based video decoder chosen");
return true;
}
else {
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION,
"Unable to load AVFoundation decoder");
delete chosenDecoder;
chosenDecoder = nullptr;
}
#endif
chosenDecoder = new FFmpegVideoDecoder();
if (chosenDecoder->initialize(vds, window, videoFormat, width, height, frameRate)) {
SDL_LogInfo(SDL_LOG_CATEGORY_APPLICATION,