dllmain_dd.cxx 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. /* Copyright (C) 2015 Mamadou DIOP
  2. * Copyright (C) 2015 Doubango Telecom <http://www.doubango.org>
  3. *
  4. * This file is part of Open Source Doubango Framework.
  5. *
  6. * DOUBANGO is free software: you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License as published by
  8. * the Free Software Foundation, either version 3 of the License, or
  9. * (at your option) any later version.
  10. *
  11. * DOUBANGO is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. * GNU General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU General Public License
  17. * along with DOUBANGO.
  18. */
  19. #include "plugin_win_dd_config.h"
  20. #include "tinymedia/tmedia_producer.h"
  21. #include "tsk_plugin.h"
  22. #include "tsk_debug.h"
  23. #include <windows.h>
  24. extern const tmedia_producer_plugin_def_t *plugin_win_dd_producer_plugin_def_t;
  25. PLUGIN_WIN_DD_BEGIN_DECLS /* BEGIN */
  26. PLUGIN_WIN_DDP_API int __plugin_get_def_count();
  27. PLUGIN_WIN_DDP_API tsk_plugin_def_type_t __plugin_get_def_type_at(int index);
  28. PLUGIN_WIN_DDP_API tsk_plugin_def_media_type_t __plugin_get_def_media_type_at(int index);
  29. PLUGIN_WIN_DDP_API tsk_plugin_def_ptr_const_t __plugin_get_def_at(int index);
  30. PLUGIN_WIN_DD_END_DECLS /* END */
  31. BOOL APIENTRY DllMain(HMODULE hModule,
  32. DWORD ul_reason_for_call,
  33. LPVOID lpReserved
  34. )
  35. {
  36. switch (ul_reason_for_call) {
  37. case DLL_PROCESS_ATTACH:
  38. break;
  39. case DLL_THREAD_ATTACH:
  40. break;
  41. case DLL_THREAD_DETACH:
  42. break;
  43. case DLL_PROCESS_DETACH:
  44. break;
  45. }
  46. return TRUE;
  47. }
  48. typedef enum PLUGIN_INDEX_E {
  49. PLUGIN_INDEX_PRODUCER,
  50. PLUGIN_INDEX_COUNT
  51. }
  52. PLUGIN_INDEX_T;
  53. int __plugin_get_def_count()
  54. {
  55. return PLUGIN_INDEX_COUNT;
  56. }
  57. tsk_plugin_def_type_t __plugin_get_def_type_at(int index)
  58. {
  59. switch (index) {
  60. case PLUGIN_INDEX_PRODUCER: {
  61. return tsk_plugin_def_type_producer;
  62. }
  63. default: {
  64. TSK_DEBUG_ERROR("No plugin at index %d", index);
  65. return tsk_plugin_def_type_none;
  66. }
  67. }
  68. }
  69. tsk_plugin_def_media_type_t __plugin_get_def_media_type_at(int index)
  70. {
  71. switch (index) {
  72. case PLUGIN_INDEX_PRODUCER: {
  73. return tsk_plugin_def_media_type_screencast;
  74. }
  75. default: {
  76. TSK_DEBUG_ERROR("No plugin at index %d", index);
  77. return tsk_plugin_def_media_type_none;
  78. }
  79. }
  80. }
  81. tsk_plugin_def_ptr_const_t __plugin_get_def_at(int index)
  82. {
  83. switch (index) {
  84. case PLUGIN_INDEX_PRODUCER: {
  85. return plugin_win_dd_producer_plugin_def_t;
  86. }
  87. default: {
  88. TSK_DEBUG_ERROR("No plugin at index %d", index);
  89. return tsk_null;
  90. }
  91. }
  92. }