Qt 4.8
Public Functions | List of all members
QMemoryVideoBuffer Class Reference

The QMemoryVideoBuffer class provides a system memory allocated video data buffer. More...

#include <qmemoryvideobuffer_p.h>

Inheritance diagram for QMemoryVideoBuffer:
QAbstractVideoBuffer

Public Functions

ucharmap (MapMode mode, int *numBytes, int *bytesPerLine)
 Reimplemented Function More...
 
MapMode mapMode () const
 Reimplemented Function More...
 
 QMemoryVideoBuffer (const QByteArray &data, int bytesPerLine)
 Constructs a video buffer with an image stride of bytesPerLine from a byte array. More...
 
void unmap ()
 Reimplemented Function More...
 
 ~QMemoryVideoBuffer ()
 Destroys a system memory allocated video buffer. More...
 
- Public Functions inherited from QAbstractVideoBuffer
virtual QVariant handle () const
 Returns a type specific handle to the data buffer. More...
 
HandleType handleType () const
 Returns the type of a video buffer's handle. More...
 
 QAbstractVideoBuffer (HandleType type)
 Constructs an abstract video buffer of the given type. More...
 
virtual ~QAbstractVideoBuffer ()
 Destroys an abstract video buffer. More...
 

Additional Inherited Members

- Public Types inherited from QAbstractVideoBuffer
enum  HandleType {
  NoHandle, GLTextureHandle, XvShmImageHandle, CoreImageHandle,
  QPixmapHandle, UserHandle = 1000
}
 Identifies the type of a video buffers handle. More...
 
enum  MapMode { NotMapped = 0x00, ReadOnly = 0x01, WriteOnly = 0x02, ReadWrite = ReadOnly | WriteOnly }
 Enumerates how a video buffer's data is mapped to memory. More...
 
- Protected Functions inherited from QAbstractVideoBuffer
 QAbstractVideoBuffer (QAbstractVideoBufferPrivate &dd, HandleType type)
 
- Protected Variables inherited from QAbstractVideoBuffer
QAbstractVideoBufferPrivated_ptr
 

Detailed Description

The QMemoryVideoBuffer class provides a system memory allocated video data buffer.

Warning
This function is not part of the public interface.

QMemoryVideoBuffer is the default video buffer for allocating system memory. It may be used to allocate memory for a QVideoFrame without implementing your own QAbstractVideoBuffer.

Definition at line 66 of file qmemoryvideobuffer_p.h.

Constructors and Destructors

◆ QMemoryVideoBuffer()

QMemoryVideoBuffer::QMemoryVideoBuffer ( const QByteArray data,
int  bytesPerLine 
)

Constructs a video buffer with an image stride of bytesPerLine from a byte array.

Definition at line 78 of file qmemoryvideobuffer.cpp.

80 {
82 
83  d->data = array;
84  d->bytesPerLine = bytesPerLine;
85 }
double d
Definition: qnumeric_p.h:62
#define Q_D(Class)
Definition: qglobal.h:2482
QAbstractVideoBuffer(HandleType type)
Constructs an abstract video buffer of the given type.
The QMemoryVideoBuffer class provides a system memory allocated video data buffer.

◆ ~QMemoryVideoBuffer()

QMemoryVideoBuffer::~QMemoryVideoBuffer ( )

Destroys a system memory allocated video buffer.

Definition at line 90 of file qmemoryvideobuffer.cpp.

91 {
92 }

Functions

◆ map()

uchar * QMemoryVideoBuffer::map ( MapMode  mode,
int *  numBytes,
int *  bytesPerLine 
)
virtual

Reimplemented Function

Implements QAbstractVideoBuffer.

Definition at line 105 of file qmemoryvideobuffer.cpp.

106 {
108 
109  if (d->mapMode == NotMapped && d->data.data() && mode != NotMapped) {
110  d->mapMode = mode;
111 
112  if (numBytes)
113  *numBytes = d->data.size();
114 
115  if (bytesPerLine)
116  *bytesPerLine = d->bytesPerLine;
117 
118  return reinterpret_cast<uchar *>(d->data.data());
119  } else {
120  return 0;
121  }
122 }
double d
Definition: qnumeric_p.h:62
#define Q_D(Class)
Definition: qglobal.h:2482
unsigned char uchar
Definition: qglobal.h:994
The QMemoryVideoBuffer class provides a system memory allocated video data buffer.

◆ mapMode()

QAbstractVideoBuffer::MapMode QMemoryVideoBuffer::mapMode ( ) const
virtual

Reimplemented Function

Implements QAbstractVideoBuffer.

Definition at line 97 of file qmemoryvideobuffer.cpp.

98 {
99  return d_func()->mapMode;
100 }

◆ unmap()

void QMemoryVideoBuffer::unmap ( )
virtual

Reimplemented Function

Implements QAbstractVideoBuffer.

Definition at line 127 of file qmemoryvideobuffer.cpp.

128 {
129  d_func()->mapMode = NotMapped;
130 }

The documentation for this class was generated from the following files: