Skip to content

Commit 552aecc

Browse files
committed
The CX Purge
1 parent 55af2ad commit 552aecc

21 files changed

+24
-1589
lines changed

windows/wrapper/impl_org_webRtc_EventQueue.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11

22
#ifdef WINUWP
33

4-
#ifdef __cplusplus_winrt
5-
#include <windows.ui.core.h>
6-
#endif //__cplusplus_winrt
7-
84
#ifdef __has_include
95
#if __has_include(<winrt/windows.ui.core.h>)
106
#include <winrt/windows.ui.core.h>

windows/wrapper/impl_org_webRtc_MediaElement.cpp

Lines changed: 4 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11

22
#ifdef WINUWP
33

4-
#ifdef __cplusplus_winrt
5-
#include <windows.ui.xaml.controls.h>
6-
#endif //__cplusplus_winrt
7-
84
#ifdef __has_include
95
#if __has_include(<winrt/Windows.UI.Xaml.Controls.h>)
106
#include <winrt/Windows.UI.Xaml.Controls.h>
@@ -45,18 +41,6 @@ ZS_DECLARE_TYPEDEF_PTR(wrapper::impl::org::webRtc::MediaElement::WrapperImplType
4541
ZS_DECLARE_TYPEDEF_PTR(WrapperImplType::WrapperType, WrapperType);
4642

4743
#ifdef WINUWP
48-
#ifdef __cplusplus_winrt
49-
50-
namespace wrapper { namespace impl { namespace org { namespace webRtc {
51-
ZS_DECLARE_STRUCT_PTR(MediaElementWrapperAnyCx);
52-
53-
struct MediaElementWrapperAnyCx : Any
54-
{
55-
Windows::UI::Xaml::Controls::MediaElement^ element_ {nullptr};
56-
};
57-
} } } }
58-
59-
#endif //__cplusplus_winrt
6044

6145
#ifdef CPPWINRT_VERSION
6246

@@ -119,35 +103,6 @@ AnyPtr wrapper::impl::org::webRtc::MediaElement::get_element() noexcept
119103

120104

121105
#ifdef WINUWP
122-
#ifdef __cplusplus_winrt
123-
124-
wrapper::org::webRtc::MediaElementPtr wrapper::impl::org::webRtc::MediaElement::toWrapper(Windows::UI::Xaml::Controls::MediaElement^ element) noexcept
125-
{
126-
auto any{ make_shared<wrapper::impl::org::webRtc::MediaElementWrapperAnyCx>() };
127-
any->element_ = element;
128-
auto result = make_shared<WrapperImplType>();
129-
result->thisWeak_ = result;
130-
result->element_ = any;
131-
return result;
132-
}
133-
134-
Windows::UI::Xaml::Controls::MediaElement^ wrapper::impl::org::webRtc::MediaElement::toNative_cx(wrapper::org::webRtc::MediaElementPtr element) noexcept
135-
{
136-
if (!element) return nullptr;
137-
AnyPtr any = element->get_element();
138-
if (!any) return nullptr;
139-
auto castedAny = ZS_DYNAMIC_PTR_CAST(wrapper::impl::org::webRtc::MediaElementWrapperAnyCx, any);
140-
if (!castedAny) {
141-
#ifdef CPPWINRT_VERSION
142-
auto result = toNative_winrt(element);
143-
if (result) return WRAPPER_TO_CX(Windows::UI::Xaml::Controls::MediaElement, result);
144-
#endif //CPPWINRT_VERSION
145-
return nullptr;
146-
}
147-
return castedAny->element_;
148-
}
149-
#endif //__cplusplus_winrt
150-
151106
#ifdef CPPWINRT_VERSION
152107

153108
wrapper::org::webRtc::MediaElementPtr wrapper::impl::org::webRtc::MediaElement::toWrapper(winrt::Windows::UI::Xaml::Controls::MediaElement const & element) noexcept
@@ -162,17 +117,13 @@ wrapper::org::webRtc::MediaElementPtr wrapper::impl::org::webRtc::MediaElement::
162117

163118
winrt::Windows::UI::Xaml::Controls::MediaElement wrapper::impl::org::webRtc::MediaElement::toNative_winrt(wrapper::org::webRtc::MediaElementPtr element) noexcept
164119
{
165-
if (!element) return nullptr;
120+
if (!element)
121+
return {nullptr};
166122
AnyPtr any = element->get_element();
167123
if (!any) return nullptr;
168124
auto castedAny = ZS_DYNAMIC_PTR_CAST(wrapper::impl::org::webRtc::MediaElementWrapperAnyWinrt, any);
169-
if (!castedAny) {
170-
#ifdef __cplusplus_winrt
171-
auto result = toNative_cx(element);
172-
if (result) return WRAPPER_FROM_CX(winrt::Windows::UI::Xaml::Controls::MediaElement, result);
173-
#endif //__cplusplus_winrt
174-
return nullptr;
175-
}
125+
if (!castedAny)
126+
return {nullptr};
176127
return castedAny->element_;
177128
}
178129

windows/wrapper/impl_org_webRtc_MediaElement.h

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,6 @@
44
#include "types.h"
55
#include "generated/org_webRtc_MediaElement.h"
66

7-
#ifdef __cplusplus_winrt
8-
#include <windows.ui.xaml.controls.h>
9-
#endif //__cplusplus_winrt
10-
117
#ifdef CPPWINRT_VERSION
128
#include <winrt/Windows.UI.Xaml.Controls.h>
139
#endif // CPPWINRT_VERSION
@@ -36,10 +32,6 @@ namespace wrapper {
3632
AnyPtr get_element() noexcept override;
3733

3834
#ifdef WINUWP
39-
#ifdef __cplusplus_winrt
40-
ZS_NO_DISCARD() static wrapper::org::webRtc::MediaElementPtr toWrapper(Windows::UI::Xaml::Controls::MediaElement^ element) noexcept;
41-
ZS_NO_DISCARD() static Windows::UI::Xaml::Controls::MediaElement^ toNative_cx(wrapper::org::webRtc::MediaElementPtr element) noexcept;
42-
#endif //__cplusplus_winrt
4335
#ifdef CPPWINRT_VERSION
4436
ZS_NO_DISCARD() static wrapper::org::webRtc::MediaElementPtr toWrapper(winrt::Windows::UI::Xaml::Controls::MediaElement const & element) noexcept;
4537
ZS_NO_DISCARD() static winrt::Windows::UI::Xaml::Controls::MediaElement toNative_winrt(wrapper::org::webRtc::MediaElementPtr element) noexcept;

windows/wrapper/impl_org_webRtc_MediaSample.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11

22
#ifdef WINUWP
33

4-
#ifdef __cplusplus_winrt
5-
#include <windows.ui.xaml.controls.h>
6-
#endif //__cplusplus_winrt
7-
84
#ifdef __has_include
95
#if __has_include(<winrt/base.h>)
106
#include <winrt/base.h>

windows/wrapper/impl_org_webRtc_MediaSample.h

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,7 @@
44
#include "types.h"
55
#include "generated/org_webRtc_MediaSample.h"
66

7-
#ifdef WINUWP
8-
#ifdef __cplusplus_winrt
9-
#include <wrl.h>
10-
#include <mfidl.h>
11-
#endif //__cplusplus_winrt
12-
#ifdef CPPWINRT_VERSION
13-
#include <mfidl.h>
14-
#endif // CPPWINRT_VERSION
15-
#else
16-
#ifdef _WIN32
177
#include <mfidl.h>
18-
#endif //_WIN32
19-
#endif // WINUWP
208

219
namespace wrapper {
2210
namespace impl {

windows/wrapper/impl_org_webRtc_MediaSource.cpp

Lines changed: 0 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11

22
#ifdef WINUWP
33

4-
#ifdef __cplusplus_winrt
5-
#include <windows.media.core.h>
6-
#endif //__cplusplus_winrt
7-
84
#ifdef __has_include
95
#if __has_include(<winrt/Windows.Media.Core.h>)
106
#include <winrt/Windows.Media.Core.h>
@@ -45,18 +41,6 @@ ZS_DECLARE_TYPEDEF_PTR(WrapperImplType::WrapperType, WrapperType);
4541

4642

4743
#ifdef WINUWP
48-
#ifdef __cplusplus_winrt
49-
50-
namespace wrapper { namespace impl { namespace org { namespace webRtc {
51-
ZS_DECLARE_STRUCT_PTR(MediaSourceWrapperAnyCx);
52-
53-
struct MediaSourceWrapperAnyCx : Any
54-
{
55-
Windows::Media::Core::IMediaSource^ source_ {nullptr};
56-
};
57-
} } } }
58-
59-
#endif //__cplusplus_winrt
6044

6145
#ifdef CPPWINRT_VERSION
6246

@@ -119,35 +103,6 @@ AnyPtr wrapper::impl::org::webRtc::MediaSource::get_source() noexcept
119103

120104

121105
#ifdef WINUWP
122-
#ifdef __cplusplus_winrt
123-
124-
WrapperImplTypePtr wrapper::impl::org::webRtc::MediaSource::toWrapper(Windows::Media::Core::IMediaSource^ source) noexcept
125-
{
126-
auto any{ make_shared<wrapper::impl::org::webRtc::MediaSourceWrapperAnyCx>() };
127-
any->source_ = source;
128-
auto result = make_shared<WrapperImplType>();
129-
result->thisWeak_ = result;
130-
result->source_ = any;
131-
return result;
132-
}
133-
134-
Windows::Media::Core::IMediaSource^ wrapper::impl::org::webRtc::MediaSource::toNative_cx(wrapper::org::webRtc::MediaSourcePtr source) noexcept
135-
{
136-
if (!source) return nullptr;
137-
AnyPtr any = source->get_source();
138-
if (!any) return nullptr;
139-
auto castedAny = ZS_DYNAMIC_PTR_CAST(wrapper::impl::org::webRtc::MediaSourceWrapperAnyCx, any);
140-
if (!castedAny) {
141-
#ifdef CPPWINRT_VERSION
142-
auto result = toNative_winrt(source);
143-
if (result) return WRAPPER_TO_CX(Windows::Media::Core::IMediaSource, result);
144-
#endif //CPPWINRT_VERSION
145-
return nullptr;
146-
}
147-
return castedAny->source_;
148-
}
149-
#endif //__cplusplus_winrt
150-
151106
#ifdef CPPWINRT_VERSION
152107

153108
WrapperImplTypePtr wrapper::impl::org::webRtc::MediaSource::toWrapper(winrt::Windows::Media::Core::IMediaSource const & source) noexcept
@@ -167,10 +122,6 @@ winrt::Windows::Media::Core::IMediaSource wrapper::impl::org::webRtc::MediaSourc
167122
if (!any) return nullptr;
168123
auto castedAny = ZS_DYNAMIC_PTR_CAST(wrapper::impl::org::webRtc::MediaSourceWrapperAnyWinrt, any);
169124
if (!castedAny) {
170-
#ifdef __cplusplus_winrt
171-
auto result = toNative_cx(source);
172-
if (result) return WRAPPER_FROM_CX(winrt::Windows::Media::Core::IMediaSource, result);
173-
#endif //__cplusplus_winrt
174125
return nullptr;
175126
}
176127
return castedAny->source_;

windows/wrapper/impl_org_webRtc_MediaSource.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,6 @@ namespace wrapper {
3333
AnyPtr get_source() noexcept override;
3434

3535
#ifdef WINUWP
36-
#ifdef __cplusplus_winrt
37-
ZS_NO_DISCARD() static WrapperImplTypePtr toWrapper(Windows::Media::Core::IMediaSource^ source) noexcept;
38-
ZS_NO_DISCARD() static Windows::Media::Core::IMediaSource^ toNative_cx(wrapper::org::webRtc::MediaSourcePtr source) noexcept;
39-
#endif //__cplusplus_winrt
4036
#ifdef CPPWINRT_VERSION
4137
ZS_NO_DISCARD() static WrapperImplTypePtr toWrapper(winrt::Windows::Media::Core::IMediaSource const & source) noexcept;
4238
ZS_NO_DISCARD() static winrt::Windows::Media::Core::IMediaSource toNative_winrt(wrapper::org::webRtc::MediaSourcePtr source) noexcept;

0 commit comments

Comments
 (0)