From c22701301750e54472e8bf65f07d8f2ec1cfc09a Mon Sep 17 00:00:00 2001 From: Jean-Yves Avenard Date: Mon, 3 Jun 2013 17:12:54 +1000 Subject: [PATCH] Remove now unused files --- mythtv/libs/libmythtv/iptv/iptvfeederhls.cpp | 150 ------------------- mythtv/libs/libmythtv/iptv/iptvfeederhls.h | 46 ------ mythtv/libs/libmythtv/iptvchannel.h | 63 -------- 3 files changed, 259 deletions(-) delete mode 100644 mythtv/libs/libmythtv/iptv/iptvfeederhls.cpp delete mode 100644 mythtv/libs/libmythtv/iptv/iptvfeederhls.h delete mode 100644 mythtv/libs/libmythtv/iptvchannel.h diff --git a/mythtv/libs/libmythtv/iptv/iptvfeederhls.cpp b/mythtv/libs/libmythtv/iptv/iptvfeederhls.cpp deleted file mode 100644 index a191ec85ce1..00000000000 --- a/mythtv/libs/libmythtv/iptv/iptvfeederhls.cpp +++ /dev/null @@ -1,150 +0,0 @@ -// -// iptvfeederhls.cpp -// MythTV -// -// Created by Jean-Yves Avenard on 24/05/12. -// Copyright (c) 2012 Bubblestuff Pty Ltd. All rights reserved. -// - -#include - -#include "iptvfeederhls.h" - -// MythTV headers -#include "mythlogging.h" -#include "streamlisteners.h" - -#include "HLS/httplivestreambuffer.h" -#define LOC QString("IPTVHLS: ") - -#define TS_SIZE 188 - -// BUFFER_SIZE must be a multiple of TS_SIZE, otherwise the IPTVRecorder will -// choke on it -#define BUFFER_SIZE (128 * TS_SIZE) - -IPTVFeederHLS::IPTVFeederHLS() : - m_buffer(new uint8_t[BUFFER_SIZE]), m_hls(NULL), - m_interrupted(false), m_running(false), m_init(false) -{ -} - -IPTVFeederHLS::~IPTVFeederHLS() -{ - Close(); - delete[] m_buffer; -} - -bool IPTVFeederHLS::IsHLS(const QString &url) -{ - QString turl = url; - return HLSRingBuffer::TestForHTTPLiveStreaming(turl); -} - -bool IPTVFeederHLS::IsOpen(void) const -{ - if (m_hls == NULL) - return false; - return m_hls->IsOpen(); -} - -bool IPTVFeederHLS::Open(const QString &url) -{ - LOG(VB_RECORD, LOG_INFO, LOC + QString("Open(%1) -- begin").arg(url)); - - QMutexLocker locker(&_lock); - - if (m_hls) - { - LOG(VB_RECORD, LOG_INFO, LOC + "Open() -- end 1"); - return true; - } - - m_url = url; - m_hls = new HLSRingBuffer(url, false); - - LOG(VB_RECORD, LOG_INFO, LOC + "Open() -- end"); - - return true; -} - -void IPTVFeederHLS::Run(void) -{ - m_lock.lock(); - m_running = true; - m_interrupted = false; - m_lock.unlock(); - - m_hls->Continue(); - if (!m_init) - { - m_init = m_hls->OpenFile(m_url); - } - - while (!m_interrupted && m_init) - { - if (m_hls == NULL) - break; - if (_listeners.empty()) - { - // No-one is listening, no point emptying the HLS buffer - usleep(50000); - continue; - } - m_lock.lock(); - uint size = m_hls->Read((void *)m_buffer, BUFFER_SIZE); - if (size < 0) - { - m_lock.unlock(); - break; - } - - if (m_buffer[0] != 0x47) - { - LOG(VB_RECORD, LOG_INFO, LOC + - QString("Packet not starting with SYNC Byte (got 0x%1)") - .arg((char)m_buffer[0], 2, QLatin1Char('0'))); - } - - _lock.lock(); - vector::iterator it = _listeners.begin(); - for (; it != _listeners.end(); ++it) - (*it)->AddData(m_buffer, size); - _lock.unlock(); - m_lock.unlock(); - } - - m_running = false; - m_lock.lock(); - m_waitcond.wakeAll(); - m_lock.unlock(); -} - -void IPTVFeederHLS::Stop(void) -{ - LOG(VB_RECORD, LOG_INFO, LOC + "Stop() -- begin"); - QMutexLocker locker(&m_lock); - - m_interrupted = true; - - if (m_hls) - m_hls->Interrupt(); - - while (m_running) - m_waitcond.wait(&m_lock, 500); - - LOG(VB_RECORD, LOG_INFO, LOC + "Stop() -- end"); -} - -void IPTVFeederHLS::Close(void) -{ - LOG(VB_RECORD, LOG_INFO, LOC + "Close() -- begin"); - Stop(); - - QMutexLocker lock(&m_lock); - delete m_hls; - m_hls = NULL; - m_init = false; - - LOG(VB_RECORD, LOG_INFO, LOC + "Close() -- end"); -} diff --git a/mythtv/libs/libmythtv/iptv/iptvfeederhls.h b/mythtv/libs/libmythtv/iptv/iptvfeederhls.h deleted file mode 100644 index 3bc956f7eef..00000000000 --- a/mythtv/libs/libmythtv/iptv/iptvfeederhls.h +++ /dev/null @@ -1,46 +0,0 @@ -// -// iptvfeederhls.h -// MythTV -// -// Created by Jean-Yves Avenard on 24/05/12. -// Copyright (c) 2012 Bubblestuff Pty Ltd. All rights reserved. -// - -#ifndef MythTV_iptvfeederhls_h -#define MythTV_iptvfeederhls_h - -// MythTV headers -#include "mythcorecontext.h" -#include "iptvfeederlive.h" - -class TSDataListener; -class HLSRingBuffer; - -class IPTVFeederHLS : public IPTVFeederLive -{ -public: - IPTVFeederHLS(); - virtual ~IPTVFeederHLS(); - - bool CanHandle(const QString &url) const { return IsHLS(url); } - bool IsOpen(void) const; - - bool Open(const QString &url); - void Stop(void); - void Close(void); - void Run(void); - - static bool IsHLS(const QString &url); - -private: - uint8_t *m_buffer; - QString m_url; - HLSRingBuffer *m_hls; - mutable QMutex m_lock; - QWaitCondition m_waitcond; - bool m_interrupted; - bool m_running; - bool m_init; -}; - -#endif diff --git a/mythtv/libs/libmythtv/iptvchannel.h b/mythtv/libs/libmythtv/iptvchannel.h deleted file mode 100644 index 18f67de0551..00000000000 --- a/mythtv/libs/libmythtv/iptvchannel.h +++ /dev/null @@ -1,63 +0,0 @@ -/** -*- Mode: c++ -*- - * IPTVChannel - * Copyright (c) 2006 by Laurent Arnal, Benjamin Lerman & Mickaƫl Remars - * Distributed as part of MythTV under GPL v2 and later. - */ - -#ifndef _IPTV_CHANNEL_H_ -#define _IPTV_CHANNEL_H_ - -#include -#include - -#include "dtvchannel.h" -#include "iptvchannelinfo.h" - -class IPTVFeederWrapper; - -class IPTVChannel : public DTVChannel -{ - friend class IPTVSignalMonitor; - friend class IPTVRecorder; - - public: - IPTVChannel(TVRec *parent, const QString &videodev); - ~IPTVChannel(); - - // Commands - bool Open(void); - void Close(void); - bool SetChannelByString(const QString &channum); - - // Gets - bool IsOpen(void) const; - - // Channel scanning stuff - using DTVChannel::Tune; - bool Tune(const DTVMultiplex&, QString) { return true; } - - private: - IPTVChannelInfo GetCurrentChanInfo(void) const - { return GetChanInfo(m_curchannelname); } - - IPTVFeederWrapper *GetFeeder(void) { return m_feeder; } - const IPTVFeederWrapper *GetFeeder(void) const { return m_feeder; } - - IPTVChannelInfo GetChanInfo( - const QString &channum, uint sourceid = 0) const; - - private: - QString m_videodev; - fbox_chan_map_t m_freeboxchannels; - IPTVFeederWrapper *m_feeder; - mutable QMutex m_lock; - - private: - IPTVChannel &operator=(const IPTVChannel&); //< avoid default impl - IPTVChannel(const IPTVChannel&); //< avoid default impl - IPTVChannel(); //< avoid default impl -}; - -#endif // _IPTV_CHANNEL_H_ - -/* vim: set expandtab tabstop=4 shiftwidth=4: */