Skip to content

Commit 6a11dc1

Browse files
committed
checkpoint
1 parent 2217033 commit 6a11dc1

40 files changed

+51
-213
lines changed

windows/wrapper/impl_org_webRtc_EventQueue.cpp

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,11 @@
11

2-
#ifdef WINUWP
3-
42
#ifdef __has_include
53
#if __has_include(<winrt/windows.ui.core.h>)
64
#include <winrt/windows.ui.core.h>
75
#endif //__has_include(<winrt/windows.ui.core.h>)
86
#endif //__has_include
97

10-
#else
11-
128
#include <zsLib/IMessageQueue.h>
13-
#endif //WINUWP
149

1510
#include "impl_org_webRtc_EventQueue.h"
1611
#include "impl_org_webRtc_helpers.h"
@@ -92,7 +87,6 @@ wrapper::org::webRtc::EventQueuePtr wrapper::org::webRtc::EventQueue::getDefault
9287
return result;
9388
}
9489

95-
#ifdef WINUWP
9690
#ifdef CPPWINRT_VERSION
9791

9892
wrapper::org::webRtc::EventQueuePtr wrapper::impl::org::webRtc::EventQueue::toWrapper(winrt::Windows::UI::Core::CoreDispatcher queue) noexcept
@@ -117,8 +111,6 @@ winrt::Windows::UI::Core::CoreDispatcher wrapper::impl::org::webRtc::EventQueue:
117111

118112
#endif // CPPWINRT_VERSION
119113

