dmxdev.h 2.3 KB

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