videodev.h 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. /*
  2. * Copyright (C) 2008-2011 Teluu Inc. (http://www.teluu.com)
  3. *
  4. * This program is free software; you can redistribute it and/or modify
  5. * it under the terms of the GNU General Public License as published by
  6. * the Free Software Foundation; either version 2 of the License, or
  7. * (at your option) any later version.
  8. *
  9. * This program is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. * GNU General Public License for more details.
  13. *
  14. * You should have received a copy of the GNU General Public License
  15. * along with this program; if not, write to the Free Software
  16. * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  17. */
  18. #ifndef __PJMEDIA_VIDEODEV_VIDEODEV_H__
  19. #define __PJMEDIA_VIDEODEV_VIDEODEV_H__
  20. /**
  21. * @file videodev.h
  22. * @brief Video device API.
  23. */
  24. #include <pjmedia/videodev.h>
  25. PJ_BEGIN_DECL
  26. /**
  27. * @defgroup video_device_reference Video Device API Reference
  28. * @ingroup video_subsystem_api
  29. * @brief API Reference
  30. * @{
  31. */
  32. /**
  33. * Initialize the video device subsystem. This will register all supported
  34. * video device factories to the video device subsystem. This function may be
  35. * called more than once, but each call to this function must have the
  36. * corresponding #pjmedia_vid_dev_subsys_shutdown() call.
  37. *
  38. * @param pf The pool factory.
  39. *
  40. * @return PJ_SUCCESS on successful operation or the appropriate
  41. * error code.
  42. */
  43. PJ_DECL(pj_status_t) pjmedia_vid_dev_subsys_init(pj_pool_factory *pf);
  44. /**
  45. * Get the pool factory registered to the video device subsystem.
  46. *
  47. * @return The pool factory.
  48. */
  49. PJ_DECL(pj_pool_factory*) pjmedia_vid_dev_subsys_get_pool_factory(void);
  50. /**
  51. * Shutdown the video device subsystem. This will destroy all video device
  52. * factories registered in the video device subsystem. Note that currently
  53. * opened video streams may or may not be closed, depending on the
  54. * implementation of the video device factories.
  55. *
  56. * @return PJ_SUCCESS on successful operation or the appropriate
  57. * error code.
  58. */
  59. PJ_DECL(pj_status_t) pjmedia_vid_dev_subsys_shutdown(void);
  60. /**
  61. * Register a supported video device factory to the video device subsystem.
  62. * Application can either register a function to create the factory, or
  63. * an instance of an already created factory.
  64. *
  65. * This function can only be called after calling
  66. * #pjmedia_vid_dev_subsys_init().
  67. *
  68. * @param vdf The factory creation function. Either vdf or factory
  69. * argument must be specified.
  70. * @param factory Factory instance. Either vdf or factory
  71. * argument must be specified.
  72. *
  73. * @return PJ_SUCCESS on successful operation or the appropriate
  74. * error code.
  75. */
  76. PJ_DECL(pj_status_t)
  77. pjmedia_vid_register_factory(pjmedia_vid_dev_factory_create_func_ptr vdf,
  78. pjmedia_vid_dev_factory *factory);
  79. /**
  80. * Unregister a video device factory from the video device subsystem. This
  81. * function can only be called after calling #pjmedia_vid_dev_subsys_init().
  82. * Devices from this factory will be unlisted. If a device from this factory
  83. * is currently in use, then the behavior is undefined.
  84. *
  85. * @param vdf The video device factory. Either vdf or factory argument
  86. * must be specified.
  87. * @param factory The factory instance. Either vdf or factory argument
  88. * must be specified.
  89. *
  90. * @return PJ_SUCCESS on successful operation or the appropriate
  91. * error code.
  92. */
  93. PJ_DECL(pj_status_t)
  94. pjmedia_vid_unregister_factory(pjmedia_vid_dev_factory_create_func_ptr vdf,
  95. pjmedia_vid_dev_factory *factory);
  96. /**
  97. * @}
  98. */
  99. PJ_END_DECL
  100. #endif /* __PJMEDIA_VIDEODEV_VIDEODEV_H__ */