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/time.h>
  28. #include <linux/timer.h>
  29. #include <linux/wait.h>
  30. #include <linux/fs.h>
  31. #include <linux/string.h>
  32. #include <linux/mutex.h>
  33. #include <linux/slab.h>
  34. #include <linux/dvb/dmx.h>
  35. #include "dvbdev.h"
  36. #include "demux.h"
  37. #include "dvb_ringbuffer.h"
  38. enum dmxdev_type {
  39. DMXDEV_TYPE_NONE,
  40. DMXDEV_TYPE_SEC,
  41. DMXDEV_TYPE_PES,
  42. };
  43. enum dmxdev_state {
  44. DMXDEV_STATE_FREE,
  45. DMXDEV_STATE_ALLOCATED,
  46. DMXDEV_STATE_SET,
  47. DMXDEV_STATE_GO,
  48. DMXDEV_STATE_DONE,
  49. DMXDEV_STATE_TIMEDOUT
  50. };
  51. struct dmxdev_feed {
  52. u16 pid;
  53. struct dmx_ts_feed *ts;
  54. struct list_head next;
  55. };
  56. struct dmxdev_filter {
  57. union {
  58. struct dmx_section_filter *sec;
  59. } filter;
  60. union {
  61. /* list of TS and PES feeds (struct dmxdev_feed) */
  62. struct list_head ts;
  63. struct dmx_section_feed *sec;
  64. } feed;
  65. union {
  66. struct dmx_sct_filter_params sec;
  67. struct dmx_pes_filter_params pes;
  68. } params;
  69. enum dmxdev_type type;
  70. enum dmxdev_state state;
  71. struct dmxdev *dev;
  72. struct dvb_ringbuffer buffer;
  73. struct mutex mutex;
  74. /* only for sections */
  75. struct timer_list timer;
  76. int todo;
  77. u8 secheader[3];
  78. };
  79. struct dmxdev {
  80. struct dvb_device *dvbdev;
  81. struct dvb_device *dvr_dvbdev;
  82. struct dmxdev_filter *filter;
  83. struct dmx_demux *demux;
  84. int filternum;
  85. int capabilities;
  86. unsigned int exit:1;
  87. #define DMXDEV_CAP_DUPLEX 1
  88. struct dmx_frontend *dvr_orig_fe;
  89. struct dvb_ringbuffer dvr_buffer;
  90. #define DVR_BUFFER_SIZE (10*188*1024)
  91. struct mutex mutex;
  92. spinlock_t lock;
  93. };
  94. int dvb_dmxdev_init(struct dmxdev *dmxdev, struct dvb_adapter *);
  95. void dvb_dmxdev_release(struct dmxdev *dmxdev);
  96. #endif /* _DMXDEV_H_ */