Ejemplo n.º 1
0
void on_langbuttonclicked(GtkWidget *widget, gpointer data)
{
	TRACEINFO;
	sPlayerInterface* player_interf;
	u32 current_service_id;
	HbbtvDemuxer *hbbtvdemuxer;
	GF_MediaInfo odi;
	u32 index_audio,audio_ID;	
	
	player_interf = (sPlayerInterface*)data;
	hbbtvdemuxer = ( HbbtvDemuxer *)player_interf->Demuxer;
	current_service_id = index_audio = audio_ID = 0;	
	
	/* Get the current channel struct */
	current_service_id = gf_term_get_current_service_id(player_interf->m_term);
	Channel* chan = (Channel*)ZapChannel(hbbtvdemuxer,current_service_id,0);	
	if(chan->Get_nb_chan_audio_stream() > 1){
		GF_ObjectManager *root_odm = gf_term_get_root_object(player_interf->m_term);
		if (root_odm){
			if (gf_term_get_object_info(player_interf->m_term, root_odm, &odi) == GF_OK){ 
				if (odi.od) {
					/* Increment the audio index to get the next audio stream */
					chan->Incr_audio_index(0);					
					gf_term_select_object(player_interf->m_term, gf_term_get_object(player_interf->m_term, root_odm, chan->Get_audio_ID(chan->Get_audio_index())));
				}
			}
		}
	}
}
Ejemplo n.º 2
0
void CFileProps::SetGeneralInfo()
{
	char info[10000];
	char buf[1000];
	GF_MediaInfo odi;
	GF_ObjectManager *odm;
	u32 h, m, s, i, j;

	Osmo4 *gpac = GetApp();
	odm = current_odm;

	strcpy(info, "");
	if (!odm || gf_term_get_object_info(gpac->m_term, odm, &odi) != GF_OK) return;

	if (!odi.od) {
		strcat(info, odi.service_url);
		m_ODInfo.SetWindowText(info);
		return;
	}
	sprintf(buf, "%sObject Descriptor ID %d\r\n", (odi.has_profiles) ? "Initial " : "", odi.od->objectDescriptorID);
	strcat(info, buf);
	if (odi.duration) {
		h = (u32) (odi.duration / 3600);
		m = (u32) (odi.duration / 60) - h*60;
		s = (u32) (odi.duration) - h*3600 - m*60;
		sprintf(buf, "Duration %02d:%02d:%02d\r\n", h, m, s);
		strcat(info, buf);
	} else {
		strcat(info, "Unknown duration\r\n");
	}
	if (odi.owns_service) {
		strcat(info, "Service Handler: ");
		strcat(info, odi.service_handler);
		strcat(info, "\r\n");
		strcat(info, "Service URL: ");
		strcat(info, odi.service_url);
		strcat(info, "\r\n");
	}
	
	if (odi.od->URLString) {
		strcat(info, "Remote OD - URL: ");
		strcat(info, odi.od->URLString);
		strcat(info, "\r\n");
	} 
	/*get OD content info*/
	if (odi.codec_name) {
		switch (odi.od_type) {
		case GF_STREAM_VISUAL:
			sprintf(buf, "Video Object: Width %d - Height %d\r\n", odi.width, odi.height);
			strcat(info, buf);
			strcat(info, "Media Codec ");
			strcat(info, odi.codec_name);
			strcat(info, "\r\n");
			if (odi.par) {
				sprintf(buf, "Pixel Aspect Ratio: %d:%d\r\n", (odi.par>>16)&0xFF, (odi.par)&0xFF);
				strcat(info, buf);
			}
			break;
		case GF_STREAM_AUDIO:
			sprintf(buf, "Audio Object: Sample Rate %d - %d channels\r\n", odi.sample_rate, odi.num_channels);
			strcat(info, buf);
			strcat(info, "Media Codec ");
			strcat(info, odi.codec_name);
			strcat(info, "\r\n");
			break;
		case GF_STREAM_PRIVATE_SCENE:
		case GF_STREAM_SCENE:
			if (odi.width && odi.height) {
				sprintf(buf, "Scene Description: Width %d - Height %d\r\n", odi.width, odi.height);
			} else {
				sprintf(buf, "Scene Description: No size specified\r\n");
			}
			strcat(info, buf);
			strcat(info, "Scene Codec ");
			strcat(info, odi.codec_name);
			strcat(info, "\r\n");
			break;
		case GF_STREAM_TEXT:
			if (odi.width && odi.height) {
				sprintf(buf, "Text Object: Width %d - Height %d\r\n", odi.width, odi.height);
			} else {
				sprintf(buf, "Text Object: No size specified\r\n");
			}
			strcat(info, buf);
			strcat(info, "Text Codec ");
			strcat(info, odi.codec_name);
			strcat(info, "\r\n");
			break;
		}
	}