mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-09-10 07:08:33 +02:00
Merge branch 'uncool/dvbsi++' commit '6e0bc85a6c0'
This is the last commit before the "menu hints" started. Needs buildfixing... Conflicts: configure.ac src/daemonc/remotecontrol.cpp src/daemonc/remotecontrol.h src/driver/audiodec/basedec.cpp src/driver/fb_window.cpp src/driver/rcinput.cpp src/driver/volume.cpp src/global.h src/gui/channellist.cpp src/gui/eventlist.cpp src/gui/infoviewer.cpp src/gui/keybind_setup.cpp src/gui/miscsettings_menu.cpp src/gui/movieplayer.cpp src/gui/osd_setup.cpp src/gui/plugins.cpp src/gui/scan.cpp src/gui/scan_setup.cpp src/gui/streaminfo2.cpp src/gui/videosettings.cpp src/gui/widget/buttons.cpp src/neutrino.cpp src/sectionsd/dmx.cpp src/sectionsd/dmxapi.cpp src/sectionsd/sectionsd.cpp src/system/setting_helpers.cpp src/zapit/include/zapit/client/zapittypes.h src/zapit/include/zapit/frontend_c.h src/zapit/include/zapit/satconfig.h src/zapit/include/zapit/scan.h src/zapit/lib/zapitclient.cpp src/zapit/src/Makefile.am src/zapit/src/frontend.cpp src/zapit/src/getservices.cpp src/zapit/src/pmt.cpp src/zapit/src/scan.cpp src/zapit/src/sdt.cpp src/zapit/src/zapit.cpp
This commit is contained in:
132
src/eitd/dmx.h
Normal file
132
src/eitd/dmx.h
Normal file
@@ -0,0 +1,132 @@
|
||||
/*
|
||||
* DMX class (sectionsd) - d-box2 linux project
|
||||
*
|
||||
* (C) 2003 by thegoodguy <thegoodguy@berlios.de>
|
||||
* Copyright (C) 2011-2012 CoolStream International Ltd
|
||||
*
|
||||
* License: GPLv2
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation;
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef __sectionsd__dmx_h__
|
||||
#define __sectionsd__dmx_h__
|
||||
|
||||
#include <pthread.h>
|
||||
#include <stdint.h>
|
||||
#include <sys/types.h>
|
||||
#include <vector>
|
||||
#include <config.h>
|
||||
#if HAVE_COOL_HARDWARE
|
||||
#include <dmx_cs.h>
|
||||
#endif
|
||||
#if HAVE_TRIPLEDRAGON || USE_STB_HAL
|
||||
#include <dmx_td.h>
|
||||
#endif
|
||||
|
||||
#include <zapit/types.h>
|
||||
#include <set>
|
||||
#include <map>
|
||||
#include <string>
|
||||
|
||||
#define MAX_SECTION_LENGTH (0x0fff + 3)
|
||||
|
||||
typedef uint64_t sections_id_t;
|
||||
typedef unsigned char version_number_t;
|
||||
|
||||
typedef std::set<sections_id_t> section_map_t;
|
||||
typedef std::map<sections_id_t, version_number_t, std::less<sections_id_t> > MyDMXOrderUniqueKey;
|
||||
|
||||
class DMX
|
||||
{
|
||||
protected:
|
||||
|
||||
int fd;
|
||||
cDemux * dmx;
|
||||
int dmx_num;
|
||||
unsigned short pID;
|
||||
unsigned short dmxBufferSizeInKB;
|
||||
sections_id_t first_skipped;
|
||||
t_channel_id current_service;
|
||||
unsigned char eit_version;
|
||||
bool cache; /* should read sections be cached? true for all but dmxCN */
|
||||
int real_pauseCounter;
|
||||
std::string name;
|
||||
|
||||
/* flag to check if there was section for that table, if yes, dont increase timeouts */
|
||||
bool seen_section;
|
||||
|
||||
inline bool isOpen(void) {
|
||||
return (fd != -1);
|
||||
}
|
||||
|
||||
int immediate_start(void); /* mutex must be locked before and unlocked after this method */
|
||||
int immediate_stop(void); /* mutex must be locked before and unlocked after this method */
|
||||
|
||||
bool next_filter();
|
||||
void init();
|
||||
|
||||
section_map_t seenSections;
|
||||
section_map_t calcedSections;
|
||||
MyDMXOrderUniqueKey myDMXOrderUniqueKey;
|
||||
bool check_complete(sections_id_t sectionNo, uint8_t number, uint8_t last, uint8_t segment_last);
|
||||
public:
|
||||
struct s_filters
|
||||
{
|
||||
unsigned char filter;
|
||||
unsigned char mask;
|
||||
};
|
||||
|
||||
std::vector<s_filters> filters;
|
||||
int filter_index;
|
||||
time_t lastChanged;
|
||||
|
||||
pthread_cond_t change_cond;
|
||||
pthread_mutex_t start_stop_mutex;
|
||||
|
||||
DMX();
|
||||
DMX(const unsigned short p, const unsigned short bufferSizeInKB, const bool cache = true, int dmx_source = 0);
|
||||
~DMX();
|
||||
|
||||
int start(void);
|
||||
void closefd(void);
|
||||
void addfilter(const unsigned char filter, const unsigned char mask);
|
||||
int stop(void);
|
||||
void close(void);
|
||||
|
||||
int real_pause(void);
|
||||
int real_unpause(void);
|
||||
#if 0
|
||||
int request_pause(void);
|
||||
int request_unpause(void);
|
||||
#endif
|
||||
int change(const int new_filter_index, const t_channel_id new_current_service = 0); // locks while changing
|
||||
|
||||
void lock(void);
|
||||
void unlock(void);
|
||||
|
||||
// section with size < 3 + 5 are skipped !
|
||||
int getSection(uint8_t *buf, const unsigned timeoutInMSeconds, int &timeouts);
|
||||
int setPid(const unsigned short new_pid);
|
||||
int setCurrentService(t_channel_id new_current_service);
|
||||
int dropCachedSectionIDs();
|
||||
|
||||
unsigned char get_eit_version(void) { return eit_version; }
|
||||
// was useful for debugging...
|
||||
t_channel_id get_current_service(void) { return current_service; }
|
||||
};
|
||||
|
||||
#endif /* __sectionsd__dmx_h__ */
|
||||
|
Reference in New Issue
Block a user