1 // Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
2 // reserved. Use of this source code is governed by a BSD-style license that
3 // can be found in the LICENSE file.
4 //
5 // ---------------------------------------------------------------------------
6 //
7 // This file was generated by the CEF translator tool. If making changes by
8 // hand only do so within the body of existing method and function
9 // implementations. See the translator.README.txt file in the tools directory
10 // for more information.
11 //
12 // $hash=59c15e457142b252222f01e36ea626bed5ed2b7a$
13 //
14
15 #include "libcef_dll/cpptoc/media_sink_cpptoc.h"
16 #include "libcef_dll/cpptoc/media_source_cpptoc.h"
17 #include "libcef_dll/ctocpp/media_sink_device_info_callback_ctocpp.h"
18 #include "libcef_dll/shutdown_checker.h"
19
20 namespace {
21
22 // MEMBER FUNCTIONS - Body may be edited by hand.
23
24 cef_string_userfree_t CEF_CALLBACK
media_sink_get_id(struct _cef_media_sink_t * self)25 media_sink_get_id(struct _cef_media_sink_t* self) {
26 shutdown_checker::AssertNotShutdown();
27
28 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
29
30 DCHECK(self);
31 if (!self)
32 return NULL;
33
34 // Execute
35 CefString _retval = CefMediaSinkCppToC::Get(self)->GetId();
36
37 // Return type: string
38 return _retval.DetachToUserFree();
39 }
40
41 cef_string_userfree_t CEF_CALLBACK
media_sink_get_name(struct _cef_media_sink_t * self)42 media_sink_get_name(struct _cef_media_sink_t* self) {
43 shutdown_checker::AssertNotShutdown();
44
45 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
46
47 DCHECK(self);
48 if (!self)
49 return NULL;
50
51 // Execute
52 CefString _retval = CefMediaSinkCppToC::Get(self)->GetName();
53
54 // Return type: string
55 return _retval.DetachToUserFree();
56 }
57
58 cef_string_userfree_t CEF_CALLBACK
media_sink_get_description(struct _cef_media_sink_t * self)59 media_sink_get_description(struct _cef_media_sink_t* self) {
60 shutdown_checker::AssertNotShutdown();
61
62 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
63
64 DCHECK(self);
65 if (!self)
66 return NULL;
67
68 // Execute
69 CefString _retval = CefMediaSinkCppToC::Get(self)->GetDescription();
70
71 // Return type: string
72 return _retval.DetachToUserFree();
73 }
74
75 cef_media_sink_icon_type_t CEF_CALLBACK
media_sink_get_icon_type(struct _cef_media_sink_t * self)76 media_sink_get_icon_type(struct _cef_media_sink_t* self) {
77 shutdown_checker::AssertNotShutdown();
78
79 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
80
81 DCHECK(self);
82 if (!self)
83 return CEF_MSIT_GENERIC;
84
85 // Execute
86 cef_media_sink_icon_type_t _retval =
87 CefMediaSinkCppToC::Get(self)->GetIconType();
88
89 // Return type: simple
90 return _retval;
91 }
92
media_sink_get_device_info(struct _cef_media_sink_t * self,struct _cef_media_sink_device_info_callback_t * callback)93 void CEF_CALLBACK media_sink_get_device_info(
94 struct _cef_media_sink_t* self,
95 struct _cef_media_sink_device_info_callback_t* callback) {
96 shutdown_checker::AssertNotShutdown();
97
98 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
99
100 DCHECK(self);
101 if (!self)
102 return;
103 // Verify param: callback; type: refptr_diff
104 DCHECK(callback);
105 if (!callback)
106 return;
107
108 // Execute
109 CefMediaSinkCppToC::Get(self)->GetDeviceInfo(
110 CefMediaSinkDeviceInfoCallbackCToCpp::Wrap(callback));
111 }
112
media_sink_is_cast_sink(struct _cef_media_sink_t * self)113 int CEF_CALLBACK media_sink_is_cast_sink(struct _cef_media_sink_t* self) {
114 shutdown_checker::AssertNotShutdown();
115
116 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
117
118 DCHECK(self);
119 if (!self)
120 return 0;
121
122 // Execute
123 bool _retval = CefMediaSinkCppToC::Get(self)->IsCastSink();
124
125 // Return type: bool
126 return _retval;
127 }
128
media_sink_is_dial_sink(struct _cef_media_sink_t * self)129 int CEF_CALLBACK media_sink_is_dial_sink(struct _cef_media_sink_t* self) {
130 shutdown_checker::AssertNotShutdown();
131
132 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
133
134 DCHECK(self);
135 if (!self)
136 return 0;
137
138 // Execute
139 bool _retval = CefMediaSinkCppToC::Get(self)->IsDialSink();
140
141 // Return type: bool
142 return _retval;
143 }
144
145 int CEF_CALLBACK
media_sink_is_compatible_with(struct _cef_media_sink_t * self,struct _cef_media_source_t * source)146 media_sink_is_compatible_with(struct _cef_media_sink_t* self,
147 struct _cef_media_source_t* source) {
148 shutdown_checker::AssertNotShutdown();
149
150 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
151
152 DCHECK(self);
153 if (!self)
154 return 0;
155 // Verify param: source; type: refptr_same
156 DCHECK(source);
157 if (!source)
158 return 0;
159
160 // Execute
161 bool _retval = CefMediaSinkCppToC::Get(self)->IsCompatibleWith(
162 CefMediaSourceCppToC::Unwrap(source));
163
164 // Return type: bool
165 return _retval;
166 }
167
168 } // namespace
169
170 // CONSTRUCTOR - Do not edit by hand.
171
CefMediaSinkCppToC()172 CefMediaSinkCppToC::CefMediaSinkCppToC() {
173 GetStruct()->get_id = media_sink_get_id;
174 GetStruct()->get_name = media_sink_get_name;
175 GetStruct()->get_description = media_sink_get_description;
176 GetStruct()->get_icon_type = media_sink_get_icon_type;
177 GetStruct()->get_device_info = media_sink_get_device_info;
178 GetStruct()->is_cast_sink = media_sink_is_cast_sink;
179 GetStruct()->is_dial_sink = media_sink_is_dial_sink;
180 GetStruct()->is_compatible_with = media_sink_is_compatible_with;
181 }
182
183 // DESTRUCTOR - Do not edit by hand.
184
~CefMediaSinkCppToC()185 CefMediaSinkCppToC::~CefMediaSinkCppToC() {
186 shutdown_checker::AssertNotShutdown();
187 }
188
189 template <>
190 CefRefPtr<CefMediaSink>
191 CefCppToCRefCounted<CefMediaSinkCppToC, CefMediaSink, cef_media_sink_t>::
UnwrapDerived(CefWrapperType type,cef_media_sink_t * s)192 UnwrapDerived(CefWrapperType type, cef_media_sink_t* s) {
193 NOTREACHED() << "Unexpected class type: " << type;
194 return nullptr;
195 }
196
197 template <>
198 CefWrapperType CefCppToCRefCounted<CefMediaSinkCppToC,
199 CefMediaSink,
200 cef_media_sink_t>::kWrapperType =
201 WT_MEDIA_SINK;
202