dmxdev.h 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. /*
  2. * dmxdev.h
  3. *
  4. * Copyright (C) 2000 Ralph Metzler & Marcus Metzler
  5. * for convergence integrated media GmbH
  6. *
  7. * This program is free software; you can redistribute it and/or
  8. * modify it under the terms of the GNU Lesser General Public License
  9. * as published by the Free Software Foundation; either version 2.1
  10. * of the License, or (at your option) any later version.
  11. *
  12. * This program is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. * GNU General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU Lesser General Public License
  18. * along with this program; if not, write to the Free Software
  19. * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  20. *
  21. */
  22. #ifndef _DMXDEV_H_
  23. #define _DMXDEV_H_
  24. #include <linux/types.h>
  25. #include <linux/spinlock.h>
  26. #include <linux/kernel.h>
  27. #include <linux/timer.h>
  28. #include <linux/wait.h>
  29. #include <linux/fs.h>
  30. #include <linux/string.h>
  31. #include <linux/mutex.h>
  32. #include <linux/slab.h>
  33. #include <linux/dvb/dmx.h>
  34. #include "dvbdev.h"
  35. #include "demux.h"
  36. #include "dvb_ringbuffer.h"
  37. enum dmxdev_type {
  38. DMXDEV_TYPE_NONE,
  39. DMXDEV_TYPE_SEC,
  40. DMXDEV_TYPE_PES,
  41. };
  42. enum dmxdev_state {
  43. DMXDEV_STATE_FREE,
  44. DMXDEV_STATE_ALLOCATED,
  45. DMXDEV_STATE_SET,
  46. DMXDEV_STATE_GO,
  47. DMXDEV_STATE_DONE,
  48. DMXDEV_STATE_TIMEDOUT
  49. };
  50. struct dmxdev_feed {
  51. u16 pid;
  52. struct dmx_ts_feed *ts;
  53. struct list_head next;
  54. };
  55. struct dmxdev_filter {
  56. union {
  57. struct dmx_section_filter *sec;
  58. } filter;
  59. union {
  60. /* list of TS and PES feeds (struct dmxdev_feed) */
  61. struct list_head ts;
  62. struct dmx_section_feed *sec;
  63. } feed;
  64. union {
  65. struct dmx_sct_filter_params sec;
  66. struct dmx_pes_filter_params pes;
  67. } params;
  68. enum dmxdev_type type;
  69. enum dmxdev_state state;
  70. struct dmxdev *dev;
  71. struct dvb_ringbuffer buffer;
  72. struct mutex mutex;
  73. /* only for sections */
  74. struct timer_list timer;
  75. int todo;
  76. u8 secheader[3];
  77. };
  78. struct dmxdev {
  79. struct dvb_device *dvbdev;
  80. struct dvb_device *dvr_dvbdev;
  81. struct dmxdev_filter *filter;
  82. struct dmx_demux *demux;
  83. int filternum;
  84. int capabilities;
  85. unsigned int exit:1;
  86. #define DMXDEV_CAP_DUPLEX 1
  87. struct dmx_frontend *dvr_orig_fe;
  88. struct dvb_ringbuffer dvr_buffer;
  89. #define DVR_BUFFER_SIZE (10*188*1024)
  90. struct mutex mutex;
  91. spinlock_t lock;
  92. };
  93. int dvb_dmxdev_init(struct dmxdev *dmxdev, struct dvb_adapter *);
  94. void dvb_dmxdev_release(struct dmxdev *dmxdev);
  95. #endif /* _DMXDEV_H_ */