Skip to content

Commit

Permalink
VideoFrame: remove useless functions
Browse files Browse the repository at this point in the history
May add an api to create from textures, an interop object will be used
internally. To get the texture, we can use like this
map(SourceSurface,...)
  • Loading branch information
wang-bin committed Jan 14, 2016
1 parent 4d9ac64 commit 4a9e705
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 32 deletions.
8 changes: 4 additions & 4 deletions src/QtAV/CommonTypes.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/******************************************************************************
QtAV: Media play library based on Qt and FFmpeg
Copyright (C) 2014-2015 Wang Bin <[email protected]>
Copyright (C) 2014-2016 Wang Bin <[email protected]>
* This file is part of QtAV
Expand Down Expand Up @@ -73,7 +73,7 @@ enum ColorSpace {
* Map the decoded frame to host memory
* GLTextureSurface:
* Map the decoded frame as an OpenGL texture
* DecoderSurface:
* SourceSurface:
* get the original surface from decoder, for example VASurfaceID for va-api, CUdeviceptr for CUDA and IDirect3DSurface9* for DXVA.
* Zero copy mode is required.
* UserSurface:
Expand All @@ -82,8 +82,8 @@ enum ColorSpace {
enum SurfaceType {
HostMemorySurface,
GLTextureSurface,
DecoderSurface,
UserSurface
SourceSurface,
UserSurface = 0xffff
};

} //namespace QtAV
Expand Down
8 changes: 0 additions & 8 deletions src/QtAV/VideoFrame.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ class Q_AV_EXPORT VideoFrame : public Frame
VideoFrame(int width, int height, const VideoFormat& format, const QByteArray& data = QByteArray());
//set planes and linesize manually or call init
QTAV_DEPRECATED VideoFrame(const QByteArray& data, int width, int height, const VideoFormat& format);
VideoFrame(const QVector<int>& textures, int width, int height, const VideoFormat& format);
VideoFrame(const QImage& image);
VideoFrame(const VideoFrame &other);
~VideoFrame();
Expand Down Expand Up @@ -126,13 +125,6 @@ class Q_AV_EXPORT VideoFrame : public Frame
* \return null on error. otherwise return the input handle
*/
void* createInteropHandle(void* handle, SurfaceType type, int plane);
//copy to host. Used if gpu filter not supported. To avoid copy too frequent, sort the filters first?
//bool mapToHost();
/*!
texture in FBO. we can use texture in FBO through filter pipeline then switch to window context to display
return -1 if no texture, not uploaded
*/
int texture(int plane = 0) const; //TODO: remove
};

class ImageConverter;
Expand Down
20 changes: 0 additions & 20 deletions src/VideoFrame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,6 @@ class VideoFramePrivate : public FramePrivate
, color_space(ColorSpace_Unknow)
, displayAspectRatio(0)
, format(VideoFormat::Format_Invalid)
, textures(4, 0)
{}
VideoFramePrivate(int w, int h, const VideoFormat& fmt)
: FramePrivate()
Expand All @@ -129,23 +128,19 @@ class VideoFramePrivate : public FramePrivate
, color_space(ColorSpace_Unknow)
, displayAspectRatio(0)
, format(fmt)
, textures(4, 0)
{
if (!format.isValid())
return;
planes.resize(format.planeCount());
line_sizes.resize(format.planeCount());
textures.resize(format.planeCount());
planes.reserve(format.planeCount());
line_sizes.reserve(format.planeCount());
textures.reserve(format.planeCount());
}
~VideoFramePrivate() {}
int width, height;
ColorSpace color_space;
float displayAspectRatio;
VideoFormat format;
QVector<int> textures;
QScopedPointer<QImage> qt_image;

VideoSurfaceInteropPtr surface_interop;
Expand All @@ -170,13 +165,6 @@ VideoFrame::VideoFrame(const QByteArray& data, int width, int height, const Vide
d->data = data;
}

VideoFrame::VideoFrame(const QVector<int>& textures, int width, int height, const VideoFormat &format)
: Frame(new VideoFramePrivate(width, height, format))
{
Q_D(VideoFrame);
d->textures = textures;
}

VideoFrame::VideoFrame(const QImage& image)
: Frame(new VideoFramePrivate(image.width(), image.height(), VideoFormat(image.format())))
{
Expand Down Expand Up @@ -465,14 +453,6 @@ void* VideoFrame::createInteropHandle(void* handle, SurfaceType type, int plane)
return d->surface_interop->createHandle(handle, type, format(), plane, planeWidth(plane), planeHeight(plane));
}

int VideoFrame::texture(int plane) const
{
Q_D(const VideoFrame);
if (d->textures.size() <= plane)
return -1;
return d->textures[plane];
}

VideoFrameConverter::VideoFrameConverter()
: m_cvt(0)
{
Expand Down

0 comments on commit 4a9e705

Please sign in to comment.