diff options
author | Andreas Monzner <andreas.monzner@multimedia-labs.de> | 2006-05-14 12:23:23 (GMT) |
---|---|---|
committer | Andreas Monzner <andreas.monzner@multimedia-labs.de> | 2006-05-14 12:23:23 (GMT) |
commit | 1f3788c5e1a47fa9b0412902acba38c86b53bb63 (patch) | |
tree | bb0c67a1ecf37d5f1ace92e33b8e10f34881a57f /lib/dvb/decoder.cpp | |
parent | 7f19468027d025ce8597318e7211995871f17376 (diff) |
remove unneeded caching of caids, use an array for pidcache instead of std::map (safe memory)
prepare for different video stream types.. (H264) ( NOT for dm7025 )
Diffstat (limited to 'lib/dvb/decoder.cpp')
-rw-r--r-- | lib/dvb/decoder.cpp | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/lib/dvb/decoder.cpp b/lib/dvb/decoder.cpp index a6537e8..1bec997 100644 --- a/lib/dvb/decoder.cpp +++ b/lib/dvb/decoder.cpp @@ -175,13 +175,21 @@ eDVBVideo::eDVBVideo(eDVBDemux *demux, int dev): m_demux(demux), m_dev(dev) eWarning("%s: %m", filename); eDebug("demux device: %s", filename); } - -int eDVBVideo::startPid(int pid) + +// not finally values i think.. !! +#define VIDEO_STREAMTYPE_MPEG2 0 +#define VIDEO_STREAMTYPE_MPEG4_H264 1 + +int eDVBVideo::startPid(int pid, int type) { if ((m_fd < 0) || (m_fd_demux < 0)) return -1; dmx_pes_filter_params pes; + if (::ioctl(m_fd, VIDEO_SET_STREAMTYPE, + type == MPEG4_H264 ? VIDEO_STREAMTYPE_MPEG4_H264 : VIDEO_STREAMTYPE_MPEG2) < 0) + eWarning("video: VIDEO_SET_STREAMTYPE: %m"); + pes.pid = pid; pes.input = DMX_IN_FRONTEND; pes.output = DMX_OUT_DECODER; @@ -465,7 +473,7 @@ int eTSMPEGDecoder::setState() { eDebug("new video"); m_video = new eDVBVideo(m_demux, m_decoder); - if (m_video->startPid(m_vpid)) + if (m_video->startPid(m_vpid, m_vtype)) { eWarning("video: startpid failed!"); res = -1; @@ -522,12 +530,13 @@ eTSMPEGDecoder::~eTSMPEGDecoder() setState(); } -RESULT eTSMPEGDecoder::setVideoPID(int vpid) +RESULT eTSMPEGDecoder::setVideoPID(int vpid, int type) { if (m_vpid != vpid) { m_changed |= changeVideo; m_vpid = vpid; + m_vtype = type; } return 0; } |