1
<?xml version="1.0" encoding="UTF-8"?>
2
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
3
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en_US" lang="en_US">
5
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
6
<title>Qt 4.7: videowidgetsurface.h Example File (multimedia/videowidget/videowidgetsurface.h)</title>
7
<link rel="stylesheet" type="text/css" href="style/style.css" />
8
<script src="scripts/jquery.js" type="text/javascript"></script>
9
<script src="scripts/functions.js" type="text/javascript"></script>
11
<body class="offline narrow creator">
12
<div class="header" id="qtdocheader">
15
<a href="index.html">Home</a></div>
16
<a href="index.html" class="qtref"><span>Qt Reference Documentation</span></a>
17
<div id="nav-topright">
19
<li class="nav-topright-home"><a href="http://qt.nokia.com/">Qt HOME</a></li>
20
<li class="nav-topright-dev"><a href="http://developer.qt.nokia.com/">DEV</a></li>
21
<li class="nav-topright-labs"><a href="http://labs.qt.nokia.com/blogs/">LABS</a></li>
22
<li class="nav-topright-doc nav-topright-doc-active"><a href="http://doc.qt.nokia.com/">
24
<li class="nav-topright-blog"><a href="http://blog.qt.nokia.com/">BLOG</a></li>
29
<li class="shortCut-topleft-inactive"><span><a href="index.html">Qt 4.7</a></span></li>
30
<li class="shortCut-topleft-active"><a href="http://doc.qt.nokia.com">ALL VERSIONS </a></li>
33
<ul class="sf-menu sf-js-enabled sf-shadow" id="narrowmenu">
34
<li><a href="#">API Lookup</a>
36
<li><a href="classes.html">Class index</a></li>
37
<li><a href="functions.html">Function index</a></li>
38
<li><a href="modules.html">Modules</a></li>
39
<li><a href="namespaces.html">Namespaces</a></li>
40
<li><a href="qtglobal.html">Global Declarations</a></li>
41
<li><a href="licensing.html">Licenses and Credits</a></li>
44
<li><a href="#">Qt Topics</a>
45
<ul id="topmenuTopic">
46
<li><a href="qt-basic-concepts.html">Programming with Qt</a></li>
47
<li><a href="qtquick.html">Device UI's & Qt Quick</a></li>
48
<li><a href="qt-gui-concepts.html">UI Design with Qt</a></li>
49
<li><a href="developing-with-qt.html">Cross-platform and Platform-specific</a></li>
50
<li><a href="platform-specific.html">Platform-specific info</a></li>
51
<li><a href="technology-apis.html">Qt and Key Technologies</a></li>
52
<li><a href="best-practices.html">How-To's and Best Practices</a></li>
55
<li><a href="#">Examples</a>
56
<ul id="topmenuexample">
57
<li><a href="all-examples.html">Examples</a></li>
58
<li><a href="tutorials.html">Tutorials</a></li>
59
<li><a href="demos.html">Demos</a></li>
60
<li><a href="qdeclarativeexamples.html">QML Examples</a></li>
70
<div class="bd group">
72
<div class="searchlabel">
75
<form id="qtdocsearch" action="" onsubmit="return false;">
77
<input type="text" name="searchstring" id="pageType" value="" />
81
<div class="box first bottombar" id="lookup">
82
<h2 title="API Lookup"><span></span>
84
<div id="list001" class="list">
86
<li class="defaultLink"><a href="classes.html">Class index</a></li>
87
<li class="defaultLink"><a href="functions.html">Function index</a></li>
88
<li class="defaultLink"><a href="modules.html">Modules</a></li>
89
<li class="defaultLink"><a href="namespaces.html">Namespaces</a></li>
90
<li class="defaultLink"><a href="qtglobal.html">Global Declarations</a></li>
91
<li class="defaultLink"><a href="qdeclarativeelements.html">QML elements</a></li>
95
<div class="box bottombar" id="topics">
96
<h2 title="Qt Topics"><span></span>
98
<div id="list002" class="list">
100
<li class="defaultLink"><a href="qt-basic-concepts.html">Programming with Qt</a></li>
101
<li class="defaultLink"><a href="qtquick.html">Device UI's & Qt Quick</a></li>
102
<li class="defaultLink"><a href="qt-gui-concepts.html">UI Design with Qt</a></li>
103
<li class="defaultLink"><a href="developing-with-qt.html">Cross-platform and Platform-specific</a></li>
104
<li class="defaultLink"><a href="platform-specific.html">Platform-specific info</a></li>
105
<li class="defaultLink"><a href="technology-apis.html">Qt and Key Technologies</a></li>
106
<li class="defaultLink"><a href="best-practices.html">How-To's and Best Practices</a></li>
110
<div class="box" id="examples">
111
<h2 title="Examples"><span></span>
113
<div id="list003" class="list">
115
<li class="defaultLink"><a href="all-examples.html">Examples</a></li>
116
<li class="defaultLink"><a href="tutorials.html">Tutorials</a></li>
117
<li class="defaultLink"><a href="demos.html">Demos</a></li>
118
<li class="defaultLink"><a href="qdeclarativeexamples.html">QML Examples</a></li>
124
<div class="toolbar">
125
<div class="breadcrumb toolblock">
127
<li class="first"><a href="index.html">Home</a></li>
128
<!-- Bread crumbs goes here -->
131
<div class="toolbuttons toolblock">
133
<li id="smallA" class="t_button">A</li>
134
<li id="medA" class="t_button active">A</li>
135
<li id="bigA" class="t_button">A</li>
136
<li id="print" class="t_button"><a href="javascript:this.print();">
137
<span>Print</span></a></li>
141
<div class="content">
142
<h1 class="title">videowidgetsurface.h Example File</h1>
143
<span class="small-subtitle">multimedia/videowidget/videowidgetsurface.h</span>
144
<!-- $$$multimedia/videowidget/videowidgetsurface.h-description -->
145
<div class="descr"> <a name="details"></a>
146
<pre class="highlightedCode brush: cpp"><span class="comment"> /****************************************************************************
148
** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
149
** All rights reserved.
150
** Contact: Nokia Corporation (qt-info@nokia.com)
152
** This file is part of the examples of the Qt Toolkit.
154
** $QT_BEGIN_LICENSE:BSD$
155
** You may use this file under the terms of the BSD license as follows:
157
** "Redistribution and use in source and binary forms, with or without
158
** modification, are permitted provided that the following conditions are
160
** * Redistributions of source code must retain the above copyright
161
** notice, this list of conditions and the following disclaimer.
162
** * Redistributions in binary form must reproduce the above copyright
163
** notice, this list of conditions and the following disclaimer in
164
** the documentation and/or other materials provided with the
166
** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
167
** the names of its contributors may be used to endorse or promote
168
** products derived from this software without specific prior written
171
** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
172
** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
173
** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
174
** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
175
** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
176
** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
177
** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
178
** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
179
** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
180
** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
181
** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
184
****************************************************************************/</span>
186
#ifndef VIDEOWIDGETSURFACE_H
187
#define VIDEOWIDGETSURFACE_H
189
#include <QtCore/QRect>
190
#include <QtGui/QImage>
191
#include <QtMultimedia/QAbstractVideoSurface>
192
#include <QtMultimedia/QVideoFrame>
194
class VideoWidgetSurface : public QAbstractVideoSurface
198
VideoWidgetSurface(QWidget *widget, QObject *parent = 0);
200
QList<QVideoFrame::PixelFormat> supportedPixelFormats(
201
QAbstractVideoBuffer::HandleType handleType = QAbstractVideoBuffer::NoHandle) const;
202
bool isFormatSupported(const QVideoSurfaceFormat &format, QVideoSurfaceFormat *similar) const;
204
bool start(const QVideoSurfaceFormat &format);
207
bool present(const QVideoFrame &frame);
209
QRect videoRect() const { return targetRect; }
210
void updateVideoRect();
212
void paint(QPainter *painter);
216
QImage::Format imageFormat;
220
QVideoFrame currentFrame;
225
<!-- @@@multimedia/videowidget/videowidgetsurface.h -->
226
<div class="feedback t_button">
227
[+] Documentation Feedback</div>
237
<acronym title="Copyright">©</acronym> 2008-2010 Nokia Corporation and/or its
238
subsidiaries. Nokia, Qt and their respective logos are trademarks of Nokia Corporation
239
in Finland and/or other countries worldwide.</p>
241
All other trademarks are property of their respective owners. <a title="Privacy Policy"
242
href="http://qt.nokia.com/about/privacy-policy">Privacy Policy</a></p>
245
Licensees holding valid Qt Commercial licenses may use this document in accordance with the Qt Commercial License Agreement provided with the Software or, alternatively, in accordance with the terms contained in a written agreement between you and Nokia.</p>
247
Alternatively, this document may be used under the terms of the <a href="http://www.gnu.org/licenses/fdl.html">GNU
248
Free Documentation License version 1.3</a>
249
as published by the Free Software Foundation.</p>
251
<div id="feedbackBox">
252
<div id="feedcloseX" class="feedclose t_button">X</div>
253
<form id="feedform" action="http://doc.qt.nokia.com/docFeedbck/feedback.php" method="get">
254
<p id="noteHead">Thank you for giving your feedback.</p> <p class="note">Make sure it is related to this specific page. For more general bugs and
255
requests, please use the <a href="http://bugreports.qt.nokia.com/secure/Dashboard.jspa">Qt Bug Tracker</a>.</p>
256
<p><textarea id="feedbox" name="feedText" rows="5" cols="40"></textarea></p>
257
<p><input id="feedsubmit" class="feedclose" type="submit" name="feedback" /></p>