Miam-Player  0.8.0
A nice music player
SurfaceInterop.h
Go to the documentation of this file.
1 /******************************************************************************
2  QtAV: Multimedia framework based on Qt and FFmpeg
3  Copyright (C) 2012-2016 Wang Bin <wbsecg1@gmail.com>
4 
5 * This file is part of QtAV (from 2014)
6 
7  This library is free software; you can redistribute it and/or
8  modify it under the terms of the GNU Lesser General Public
9  License as published by the Free Software Foundation; either
10  version 2.1 of the License, or (at your option) any later version.
11 
12  This library is distributed in the hope that it will be useful,
13  but WITHOUT ANY WARRANTY; without even the implied warranty of
14  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15  Lesser General Public License for more details.
16 
17  You should have received a copy of the GNU Lesser General Public
18  License along with this library; if not, write to the Free Software
19  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 ******************************************************************************/
21 
22 #ifndef QTAV_SURFACEINTEROP_H
23 #define QTAV_SURFACEINTEROP_H
24 
25 #include <QtCore/QSharedPointer>
26 #include <QtAV/VideoFormat.h>
27 
28 namespace QtAV {
29 
31 {
32 public:
33  virtual ~VideoSurfaceInterop() {}
46  virtual void* map(SurfaceType type, const VideoFormat& fmt, void* handle = 0, int plane = 0) {
47  Q_UNUSED(type);
48  Q_UNUSED(fmt);
49  Q_UNUSED(handle);
50  Q_UNUSED(plane);
51  return 0;
52  }
53  // TODO: SurfaceType. unmap is currenty used by opengl rendering
54  virtual void unmap(void* handle) { Q_UNUSED(handle);}
55  //virtual void unmap(void* handle, SurfaceType type) { Q_UNUSED(handle);} //for SourceSurfaceType
62  virtual void* createHandle(void* handle, SurfaceType type, const VideoFormat &fmt, int plane, int planeWidth, int planeHeight) {
63  Q_UNUSED(handle);
64  Q_UNUSED(type);
65  Q_UNUSED(fmt);
66  Q_UNUSED(plane);
67  Q_UNUSED(planeWidth);
68  Q_UNUSED(planeHeight);
69  return 0;
70  }
71 };
72 
73 typedef QSharedPointer<VideoSurfaceInterop> VideoSurfaceInteropPtr;
74 } //namespace QtAV
75 
76 Q_DECLARE_METATYPE(QtAV::VideoSurfaceInteropPtr)
77 
78 #endif // QTAV_SURFACEINTEROP_H
virtual void * createHandle(void *handle, SurfaceType type, const VideoFormat &fmt, int plane, int planeWidth, int planeHeight)
createHandle It is used by opengl renderer to create a texture when rendering frame from VDA/VideoToo...
Definition: SurfaceInterop.h:62
QSharedPointer< VideoSurfaceInterop > VideoSurfaceInteropPtr
Definition: SurfaceInterop.h:73
#define Q_AV_EXPORT
Definition: QtAV_Global.h:40
The VideoFormat class Describes the layout of video data.
Definition: VideoFormat.h:39
virtual ~VideoSurfaceInterop()
Definition: SurfaceInterop.h:33
SurfaceType
The SurfaceType enum HostMemorySurface: Map the decoded frame to host memory GLTextureSurface: Map th...
Definition: QtAV_Global.h:152
virtual void unmap(void *handle)
Definition: SurfaceInterop.h:54
AudioOutput ao; ao.setAudioFormat(fmt); ao.open(); while (has_data) { data = read_data(ao->bufferSize...
Definition: AudioDecoder.h:31
Definition: SurfaceInterop.h:30
virtual void * map(SurfaceType type, const VideoFormat &fmt, void *handle=0, int plane=0)
map currently is used to map a frame from hardware decoder to opengl texture, host memory...
Definition: SurfaceInterop.h:46