mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-06-06 15:30:50 +00:00
Added a "--software" option to testffmpeg
This allows easy performance comparison between hardware and software decoding
This commit is contained in:
parent
86ada8a9f0
commit
adcace6f95
1 changed files with 15 additions and 10 deletions
|
@ -69,6 +69,7 @@ static SDL_Renderer *renderer;
|
||||||
static SDL_AudioStream *audio;
|
static SDL_AudioStream *audio;
|
||||||
static SDL_Texture *video_texture;
|
static SDL_Texture *video_texture;
|
||||||
static Uint64 video_start;
|
static Uint64 video_start;
|
||||||
|
static SDL_bool software_only;
|
||||||
static SDL_bool has_eglCreateImage;
|
static SDL_bool has_eglCreateImage;
|
||||||
#ifdef HAVE_EGL
|
#ifdef HAVE_EGL
|
||||||
static SDL_bool has_EGL_EXT_image_dma_buf_import;
|
static SDL_bool has_EGL_EXT_image_dma_buf_import;
|
||||||
|
@ -248,6 +249,7 @@ static Uint32 GetTextureFormat(enum AVPixelFormat format)
|
||||||
|
|
||||||
static SDL_bool SupportedPixelFormat(enum AVPixelFormat format)
|
static SDL_bool SupportedPixelFormat(enum AVPixelFormat format)
|
||||||
{
|
{
|
||||||
|
if (!software_only) {
|
||||||
if (has_eglCreateImage &&
|
if (has_eglCreateImage &&
|
||||||
(format == AV_PIX_FMT_VAAPI || format == AV_PIX_FMT_DRM_PRIME)) {
|
(format == AV_PIX_FMT_VAAPI || format == AV_PIX_FMT_DRM_PRIME)) {
|
||||||
return SDL_TRUE;
|
return SDL_TRUE;
|
||||||
|
@ -262,6 +264,7 @@ static SDL_bool SupportedPixelFormat(enum AVPixelFormat format)
|
||||||
return SDL_TRUE;
|
return SDL_TRUE;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
if (GetTextureFormat(format) != SDL_PIXELFORMAT_UNKNOWN) {
|
if (GetTextureFormat(format) != SDL_PIXELFORMAT_UNKNOWN) {
|
||||||
return SDL_TRUE;
|
return SDL_TRUE;
|
||||||
|
@ -789,6 +792,8 @@ int main(int argc, char *argv[])
|
||||||
if (SDL_strcmp(argv[i], "--sprites") == 0 && argv[i+1]) {
|
if (SDL_strcmp(argv[i], "--sprites") == 0 && argv[i+1]) {
|
||||||
num_sprites = SDL_atoi(argv[i+1]);
|
num_sprites = SDL_atoi(argv[i+1]);
|
||||||
++i;
|
++i;
|
||||||
|
} else if (SDL_strcmp(argv[i], "--software") == 0) {
|
||||||
|
software_only = SDL_TRUE;
|
||||||
} else {
|
} else {
|
||||||
/* We'll try to open this as a media file */
|
/* We'll try to open this as a media file */
|
||||||
file = argv[i];
|
file = argv[i];
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue