MediaController_server_g.h 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569
  1. #ifndef __MEDIACONTROLLER_SERVER_G_H
  2. #define __MEDIACONTROLLER_SERVER_G_H
  3. #pragma once
  4. // This code is generated by spgen tool!
  5. #include "MediaController_def_g.h"
  6. namespace MediaController {
  7. class MediaService_ServerSessionBase : public CServerSessionBase
  8. {
  9. public:
  10. MediaService_ServerSessionBase()
  11. {
  12. /// override by user
  13. }
  14. virtual ~MediaService_ServerSessionBase()
  15. {
  16. /// override by user
  17. }
  18. virtual bool IsExclusive() { return false; }
  19. virtual bool IsSessionOverlap() { return true; }
  20. virtual ErrorCodeEnum GetMessageAttr(DWORD dwMessageID, DWORD dwSignature, bool &bOverlap)
  21. {
  22. ErrorCodeEnum Error = Error_Succeed;
  23. switch (dwMessageID) {
  24. case MediaService_Method_GetVideoDeviceName:
  25. if (dwSignature == MediaService_MethodSignature_GetVideoDeviceName) {
  26. bOverlap = true;
  27. } else {
  28. Error = Error_MethodSignatureFailed;
  29. }
  30. break;
  31. case MediaService_Method_StartCamera:
  32. if (dwSignature == MediaService_MethodSignature_StartCamera) {
  33. bOverlap = true;
  34. } else {
  35. Error = Error_MethodSignatureFailed;
  36. }
  37. break;
  38. case MediaService_Method_StopCamera:
  39. if (dwSignature == MediaService_MethodSignature_StopCamera) {
  40. bOverlap = true;
  41. } else {
  42. Error = Error_MethodSignatureFailed;
  43. }
  44. break;
  45. case MediaService_Method_StartEnvCamera:
  46. if (dwSignature == MediaService_MethodSignature_StartEnvCamera) {
  47. bOverlap = true;
  48. } else {
  49. Error = Error_MethodSignatureFailed;
  50. }
  51. break;
  52. case MediaService_Method_StopEnvCamera:
  53. if (dwSignature == MediaService_MethodSignature_StopEnvCamera) {
  54. bOverlap = true;
  55. } else {
  56. Error = Error_MethodSignatureFailed;
  57. }
  58. break;
  59. case MediaService_Method_StartSpeakerRender:
  60. if (dwSignature == MediaService_MethodSignature_StartSpeakerRender) {
  61. bOverlap = true;
  62. } else {
  63. Error = Error_MethodSignatureFailed;
  64. }
  65. break;
  66. case MediaService_Method_StopSpeakerRender:
  67. if (dwSignature == MediaService_MethodSignature_StopSpeakerRender) {
  68. bOverlap = true;
  69. } else {
  70. Error = Error_MethodSignatureFailed;
  71. }
  72. break;
  73. case MediaService_Method_ManipulateMediaDevice:
  74. if (dwSignature == MediaService_MethodSignature_ManipulateMediaDevice) {
  75. bOverlap = true;
  76. } else {
  77. Error = Error_MethodSignatureFailed;
  78. }
  79. break;
  80. case MediaService_Method_GetAudioDevices:
  81. if (dwSignature == MediaService_MethodSignature_GetAudioDevices) {
  82. bOverlap = true;
  83. } else {
  84. Error = Error_MethodSignatureFailed;
  85. }
  86. break;
  87. case MediaService_Method_GetVideoDevices:
  88. if (dwSignature == MediaService_MethodSignature_GetVideoDevices) {
  89. bOverlap = true;
  90. } else {
  91. Error = Error_MethodSignatureFailed;
  92. }
  93. break;
  94. case MediaService_Method_GetCameraInfos:
  95. if (dwSignature == MediaService_MethodSignature_GetCameraInfos) {
  96. bOverlap = true;
  97. } else {
  98. Error = Error_MethodSignatureFailed;
  99. }
  100. break;
  101. case MediaService_Method_ManipulateCameras:
  102. if (dwSignature == MediaService_MethodSignature_ManipulateCameras) {
  103. bOverlap = true;
  104. } else {
  105. Error = Error_MethodSignatureFailed;
  106. }
  107. break;
  108. case MediaService_Method_GetEnvCameraVideoCaptureInfo:
  109. if (dwSignature == MediaService_MethodSignature_GetEnvCameraVideoCaptureInfo) {
  110. bOverlap = true;
  111. } else {
  112. Error = Error_MethodSignatureFailed;
  113. }
  114. break;
  115. case MediaService_Method_GetEnvCamRawBrightnessInfo:
  116. if (dwSignature == MediaService_MethodSignature_GetEnvCamRawBrightnessInfo) {
  117. bOverlap = true;
  118. } else {
  119. Error = Error_MethodSignatureFailed;
  120. }
  121. break;
  122. case MediaService_Method_SetEnvCamRawBrightness:
  123. if (dwSignature == MediaService_MethodSignature_SetEnvCamRawBrightness) {
  124. bOverlap = true;
  125. } else {
  126. Error = Error_MethodSignatureFailed;
  127. }
  128. break;
  129. case MediaService_Method_TurnOnCamera:
  130. if (dwSignature == MediaService_MethodSignature_TurnOnCamera) {
  131. bOverlap = true;
  132. } else {
  133. Error = Error_MethodSignatureFailed;
  134. }
  135. break;
  136. case MediaService_Method_TurnOffCamera:
  137. if (dwSignature == MediaService_MethodSignature_TurnOffCamera) {
  138. bOverlap = true;
  139. } else {
  140. Error = Error_MethodSignatureFailed;
  141. }
  142. break;
  143. case MediaService_Method_IsCameraOnStatus:
  144. if (dwSignature == MediaService_MethodSignature_IsCameraOnStatus) {
  145. bOverlap = true;
  146. } else {
  147. Error = Error_MethodSignatureFailed;
  148. }
  149. break;
  150. default:
  151. Error = Error_MethodNotFound;
  152. break;
  153. }
  154. return Error;
  155. }
  156. int CheckMessageSignature(DWORD dwMessageID, DWORD dwSignature)
  157. {
  158. ErrorCodeEnum Error = Error_Succeed;
  159. switch (dwMessageID) {
  160. case MediaService_Method_GetVideoDeviceName:
  161. if (dwSignature != MediaService_MethodSignature_GetVideoDeviceName) {
  162. Error = Error_MethodSignatureFailed;
  163. }
  164. break;
  165. case MediaService_Method_StartCamera:
  166. if (dwSignature != MediaService_MethodSignature_StartCamera) {
  167. Error = Error_MethodSignatureFailed;
  168. }
  169. break;
  170. case MediaService_Method_StopCamera:
  171. if (dwSignature != MediaService_MethodSignature_StopCamera) {
  172. Error = Error_MethodSignatureFailed;
  173. }
  174. break;
  175. case MediaService_Method_StartEnvCamera:
  176. if (dwSignature != MediaService_MethodSignature_StartEnvCamera) {
  177. Error = Error_MethodSignatureFailed;
  178. }
  179. break;
  180. case MediaService_Method_StopEnvCamera:
  181. if (dwSignature != MediaService_MethodSignature_StopEnvCamera) {
  182. Error = Error_MethodSignatureFailed;
  183. }
  184. break;
  185. case MediaService_Method_StartSpeakerRender:
  186. if (dwSignature != MediaService_MethodSignature_StartSpeakerRender) {
  187. Error = Error_MethodSignatureFailed;
  188. }
  189. break;
  190. case MediaService_Method_StopSpeakerRender:
  191. if (dwSignature != MediaService_MethodSignature_StopSpeakerRender) {
  192. Error = Error_MethodSignatureFailed;
  193. }
  194. break;
  195. case MediaService_Method_ManipulateMediaDevice:
  196. if (dwSignature != MediaService_MethodSignature_ManipulateMediaDevice) {
  197. Error = Error_MethodSignatureFailed;
  198. }
  199. break;
  200. case MediaService_Method_GetAudioDevices:
  201. if (dwSignature != MediaService_MethodSignature_GetAudioDevices) {
  202. Error = Error_MethodSignatureFailed;
  203. }
  204. break;
  205. case MediaService_Method_GetVideoDevices:
  206. if (dwSignature != MediaService_MethodSignature_GetVideoDevices) {
  207. Error = Error_MethodSignatureFailed;
  208. }
  209. break;
  210. case MediaService_Method_GetCameraInfos:
  211. if (dwSignature != MediaService_MethodSignature_GetCameraInfos) {
  212. Error = Error_MethodSignatureFailed;
  213. }
  214. break;
  215. case MediaService_Method_ManipulateCameras:
  216. if (dwSignature != MediaService_MethodSignature_ManipulateCameras) {
  217. Error = Error_MethodSignatureFailed;
  218. }
  219. break;
  220. case MediaService_Method_GetEnvCameraVideoCaptureInfo:
  221. if (dwSignature != MediaService_MethodSignature_GetEnvCameraVideoCaptureInfo) {
  222. Error = Error_MethodSignatureFailed;
  223. }
  224. break;
  225. case MediaService_Method_GetEnvCamRawBrightnessInfo:
  226. if (dwSignature != MediaService_MethodSignature_GetEnvCamRawBrightnessInfo) {
  227. Error = Error_MethodSignatureFailed;
  228. }
  229. break;
  230. case MediaService_Method_SetEnvCamRawBrightness:
  231. if (dwSignature != MediaService_MethodSignature_SetEnvCamRawBrightness) {
  232. Error = Error_MethodSignatureFailed;
  233. }
  234. break;
  235. case MediaService_Method_TurnOnCamera:
  236. if (dwSignature != MediaService_MethodSignature_TurnOnCamera) {
  237. Error = Error_MethodSignatureFailed;
  238. }
  239. break;
  240. case MediaService_Method_TurnOffCamera:
  241. if (dwSignature != MediaService_MethodSignature_TurnOffCamera) {
  242. Error = Error_MethodSignatureFailed;
  243. }
  244. break;
  245. case MediaService_Method_IsCameraOnStatus:
  246. if (dwSignature != MediaService_MethodSignature_IsCameraOnStatus) {
  247. Error = Error_MethodSignatureFailed;
  248. }
  249. break;
  250. default:
  251. Error = Error_MethodNotFound;
  252. break;
  253. }
  254. return Error;
  255. }
  256. virtual void Handle_GetVideoDeviceName(SpReqAnsContext<MediaService_GetVideoDeviceName_Req, MediaService_GetVideoDeviceName_Ans>::Pointer ctx)
  257. {
  258. /// override by user
  259. }
  260. virtual void Handle_StartCamera(SpOnewayCallContext<MediaService_StartCamera_Info>::Pointer ctx)
  261. {
  262. /// override by user
  263. }
  264. virtual void Handle_StopCamera(SpOnewayCallContext<MediaService_StopCamera_Info>::Pointer ctx)
  265. {
  266. /// override by user
  267. }
  268. virtual void Handle_StartEnvCamera(SpReqAnsContext<MediaService_StartEnvCamera_Req, MediaService_StartEnvCamera_Ans>::Pointer ctx)
  269. {
  270. /// override by user
  271. }
  272. virtual void Handle_StopEnvCamera(SpOnewayCallContext<MediaService_StopEnvCamera_Info>::Pointer ctx)
  273. {
  274. /// override by user
  275. }
  276. virtual void Handle_StartSpeakerRender(SpOnewayCallContext<MediaService_StartSpeakerRender_Info>::Pointer ctx)
  277. {
  278. /// override by user
  279. }
  280. virtual void Handle_StopSpeakerRender(SpOnewayCallContext<MediaService_StopSpeakerRender_Info>::Pointer ctx)
  281. {
  282. /// override by user
  283. }
  284. virtual void Handle_ManipulateMediaDevice(SpReqAnsContext<MediaService_ManipulateMediaDevice_Req, MediaService_ManipulateMediaDevice_Ans>::Pointer ctx)
  285. {
  286. /// override by user
  287. }
  288. virtual void Handle_GetAudioDevices(SpReqAnsContext<MediaService_GetAudioDevices_Req, MediaService_GetAudioDevices_Ans>::Pointer ctx)
  289. {
  290. /// override by user
  291. }
  292. virtual void Handle_GetVideoDevices(SpReqAnsContext<MediaService_GetVideoDevices_Req, MediaService_GetVideoDevices_Ans>::Pointer ctx)
  293. {
  294. /// override by user
  295. }
  296. virtual void Handle_GetCameraInfos(SpReqAnsContext<MediaService_GetCameraInfos_Req, MediaService_GetCameraInfos_Ans>::Pointer ctx)
  297. {
  298. /// override by user
  299. }
  300. virtual void Handle_ManipulateCameras(SpReqAnsContext<MediaService_ManipulateCameras_Req, MediaService_ManipulateCameras_Ans>::Pointer ctx)
  301. {
  302. /// override by user
  303. }
  304. virtual void Handle_GetEnvCameraVideoCaptureInfo(SpReqAnsContext<MediaService_GetEnvCameraVideoCaptureInfo_Req, MediaService_GetEnvCameraVideoCaptureInfo_Ans>::Pointer ctx)
  305. {
  306. /// override by user
  307. }
  308. virtual void Handle_GetEnvCamRawBrightnessInfo(SpReqAnsContext<MediaService_GetEnvCamRawBrightnessInfo_Req, MediaService_GetEnvCamRawBrightnessInfo_Ans>::Pointer ctx)
  309. {
  310. /// override by user
  311. }
  312. virtual void Handle_SetEnvCamRawBrightness(SpReqAnsContext<MediaService_SetEnvCamRawBrightness_Req, MediaService_SetEnvCamRawBrightness_Ans>::Pointer ctx)
  313. {
  314. /// override by user
  315. }
  316. virtual void Handle_TurnOnCamera(SpReqAnsContext<MediaService_TurnOnCamera_Req, MediaService_TurnOnCamera_Ans>::Pointer ctx)
  317. {
  318. /// override by user
  319. }
  320. virtual void Handle_TurnOffCamera(SpReqAnsContext<MediaService_TurnOffCamera_Req, MediaService_TurnOffCamera_Ans>::Pointer ctx)
  321. {
  322. /// override by user
  323. }
  324. virtual void Handle_IsCameraOnStatus(SpReqAnsContext<MediaService_IsCameraOnStatus_Req, MediaService_IsCameraOnStatus_Ans>::Pointer ctx)
  325. {
  326. /// override by user
  327. }
  328. virtual void OnRequest(CSmartPointer<ITransactionContext> pTransactionContext)
  329. {
  330. CAutoBuffer Buf;
  331. DWORD dwMessageID;
  332. DWORD dwMessageSignature;
  333. ErrorCodeEnum Error = pTransactionContext->GetReceiveBuffer(dwMessageID, dwMessageSignature, Buf);
  334. if (Error == Error_Succeed) {
  335. #ifdef DEBUG
  336. assert(CheckMessageSignature(dwMessageID, dwMessageSignature) == Error_Succeed);
  337. #else
  338. if (CheckMessageSignature(dwMessageID, dwMessageSignature) != Error_Succeed) {
  339. pTransactionContext->SendAnswer(Error_MethodSignatureFailed);
  340. return;
  341. }
  342. #endif
  343. switch (dwMessageID) {
  344. case MediaService_Method_GetVideoDeviceName:
  345. {
  346. SpReqAnsContext<MediaService_GetVideoDeviceName_Req,MediaService_GetVideoDeviceName_Ans>::Pointer ctx;
  347. ctx.Attach(new SpReqAnsContext<MediaService_GetVideoDeviceName_Req,MediaService_GetVideoDeviceName_Ans>(pTransactionContext));
  348. SpBuffer2Object(Buf, ctx->Req);
  349. pTransactionContext->GetLinkContext(ctx->link);
  350. EntityResource::setLink(ctx->link);
  351. Handle_GetVideoDeviceName(ctx);
  352. }
  353. break;
  354. case MediaService_Method_StartCamera:
  355. {
  356. SpOnewayCallContext<MediaService_StartCamera_Info>::Pointer ctx;
  357. ctx.Attach(new SpOnewayCallContext<MediaService_StartCamera_Info>());
  358. SpBuffer2Object(Buf, ctx->Info);
  359. pTransactionContext->GetLinkContext(ctx->link);
  360. EntityResource::setLink(ctx->link);
  361. Handle_StartCamera(ctx);
  362. }
  363. break;
  364. case MediaService_Method_StopCamera:
  365. {
  366. SpOnewayCallContext<MediaService_StopCamera_Info>::Pointer ctx;
  367. ctx.Attach(new SpOnewayCallContext<MediaService_StopCamera_Info>());
  368. SpBuffer2Object(Buf, ctx->Info);
  369. pTransactionContext->GetLinkContext(ctx->link);
  370. EntityResource::setLink(ctx->link);
  371. Handle_StopCamera(ctx);
  372. }
  373. break;
  374. case MediaService_Method_StartEnvCamera:
  375. {
  376. SpReqAnsContext<MediaService_StartEnvCamera_Req,MediaService_StartEnvCamera_Ans>::Pointer ctx;
  377. ctx.Attach(new SpReqAnsContext<MediaService_StartEnvCamera_Req,MediaService_StartEnvCamera_Ans>(pTransactionContext));
  378. SpBuffer2Object(Buf, ctx->Req);
  379. pTransactionContext->GetLinkContext(ctx->link);
  380. EntityResource::setLink(ctx->link);
  381. Handle_StartEnvCamera(ctx);
  382. }
  383. break;
  384. case MediaService_Method_StopEnvCamera:
  385. {
  386. SpOnewayCallContext<MediaService_StopEnvCamera_Info>::Pointer ctx;
  387. ctx.Attach(new SpOnewayCallContext<MediaService_StopEnvCamera_Info>());
  388. SpBuffer2Object(Buf, ctx->Info);
  389. pTransactionContext->GetLinkContext(ctx->link);
  390. EntityResource::setLink(ctx->link);
  391. Handle_StopEnvCamera(ctx);
  392. }
  393. break;
  394. case MediaService_Method_StartSpeakerRender:
  395. {
  396. SpOnewayCallContext<MediaService_StartSpeakerRender_Info>::Pointer ctx;
  397. ctx.Attach(new SpOnewayCallContext<MediaService_StartSpeakerRender_Info>());
  398. SpBuffer2Object(Buf, ctx->Info);
  399. pTransactionContext->GetLinkContext(ctx->link);
  400. EntityResource::setLink(ctx->link);
  401. Handle_StartSpeakerRender(ctx);
  402. }
  403. break;
  404. case MediaService_Method_StopSpeakerRender:
  405. {
  406. SpOnewayCallContext<MediaService_StopSpeakerRender_Info>::Pointer ctx;
  407. ctx.Attach(new SpOnewayCallContext<MediaService_StopSpeakerRender_Info>());
  408. SpBuffer2Object(Buf, ctx->Info);
  409. pTransactionContext->GetLinkContext(ctx->link);
  410. EntityResource::setLink(ctx->link);
  411. Handle_StopSpeakerRender(ctx);
  412. }
  413. break;
  414. case MediaService_Method_ManipulateMediaDevice:
  415. {
  416. SpReqAnsContext<MediaService_ManipulateMediaDevice_Req,MediaService_ManipulateMediaDevice_Ans>::Pointer ctx;
  417. ctx.Attach(new SpReqAnsContext<MediaService_ManipulateMediaDevice_Req,MediaService_ManipulateMediaDevice_Ans>(pTransactionContext));
  418. SpBuffer2Object(Buf, ctx->Req);
  419. pTransactionContext->GetLinkContext(ctx->link);
  420. EntityResource::setLink(ctx->link);
  421. Handle_ManipulateMediaDevice(ctx);
  422. }
  423. break;
  424. case MediaService_Method_GetAudioDevices:
  425. {
  426. SpReqAnsContext<MediaService_GetAudioDevices_Req,MediaService_GetAudioDevices_Ans>::Pointer ctx;
  427. ctx.Attach(new SpReqAnsContext<MediaService_GetAudioDevices_Req,MediaService_GetAudioDevices_Ans>(pTransactionContext));
  428. SpBuffer2Object(Buf, ctx->Req);
  429. pTransactionContext->GetLinkContext(ctx->link);
  430. EntityResource::setLink(ctx->link);
  431. Handle_GetAudioDevices(ctx);
  432. }
  433. break;
  434. case MediaService_Method_GetVideoDevices:
  435. {
  436. SpReqAnsContext<MediaService_GetVideoDevices_Req,MediaService_GetVideoDevices_Ans>::Pointer ctx;
  437. ctx.Attach(new SpReqAnsContext<MediaService_GetVideoDevices_Req,MediaService_GetVideoDevices_Ans>(pTransactionContext));
  438. SpBuffer2Object(Buf, ctx->Req);
  439. pTransactionContext->GetLinkContext(ctx->link);
  440. EntityResource::setLink(ctx->link);
  441. Handle_GetVideoDevices(ctx);
  442. }
  443. break;
  444. case MediaService_Method_GetCameraInfos:
  445. {
  446. SpReqAnsContext<MediaService_GetCameraInfos_Req,MediaService_GetCameraInfos_Ans>::Pointer ctx;
  447. ctx.Attach(new SpReqAnsContext<MediaService_GetCameraInfos_Req,MediaService_GetCameraInfos_Ans>(pTransactionContext));
  448. SpBuffer2Object(Buf, ctx->Req);
  449. pTransactionContext->GetLinkContext(ctx->link);
  450. EntityResource::setLink(ctx->link);
  451. Handle_GetCameraInfos(ctx);
  452. }
  453. break;
  454. case MediaService_Method_ManipulateCameras:
  455. {
  456. SpReqAnsContext<MediaService_ManipulateCameras_Req,MediaService_ManipulateCameras_Ans>::Pointer ctx;
  457. ctx.Attach(new SpReqAnsContext<MediaService_ManipulateCameras_Req,MediaService_ManipulateCameras_Ans>(pTransactionContext));
  458. SpBuffer2Object(Buf, ctx->Req);
  459. pTransactionContext->GetLinkContext(ctx->link);
  460. EntityResource::setLink(ctx->link);
  461. Handle_ManipulateCameras(ctx);
  462. }
  463. break;
  464. case MediaService_Method_GetEnvCameraVideoCaptureInfo:
  465. {
  466. SpReqAnsContext<MediaService_GetEnvCameraVideoCaptureInfo_Req,MediaService_GetEnvCameraVideoCaptureInfo_Ans>::Pointer ctx;
  467. ctx.Attach(new SpReqAnsContext<MediaService_GetEnvCameraVideoCaptureInfo_Req,MediaService_GetEnvCameraVideoCaptureInfo_Ans>(pTransactionContext));
  468. SpBuffer2Object(Buf, ctx->Req);
  469. pTransactionContext->GetLinkContext(ctx->link);
  470. EntityResource::setLink(ctx->link);
  471. Handle_GetEnvCameraVideoCaptureInfo(ctx);
  472. }
  473. break;
  474. case MediaService_Method_GetEnvCamRawBrightnessInfo:
  475. {
  476. SpReqAnsContext<MediaService_GetEnvCamRawBrightnessInfo_Req,MediaService_GetEnvCamRawBrightnessInfo_Ans>::Pointer ctx;
  477. ctx.Attach(new SpReqAnsContext<MediaService_GetEnvCamRawBrightnessInfo_Req,MediaService_GetEnvCamRawBrightnessInfo_Ans>(pTransactionContext));
  478. SpBuffer2Object(Buf, ctx->Req);
  479. pTransactionContext->GetLinkContext(ctx->link);
  480. EntityResource::setLink(ctx->link);
  481. Handle_GetEnvCamRawBrightnessInfo(ctx);
  482. }
  483. break;
  484. case MediaService_Method_SetEnvCamRawBrightness:
  485. {
  486. SpReqAnsContext<MediaService_SetEnvCamRawBrightness_Req,MediaService_SetEnvCamRawBrightness_Ans>::Pointer ctx;
  487. ctx.Attach(new SpReqAnsContext<MediaService_SetEnvCamRawBrightness_Req,MediaService_SetEnvCamRawBrightness_Ans>(pTransactionContext));
  488. SpBuffer2Object(Buf, ctx->Req);
  489. pTransactionContext->GetLinkContext(ctx->link);
  490. EntityResource::setLink(ctx->link);
  491. Handle_SetEnvCamRawBrightness(ctx);
  492. }
  493. break;
  494. case MediaService_Method_TurnOnCamera:
  495. {
  496. SpReqAnsContext<MediaService_TurnOnCamera_Req,MediaService_TurnOnCamera_Ans>::Pointer ctx;
  497. ctx.Attach(new SpReqAnsContext<MediaService_TurnOnCamera_Req,MediaService_TurnOnCamera_Ans>(pTransactionContext));
  498. SpBuffer2Object(Buf, ctx->Req);
  499. pTransactionContext->GetLinkContext(ctx->link);
  500. EntityResource::setLink(ctx->link);
  501. Handle_TurnOnCamera(ctx);
  502. }
  503. break;
  504. case MediaService_Method_TurnOffCamera:
  505. {
  506. SpReqAnsContext<MediaService_TurnOffCamera_Req,MediaService_TurnOffCamera_Ans>::Pointer ctx;
  507. ctx.Attach(new SpReqAnsContext<MediaService_TurnOffCamera_Req,MediaService_TurnOffCamera_Ans>(pTransactionContext));
  508. SpBuffer2Object(Buf, ctx->Req);
  509. pTransactionContext->GetLinkContext(ctx->link);
  510. EntityResource::setLink(ctx->link);
  511. Handle_TurnOffCamera(ctx);
  512. }
  513. break;
  514. case MediaService_Method_IsCameraOnStatus:
  515. {
  516. SpReqAnsContext<MediaService_IsCameraOnStatus_Req,MediaService_IsCameraOnStatus_Ans>::Pointer ctx;
  517. ctx.Attach(new SpReqAnsContext<MediaService_IsCameraOnStatus_Req,MediaService_IsCameraOnStatus_Ans>(pTransactionContext));
  518. SpBuffer2Object(Buf, ctx->Req);
  519. pTransactionContext->GetLinkContext(ctx->link);
  520. EntityResource::setLink(ctx->link);
  521. Handle_IsCameraOnStatus(ctx);
  522. }
  523. break;
  524. default:
  525. assert(0);
  526. break;
  527. }
  528. } else {
  529. pTransactionContext->SendAnswer(Error);
  530. }
  531. }
  532. };
  533. ///////////////////////////
  534. } // namespace MediaController
  535. #endif // __MEDIACONTROLLER_SERVER_G_H