120-
#endif //WINUWP
121-
122114
wrapper::org::webRtc::EventQueuePtr wrapper::impl::org::webRtc::EventQueue::toWrapper(::zsLib::IMessageQueuePtr queue) noexcept
123115
{
124116
if (!queue)
@@ -136,7 +128,9 @@ ::zsLib::IMessageQueuePtr wrapper::impl::org::webRtc::EventQueue::toNative(wrapp
136128
auto converted = ZS_DYNAMIC_PTR_CAST(WrapperImplType, queue);
137129
if (!converted)
138130
return {};
131+
#ifdef CPPWINRT_VERSION
139132
if (converted->dispatcher_)
140133
return zsLib::IMessageQueueDispatcher::create(converted->dispatcher_);
134+
#endif //CPPWINRT_VERSION
141135
return converted->queue_;
142136
}

windows/wrapper/impl_org_webRtc_EventQueue.h

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

22
#pragma once
33

4-
#ifdef WINUWP
5-
64
#ifdef __has_include
75
#if __has_include(<winrt/windows.ui.core.h>)
86
#include <winrt/windows.ui.core.h>
97
#endif //__has_include(<winrt/windows.ui.core.h>)
108
#endif //__has_include
119

12-
#endif //WINUWP
13-
1410
#include "types.h"
1511
#include "generated/org_webRtc_EventQueue.h"
1612

@@ -27,22 +23,16 @@ namespace wrapper {
2723

2824
EventQueueWeakPtr thisWeak_;
2925

30-
#ifdef WINUWP
3126
#ifdef CPPWINRT_VERSION
3227
winrt::Windows::UI::Core::CoreDispatcher dispatcher_ {nullptr};
3328
#endif // CPPWINRT_VERSION
34-
#endif //WINUWP
3529
zsLib::IMessageQueuePtr queue_;
3630

3731
EventQueue() noexcept;
3832
virtual ~EventQueue() noexcept;
3933

40-
#ifdef WINUWP
41-
#ifdef CPPWINRT_VERSION
4234
ZS_NO_DISCARD() static wrapper::org::webRtc::EventQueuePtr toWrapper(winrt::Windows::UI::Core::CoreDispatcher queue) noexcept;
4335
ZS_NO_DISCARD() static winrt::Windows::UI::Core::CoreDispatcher toNative_winrt(WrapperTypePtr queue) noexcept;
44-
#endif // CPPWINRT_VERSION
45-
#endif //WINUWP
4636
ZS_NO_DISCARD() static wrapper::org::webRtc::EventQueuePtr toWrapper(::zsLib::IMessageQueuePtr queue) noexcept;
4737
ZS_NO_DISCARD() static ::zsLib::IMessageQueuePtr toNative(WrapperTypePtr queue) noexcept;
4838

windows/wrapper/impl_org_webRtc_MediaElement.cpp

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,15 @@
11

2-
#ifdef WINUWP
3-
42
#ifdef __has_include
53
#if __has_include(<winrt/Windows.UI.Xaml.Controls.h>)
64
#include <winrt/Windows.UI.Xaml.Controls.h>
75
#endif //__has_include(<winrt/Windows.UI.Xaml.Controls.h>)
86
#endif //__has_include
97

10-
#else
11-
8+
#ifndef WINUWP
129
#ifdef _WIN32
1310
#include <Windows.h>
1411
#endif //_WIN32
15-
16-
#endif //WINUWP
12+
#endif //ndef WINUWP
1713

1814
#include "impl_org_webRtc_MediaElement.h"
1915
#include "impl_org_webRtc_helpers.h"
@@ -40,8 +36,6 @@ using ::std::map;
4036
ZS_DECLARE_TYPEDEF_PTR(wrapper::impl::org::webRtc::MediaElement::WrapperImplType, WrapperImplType);
4137
ZS_DECLARE_TYPEDEF_PTR(WrapperImplType::WrapperType, WrapperType);
4238

43-
#ifdef WINUWP
44-
4539
#ifdef CPPWINRT_VERSION
4640

4741
namespace wrapper { namespace impl { namespace org { namespace webRtc {
@@ -55,8 +49,8 @@ namespace wrapper { namespace impl { namespace org { namespace webRtc {
5549

5650
#endif // CPPWINRT_VERSION
5751

58-
#else
59-
52+
#ifndef WINUWP
53+
#ifdef _WIN32
6054

6155
namespace wrapper { namespace impl { namespace org { namespace webRtc {
6256
ZS_DECLARE_STRUCT_PTR(MediaElementWrapperAny);
@@ -67,6 +61,7 @@ namespace wrapper { namespace impl { namespace org { namespace webRtc {
6761
};
6862
} } } }
6963

64+
#endif //_WIN32
7065
#endif //WINUWP
7166

7267
//------------------------------------------------------------------------------
@@ -102,7 +97,6 @@ AnyPtr wrapper::impl::org::webRtc::MediaElement::get_element() noexcept
10297
}
10398

10499

105-
#ifdef WINUWP
106100
#ifdef CPPWINRT_VERSION
107101

108102
wrapper::org::webRtc::MediaElementPtr wrapper::impl::org::webRtc::MediaElement::toWrapper(winrt::Windows::UI::Xaml::Controls::MediaElement const & element) noexcept
@@ -129,7 +123,8 @@ winrt::Windows::UI::Xaml::Controls::MediaElement wrapper::impl::org::webRtc::Med
129123

130124
#endif // CPPWINRT_VERSION
131125

132-
#else
126+
#ifndef WINUWP
127+
#ifdef _WIN32
133128

134129
wrapper::org::webRtc::MediaElementPtr wrapper::impl::org::webRtc::MediaElement::toWrapper(HWND element) noexcept
135130
{
@@ -150,5 +145,6 @@ HWND wrapper::impl::org::webRtc::MediaElement::toNative(wrapper::org::webRtc::Me
150145
return castedAny->element_;
151146
}
152147

153-
#endif //WINUWP
148+
#endif //_WIN32
149+
#endif //ndef WINUWP
154150

windows/wrapper/impl_org_webRtc_MediaElement.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,17 +31,17 @@ namespace wrapper {
3131
// properties MediaElement
3232
AnyPtr get_element() noexcept override;
3333

34-
#ifdef WINUWP
3534
#ifdef CPPWINRT_VERSION
3635
ZS_NO_DISCARD() static wrapper::org::webRtc::MediaElementPtr toWrapper(winrt::Windows::UI::Xaml::Controls::MediaElement const & element) noexcept;
3736
ZS_NO_DISCARD() static winrt::Windows::UI::Xaml::Controls::MediaElement toNative_winrt(wrapper::org::webRtc::MediaElementPtr element) noexcept;
3837
#endif // CPPWINRT_VERSION
39-
#else
38+
39+
#ifndef WINUWP
4040
#ifdef _WIN32
4141
ZS_NO_DISCARD() static wrapper::org::webRtc::MediaElementPtr toWrapper(HWND element) noexcept;
42-
ZS_NO_DISCARD() static element toNative(wrapper::org::webRtc::MediaElementPtr element) noexcept;
42+
ZS_NO_DISCARD() static HWND toNative(wrapper::org::webRtc::MediaElementPtr element) noexcept;
4343
#endif //_WIN32
44-
#endif //WINUWP
44+
#endif //ndef WINUWP
4545

4646
};
4747

windows/wrapper/impl_org_webRtc_MediaSample.cpp

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,14 @@
11

2-
#ifdef WINUWP
3-
42
#ifdef __has_include
53
#if __has_include(<winrt/base.h>)
64
#include <winrt/base.h>
75
#endif //__has_include(<winrt/base.h>)
86
#endif //__has_include
97

10-
#else
11-
8+
#ifndef WINUWP
129
#ifdef _WIN32
1310
#include <Windows.h>
1411
#endif //_WIN32
15-
1612
#endif //WINUWP
1713

1814
#include "impl_org_webRtc_MediaSample.h"
@@ -59,7 +55,6 @@ wrapper::impl::org::webRtc::MediaSample::~MediaSample() noexcept
5955
thisWeak_.reset();
6056
}
6157

62-
#ifdef WINUWP
6358
#ifdef CPPWINRT_VERSION
6459
//------------------------------------------------------------------------------
6560
void wrapper::impl::org::webRtc::MediaSample::wrapper_dispose() noexcept
@@ -87,5 +82,3 @@ winrt::com_ptr<IMFSample> wrapper::impl::org::webRtc::MediaSample::toNative(wrap
8782
}
8883

8984
#endif // CPPWINRT_VERSION
90-
#endif //WINUWP
91-

windows/wrapper/impl_org_webRtc_MediaSample.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,23 +18,20 @@ namespace wrapper {
1818

1919
MediaSampleWeakPtr thisWeak_;
2020
zsLib::Lock lock_;
21-
#ifdef WINUWP
21+
2222
#ifdef CPPWINRT_VERSION
2323
winrt::com_ptr<IMFSample> sample_;
2424
#endif //CPPWINRT_VERSION
25-
#endif //WINUWP
2625

2726
MediaSample() noexcept;
2827
virtual ~MediaSample() noexcept;
2928

3029
void wrapper_dispose() noexcept override;
3130

32-
#ifdef WINUWP
3331
#ifdef CPPWINRT_VERSION
3432
ZS_NO_DISCARD() static wrapper::org::webRtc::MediaSamplePtr toWrapper(winrt::com_ptr<IMFSample> const & sample) noexcept;
3533
ZS_NO_DISCARD() static winrt::com_ptr<IMFSample> toNative(wrapper::org::webRtc::MediaSamplePtr sample) noexcept;
3634
#endif //CPPWINRT_VERSION
37-
#endif //WINUWP
3835

3936
};
4037

windows/wrapper/impl_org_webRtc_MediaSource.cpp

Lines changed: 2 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,10 @@
11

2-
#ifdef WINUWP
3-
42
#ifdef __has_include
53
#if __has_include(<winrt/Windows.Media.Core.h>)
64
#include <winrt/Windows.Media.Core.h>
75
#endif //__has_include(<winrt/Windows.Media.Core.h>)
86
#endif //__has_include
97

10-
#else
11-
12-
#ifdef _WIN32
13-
#endif //_WIN32
14-
15-
#endif //WINUWP
16-
178
#include "impl_org_webRtc_MediaSource.h"
189
#include "impl_org_webRtc_helpers.h"
1910

@@ -40,8 +31,6 @@ ZS_DECLARE_TYPEDEF_PTR(wrapper::impl::org::webRtc::MediaSource::WrapperImplType,
4031
ZS_DECLARE_TYPEDEF_PTR(WrapperImplType::WrapperType, WrapperType);
4132

4233

43-
#ifdef WINUWP
44-
4534
#ifdef CPPWINRT_VERSION
4635

4736
namespace wrapper { namespace impl { namespace org { namespace webRtc {
@@ -55,7 +44,7 @@ namespace wrapper { namespace impl { namespace org { namespace webRtc {
5544

5645
#endif // CPPWINRT_VERSION
5746

58-
#else
47+
#ifndef WINUWP
5948

6049

6150
namespace wrapper { namespace impl { namespace org { namespace webRtc {
@@ -67,7 +56,7 @@ namespace wrapper { namespace impl { namespace org { namespace webRtc {
6756
};
6857
} } } }
6958

70-
#endif //WINUWP
59+
#endif //ndef WINUWP
7160

7261
//------------------------------------------------------------------------------
7362
wrapper::impl::org::webRtc::MediaSource::MediaSource() noexcept
@@ -102,7 +91,6 @@ AnyPtr wrapper::impl::org::webRtc::MediaSource::get_source() noexcept
10291
}
10392

10493

105-
#ifdef WINUWP
10694
#ifdef CPPWINRT_VERSION
10795

10896
WrapperImplTypePtr wrapper::impl::org::webRtc::MediaSource::toWrapper(winrt::Windows::Media::Core::IMediaSource const & source) noexcept
@@ -128,11 +116,3 @@ winrt::Windows::Media::Core::IMediaSource wrapper::impl::org::webRtc::MediaSourc
128116
}
129117

130118
#endif // CPPWINRT_VERSION
131-
132-
#else
133-
134-
#ifdef _WIN32
135-
#endif //_WIN32
136-
137-
#endif //WINUWP
138-

windows/wrapper/impl_org_webRtc_MediaSource.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,15 +32,10 @@ namespace wrapper {
3232
// properties MediaSource
3333
AnyPtr get_source() noexcept override;
3434

35-
#ifdef WINUWP
3635
#ifdef CPPWINRT_VERSION
3736
ZS_NO_DISCARD() static WrapperImplTypePtr toWrapper(winrt::Windows::Media::Core::IMediaSource const & source) noexcept;
3837
ZS_NO_DISCARD() static winrt::Windows::Media::Core::IMediaSource toNative_winrt(wrapper::org::webRtc::MediaSourcePtr source) noexcept;
3938
#endif // CPPWINRT_VERSION
40-
#else
41-
#ifdef _WIN32
42-
#endif //_WIN32
43-
#endif //WINUWP
4439

4540
};
4641

windows/wrapper/impl_org_webRtc_MediaStreamTrack.cpp

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

2-
#ifdef WINUWP
3-
42
#ifdef __has_include
53
#if __has_include(<winrt/Windows.UI.Xaml.Controls.h>)
64
#include <winrt/Windows.UI.Xaml.Controls.h>
75
#endif //__has_include(<winrt/Windows.UI.Xaml.Controls.h>)
86
#endif //__has_include
97

10-
#endif //WINUWP
11-
128
#include "impl_org_webRtc_MediaStreamTrack.h"
139

1410
#include "impl_org_webRtc_helpers.h"
@@ -94,7 +90,6 @@ static ::webrtc::VideoTrackInterface *unproxyVideoTrack(NativeType *native)
9490
return WRAPPER_DEPROXIFY_CLASS(::webrtc::VideoTrack, ::webrtc::VideoTrack, converted);
9591
}
9692

97-
#ifdef WINUWP
9893
#ifdef CPPWINRT_VERSION
9994
//------------------------------------------------------------------------------
10095
static void notifyAboutNewMediaSource(WrapperImplType &wrapper, winrt::Windows::Media::Core::IMediaSource const & newSource)
@@ -104,7 +99,6 @@ static void notifyAboutNewMediaSource(WrapperImplType &wrapper, winrt::Windows::
10499
wrapper.notifySourceChanged(source);
105100
}
106101
#endif //CPPWINRT_VERSION
107-
#endif //WINUWP
108102

109103
//------------------------------------------------------------------------------
110104
wrapper::impl::org::webRtc::MediaStreamTrack::MediaStreamTrack() noexcept :

0 commit comments

Comments
 (0)