Giter Site home page Giter Site logo

yuan631111976 / qtavplayer Goto Github PK

View Code? Open in Web Editor NEW
108.0 108.0 42.0 493 KB

一个简单qt多媒体播放器,使用ffmpeg软解码,opengl渲染 ,只支持QML,不支持QWidget,不需要提前编译,直接引入项目即可使用

License: GNU General Public License v3.0

C++ 99.14% QMake 0.04% GLSL 0.82%
audio audioplayer avplayer ffmpeg media mediaplayer player qt qtavplayer video videoplayer

qtavplayer's People

Contributors

yuan631111976 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

qtavplayer's Issues

QOpenGLShader::compile(Fragment): ERROR: 4:12: 'uniform' : cannot initialize this type of qualifier

QT5.12 mingw64
Win10
Intel UHD Graphics 630 GPU

QOpenGLShader::compile(Fragment): ERROR: 4:12: 'uniform' : cannot initialize this type of qualifier
ERROR: 4:13: 'uniform' : cannot initialize this type of qualifier
ERROR: 4:14: 'uniform' : cannot initialize this type of qualifier
ERROR: 4:15: 'uniform' : cannot initialize this type of qualifier
ERROR: 4:16: 'uniform' : cannot initialize this type of qualifier
ERROR: 4:17: 'uniform' : cannot initialize this type of qualifier
ERROR: 4:18: 'uniform' : cannot initialize this type of qualifier
ERROR: 4:36: Unary operation not folded into constant
ERROR: 4:64: 'assign' : implicit conversion between types not allowed in ES 2.0
ERROR: 4:64: 'assign' : cannot convert from 'const int' to 'mediump float'
ERROR: 4:65: 'assign' : implicit conversion between types not allowed in ES 2.0
ERROR: 4:65: 'assign' : cannot convert from 'const int' to 'mediump float'
ERROR: 4:66: 'assign' : implicit conversion between types not allowed in ES 2.0
ERROR: 4:66: 'assign' : cannot convert from 'const int' to 'mediump float'
ERROR: 4:67: 'assign' : implicit conversion between types not allowed in ES 2.0
ERROR: 4:67: 'assign' : cannot convert from 'const int' to 'mediump float'
ERROR: 4:72: 'assign' : implicit conversion between types not allowed in ES 2.0
ERROR: 4:72: 'assign' : implicit conversion between types not allowed in ES 2.0
ERROR: 4:72: '==' : wrong operand types no operation '==' exists that takes a left-hand operand of type 'uniform highp float' and a right operand of type 'const int' (or there is no acceptable conversion)
ERROR: 4:72: 'assign' : implicit conversion between types not allowed in ES 2.0
ERROR: 4:72: 'assign' : implicit conversion between types not allowed in ES 2.0
ERROR: 4:72: '==' : wrong operand types no operation '==' exists that takes a left-hand operand of type 'uniform highp float' and a right operand of type 'const int' (or there is no acceptable conversion)
ERROR: 4:73: 'assign' : implicit conversion between types not allowed in ES 2.0
ERROR: 4:73: 'assign' : implicit conversion between types not allowed in ES 2.0
ERROR: 4:73: '==' : wrong operand types no operation '==' exists that takes a left-hand operand of type 'uniform highp float' and a right operand of type 'const int' (or there is no acceptable conversion)
ERROR: 4:80: 'assign' : implicit conversion between types not allowed in ES 2.0
ERROR: 4:80: 'assign' : implicit conversion between types not allowed in ES 2.0
ERROR: 4:80: '==' : wrong operand types no operation '==' exists that takes a left-hand operand of type 'uniform highp float' and a right operand of type 'const int' (or there is no acceptable conversion)
ERROR: 4:82: 'assign' : implicit conversion between types not allowed in ES 2.0
ERROR: 4:82: 'assign' : implicit conversion between types not allowed in ES 2.0
ERROR: 4:82: '==' : wrong operand types no operation '==' exists that takes a left-hand operand of type 'uniform highp float' and a right operand of type 'const int' (or there is no acceptable conversion)
ERROR: 4:84: 'assign' : implicit conversion between types not allowed in ES 2.0
ERROR: 4:84: 'assign' : implicit conversion between types not allowed in ES 2.0
ERROR: 4:84: '==' : wrong operand types no operation '==' exists that takes a left-hand operand of type 'uniform highp float' and a right operand of type 'const int' (or there is no acceptable conversion)
ERROR: 4:86: 'assign' : implicit conversion between types not allowed in ES 2.0
ERROR: 4:86: 'assign' : implicit conversion between types not allowed in ES 2.0
ERROR: 4:86: '==' : wrong operand types no operation '==' exists that takes a left-hand operand of type 'uniform highp float' and a right operand of type 'const int' (or there is no acceptable conversion)
ERROR: 4:96: 'assign' : implicit conversion between types not allowed in ES 2.0
ERROR: 4:96: 'assign' : implicit conversion between types not allowed in ES 2.0
ERROR: 4:96: '==' : wrong operand types no operation '==' exists that takes a left-hand operand of type 'uniform highp float' and a right operand of type 'const int' (or there is no acceptable conversion)
ERROR: 4:96: 'assign' : implicit conversion between types not allowed in ES 2.0
ERROR: 4:96: 'assign' : implicit conversion between types not allowed in ES 2.0
ERROR: 4:96: '==' : wrong operand types no operation '==' exists that takes a left-hand operand of type 'uniform highp float' and a right operand of type 'const int' (or there is no acceptable conversion)
ERROR: 4:99: 'assign' : implicit conversion between types not allowed in ES 2.0
ERROR: 4:99: 'assign' : implicit conversion between types not allowed in ES 2.0
ERROR: 4:99: '==' : wrong operand types no operation '==' exists that takes a left-hand operand of type 'uniform highp float' and a right operand of type 'const int' (or there is no acceptable conversion)
ERROR: 4:106: 'assign' : implicit conversion between types not allowed in ES 2.0
ERROR: 4:106: 'assign' : implicit conversion between types not allowed in ES 2.0
ERROR: 4:106: '==' : wrong operand types no operation '==' exists that takes a left-hand operand of type 'uniform highp float' and a right operand of type 'const int' (or there is no acceptable conversion)
ERROR: 4:106: 'assign' : implicit conversion between types not allowed in ES 2.0
ERROR: 4:106: 'assign' : implicit conversion between types not allowed in ES 2.0
ERROR: 4:106: '==' : wrong operand types no operation '==' exists that takes a left-hand operand of type 'uniform highp float' and a right operand of type 'const int' (or there is no acceptable conversion)
ERROR: 4:107: 'assign' : implicit conversion between types not allowed in ES 2.0
ERROR: 4:107: 'assign' : implicit conversion between types not allowed in ES 2.0
ERROR: 4:107: '==' : wrong operand types no operation '==' exists that takes a left-hand operand of type 'uniform highp float' and a right operand of type 'const int' (or there is no acceptable conversion)
ERROR: 4:118: 'assign' : implicit conversion between types not allowed in ES 2.0
ERROR: 4:118: 'assign' : implicit conversion between types not allowed in ES 2.0
ERROR: 4:118: '==' : wrong operand types no operation '==' exists that takes a left-hand operand of type 'uniform highp float' and a right operand of type 'const int' (or there is no acceptable conversion)
ERROR: 4:118: 'assign' : implicit conversion between types not allowed in ES 2.0
ERROR: 4:118: 'assign' : implicit conversion between types not allowed in ES 2.0
ERROR: 4:118: '==' : wrong operand types no operation '==' exists that takes a left-hand operand of type 'uniform highp float' and a right operand of type 'const int' (or there is no acceptable conversion)
ERROR: 4:118: 'assign' : implicit conversion between types not allowed in ES 2.0
ERROR: 4:118: 'assign' : implicit conversion between types not allowed in ES 2.0
ERROR: 4:118: '==' : wrong operand types no operation '==' exists that takes a left-hand operand of type 'uniform highp float' and a right operand of type 'const int' (or there is no acceptable conversion)
ERROR: 4:122: 'assign' : implicit conversion between types not allowed in ES 2.0
ERROR: 4:122: 'assign' : implicit conversion between types not allowed in ES 2.0
ERROR: 4:122: '==' : wrong operand types no operation '==' exists that takes a left-hand operand of type 'uniform highp float' and a right operand of type 'const int' (or there is no acceptable conversion)
ERROR: 4:122: 'assign' : implicit conversion between types not allowed in ES 2.0
ERROR: 4:122: 'assign' : implicit conversion between types not allowed in ES 2.0
ERROR: 4:122: '==' : wrong operand types no operation '==' exists that takes a left-hand operand of type 'uniform highp float' and a right operand of type 'const int' (or there is no acceptable conversion)
ERROR: 4:127: 'assign' : implicit conversion between types not allowed in ES 2.0
ERROR: 4:127: 'assign' : implicit conversion between types not allowed in ES 2.0
ERROR: 4:127: '==' : wrong operand types no operation '==' exists that takes a left-hand operand of type 'uniform highp float' and a right operand of type 'const int' (or there is no acceptable conversion)
ERROR: 4:129: 'assign' : implicit conversion between types not allowed in ES 2.0
ERROR: 4:129: 'assign' : implicit conversion between types not allowed in ES 2.0
ERROR: 4:129: '==' : wrong operand types no operation '==' exists that takes a left-hand operand of type 'uniform highp float' and a right operand of type 'const int' (or there is no acceptable conversion)
ERROR: 4:133: 'assign' : implicit conversion between types not allowed in ES 2.0
ERROR: 4:133: 'assign' : implicit conversion between types not allowed in ES 2.0
ERROR: 4:133: '==' : wrong operand types no operation '==' exists that takes a left-hand operand of type 'uniform highp float' and a right operand of type 'const int' (or there is no acceptable conversion)
ERROR: 4:137: 'assign' : implicit conversion between types not allowed in ES 2.0
ERROR: 4:137: 'assign' : implicit conversion between types not allowed in ES 2.0
ERROR: 4:137: '==' : wrong operand types no operation '==' exists that takes a left-hand operand of type 'uniform highp float' and a right operand of type 'const int' (or there is no acceptable conversion)
ERROR: 4:146: 'assign' : implicit conversion between types not allowed in ES 2.0
ERROR: 4:146: 'assign' : implicit conversion between types not allowed in ES 2.0
ERROR: 4:146: '==' : wrong operand types no operation '==' exists that takes a left-hand operand of type 'uniform highp float' and a right operand of type 'const int' (or there is no acceptable conversion)
ERROR: 4:148: 'assign' : implicit conversion between types not allowed in ES 2.0
ERROR: 4:148: 'assign' : implicit conversion between types not allowed in ES 2.0
ERROR: 4:148: '==' : wrong operand types no operation '==' exists that takes a left-hand operand of type 'uniform highp float' and a right operand of type 'const int' (or there is no acceptable conversion)
ERROR: 4:150: 'assign' : implicit conversion between types not allowed in ES 2.0
ERROR: 4:150: 'assign' : implicit conversion between types not allowed in ES 2.0
ERROR: 4:150: '==' : wrong operand types no operation '==' exists that takes a left-hand operand of type 'uniform highp float' and a right operand of type 'const int' (or there is no acceptable conversion)
ERROR: 4:152: 'assign' : implicit conversion between types not allowed in ES 2.0
ERROR: 4:152: 'assign' : implicit conversion between types not allowed in ES 2.0
ERROR: 4:152: '==' : wrong operand types no operation '==' exists that takes a left-hand operand of type 'uniform highp float' and a right operand of type 'const int' (or there is no acceptable conversion)
ERROR: 4:170: 'GaussianBlur' : no matching overloaded function found - implicit conversion not allowed
ERROR: 4:170: 'GaussianBlur' : function is not known

