Esempio n. 1
0
Channel::Channel(Channel& channel)
  : m_id(channel.GetID()), 
    m_dvbLinkId(channel.GetDvbLinkID()), 
    m_name(channel.GetName()), 
    m_type(channel.GetChannelType()),
    Number(channel.Number), 
    SubNumber(channel.SubNumber),
    ChildLock(channel.ChildLock),
    m_logo_url(channel.GetLogoUrl())
{

}
Esempio n. 2
0
bool DVBLinkClient::OpenLiveStream(const PVR_CHANNEL &channel, bool use_timeshift, bool use_transcoder, int width, int height, int bitrate, std::string audiotrack)
{
    bool ret_val = false;

    //if transcoding is requested and no transcoder is supported return false
    if (use_transcoder && !transcoding_supported_)
    {
        XBMC->QueueNotification(QUEUE_ERROR, XBMC->GetLocalizedString(32024));
        return false;
    }
	
    PLATFORM::CLockObject critsec(m_mutex);

    if (m_live_streamer)
    {
        SAFE_DELETE(m_live_streamer);
    }
	//time-shifted playback always uses raw http stream type - no transcoding option is possible now
    if (use_timeshift)
        m_live_streamer = new TimeShiftBuffer(XBMC);
    else
        m_live_streamer = new LiveTVStreamer(XBMC);

    //adjust transcoded height and width if needed
    int w = width == 0 ? GUI->GetScreenWidth() : width;
    int h = height == 0 ? GUI->GetScreenHeight() : height;

    Channel * c = m_channelMap[channel.iUniqueId];

    StreamRequest* sr = m_live_streamer->GetStreamRequest(c->GetDvbLinkID(), m_clientname, m_hostname, use_transcoder, w, h, bitrate, audiotrack);
    if (sr != NULL)
    {
        std::string url;
        if (StartStreaming(channel, sr, url))
        {
            m_live_streamer->Start(url);
            ret_val = true;
        }
        else
        {
            delete m_live_streamer;
            m_live_streamer = NULL;
        }
        delete sr;
    }
    else
    {
        XBMC->Log(LOG_ERROR, "m_live_streamer->GetStreamRequest returned NULL. (channel %i)", channel.iUniqueId);
        delete m_live_streamer;
        m_live_streamer = NULL;
    }
    return ret_val;
}