A small, affordable computer with free resources to help people learn, make things, and have fun
https://forums.raspberrypi.com/
Code: Select all
Attribute Qt::AA_ShareOpenGLContexts must be set before QCoreApplication is created.
videowidgetsurface: "creating myQAbstractVideoSurface"
videowidgetsurface: "supportedPixelFormats" GLTextureHandle
videowidgetsurface: "stop"
0:00:04.631441253 1579 0x6d251980 WARN qtdemux qtdemux.c:7790:qtdemux_parse_container:<qtdemux0> length too long (1507328 > 27)
0:00:04.632760050 1579 0x6d251980 WARN qtdemux qtdemux.c:3237:qtdemux_parse_trex:<qtdemux0> failed to find fragment defaults for stream 1
0:00:04.633326454 1579 0x6d251980 WARN qtdemux qtdemux.c:3237:qtdemux_parse_trex:<qtdemux0> failed to find fragment defaults for stream 2
0:00:04.633658068 1579 0x6d251980 WARN qtdemux qtdemux.c:9865:qtdemux_parse_segments:<qtdemux0> Segment 0 extends to 0:00:09.801455555 past the end of the declared movie duration 0:00:09.676333333 movie segment will be extended
0:00:05.765046970 1579 0x6dc08690 WARN audio-resampler audio-resampler.c:275:convert_taps_gint32_c: can't find exact taps
videowidgetsurface: "start" QVideoSurfaceFormat(Format_ABGR32, QSize(1366, 768), viewport=QRect(0,0 1366x768), pixelAspectRatio=QSize(1, 1), handleType=GLTextureHandle, yCbCrColorSpace=YCbCr_Undefined)
0:00:06.268449235 1579 0x6c807720 ERROR omx gstomx.c:3138:gst_omx_port_populate_unlocked:<omxh264dec-omxh264dec0> Populated egl_render port 221: Incorrect state operation (0x80001018)
0:00:06.268636318 1579 0x6c807720 WARN omxvideodec gstomxvideodec.c:1940:gst_omx_video_dec_loop:<omxh264dec-omxh264dec0> error: Unable to reconfigure output port
videowidgetsurface: "stop"
videowidgetsurface: "stop"
Error: "Could not configure supporting library."
appsrc: push buffer wrong state
Code: Select all
QImage image( currentFrame.width(), currentFrame.height(), QImage::Format_RGB16 );
GLint format = 0;
GLint type = 0;
QOpenGLContext* ctx = QOpenGLContext::currentContext();
QOpenGLFunctions* f = ctx->functions();
GLuint framebuffer;
GLuint depthRenderbuffer;
GLCHK(f->glGetIntegerv( GL_FRAMEBUFFER_BINDING, &prevFbo ));
GLCHK(f->glGenFramebuffers(1, &framebuffer));
GLCHK(f->glBindFramebuffer(GL_FRAMEBUFFER, framebuffer));
GLCHK(f->glGenRenderbuffers(1, &depthRenderbuffer));
GLCHK(f->glBindTexture(GL_TEXTURE_2D, texture));
GLCHK(f->glBindRenderbuffer(GL_RENDERBUFFER, depthRenderbuffer));
GLCHK(f->glRenderbufferStorage(GL_RENDERBUFFER, GL_DEPTH_COMPONENT16, texWidth, texHeight));
GLCHK(f->glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, texture, 0));
GLCHK(f->glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_RENDERBUFFER, depthRenderbuffer));
status = glCheckFramebufferStatus(GL_FRAMEBUFFER);
if(status != GL_FRAMEBUFFER_COMPLETE) {
qCDebug(LOG_RESERV) <<"Problem with OpenGL framebuffer" << status;
} else {
qCDebug(LOG_RESERV) << "FBO creation succedded";
}
GLCHK(f->glReadPixels( 0, 0, texWidth, texHeight, GL_RGBA, GL_UNSIGNED_BYTE, image.bits() ));
GLCHK(f->glBindTexture(GL_TEXTURE_2D, 0));
GLCHK(f->glBindFramebuffer(GL_FRAMEBUFFER, prevFbo));
Code: Select all
GstGLMemory *glmem = GST_GL_MEMORY_CAST(gst_buffer_peek_memory(buffer, 0));
guint textureId = gst_gl_memory_get_texture_id(glmem);
videoBuffer = new QGstVideoBuffer(buffer, m_videoInfo, m_format.handleType(), textureId);
...
if (!videoBuffer)
videoBuffer = new QGstVideoBuffer(buffer, m_videoInfo);
QVideoFrame frame(
videoBuffer,
m_format.frameSize(),
m_format.pixelFormat());
QGstUtils::setFrameTimeStamps(&frame, buffer);
return surface->present(frame); // here
Code: Select all
int w = Util::nextPOT(size.width());
int h = Util::nextPOT(size.height());
vcsm_info.width = w;
vcsm_info.height = h;
vcsm_init();
const EGLint attrib[] = {
EGL_IMAGE_PRESERVED_KHR, EGL_TRUE,
EGL_NONE, EGL_NONE
};
eglFbImage = eglCreateImageKHR(eglGetCurrentDisplay(), EGL_NO_CONTEXT, EGL_IMAGE_BRCM_VCSM, &vcsm_info, attrib);
if (eglFbImage == EGL_NO_IMAGE_KHR || vcsm_info.vcsm_handle == 0) {
qCDebug(LOG_RESERV) << QString("%1: Failed to create EGL VCSM image\n").arg(VCOS_FUNCTION);
}else{
qCDebug(LOG_RESERV) << QString(" *********** VCSM Image created with %1 %2 ").arg(w).arg(h);
}
Code: Select all
QOpenGLFunctions* f = ctx->functions();
GLuint framebuffer;
GLuint depthRenderbuffer;
GLint prevFbo;
GLenum status = GL_FRAMEBUFFER_COMPLETE;
GLuint texture = static_cast<GLuint>( currentFrame.handle().toInt() );
int texWidth = Util::nextPOT(currentFrame.width());
int texHeight = Util::nextPOT(currentFrame.height());
GLCHK(f->glGetIntegerv( GL_FRAMEBUFFER_BINDING, &prevFbo ));
GLCHK(f->glGenFramebuffers(1, &framebuffer));
GLCHK(f->glBindFramebuffer(GL_FRAMEBUFFER, framebuffer));
GLCHK(glActiveTexture(GL_TEXTURE0));
GLCHK(glBindTexture(GL_TEXTURE_2D, texture));
GLCHK(glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST));
GLCHK(glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST));
GLCHK(glEGLImageTargetTexture2DOES(GL_TEXTURE_2D, eglFbImage));
GLCHK(f->glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, texture, 0));
GLCHK(glBindTexture(GL_TEXTURE_2D, 0));
status = glCheckFramebufferStatus(GL_FRAMEBUFFER);
if(status != GL_FRAMEBUFFER_COMPLETE) {
qCDebug(LOG_RESERV) <<"Problem with OpenGL framebuffer after specifying color render buffer: " << status;
} else {
qCDebug(LOG_RESERV) << "FBO creation succedded";
}
GLCHK(f->glFinish());
uint8_t *vcsmBuffer;
VCSM_CACHE_TYPE_T cacheType;
vcsmBuffer = (uint8_t*)vcsm_lock_cache(vcsm_info.vcsm_handle, VCSM_CACHE_TYPE_HOST, &cacheType);
if (!vcsmBuffer){
qCDebug(LOG_RESERV) << "Failed to lock VCSM buffer!";
}else{
unsigned char *line_start = (unsigned char *) vcsmBuffer;
for (int i = 0; i < texHeight; i++) {
QString s;
QString result = "";
for(int j=0; j < texWidth; j++){
s = QString("%1").arg(line_start[j],0,16);
result.append(s);
}
qCDebug(LOG_RESERV) << result;
line_start += texWidth;
}
}
vcsm_unlock_ptr(vcsmBuffer);
....