• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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=2c4dc1026a21a2712fc84c1393d4c69c0335f484$
13 //
14 
15 #include "libcef_dll/cpptoc/media_route_cpptoc.h"
16 #include "libcef_dll/cpptoc/media_sink_cpptoc.h"
17 #include "libcef_dll/cpptoc/media_source_cpptoc.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_route_get_id(struct _cef_media_route_t * self)25 media_route_get_id(struct _cef_media_route_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 = CefMediaRouteCppToC::Get(self)->GetId();
36 
37   // Return type: string
38   return _retval.DetachToUserFree();
39 }
40 
41 struct _cef_media_source_t* CEF_CALLBACK
media_route_get_source(struct _cef_media_route_t * self)42 media_route_get_source(struct _cef_media_route_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   CefRefPtr<CefMediaSource> _retval =
53       CefMediaRouteCppToC::Get(self)->GetSource();
54 
55   // Return type: refptr_same
56   return CefMediaSourceCppToC::Wrap(_retval);
57 }
58 
59 struct _cef_media_sink_t* CEF_CALLBACK
media_route_get_sink(struct _cef_media_route_t * self)60 media_route_get_sink(struct _cef_media_route_t* self) {
61   shutdown_checker::AssertNotShutdown();
62 
63   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
64 
65   DCHECK(self);
66   if (!self)
67     return NULL;
68 
69   // Execute
70   CefRefPtr<CefMediaSink> _retval = CefMediaRouteCppToC::Get(self)->GetSink();
71 
72   // Return type: refptr_same
73   return CefMediaSinkCppToC::Wrap(_retval);
74 }
75 
76 void CEF_CALLBACK
media_route_send_route_message(struct _cef_media_route_t * self,const void * message,size_t message_size)77 media_route_send_route_message(struct _cef_media_route_t* self,
78                                const void* message,
79                                size_t message_size) {
80   shutdown_checker::AssertNotShutdown();
81 
82   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
83 
84   DCHECK(self);
85   if (!self)
86     return;
87   // Verify param: message; type: simple_byaddr
88   DCHECK(message);
89   if (!message)
90     return;
91 
92   // Execute
93   CefMediaRouteCppToC::Get(self)->SendRouteMessage(message, message_size);
94 }
95 
media_route_terminate(struct _cef_media_route_t * self)96 void CEF_CALLBACK media_route_terminate(struct _cef_media_route_t* self) {
97   shutdown_checker::AssertNotShutdown();
98 
99   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
100 
101   DCHECK(self);
102   if (!self)
103     return;
104 
105   // Execute
106   CefMediaRouteCppToC::Get(self)->Terminate();
107 }
108 
109 }  // namespace
110 
111 // CONSTRUCTOR - Do not edit by hand.
112 
CefMediaRouteCppToC()113 CefMediaRouteCppToC::CefMediaRouteCppToC() {
114   GetStruct()->get_id = media_route_get_id;
115   GetStruct()->get_source = media_route_get_source;
116   GetStruct()->get_sink = media_route_get_sink;
117   GetStruct()->send_route_message = media_route_send_route_message;
118   GetStruct()->terminate = media_route_terminate;
119 }
120 
121 // DESTRUCTOR - Do not edit by hand.
122 
~CefMediaRouteCppToC()123 CefMediaRouteCppToC::~CefMediaRouteCppToC() {
124   shutdown_checker::AssertNotShutdown();
125 }
126 
127 template <>
128 CefRefPtr<CefMediaRoute>
129 CefCppToCRefCounted<CefMediaRouteCppToC, CefMediaRoute, cef_media_route_t>::
UnwrapDerived(CefWrapperType type,cef_media_route_t * s)130     UnwrapDerived(CefWrapperType type, cef_media_route_t* s) {
131   NOTREACHED() << "Unexpected class type: " << type;
132   return nullptr;
133 }
134 
135 template <>
136 CefWrapperType CefCppToCRefCounted<CefMediaRouteCppToC,
137                                    CefMediaRoute,
138                                    cef_media_route_t>::kWrapperType =
139     WT_MEDIA_ROUTE;
140