*** Problematic Fragment shader source code ***
#version 110
#ifdef GL_KHR_blend_equation_advanced
#extension GL_ARB_fragment_coord_conventions : enable
#extension GL_KHR_blend_equation_advanced : enable
#endif
#define lowp
#define mediump
#define highp
#line 1
#ifdef GL_ES
// Set default precision to medium
precision mediump int;
precision mediump float;
#endif

//#include "qrc:/effects.glsl"

uniform sampler2D tex_y;
uniform sampler2D tex_u;
uniform sampler2D tex_v;
uniform float tex_format = 1.0;
uniform float alpha = 1.0;
uniform float tex_offset = 0;
uniform float imageWidth = 0;
uniform float imageHeight = 0;
uniform bool enableHDR = false;
uniform bool enableGaussianBlur = false;

varying vec2 textureOut;

float gamma = 2.2;
vec3 toLinear(in vec3 colour) { return pow(colour, vec3(gamma)); }
vec3 toHDR(in vec3 colour, in float range) { return toLinear(colour) * range; }
const float M_PI = 3.1415926535897932384626433832795;
vec4 GaussianBlur(sampler2D tex0, vec2 texCoordinates, float blurAmnt, int passingTurn, float sigma, float numBlurPixelsPerSide)
{
vec4 outputColor;
vec2 blurMultiplyVec;
if (passingTurn == 0) blurMultiplyVec = vec2(1.0, 0.0);
else blurMultiplyVec = vec2(0.0, 1.0);

// Incremental Gaussian Coefficent Calculation (See GPU Gems 3 pp. 877 - 889)
vec3 incrementalGaussian;
incrementalGaussian.x = 1.0 / (sqrt(2.0 * M_PI) * sigma);
incrementalGaussian.y = exp(-0.5f / (sigma * sigma));
incrementalGaussian.z = incrementalGaussian.y * incrementalGaussian.y;

vec4 avgValue = vec4(0.0, 0.0, 0.0, 0.0);
float coefficientSum = 0.0;

// Take the central sample first...
avgValue += texture2D(tex0, texCoordinates ) * incrementalGaussian.x;
coefficientSum += incrementalGaussian.x;
incrementalGaussian.xy *= incrementalGaussian.yz;

// Go through the remaining 8 vertical samples (4 on each side of the center)
for (float i = 1.0; i <= numBlurPixelsPerSide; i++)
{
    avgValue += texture2D(tex0, texCoordinates  - i * blurAmnt * blurMultiplyVec) * incrementalGaussian.x;
    avgValue += texture2D(tex0, texCoordinates  + i * blurAmnt * blurMultiplyVec) * incrementalGaussian.x;
    coefficientSum += 2.0 * incrementalGaussian.x;
    incrementalGaussian.xy *= incrementalGaussian.yz;
}

outputColor = avgValue / coefficientSum;

return outputColor;

}
void main()
{
if(textureOut.x > 1.0 - tex_offset){
gl_FragColor.a = 0;
gl_FragColor.r = 0;
gl_FragColor.g = 0;
gl_FragColor.b = 0;
return;
}
vec3 yuv;
vec4 rgba;
if(tex_format == 0 || tex_format == 1){
if(tex_format == 0){
yuv.r = texture2D(tex_y, textureOut).r - 0.0625;
}else{
yuv.r = texture2D(tex_y, textureOut).r;
}
yuv.g = texture2D(tex_u, textureOut).r - 0.5;
yuv.b = texture2D(tex_v, textureOut).r - 0.5;
}else if(tex_format == 2){ // rgb
yuv = texture2D(tex_y, textureOut).rgb;
}else if(tex_format == 3){ // gray8
yuv.r = texture2D(tex_y, textureOut).r;
}else if(tex_format == 6){ //BGR
yuv = texture2D(tex_y, textureOut).bgr;
}else if(tex_format == 10){//yuv420p10le yuv444p10le
vec3 yuv_l;
vec3 yuv_h;
yuv_l.x = texture2D(tex_y, textureOut).r;
yuv_h.x = texture2D(tex_y, textureOut).a;
yuv_l.y = texture2D(tex_u, textureOut).r;
yuv_h.y = texture2D(tex_u, textureOut).a;
yuv_l.z = texture2D(tex_v, textureOut).r;
yuv_h.z = texture2D(tex_v, textureOut).a;
yuv = (yuv_l * 255.0 + yuv_h * 255.0 * 256.0) / (1023.0) - vec3(16.0 / 255.0, 0.5, 0.5);
}else if(tex_format == 8 || tex_format == 9){ //NV12 | NV21
yuv.r = texture2D(tex_y, textureOut).r - 0.0625;
vec4 uv = texture2D( tex_u, textureOut);
if(tex_format == 9){ //NV21
yuv.g = uv.a - 0.5;
yuv.b = uv.r - 0.5;
}else{ //NV12
yuv.g = uv.r - 0.5;
yuv.b = uv.a - 0.5;
}
}else if(tex_format == 16 || tex_format == 17){ //YUV16 YUVJ16
if(tex_format == 16){
yuv.r = texture2D(tex_y, textureOut).r - 0.0625;
}else{
yuv.r = texture2D(tex_y, textureOut).r;
}
yuv.g = texture2D(tex_u, textureOut).r - 0.5;
yuv.b = texture2D(tex_v, textureOut).r - 0.5;
}

if(tex_format == 0 || tex_format == 10 || tex_format == 16){//yuv | p10le | //YUV16
    rgba.r = yuv.r + 1.596 * yuv.b;
    rgba.g = yuv.r - 0.813 * yuv.b - 0.391 * yuv.g;
    rgba.b = yuv.r + 2.018 * yuv.g;
}else if(tex_format == 1 || tex_format == 17){ //yuy-jpeg || YUVJ16
    rgba.r = yuv.r + 1.402 * yuv.b;
    rgba.g = yuv.r - 0.34413 * yuv.g - 0.71414 * yuv.b;
    rgba.b = yuv.r + 1.772 * yuv.g;
}
else if(tex_format == 2){ //rgb
    rgba.rgb = yuv.rgb;
}else if(tex_format == 3){ //gray8
    rgba.r = yuv.r;
    rgba.g = yuv.r;
    rgba.b = yuv.r;
}else if(tex_format == 6){ //BGR
    rgba.r = yuv.b;
    rgba.g = yuv.g;
    rgba.b = yuv.r;
}else if(tex_format == 19){ // BGGR
    vec2 firstRed = vec2(1,1);
    rgba.r = texture2D(tex_y, textureOut).r;
    rgba.g = texture2D(tex_u, textureOut).r;
    rgba.b = texture2D(tex_v, textureOut).r;
    //        //        BGGR = 19,
    //        //        RGGB = 20 ,
    //        //        GRBG = 21 ,
    //        //        GBRG = 22 ,
}else if(tex_format == 20){ //RGGB
    vec2 firstRed = vec2(0,0);
}else if(tex_format == 21){ //GRBG
    vec2 firstRed = vec2(0,1);
}else if(tex_format == 22){ //GBRG
    vec2 firstRed = vec2(1,0);
}else if(tex_format == 23){//BGR565
    rgba.rgb = texture2D(tex_y, textureOut).bgr;
}else{ //??????
    rgba.r = yuv.r + 1.596 * yuv.b;
    rgba.g = yuv.r - 0.813 * yuv.b - 0.391 * yuv.g;
    rgba.b = yuv.r + 2.018 * yuv.g;
}
rgba.a = alpha;
if(enableHDR){
    rgba.rgb = toHDR(rgba.rgb,1.0);
}
rgba.a = alpha;
gl_FragColor = rgba;

// sampler2D tex0, vec2 texCoordinates, float blurAmnt, int passingTurn, float sigma, float numBlurPixelsPerSide
if(enableGaussianBlur)//
{
gl_FragColor *= GaussianBlur(tex_y, textureOut, 0, 1, 1, 9);
}
else{
// gl_FragColor.a = 0.5;
}
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.