Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
mfevrvideowindowcontrol.cpp
Go to the documentation of this file.
1// Copyright (C) 2016 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
5
6#include <qdebug.h>
7
10 , m_currentActivate(NULL)
11 , m_evrSink(NULL)
12{
13}
14
19
20void MFEvrVideoWindowControl::clear()
21{
22 setEvr(NULL);
23
24 if (m_evrSink)
25 m_evrSink->Release();
26 if (m_currentActivate) {
27 m_currentActivate->ShutdownObject();
28 m_currentActivate->Release();
29 }
30 m_evrSink = NULL;
31 m_currentActivate = NULL;
32}
33
35{
36 clear();
37
38 if (FAILED(MFCreateVideoRendererActivate(0, &m_currentActivate))) {
39 qWarning() << "Failed to create evr video renderer activate!";
40 return NULL;
41 }
42 if (FAILED(m_currentActivate->ActivateObject(IID_IMFMediaSink, (LPVOID*)(&m_evrSink)))) {
43 qWarning() << "Failed to activate evr media sink!";
44 return NULL;
45 }
46 if (!setEvr(m_evrSink))
47 return NULL;
48
49 return m_currentActivate;
50}
51
MFEvrVideoWindowControl(QVideoSink *parent=0)
The QVideoSink class represents a generic sink for video data.
Definition qvideosink.h:22
#define qWarning
Definition qlogging.h:166