Add satellite position to subservices

git-svn-id: file:///home/bas/coolstream_public_svn/THIRDPARTY/applications/neutrino-beta@1616 e54a6e83-5905-42d5-8d5c-058d10e6a962
This commit is contained in:
focus
2011-08-09 13:11:34 +00:00
parent 4d907895c2
commit e0ee8a723c
3 changed files with 23 additions and 11 deletions

View File

@@ -44,6 +44,13 @@
#include "libdvbsub/dvbsub.h"
#include "libtuxtxt/teletext.h"
#include <zapit/channel.h>
#include <zapit/bouquets.h>
extern tallchans allchans;
extern CBouquetManager *g_bouquetManager;
extern CZapitChannel *g_current_channel;
extern uint32_t scrambled_timer;
extern t_channel_id live_channel_id; //zapit
@@ -60,6 +67,7 @@ CSubService::CSubService(const t_original_network_id anoriginal_network_id, cons
startzeit = 0;
dauer = 0;
subservice_name = asubservice_name;
satellitePosition = g_current_channel ? g_current_channel->getSatellitePosition() : 0;
}
CSubService::CSubService(const t_original_network_id anoriginal_network_id, const t_service_id aservice_id, const t_transport_stream_id atransport_stream_id, const time_t astartzeit, const unsigned adauer)
@@ -70,11 +78,13 @@ CSubService::CSubService(const t_original_network_id anoriginal_network_id, cons
startzeit = astartzeit;
dauer = adauer;
subservice_name = "";
satellitePosition = g_current_channel ? g_current_channel->getSatellitePosition() : 0;
}
t_channel_id CSubService::getChannelID(void) const
{
return CREATE_CHANNEL_ID_FROM_SERVICE_ORIGINALNETWORK_TRANSPORTSTREAM_ID(service.service_id, service.original_network_id, service.transport_stream_id);
return ((uint64_t) ( satellitePosition > 0 ? satellitePosition : (uint64_t)(0xF000+ abs(satellitePosition))) << 48) |
(uint64_t) CREATE_CHANNEL_ID_FROM_SERVICE_ORIGINALNETWORK_TRANSPORTSTREAM_ID(service.service_id, service.original_network_id, service.transport_stream_id);
}
@@ -97,10 +107,6 @@ CRemoteControl::CRemoteControl()
is_video_started = true;
}
#include <zapit/channel.h>
#include <zapit/bouquets.h>
extern tallchans allchans;
extern CBouquetManager *g_bouquetManager;
int CRemoteControl::handleMsg(const neutrino_msg_t msg, neutrino_msg_data_t data)
{
@@ -358,7 +364,7 @@ void CRemoteControl::getSubChannels()
linkedServices[i].serviceId,
linkedServices[i].transportStreamId,
linkedServices[i].name));
if (subChannels[i].getChannelID() == (current_channel_id&0xFFFFFFFFFFFFULL))
if ((subChannels[i].getChannelID()&0xFFFFFFFFFFFFULL) == (current_channel_id&0xFFFFFFFFFFFFULL))
selected_subchannel = i;
}
copySubChannelsToZapit();

View File

@@ -53,6 +53,7 @@ class CSubService
{
private:
struct CZapitClient::commandAddSubServices service;
t_satellite_position satellitePosition;
public:
time_t startzeit;
@@ -62,7 +63,7 @@ class CSubService
CSubService(const t_original_network_id, const t_service_id, const t_transport_stream_id, const std::string &asubservice_name);
CSubService(const t_original_network_id, const t_service_id, const t_transport_stream_id, const time_t astartzeit, const unsigned adauer);
t_channel_id getChannelID (void) const;
t_channel_id getChannelID (void) const;
inline const struct CZapitClient::commandAddSubServices getAsZapitSubService(void) const { return service; }
};

View File

@@ -566,7 +566,7 @@ int zapit(const t_channel_id channel_id, bool in_nvod, bool forupdate = 0, bool
live_channel_id = g_current_channel->getChannelID();
saveZapitSettings(false, false);
printf("[zapit] zap to %s(%llx)\n", g_current_channel->getName().c_str(), live_channel_id);
printf("[zapit] zap to %s (%llx)\n", g_current_channel->getName().c_str(), live_channel_id);
if(!tune_to_channel(newchannel, transponder_change))
return -1;
@@ -1595,17 +1595,22 @@ printf("[zapit] recording mode: %d\n", msgSetRecordMode.activate);fflush(stdout)
while (CBasicServer::receive_data(connfd, &msgAddSubService, sizeof(msgAddSubService))) {
t_original_network_id original_network_id = msgAddSubService.original_network_id;
t_service_id service_id = msgAddSubService.service_id;
DBG("NVOD insert %llx\n", CREATE_CHANNEL_ID_FROM_SERVICE_ORIGINALNETWORK_TRANSPORTSTREAM_ID(msgAddSubService.service_id, msgAddSubService.original_network_id, msgAddSubService.transport_stream_id));
t_satellite_position satellitePosition = g_current_channel ? g_current_channel->getSatellitePosition() : 0;
t_channel_id sub_channel_id =
((uint64_t) ( satellitePosition > 0 ? satellitePosition : (uint64_t)(0xF000+ abs(satellitePosition))) << 48) |
(uint64_t) CREATE_CHANNEL_ID_FROM_SERVICE_ORIGINALNETWORK_TRANSPORTSTREAM_ID(msgAddSubService.service_id, msgAddSubService.original_network_id, msgAddSubService.transport_stream_id);
DBG("NVOD insert %llx\n", sub_channel_id);
nvodchannels.insert (
std::pair <t_channel_id, CZapitChannel> (
CREATE_CHANNEL_ID_FROM_SERVICE_ORIGINALNETWORK_TRANSPORTSTREAM_ID(msgAddSubService.service_id, msgAddSubService.original_network_id, msgAddSubService.transport_stream_id),
sub_channel_id,
CZapitChannel (
"NVOD",
service_id,
msgAddSubService.transport_stream_id,
original_network_id,
1,
g_current_channel ? g_current_channel->getSatellitePosition() : 0,
satellitePosition,
0
)
)