コード例 #1
0
ファイル: servicedvd.cpp プロジェクト: vitmod/dvbapp
RESULT eServiceDVD::getSubtitleList(std::vector<struct SubtitleTrack> &subtitlelist)
{
	unsigned int spu_count = 0;
	ddvd_get_spu_count(m_ddvdconfig, &spu_count);

	for ( unsigned int spu_id = 0; spu_id < spu_count; spu_id++ )
	{
		struct SubtitleTrack track;
		uint16_t spu_lang;
		ddvd_get_spu_byid(m_ddvdconfig, spu_id, &spu_lang);
		char spu_string[3]={spu_lang >> 8, spu_lang, 0};

		track.type = 2;
		track.pid = spu_id + 1;
		track.page_number = 5;
		track.magazine_number = 0;
		track.language_code = spu_string;
		subtitlelist.push_back(track);
	}
	return 0;
}
コード例 #2
0
ファイル: servicedvd.cpp プロジェクト: Caught/openpliPC
PyObject *eServiceDVD::getSubtitleList()
{
	ePyObject l = PyList_New(0);
	unsigned int spu_count = 0;
	ddvd_get_spu_count(m_ddvdconfig, &spu_count);

	for ( unsigned int spu_id = 0; spu_id < spu_count; spu_id++ )
	{
		uint16_t spu_lang;
		ddvd_get_spu_byid(m_ddvdconfig, spu_id, &spu_lang);
		char spu_string[3]={spu_lang >> 8, spu_lang, 0};

		ePyObject tuple = PyTuple_New(5);
		PyTuple_SetItem(tuple, 0, PyInt_FromLong(2));
		PyTuple_SetItem(tuple, 1, PyInt_FromLong(spu_id+1));
		PyTuple_SetItem(tuple, 2, PyInt_FromLong(5));
		PyTuple_SetItem(tuple, 3, PyInt_FromLong(0));
		PyTuple_SetItem(tuple, 4, PyString_FromString(spu_string));
		PyList_Append(l, tuple);
		Py_DECREF(tuple);
	}
	return l;
}