libv4l-plugin.h 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. /*
  2. * Copyright (C) 2010 Nokia Corporation <multimedia@maemo.org>
  3. * This program is free software; you can redistribute it and/or modify
  4. * it under the terms of the GNU Lesser General Public License as published by
  5. * the Free Software Foundation; either version 2.1 of the License, or
  6. * (at your option) any later version.
  7. *
  8. * This program is distributed in the hope that it will be useful,
  9. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  11. * Lesser General Public License for more details.
  12. *
  13. * You should have received a copy of the GNU Lesser General Public License
  14. * along with this program; if not, write to the Free Software
  15. * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  16. */
  17. #ifndef __LIBV4L_PLUGIN_H
  18. #define __LIBV4L_PLUGIN_H
  19. #include <sys/types.h>
  20. /* Structure libv4l_dev_ops holds the calls from libv4ls to video nodes.
  21. They can be normal open/close/ioctl etc. or any of them may be replaced
  22. with a callback by a loaded plugin.
  23. */
  24. struct libv4l_dev_ops {
  25. void * (*init)(int fd);
  26. void (*close)(void *dev_ops_priv);
  27. int (*ioctl)(void *dev_ops_priv, int fd, unsigned long int request, void *arg);
  28. ssize_t (*read)(void *dev_ops_priv, int fd, void *buffer, size_t n);
  29. ssize_t (*write)(void *dev_ops_priv, int fd, const void *buffer, size_t n);
  30. /* For future plugin API extension, plugins implementing the current API
  31. must set these all to NULL, as future versions may check for these */
  32. void (*reserved1)(void);
  33. void (*reserved2)(void);
  34. void (*reserved3)(void);
  35. void (*reserved4)(void);
  36. void (*reserved5)(void);
  37. void (*reserved6)(void);
  38. void (*reserved7)(void);
  39. };
  40. #endif