File: avtogl.cpp

package info (click to toggle)
olive-editor 20181223-2
  • links: PTS
  • area: main
  • in suites: buster
  • size: 2,844 kB
  • sloc: cpp: 20,147; xml: 315; ansic: 16; makefile: 11
file content (19 lines) | stat: -rw-r--r-- 456 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#include "avtogl.h"

extern "C" {
	#include <libavutil/avutil.h>
}

enum QOpenGLTexture::PixelFormat get_gl_pix_fmt_from_av(int format) {
	switch (format) {
	case AV_PIX_FMT_RGB24: return QOpenGLTexture::RGB;
	}
	return QOpenGLTexture::RGBA;
}

enum QOpenGLTexture::TextureFormat get_gl_tex_fmt_from_av(int format) {
	switch (format) {
	case AV_PIX_FMT_RGB24: return QOpenGLTexture::RGB8_UNorm;
	}
	return QOpenGLTexture::RGBA8_UNorm;
}