Forums | developer.brewmp.com Forums | developer.brewmp.com

Developer

Forums

Forums:

If you check the properties of a video file, you would find that video is created in a perticular size/dimentions. say - 176x220

If you play the video using IMedia, it would play in the size, it has been created, by default.

If you want to play a video in full screen, where the Physical screen size of the device is larger than the default dimentions of the video, you will need to zoom the video before rendering it to the screen.

 

full screen video playback works fine on QRD6270. use the code below:-

i am zooming & rotating the video in the example here as it smaller in my case & will need landscape mode for full screen view.

  

 

#include "AEEMediaMPEG4.h"

if your default installation does not has AEEMediaMPEG4.h, download this Media Extension package & include the header from here:
https://brewx.qualcomm.com/brew/sdk/download.jsp?page=dx/tools/imediampe...



void c_PlayVideo(myApp *pMe)
{
	AEECLSID	 cls;
	AEEMediaData        md;
	AEERect		 rImage;
	int		 nErr;
	char		*str;
	IMediaUtil	*pMediaUtil;


	SETAEERECT(&rImage, 0, 0, pMe->deviceInfo.cxScreen, pMe->deviceInfo.cyScreen);
	str = "video.mp4"
//	str = "rtspfile.url"//For playing a Rtsp streaming video
	md.clsData = MMD_FILE_NAME;
	md.pData = (void*)str;
	md.dwSize = 0;


	if(ISHELL_CreateInstance(pMe->a.m_pIShell, AEECLSID_MEDIAUTIL, (void**)&pMediaUtil) != SUCCESS) {
		DBGPRINTF_ERROR("Error Creating Media Util Object");
		return;
	}

	if(IMEDIAUTIL_CreateMedia(pMediaUtil, &md, &pMe->pMedia) != SUCCESS) {
		DBGPRINTF_ERROR("Error Creating Media Object");
		return;
	}


	IMedia_RegisterNotify(pMe->pMedia, (PFNMEDIANOTIFY)c_MediaNotify, pMe);

	if((nErr = IMedia_SetRect(pMe->pMedia, &rImage, &rImage)) != SUCCESS) {
		DBGPRINTF_ERROR("Error Setting Rect %d", nErr);
		return;
	}

	IMedia_EnableFrameCallback(pMe->pMedia,  TRUE);


	nErr = IMedia_SetMediaParm(pMe->pMedia, MM_MP4_PARM_ROTATION, MM_MPEG4_90_CW_ROTATION, 0);
	DBGPRINTF("***********************Rotate: %d", nErr);


	nErr = IMedia_SetMediaParm(pMe->pMedia, MM_MP4_PARM_SCALING, MM_MPEG4_2X_ZOOM , (int32)&md);
	DBGPRINTF("***********************Scaling: %d", nErr);

	IMedia_SetVolume(pMe->pMedia, 20);

	nErr = IMedia_GetTotalTime(pMe->pMedia);
	DBGPRINTF("****************GetTotalTime %d", nErr);

	IMedia_Play(pMe->pMedia);





void c_MediaNotify(myApp *pMe, AEEMediaCmdNotify * pNotify)
{
	IBitmap *pFrame;
	AEEBitmapInfo pinfo;
	int nErr;


	DBGPRINTF("Media Notify CMD %d SUB %d STATUS %d", pNotify->nCmd, pNotify->nSubCmd, pNotify->nStatus );

	switch(pNotify->nCmd)
	{
	case MM_CMD_PLAY:
		switch(pNotify->nStatus)
		{
		case MM_STATUS_START:
			pMe->currentTime = 0;
			IDISPLAY_ClearScreen(pMe->a.m_pIDisplay);
			IDisplay_DrawText(pMe->a.m_pIDisplay, AEE_FONT_BOLD, L"Playback Started", -1, 0, 0, NULL, IDF_ALIGN_CENTER |IDF_ALIGN_MIDDLE);
			IDisplay_Update(pMe->a.m_pIDisplay);
			break;
		case MM_STATUS_ABORT:
			IDISPLAY_ClearScreen(pMe->a.m_pIDisplay);
			IDisplay_DrawText(pMe->a.m_pIDisplay, AEE_FONT_BOLD, L"Playback Stopped", -1, 0, 0, NULL, IDF_ALIGN_CENTER |IDF_ALIGN_MIDDLE);
			IDisplay_Update(pMe->a.m_pIDisplay);
			break;
		case MM_STATUS_FRAME:
			DBGPRINTF("******FRAME");
			IMedia_GetFrame(pMe->pMedia, &pFrame);
			if(pFrame) {
				IBitmap_GetInfo(pFrame, &pinfo, sizeof(AEEBitmapInfo));
				IDisplay_BitBlt(pMe->a.m_pIDisplay, 0, 0, pinfo.cx, pinfo.cy, pFrame, 0, 0, AEE_RO_COPY);
				IDisplay_UpdateEx(pMe->a.m_pIDisplay, TRUE);
				RELEASEIF(pFrame);
			}
			break;
		default:
			break;
		}
		break;
	case MM_CMD_RECORD:
		break;
	case MM_CMD_GETMEDIAPARM:
		break;
	case MM_CMD_SETMEDIAPARM:
		break;
	case MM_CMD_GETTOTALTIME:
		DBGPRINTF("******Get Total Time");
		if(pNotify->nStatus == MM_STATUS_DONE)
		{
			DBGPRINTF("******Get Total Time DONE");
		}
		else if(pNotify->nStatus == MM_STATUS_ABORT) {
			DBGPRINTF("******Get Total Time ABORT");
		}
		break;
	default:
		break;
	}

i have used this code.
but rotation is not there.
&
when i using
 
IMedia_EnableFrameCallback(pMe->pMedia, TRUE);then only blanck scree is there.

i have used this code.
but rotation is not there.
&
when i using
 
IMedia_EnableFrameCallback(pMe->pMedia, TRUE);then only blanck scree is there.

for me it works fine on QRD6270.

for me it works fine on QRD6270.

For playing a Rtsp streaming video, is it supported on simulator? did u ever try to play youtube videos in recent past?I hear youtube changes very often.Also what dependency needs to be added to mif? I tried adding IMedia and IMediaVideo related all dependencies, but still get the following error.9/21/2011 4:53:55 PM youtubeplayer.c:615 - Playback
Started Successful9/21/2011 4:53:55 PM contenthandlersregisterapp.c:735 -
**********************************************************************9/21/2011
4:53:55 PM contenthandlersregisterapp.c:736 - REGISTERING
CONTENTHANDLERS ASF HANDLERS9/21/2011 4:53:55 PM
contenthandlersregisterapp.c:737 -
**********************************************************************9/21/2011
4:53:55 PM contenthandlersregisterapp.c:275 - AEECLSID_CONTENTHANDLER not supported: 39/21/2011
4:53:55 PM contenthandlersregisterapp.c:765 - Not registering asf
handlers.9/21/2011 4:53:55 PM contenthandlersregisterapp.c:795 -
ContentHandlerRegister app closing itself9/21/2011 4:53:55 PM Event - 0x1 9/21/2011 4:54:16 PM youtubeplayer.c:643 - Playback
Aborted9/21/2011 4:54:16 PM youtubeplayer.c:643 - Playback
Aborted9/21/2011 4:54:16 PM youtubeplayer.c:639 - Playback Stopped/Completed
Successful
 

For playing a Rtsp streaming video, is it supported on simulator? did u ever try to play youtube videos in recent past?I hear youtube changes very often.Also what dependency needs to be added to mif? I tried adding IMedia and IMediaVideo related all dependencies, but still get the following error.9/21/2011 4:53:55 PM youtubeplayer.c:615 - Playback
Started Successful9/21/2011 4:53:55 PM contenthandlersregisterapp.c:735 -
**********************************************************************9/21/2011
4:53:55 PM contenthandlersregisterapp.c:736 - REGISTERING
CONTENTHANDLERS ASF HANDLERS9/21/2011 4:53:55 PM
contenthandlersregisterapp.c:737 -
**********************************************************************9/21/2011
4:53:55 PM contenthandlersregisterapp.c:275 - AEECLSID_CONTENTHANDLER not supported: 39/21/2011
4:53:55 PM contenthandlersregisterapp.c:765 - Not registering asf
handlers.9/21/2011 4:53:55 PM contenthandlersregisterapp.c:795 -
ContentHandlerRegister app closing itself9/21/2011 4:53:55 PM Event - 0x1 9/21/2011 4:54:16 PM youtubeplayer.c:643 - Playback
Aborted9/21/2011 4:54:16 PM youtubeplayer.c:643 - Playback
Aborted9/21/2011 4:54:16 PM youtubeplayer.c:639 - Playback Stopped/Completed
Successful
 

yes rtsp videos do play on simulator.
it seems the rtsp URLs we get from m.youtube.com work only on mobile devices.
they are not working on Windows & simulator but will work on mobile devices.
tried on CDM 8999 & VX11K & the same rtsp links work fine.
you do not need a depedency in MIF.

yes rtsp videos do play on simulator.
it seems the rtsp URLs we get from m.youtube.com work only on mobile devices.
they are not working on Windows & simulator but will work on mobile devices.
tried on CDM 8999 & VX11K & the same rtsp links work fine.
you do not need a depedency in MIF.