Example #1
0
BOOL CEpgDBUtil::AddServiceList(WORD TSID, const CSITTable* sit)
{
	CBlockLock lock(&this->dbLock);

	WORD ONID = 0xFFFF;
	for( size_t i=0; i<sit->descriptorList.size(); i++ ){
		if( sit->descriptorList[i].GetNumber(AribDescriptor::descriptor_tag) == AribDescriptor::network_identification_descriptor ){
			ONID = (WORD)sit->descriptorList[i].GetNumber(AribDescriptor::network_id);
		}
	}
	if(ONID == 0xFFFF){
		return FALSE;
	}

	DWORD key = ((DWORD)ONID)<<16 | TSID;
	map<DWORD, DB_TS_INFO>::iterator itrTS;
	itrTS = this->serviceInfoList.find(key);
	if( itrTS == this->serviceInfoList.end() ){
		DB_TS_INFO info;
		info.original_network_id = ONID;
		info.transport_stream_id = TSID;

		for(size_t i=0; i<sit->serviceLoopList.size(); i++ ){
			DB_SERVICE_INFO item;
			item.original_network_id = ONID;
			item.transport_stream_id = TSID;
			item.service_id = sit->serviceLoopList[i].service_id;

			for( size_t j=0; j<sit->serviceLoopList[i].descriptorList.size(); j++ ){
				if( sit->serviceLoopList[i].descriptorList[j].GetNumber(AribDescriptor::descriptor_tag) == AribDescriptor::service_descriptor ){
					const AribDescriptor::CDescriptor* service = &sit->serviceLoopList[i].descriptorList[j];
					CARIB8CharDecode arib;
					string service_provider_name = "";
					string service_name = "";
					const char* src;
					DWORD srcSize;
					src = service->GetStringOrEmpty(AribDescriptor::service_provider_name, &srcSize);
					if( srcSize > 0 ){
						arib.PSISI((const BYTE*)src, srcSize, &service_provider_name);
					}
					src = service->GetStringOrEmpty(AribDescriptor::service_name, &srcSize);
					if( srcSize > 0 ){
						arib.PSISI((const BYTE*)src, srcSize, &service_name);
					}
					AtoW(service_provider_name, item.service_provider_name);
					AtoW(service_name, item.service_name);

					item.service_type = (BYTE)service->GetNumber(AribDescriptor::service_type);
				}
			}
			info.serviceList.insert(std::make_pair(item.service_id, item));
		}
		this->serviceInfoList.insert(std::make_pair(key, info));
	}


	return TRUE;
}
Example #2
0
BOOL CEpgDBUtil::AddAudioComponent(EVENT_INFO* eventInfo, const vector<AribDescriptor::CDescriptor>* descriptorList)
{
	{
		WORD listSize = 0;
		for( size_t i=0; i<descriptorList->size(); i++ ){
			if( (*descriptorList)[i].GetNumber(AribDescriptor::descriptor_tag) == AribDescriptor::audio_component_descriptor ){
				listSize++;
			}
		}
		if( listSize == 0 ){
			return FALSE;
		}
		if( eventInfo->audioInfo == NULL ){
			eventInfo->audioInfo = new EPG_AUDIO_COMPONENT_INFO;
		}
		SAFE_DELETE_ARRAY(eventInfo->audioInfo->audioList);
		eventInfo->audioInfo->listSize = listSize;
		eventInfo->audioInfo->audioList = new EPG_AUDIO_COMPONENT_INFO_DATA[listSize];

		for( size_t i=0, j=0; j<eventInfo->audioInfo->listSize; i++ ){
			if( (*descriptorList)[i].GetNumber(AribDescriptor::descriptor_tag) == AribDescriptor::audio_component_descriptor ){
				const AribDescriptor::CDescriptor* audioComponent = &(*descriptorList)[i];
				EPG_AUDIO_COMPONENT_INFO_DATA& item = eventInfo->audioInfo->audioList[j++];

				item.stream_content = (BYTE)audioComponent->GetNumber(AribDescriptor::stream_content);
				item.component_type = (BYTE)audioComponent->GetNumber(AribDescriptor::component_type);
				item.component_tag = (BYTE)audioComponent->GetNumber(AribDescriptor::component_tag);

				item.stream_type = (BYTE)audioComponent->GetNumber(AribDescriptor::stream_type);
				item.simulcast_group_tag = (BYTE)audioComponent->GetNumber(AribDescriptor::simulcast_group_tag);
				item.ES_multi_lingual_flag = (BYTE)audioComponent->GetNumber(AribDescriptor::ES_multi_lingual_flag);
				item.main_component_flag = (BYTE)audioComponent->GetNumber(AribDescriptor::main_component_flag);
				item.quality_indicator = (BYTE)audioComponent->GetNumber(AribDescriptor::quality_indicator);
				item.sampling_rate = (BYTE)audioComponent->GetNumber(AribDescriptor::sampling_rate);


				CARIB8CharDecode arib;
				string text_char = "";
				DWORD srcSize;
				const char* src = audioComponent->GetStringOrEmpty(AribDescriptor::text_char, &srcSize);
				arib.PSISI((const BYTE*)src, srcSize, &text_char);
				item.text_charLength = UpdateInfoText(item.text_char, text_char.c_str());

			}
		}
	}

	return TRUE;
}
Example #3
0
void CEpgDBUtil::AddComponent(EVENT_INFO* eventInfo, const AribDescriptor::CDescriptor* component)
{
	if( eventInfo->componentInfo == NULL ){
		eventInfo->componentInfo = new EPG_COMPONENT_INFO;
	}
	{
		eventInfo->componentInfo->stream_content = (BYTE)component->GetNumber(AribDescriptor::stream_content);
		eventInfo->componentInfo->component_type = (BYTE)component->GetNumber(AribDescriptor::component_type);
		eventInfo->componentInfo->component_tag = (BYTE)component->GetNumber(AribDescriptor::component_tag);

		CARIB8CharDecode arib;
		string text_char = "";
		DWORD srcSize;
		const char* src = component->GetStringOrEmpty(AribDescriptor::text_char, &srcSize);
		arib.PSISI((const BYTE*)src, srcSize, &text_char);
		eventInfo->componentInfo->text_charLength = UpdateInfoText(eventInfo->componentInfo->text_char, text_char.c_str());

	}
}
Example #4
0
void CEpgDBUtil::AddShortEvent(EVENT_INFO* eventInfo, const AribDescriptor::CDescriptor* shortEvent)
{
	if( eventInfo->shortInfo == NULL ){
		eventInfo->shortInfo = new EPG_SHORT_EVENT_INFO;
	}
	{
		CARIB8CharDecode arib;
		string event_name = "";
		string text_char = "";
		const char* src;
		DWORD srcSize;
		src = shortEvent->GetStringOrEmpty(AribDescriptor::event_name_char, &srcSize);
		arib.PSISI((const BYTE*)src, srcSize, &event_name);
		src = shortEvent->GetStringOrEmpty(AribDescriptor::text_char, &srcSize);
		arib.PSISI((const BYTE*)src, srcSize, &text_char);
#ifdef DEBUG_EIT
		text_char = g_szDebugEIT + text_char;
#endif

		eventInfo->shortInfo->event_nameLength = UpdateInfoText(eventInfo->shortInfo->event_name, event_name.c_str());
		eventInfo->shortInfo->text_charLength = UpdateInfoText(eventInfo->shortInfo->text_char, text_char.c_str());
	}
}
Example #5
0
//自ストリームのサービス一覧をSITから取得する
//引数:
// serviceListSize			[OUT]serviceListの個数
// serviceList				[OUT]サービス情報のリスト(DLL内で自動的にdeleteする。次に取得を行うまで有効)
BOOL CDecodeUtil::GetServiceListSIT(
	DWORD* serviceListSize,
	SERVICE_INFO** serviceList
	)
{
	if( this->sitInfo == NULL || this->patInfo == NULL ){
		return FALSE;
	}

	SAFE_DELETE_ARRAY(this->serviceList);

	//ONID
	WORD ONID = 0xFFFF;
	for( size_t i=0; i<this->sitInfo->descriptorList.size(); i++ ){
		if( this->sitInfo->descriptorList[i]->GetNumber(AribDescriptor::descriptor_tag) == AribDescriptor::network_identification_descriptor ){
			ONID = (WORD)this->sitInfo->descriptorList[i]->GetNumber(AribDescriptor::network_id);
		}
	}

	//TSID
	WORD TSID = 0xFFFF;
	TSID = this->patInfo->transport_stream_id;

	*serviceListSize = (DWORD)this->sitInfo->serviceLoopList.size();
	this->serviceList = new SERVICE_INFO[*serviceListSize];

	wstring network_nameW = L"";
	wstring ts_nameW = L"";
	BYTE remote_control_key_id = 0;

	//サービスリスト
	for( DWORD i=0; i<*serviceListSize; i++ ){
		this->serviceList[i].original_network_id = ONID;
		this->serviceList[i].transport_stream_id = TSID;
		this->serviceList[i].service_id = this->sitInfo->serviceLoopList[i]->service_id;
		this->serviceList[i].extInfo = new SERVICE_EXT_INFO;

		for( size_t j=0; j<this->sitInfo->serviceLoopList[i]->descriptorList.size(); j++ ){
			if( this->sitInfo->serviceLoopList[i]->descriptorList[j]->GetNumber(AribDescriptor::descriptor_tag) == AribDescriptor::service_descriptor ){
				AribDescriptor::CDescriptor* service = this->sitInfo->serviceLoopList[i]->descriptorList[j];
				CARIB8CharDecode arib;
				string service_provider_name = "";
				string service_name = "";
				const char* src;
				DWORD srcSize;
				src = service->GetStringOrEmpty(AribDescriptor::service_provider_name, &srcSize);
				if( srcSize > 0 ){
					arib.PSISI((const BYTE*)src, srcSize, &service_provider_name);
				}
				src = service->GetStringOrEmpty(AribDescriptor::service_name, &srcSize);
				if( srcSize > 0 ){
					arib.PSISI((const BYTE*)src, srcSize, &service_name);
				}
				wstring service_provider_nameW = L"";
				wstring service_nameW = L"";
				AtoW(service_provider_name, service_provider_nameW);
				AtoW(service_name, service_nameW);

				this->serviceList[i].extInfo->service_type = (BYTE)service->GetNumber(AribDescriptor::service_type);
				if( service_provider_nameW.size() > 0 ){
					this->serviceList[i].extInfo->service_provider_name = new WCHAR[service_provider_nameW.size()+1];
					wcscpy_s(this->serviceList[i].extInfo->service_provider_name, service_provider_nameW.size()+1, service_provider_nameW.c_str());
				}
				if( service_nameW.size() > 0 ){
					this->serviceList[i].extInfo->service_name = new WCHAR[service_nameW.size()+1];
					wcscpy_s(this->serviceList[i].extInfo->service_name, service_nameW.size()+1, service_nameW.c_str());
				}
			}
		}

		if( network_nameW.size() > 0 ){
			this->serviceList[i].extInfo->network_name = new WCHAR[network_nameW.size()+1];
			wcscpy_s(this->serviceList[i].extInfo->network_name, network_nameW.size()+1, network_nameW.c_str());
		}
		if( ts_nameW.size() > 0 ){
			this->serviceList[i].extInfo->ts_name = new WCHAR[ts_nameW.size()+1];
			wcscpy_s(this->serviceList[i].extInfo->ts_name, ts_nameW.size()+1, ts_nameW.c_str());
		}
		this->serviceList[i].extInfo->remote_control_key_id = remote_control_key_id;

		this->serviceList[i].extInfo->partialReceptionFlag = FALSE;
	}


	*serviceList = this->serviceList;

	return TRUE;
}
Example #6
0
//自ストリームのサービス一覧を取得する
//引数:
// serviceListSize			[OUT]serviceListの個数
// serviceList				[OUT]サービス情報のリスト(DLL内で自動的にdeleteする。次に取得を行うまで有効)
BOOL CDecodeUtil::GetServiceListActual(
	DWORD* serviceListSize,
	SERVICE_INFO** serviceList
	)
{
	SAFE_DELETE_ARRAY(this->serviceList);

	if( this->nitActualInfo == NULL || this->sdtActualInfo == NULL ){
		return GetServiceListSIT(serviceListSize, serviceList);
	}else{
		if( this->nitActualInfo->last_section_number+1 != this->nitActualInfo->nitSection.size() ||
			this->sdtActualInfo->last_section_number+1 != this->sdtActualInfo->sdtSection.size() ){
			return FALSE;
		}
	}
	*serviceListSize = 0;

	map<BYTE, CSDTTable*>::iterator itrSdt;
	for(itrSdt = this->sdtActualInfo->sdtSection.begin(); itrSdt != this->sdtActualInfo->sdtSection.end(); itrSdt++){
		*serviceListSize += (DWORD)itrSdt->second->serviceInfoList.size();
	}
	this->serviceList = new SERVICE_INFO[*serviceListSize];


	wstring network_nameW = L"";
	wstring ts_nameW = L"";
	BYTE remote_control_key_id = 0;
	vector<WORD> partialServiceList;

	map<BYTE, CNITTable*>::iterator itrNit;
	for( itrNit = this->nitActualInfo->nitSection.begin(); itrNit != this->nitActualInfo->nitSection.end(); itrNit++ ){
		for( size_t i=0; i<itrNit->second->descriptorList.size(); i++ ){
			if( itrNit->second->descriptorList[i]->GetNumber(AribDescriptor::descriptor_tag) == AribDescriptor::network_name_descriptor ){
				AribDescriptor::CDescriptor* networkName = itrNit->second->descriptorList[i];
				DWORD srcSize;
				const char* src = networkName->GetStringOrEmpty(AribDescriptor::d_char, &srcSize);
				if( srcSize > 0 ){
					CARIB8CharDecode arib;
					string network_name = "";
					arib.PSISI((const BYTE*)src, srcSize, &network_name);
					AtoW(network_name, network_nameW);
				}
			}
		}
		for( size_t i=0; i<itrNit->second->TSInfoList.size(); i++ ){
			for( size_t j=0; j<itrNit->second->TSInfoList[i]->descriptorList.size(); j++ ){
				if( itrNit->second->TSInfoList[i]->descriptorList[j]->GetNumber(AribDescriptor::descriptor_tag) == AribDescriptor::ts_information_descriptor ){
					AribDescriptor::CDescriptor* TSInfo = itrNit->second->TSInfoList[i]->descriptorList[j];
					DWORD srcSize;
					const char* src = TSInfo->GetStringOrEmpty(AribDescriptor::ts_name_char, &srcSize);
					if( srcSize > 0 ){
						CARIB8CharDecode arib;
						string ts_name = "";
						arib.PSISI((const BYTE*)src, srcSize, &ts_name);
						AtoW(ts_name, ts_nameW);
					}
					remote_control_key_id = (BYTE)TSInfo->GetNumber(AribDescriptor::remote_control_key_id);
				}
				if( itrNit->second->TSInfoList[i]->descriptorList[j]->GetNumber(AribDescriptor::descriptor_tag) == AribDescriptor::partial_reception_descriptor ){
					partialServiceList.clear();
					AribDescriptor::CDescriptor::CLoopPointer lp;
					if( itrNit->second->TSInfoList[i]->descriptorList[j]->EnterLoop(lp) ){
						for( DWORD k=0; itrNit->second->TSInfoList[i]->descriptorList[j]->SetLoopIndex(lp, k); k++ ){
							partialServiceList.push_back((WORD)itrNit->second->TSInfoList[i]->descriptorList[j]->GetNumber(AribDescriptor::service_id, lp));
						}
					}
				}
			}
		}
	}

	DWORD count = 0;
	for(itrSdt = this->sdtActualInfo->sdtSection.begin(); itrSdt != this->sdtActualInfo->sdtSection.end(); itrSdt++){
		for( size_t i=0; i<itrSdt->second->serviceInfoList.size(); i++ ){
			this->serviceList[count].original_network_id = itrSdt->second->original_network_id;
			this->serviceList[count].transport_stream_id = itrSdt->second->transport_stream_id;
			this->serviceList[count].service_id = itrSdt->second->serviceInfoList[i]->service_id;
			this->serviceList[count].extInfo = new SERVICE_EXT_INFO;

			for( size_t j=0; j<itrSdt->second->serviceInfoList[i]->descriptorList.size(); j++ ){
				if( itrSdt->second->serviceInfoList[i]->descriptorList[j]->GetNumber(AribDescriptor::descriptor_tag) == AribDescriptor::service_descriptor ){
					AribDescriptor::CDescriptor* service = itrSdt->second->serviceInfoList[i]->descriptorList[j];
					CARIB8CharDecode arib;
					string service_provider_name = "";
					string service_name = "";
					const char* src;
					DWORD srcSize;
					src = service->GetStringOrEmpty(AribDescriptor::service_provider_name, &srcSize);
					if( srcSize > 0 ){
						arib.PSISI((const BYTE*)src, srcSize, &service_provider_name);
					}
					src = service->GetStringOrEmpty(AribDescriptor::service_name, &srcSize);
					if( srcSize > 0 ){
						arib.PSISI((const BYTE*)src, srcSize, &service_name);
					}
					wstring service_provider_nameW = L"";
					wstring service_nameW = L"";
					AtoW(service_provider_name, service_provider_nameW);
					AtoW(service_name, service_nameW);

					this->serviceList[count].extInfo->service_type = (BYTE)service->GetNumber(AribDescriptor::service_type);
					if( service_provider_nameW.size() > 0 ){
						this->serviceList[count].extInfo->service_provider_name = new WCHAR[service_provider_nameW.size()+1];
						wcscpy_s(this->serviceList[count].extInfo->service_provider_name, service_provider_nameW.size()+1, service_provider_nameW.c_str());
					}
					if( service_nameW.size() > 0 ){
						this->serviceList[count].extInfo->service_name = new WCHAR[service_nameW.size()+1];
						wcscpy_s(this->serviceList[count].extInfo->service_name, service_nameW.size()+1, service_nameW.c_str());
					}
				}
			}

			if( network_nameW.size() > 0 ){
				this->serviceList[count].extInfo->network_name = new WCHAR[network_nameW.size()+1];
				wcscpy_s(this->serviceList[count].extInfo->network_name, network_nameW.size()+1, network_nameW.c_str());
			}
			if( ts_nameW.size() > 0 ){
				this->serviceList[count].extInfo->ts_name = new WCHAR[ts_nameW.size()+1];
				wcscpy_s(this->serviceList[count].extInfo->ts_name, ts_nameW.size()+1, ts_nameW.c_str());
			}
			this->serviceList[count].extInfo->remote_control_key_id = remote_control_key_id;

			this->serviceList[count].extInfo->partialReceptionFlag = FALSE;
			for( size_t j=0; j<partialServiceList.size(); j++ ){
				if( partialServiceList[j] == this->serviceList[count].service_id ){
					this->serviceList[count].extInfo->partialReceptionFlag = TRUE;
				}
			}

			count++;
		}
	}

	*serviceList = this->serviceList;


	return TRUE;
}
Example #7
0
BOOL CEpgDBUtil::AddSDT(const CSDTTable* sdt)
{
	CBlockLock lock(&this->dbLock);

	DWORD key = ((DWORD)sdt->original_network_id)<<16 | sdt->transport_stream_id;
	map<DWORD, DB_TS_INFO>::iterator itrTS;
	itrTS = this->serviceInfoList.find(key);
	if( itrTS == this->serviceInfoList.end() ){
		DB_TS_INFO info;
		info.original_network_id = sdt->original_network_id;
		info.transport_stream_id = sdt->transport_stream_id;

		for(size_t i=0; i<sdt->serviceInfoList.size(); i++ ){
			DB_SERVICE_INFO item;
			item.original_network_id = sdt->original_network_id;
			item.transport_stream_id = sdt->transport_stream_id;
			item.service_id = sdt->serviceInfoList[i].service_id;

			for( size_t j=0; j<sdt->serviceInfoList[i].descriptorList.size(); j++ ){
				if( sdt->serviceInfoList[i].descriptorList[j].GetNumber(AribDescriptor::descriptor_tag) == AribDescriptor::service_descriptor ){
					const AribDescriptor::CDescriptor* service = &sdt->serviceInfoList[i].descriptorList[j];
					CARIB8CharDecode arib;
					string service_provider_name = "";
					string service_name = "";
					const char* src;
					DWORD srcSize;
					src = service->GetStringOrEmpty(AribDescriptor::service_provider_name, &srcSize);
					if( srcSize > 0 ){
						arib.PSISI((const BYTE*)src, srcSize, &service_provider_name);
					}
					src = service->GetStringOrEmpty(AribDescriptor::service_name, &srcSize);
					if( srcSize > 0 ){
						arib.PSISI((const BYTE*)src, srcSize, &service_name);
					}
					AtoW(service_provider_name, item.service_provider_name);
					AtoW(service_name, item.service_name);

					item.service_type = (BYTE)service->GetNumber(AribDescriptor::service_type);
				}
			}
			info.serviceList.insert(std::make_pair(item.service_id, item));
		}
		this->serviceInfoList.insert(std::make_pair(key, info));
	}else{
		for(size_t i=0; i<sdt->serviceInfoList.size(); i++ ){
			map<WORD,DB_SERVICE_INFO>::iterator itrS;
			itrS = itrTS->second.serviceList.find(sdt->serviceInfoList[i].service_id);
			if( itrS == itrTS->second.serviceList.end()){
				DB_SERVICE_INFO item;
				item.original_network_id = sdt->original_network_id;
				item.transport_stream_id = sdt->transport_stream_id;
				item.service_id = sdt->serviceInfoList[i].service_id;

				for( size_t j=0; j<sdt->serviceInfoList[i].descriptorList.size(); j++ ){
					if( sdt->serviceInfoList[i].descriptorList[j].GetNumber(AribDescriptor::descriptor_tag) == AribDescriptor::service_descriptor ){
						const AribDescriptor::CDescriptor* service = &sdt->serviceInfoList[i].descriptorList[j];
						CARIB8CharDecode arib;
						string service_provider_name = "";
						string service_name = "";
						const char* src;
						DWORD srcSize;
						src = service->GetStringOrEmpty(AribDescriptor::service_provider_name, &srcSize);
						if( srcSize > 0 ){
							arib.PSISI((const BYTE*)src, srcSize, &service_provider_name);
						}
						src = service->GetStringOrEmpty(AribDescriptor::service_name, &srcSize);
						if( srcSize > 0 ){
							arib.PSISI((const BYTE*)src, srcSize, &service_name);
						}
						AtoW(service_provider_name, item.service_provider_name);
						AtoW(service_name, item.service_name);

						item.service_type = (BYTE)service->GetNumber(AribDescriptor::service_type);
					}
				}
				itrTS->second.serviceList.insert(std::make_pair(item.service_id, item));
			}
		}
	}

	return TRUE;
}
Example #8
0
BOOL CEpgDBUtil::AddServiceList(const CNITTable* nit)
{
	if( nit == NULL ){
		return FALSE;
	}
	CBlockLock lock(&this->dbLock);

	wstring network_nameW = L"";

	for( size_t i=0; i<nit->descriptorList.size(); i++ ){
		if( nit->descriptorList[i].GetNumber(AribDescriptor::descriptor_tag) == AribDescriptor::network_name_descriptor ){
			const AribDescriptor::CDescriptor* networkName = &nit->descriptorList[i];
			DWORD srcSize;
			const char* src = networkName->GetStringOrEmpty(AribDescriptor::d_char, &srcSize);
			if( srcSize > 0 ){
				CARIB8CharDecode arib;
				string network_name = "";
				arib.PSISI((const BYTE*)src, srcSize, &network_name);
				AtoW(network_name, network_nameW);
			}
		}
	}

	for( size_t i=0; i<nit->TSInfoList.size(); i++ ){
		const CNITTable::TS_INFO_DATA* tsInfo = &nit->TSInfoList[i];
		//サービス情報更新用
		map<DWORD, DB_TS_INFO>::iterator itrFind;
		itrFind = this->serviceInfoList.find((DWORD)tsInfo->original_network_id << 16 | tsInfo->transport_stream_id);
		if( itrFind != this->serviceInfoList.end() ){
			itrFind->second.network_name = network_nameW;
		}

		for( size_t j=0; j<tsInfo->descriptorList.size(); j++ ){
			const AribDescriptor::CDescriptor* desc = &tsInfo->descriptorList[j];
			if( desc->GetNumber(AribDescriptor::descriptor_tag) == AribDescriptor::service_list_descriptor ){
				AribDescriptor::CDescriptor::CLoopPointer lp;
				if( desc->EnterLoop(lp) ){
					for( DWORD k=0; desc->SetLoopIndex(lp, k); k++ ){
						ULONGLONG key = _Create64Key(tsInfo->original_network_id, tsInfo->transport_stream_id, (WORD)desc->GetNumber(AribDescriptor::service_id, lp));
						map<ULONGLONG, BYTE>::iterator itrService;
						itrService = this->serviceList.find(key);
						if( itrService == this->serviceList.end() ){
							this->serviceList.insert(pair<ULONGLONG, BYTE>(key, (BYTE)desc->GetNumber(AribDescriptor::service_type, lp)));
						}
					}
				}
			}
			if( desc->GetNumber(AribDescriptor::descriptor_tag) == AribDescriptor::ts_information_descriptor && itrFind != this->serviceInfoList.end()){
				//ts_nameとremote_control_key_id
				DWORD srcSize;
				const char* src = desc->GetStringOrEmpty(AribDescriptor::ts_name_char, &srcSize);
				if( srcSize > 0 ){
					CARIB8CharDecode arib;
					string ts_name = "";
					arib.PSISI((const BYTE*)src, srcSize, &ts_name);
					AtoW(ts_name, itrFind->second.ts_name);
				}
				itrFind->second.remote_control_key_id = (BYTE)desc->GetNumber(AribDescriptor::remote_control_key_id);
			}
			if( desc->GetNumber(AribDescriptor::descriptor_tag) == AribDescriptor::partial_reception_descriptor && itrFind != this->serviceInfoList.end()){
				//部分受信フラグ
				AribDescriptor::CDescriptor::CLoopPointer lp;
				if( desc->EnterLoop(lp) ){
					map<WORD,DB_SERVICE_INFO>::iterator itrService;
					for( DWORD k=0; desc->SetLoopIndex(lp, k); k++ ){
						itrService = itrFind->second.serviceList.find((WORD)desc->GetNumber(AribDescriptor::service_id, lp));
						if( itrService != itrFind->second.serviceList.end() ){
							itrService->second.partialReceptionFlag = 1;
						}
					}
				}
			}
		}
	}

	return TRUE;
}
Example #9
0
BOOL CEpgDBUtil::AddExtEvent(EVENT_INFO* eventInfo, const vector<AribDescriptor::CDescriptor>* descriptorList)
{
	{
		BOOL foundFlag = FALSE;
		CARIB8CharDecode arib;
		string extendText = "";
		string itemDescBuff = "";
		string itemBuff = "";
		//text_lengthは0で運用される
//		string textBuff = "";

		for( size_t i=0; i<descriptorList->size(); i++ ){
			if( (*descriptorList)[i].GetNumber(AribDescriptor::descriptor_tag) == AribDescriptor::extended_event_descriptor ){
				foundFlag = TRUE;
				const AribDescriptor::CDescriptor* extEvent = &(*descriptorList)[i];
				AribDescriptor::CDescriptor::CLoopPointer lp;
				if( extEvent->EnterLoop(lp) ){
					for( DWORD j=0; extEvent->SetLoopIndex(lp, j); j++ ){
						const char* src;
						DWORD srcSize;
						src = extEvent->GetStringOrEmpty(AribDescriptor::item_description_char, &srcSize, lp);
						if( srcSize > 0 ){
							//if( textBuff.size() > 0 ){
							//	string buff = "";
							//	arib.PSISI((const BYTE*)textBuff.c_str(), textBuff.length(), &buff);
							//	buff += "\r\n";
							//	extendText += buff;
							//	textBuff = "";
							//}
							if( itemBuff.size() > 0 ){
								string buff = "";
								arib.PSISI((const BYTE*)itemBuff.c_str(), (DWORD)itemBuff.length(), &buff);
								buff += "\r\n";
								extendText += buff;
								itemBuff = "";
							}

							itemDescBuff += src;
						}
						src = extEvent->GetStringOrEmpty(AribDescriptor::item_char, &srcSize, lp);
						if( srcSize > 0 ){
							//if( textBuff.size() > 0 ){
							//	string buff = "";
							//	arib.PSISI((const BYTE*)textBuff.c_str(), textBuff.length(), &buff);
							//	buff += "\r\n";
							//	extendText += buff;
							//	textBuff = "";
							//}
							if( itemDescBuff.size() > 0 ){
								string buff = "";
								arib.PSISI((const BYTE*)itemDescBuff.c_str(), (DWORD)itemDescBuff.length(), &buff);
								buff += "\r\n";
								extendText += buff;
								itemDescBuff = "";
							}

							itemBuff += src;
						}
					}
				}
				//if( extEvent->text_length > 0 ){
				//	if( itemDescBuff.size() > 0 ){
				//		string buff = "";
				//		arib.PSISI((const BYTE*)itemDescBuff.c_str(), itemDescBuff.length(), &buff);
				//		buff += "\r\n";
				//		extendText += buff;
				//		itemDescBuff = "";
				//	}
				//	if( itemBuff.size() > 0 ){
				//		string buff = "";
				//		arib.PSISI((const BYTE*)itemBuff.c_str(), itemBuff.length(), &buff);
				//		buff += "\r\n";
				//		extendText += buff;
				//		itemBuff = "";
				//	}

				//	textBuff += extEvent->text_char;
				//}
			}
		}

		if( itemDescBuff.size() > 0 ){
			string buff = "";
			arib.PSISI((const BYTE*)itemDescBuff.c_str(), (DWORD)itemDescBuff.length(), &buff);
			buff += "\r\n";
			extendText += buff;
			itemDescBuff = "";
		}
		if( itemBuff.size() > 0 ){
			string buff = "";
			arib.PSISI((const BYTE*)itemBuff.c_str(), (DWORD)itemBuff.length(), &buff);
			buff += "\r\n";
			extendText += buff;
			itemBuff = "";
		}
		//if( textBuff.size() > 0 ){
		//	string buff = "";
		//	arib.PSISI((const BYTE*)textBuff.c_str(), textBuff.length(), &buff);
		//	buff += "\r\n";
		//	extendText += buff;
		//	textBuff = "";
		//}

		if( foundFlag == FALSE ){
			return FALSE;
		}
		if( eventInfo->extInfo == NULL ){
			eventInfo->extInfo = new EPG_EXTENDED_EVENT_INFO;
		}
#ifdef DEBUG_EIT
		extendText = g_szDebugEIT + extendText;
#endif
		eventInfo->extInfo->text_charLength = UpdateInfoText(eventInfo->extInfo->text_char, extendText.c_str());
	}

	return TRUE;
}