Skip to content

Commit

Permalink
gl: change dir
Browse files Browse the repository at this point in the history
  • Loading branch information
wang-bin committed Mar 25, 2016
1 parent ebf9a1c commit e86135b
Show file tree
Hide file tree
Showing 21 changed files with 45 additions and 37 deletions.
1 change: 1 addition & 0 deletions src/QtAV/GLSLFilter.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ class Q_AV_EXPORT GLSLFilter : public VideoFilter
*/
QSize outputSize() const;
void setOutputSize(const QSize& value);
void setOutputSize(int width, int height);
Q_SIGNALS:
void outputSizeChanged(const QSize& size);
protected:
Expand Down
2 changes: 1 addition & 1 deletion src/QtAV/OpenGLWindowRenderer.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/******************************************************************************
QtAV: Media play library based on Qt and FFmpeg
QtAV: Multimedia framework based on Qt and FFmpeg
Copyright (C) 2014-2016 Wang Bin <[email protected]>
* This file is part of QtAV
Expand Down
2 changes: 1 addition & 1 deletion src/codec/video/SurfaceInteropCUDA.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
#include "cuda_api.h"
#include <QtCore/QWeakPointer>
#include "QtAV/SurfaceInterop.h"
#include "utils/OpenGLHelper.h"
#include "opengl/OpenGLHelper.h"
#ifndef QT_NO_OPENGL
#ifdef Q_OS_WIN
// no need to check qt4 because no ANGLE there
Expand Down
2 changes: 1 addition & 1 deletion src/codec/video/SurfaceInteropCV.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

#include "SurfaceInteropCV.h"
#include "QtAV/VideoFrame.h"
#include "utils/OpenGLHelper.h"
#include "opengl/OpenGLHelper.h"

namespace QtAV {
typedef struct {
Expand Down
2 changes: 1 addition & 1 deletion src/codec/video/SurfaceInteropCVOpenGLES.mm
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
#include <CoreVideo/CVOpenGLESTexture.h>
#import <OpenGLES/EAGL.h>
#include "QtAV/VideoFrame.h"
#include "utils/OpenGLHelper.h"
#include "opengl/OpenGLHelper.h"

namespace QtAV {
namespace cv {
Expand Down
8 changes: 5 additions & 3 deletions src/codec/video/SurfaceInteropDXVA.cpp
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/******************************************************************************
QtAV: Media play library based on Qt and FFmpeg
Copyright (C) 2015 Wang Bin <[email protected]>
QtAV: Multimedia framework based on Qt and FFmpeg
Copyright (C) 2012-2016 Wang Bin <[email protected]>
* This file is part of QtAV
* This file is part of QtAV (from 2015)
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
Expand Down Expand Up @@ -128,6 +128,7 @@ void* SurfaceInteropDXVA::mapToHost(const VideoFormat &format, void *handle, int
const bool swap_uv = desc.Format == MAKEFOURCC('I','M','C','3');
// try to use SSE. fallback to normal copy if SSE is not supported
VideoFrame frame(VideoFrame::fromGPU(fmt, frame_width, frame_height, desc.Height, src, pitch, true, swap_uv));
// TODO: check rgb32 because d3d can use hw to convert
if (format != fmt)
frame = frame.to(format);
VideoFrame *f = reinterpret_cast<VideoFrame*>(handle);
Expand Down Expand Up @@ -190,6 +191,7 @@ void EGLInteropResource::releaseEGL() {
bool EGLInteropResource::ensureSurface(int w, int h) {
if (dx_surface && width == w && height == h)
return true;
//TODO: use eglChooseConfig
#if QTAV_HAVE(GUI_PRIVATE)
QPlatformNativeInterface *nativeInterface = QGuiApplication::platformNativeInterface();
egl->dpy = static_cast<EGLDisplay>(nativeInterface->nativeResourceForContext("eglDisplay", QOpenGLContext::currentContext()));
Expand Down
8 changes: 4 additions & 4 deletions src/codec/video/SurfaceInteropDXVA.h
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/******************************************************************************
QtAV: Media play library based on Qt and FFmpeg
Copyright (C) 2015 Wang Bin <[email protected]>
QtAV: Multimedia framework based on Qt and FFmpeg
Copyright (C) 2012-2016 Wang Bin <[email protected]>
* This file is part of QtAV
* This file is part of QtAV (from 2015)
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
Expand All @@ -23,7 +23,7 @@
#define QTAV_SURFACEINTEROPDXVA_H
#include <d3d9.h>
#include "QtAV/SurfaceInterop.h"
#include "utils/OpenGLHelper.h"
#include "opengl/OpenGLHelper.h"
// no need to check qt4 because no ANGLE there
#if QTAV_HAVE(EGL_CAPI) // always use dynamic load
#if defined(QT_OPENGL_DYNAMIC) || defined(QT_OPENGL_ES_2) || defined(QT_OPENGL_ES_2_ANGLE)
Expand Down
4 changes: 2 additions & 2 deletions src/codec/video/SurfaceInteropIOSurface.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/******************************************************************************
QtAV: Media play library based on Qt and FFmpeg
QtAV: Multimedia framework based on Qt and FFmpeg
Copyright (C) 2012-2016 Wang Bin <[email protected]>
* This file is part of QtAV (from 2016)
Expand All @@ -22,7 +22,7 @@
#include "SurfaceInteropCV.h"
#include <IOSurface/IOSurface.h>
#include "QtAV/VideoFrame.h"
#include "utils/OpenGLHelper.h"
#include "opengl/OpenGLHelper.h"

namespace QtAV {
namespace cv {
Expand Down
4 changes: 2 additions & 2 deletions src/codec/video/VideoDecoderVDA.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/******************************************************************************
QtAV: Media play library based on Qt and FFmpeg
QtAV: Multimedia framework based on Qt and FFmpeg
Copyright (C) 2012-2016 Wang Bin <[email protected]>
* This file is part of QtAV (from 2014)
Expand All @@ -25,7 +25,7 @@
#include "QtAV/SurfaceInterop.h"
#include "QtAV/private/AVCompat.h"
#include "QtAV/private/factory.h"
#include "utils/OpenGLHelper.h"
#include "opengl/OpenGLHelper.h"
#include <assert.h>
#ifdef __cplusplus
extern "C" {
Expand Down
7 changes: 6 additions & 1 deletion src/filter/GLSLFilter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
#include "QtAV/GLSLFilter.h"
#include "QtAV/private/Filter_p.h"
#include "QtAV/VideoFrame.h"
#include "utils/OpenGLHelper.h"
#include "opengl/OpenGLHelper.h"
#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
#include <QtGui/QOpenGLFramebufferObject>
#else
Expand Down Expand Up @@ -72,6 +72,11 @@ void GLSLFilter::setOutputSize(const QSize &value)
Q_EMIT outputSizeChanged(value);
}

void GLSLFilter::setOutputSize(int width, int height)
{
setOutputSize(QSize(width, height));
}

void GLSLFilter::process(Statistics *statistics, VideoFrame *frame)
{
Q_UNUSED(statistics);
Expand Down
12 changes: 6 additions & 6 deletions src/libQtAV.pro
Original file line number Diff line number Diff line change
Expand Up @@ -319,16 +319,16 @@ config_gl|config_opengl {
SDK_PRIVATE_HEADERS = \
QtAV/private/OpenGLRendererBase_p.h
HEADERS *= \
utils/OpenGLHelper.h \
ShaderManager.h
opengl/OpenGLHelper.h \
opengl/ShaderManager.h
SOURCES *= \
filter/GLSLFilter.cpp \
output/video/OpenGLRendererBase.cpp \
OpenGLVideo.cpp \
VideoShader.cpp \
ShaderManager.cpp \
opengl/OpenGLVideo.cpp \
opengl/VideoShader.cpp \
opengl/ShaderManager.cpp \
opengl/ConvolutionShader.cpp \
utils/OpenGLHelper.cpp
opengl/OpenGLHelper.cpp
}
config_openglwindow {
SDK_HEADERS *= QtAV/OpenGLWindowRenderer.h
Expand Down
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion src/OpenGLVideo.cpp → src/opengl/OpenGLVideo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
#include "QtAV/SurfaceInterop.h"
#include "QtAV/VideoShader.h"
#include "ShaderManager.h"
#include "utils/OpenGLHelper.h"
#include "opengl/OpenGLHelper.h"
#include "utils/Logger.h"

namespace QtAV {
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion src/ShaderManager.h → src/opengl/ShaderManager.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/******************************************************************************
QtAV: Media play library based on Qt and FFmpeg
QtAV: Multimedia framework based on Qt and FFmpeg
Copyright (C) 2012-2016 Wang Bin <[email protected]>
* This file is part of QtAV (from 2014)
Expand Down
2 changes: 1 addition & 1 deletion src/VideoShader.cpp → src/opengl/VideoShader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
#include "QtAV/VideoShader.h"
#include "QtAV/private/VideoShader_p.h"
#include "ColorTransform.h"
#include "utils/OpenGLHelper.h"
#include "opengl/OpenGLHelper.h"
#include <cmath>
#include <QtCore/QCoreApplication>
#include <QtCore/QFile>
Expand Down
2 changes: 1 addition & 1 deletion src/output/video/OpenGLRendererBase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
#include "QtAV/OpenGLVideo.h"
#include "QtAV/FilterContext.h"
#include <QResizeEvent>
#include "utils/OpenGLHelper.h"
#include "opengl/OpenGLHelper.h"
#include "utils/Logger.h"

namespace QtAV {
Expand Down
6 changes: 3 additions & 3 deletions src/output/video/OpenGLWindowRenderer.cpp
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/******************************************************************************
QtAV: Media play library based on Qt and FFmpeg
Copyright (C) 2014-2015 Wang Bin <[email protected]>
QtAV: Multimedia framework based on Qt and FFmpeg
Copyright (C) 2012-2016 Wang Bin <[email protected]>
* This file is part of QtAV
* This file is part of QtAV (from 2014)
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
Expand Down
8 changes: 4 additions & 4 deletions src/vaapi/SurfaceInteropVAAPI.cpp
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/******************************************************************************
QtAV: Media play library based on Qt and FFmpeg
Copyright (C) 2014-2016 Wang Bin <[email protected]>
QtAV: Multimedia framework based on Qt and FFmpeg
Copyright (C) 2012-2016 Wang Bin <[email protected]>
* This file is part of QtAV
* This file is part of QtAV (from 2014)
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
Expand All @@ -22,7 +22,7 @@

#include "SurfaceInteropVAAPI.h"
#ifndef QT_NO_OPENGL
#include "utils/OpenGLHelper.h"
#include "opengl/OpenGLHelper.h"
#include "QtAV/VideoFrame.h"
#include "utils/Logger.h"
#if VA_X11_INTEROP
Expand Down
8 changes: 4 additions & 4 deletions src/vaapi/SurfaceInteropVAAPI.h
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/******************************************************************************
QtAV: Media play library based on Qt and FFmpeg
Copyright (C) 2014-2015 Wang Bin <[email protected]>
QtAV: Multimedia framework based on Qt and FFmpeg
Copyright (C) 2012-2016 Wang Bin <[email protected]>
* This file is part of QtAV
* This file is part of QtAV (from 2014)
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
Expand Down Expand Up @@ -63,7 +63,7 @@ class SurfaceInteropVAAPI Q_DECL_FINAL: public VideoSurfaceInterop
{
public:
SurfaceInteropVAAPI(const InteropResourcePtr& res) : frame_width(0), frame_height(0), m_resource(res) {}
void setSurface(const surface_ptr& surface, int w, int h); // use surface->width/height if w/h is 0
void setSurface(const surface_ptr& surface, int w, int h); // use surface->width/height if w/h is 0
void* map(SurfaceType type, const VideoFormat& fmt, void* handle, int plane) Q_DECL_OVERRIDE;
void unmap(void *handle) Q_DECL_OVERRIDE;
protected:
Expand Down

0 comments on commit e86135b

Please sign in to comment.