Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
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
9
11 : EvrVideoWindowControl(parent)
12 , m_currentActivate(NULL)
13 , m_evrSink(NULL)
14{
15}
16
17MFEvrVideoWindowControl::~MFEvrVideoWindowControl()
18{
19 clear();
20}
21
22void MFEvrVideoWindowControl::clear()
23{
24 setEvr(NULL);
25
26 if (m_evrSink)
27 m_evrSink->Release();
28 if (m_currentActivate) {
29 m_currentActivate->ShutdownObject();
30 m_currentActivate->Release();
31 }
32 m_evrSink = NULL;
33 m_currentActivate = NULL;
34}
35
37{
38 clear();
39
40 if (FAILED(MFCreateVideoRendererActivate(0, &m_currentActivate))) {
41 qWarning() << "Failed to create evr video renderer activate!";
42 return NULL;
43 }
44 if (FAILED(m_currentActivate->ActivateObject(IID_IMFMediaSink, (LPVOID*)(&m_evrSink)))) {
45 qWarning() << "Failed to activate evr media sink!";
46 return NULL;
47 }
48 if (!setEvr(m_evrSink))
49 return NULL;
50
51 return m_currentActivate;
52}
53
55{
56 clear();
57}
58
59QT_END_NAMESPACE
QObject * parent
Definition qobject.h:73
The QVideoSink class represents a generic sink for video data.
Definition qvideosink.h:22