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

Developer

Forums

Forums:

Hi

 

Can any one know how to save rtsp video stream into a buffer while media is playing.

 

Regards

Srinag

1.) do you want to play, also want to buffer simultaneously when it is playing?
3.) do you want to buffer first and then play?

1.) do you want to play, also want to buffer simultaneously when it is playing?
3.) do you want to buffer first and then play?

I want to play simultaneously want to buffer

I want to play simultaneously want to buffer

In the media callback, you can get the frame data under MM_STATUS_FRAME, refer below code...
void MediaControl::MediaNotifyCallback( void* pUser, AEEMediaCmdNotify * pCmdNotify){ //DBGPRINTF("MediaNotifyCallback");
 if( pCmdNotify->nSubCmd == MM_PARM_VOLUME )  return;
 switch (pCmdNotify->nCmd) { case MM_CMD_GETTOTALTIME:  {   DBGPRINTF("nCmd == MM_CMD_GETTOTALTIME");
   break;  } case MM_CMD_PLAY:  {   switch (pCmdNotify->nStatus)   {   case MM_STATUS_TICK_UPDATE:    DBGPRINTF("play.tickupdate");    break;
   case MM_STATUS_DONE:    DBGPRINTF("play.done");    break;   case MM_STATUS_FRAME :    DBGPRINTF("frame got");    break;   case MM_STATUS_PAUSE:    DBGPRINTF("play.pause");    break;
   case MM_STATUS_START:   case MM_STATUS_RESUME:    DBGPRINTF("play.playing");    break;
   case MM_STATUS_SEEK:    break;
   case MM_STATUS_ABORT:    DBGPRINTF("play.finalabort");;    break;
   case MM_STATUS_SEEK_FAIL:   case MM_STATUS_PAUSE_FAIL:   case MM_STATUS_RESUME_FAIL:    DBGPRINTF("play.seekabort");    break;
   default:    //DBGPRINTF("play.unhandled_status");    break;
   }
   break;  }
 default:  DBGPRINTF("unhandled command");   break; }}

In the media callback, you can get the frame data under MM_STATUS_FRAME, refer below code...
void MediaControl::MediaNotifyCallback( void* pUser, AEEMediaCmdNotify * pCmdNotify){ //DBGPRINTF("MediaNotifyCallback");
 if( pCmdNotify->nSubCmd == MM_PARM_VOLUME )  return;
 switch (pCmdNotify->nCmd) { case MM_CMD_GETTOTALTIME:  {   DBGPRINTF("nCmd == MM_CMD_GETTOTALTIME");
   break;  } case MM_CMD_PLAY:  {   switch (pCmdNotify->nStatus)   {   case MM_STATUS_TICK_UPDATE:    DBGPRINTF("play.tickupdate");    break;
   case MM_STATUS_DONE:    DBGPRINTF("play.done");    break;   case MM_STATUS_FRAME :    DBGPRINTF("frame got");    break;   case MM_STATUS_PAUSE:    DBGPRINTF("play.pause");    break;
   case MM_STATUS_START:   case MM_STATUS_RESUME:    DBGPRINTF("play.playing");    break;
   case MM_STATUS_SEEK:    break;
   case MM_STATUS_ABORT:    DBGPRINTF("play.finalabort");;    break;
   case MM_STATUS_SEEK_FAIL:   case MM_STATUS_PAUSE_FAIL:   case MM_STATUS_RESUME_FAIL:    DBGPRINTF("play.seekabort");    break;
   default:    //DBGPRINTF("play.unhandled_status");    break;
   }
   break;  }
 default:  DBGPRINTF("unhandled command");   break; }}

void MediaControl::MediaNotifyCallback( void* pUser, AEEMediaCmdNotify * pCmdNotify)
{
//DBGPRINTF("MediaNotifyCallback");

if( pCmdNotify->nSubCmd == MM_PARM_VOLUME )
return;

switch (pCmdNotify->nCmd)
{
case MM_CMD_GETTOTALTIME:
{
DBGPRINTF("nCmd == MM_CMD_GETTOTALTIME");

break;
}
case MM_CMD_PLAY:
{
switch (pCmdNotify->nStatus)
{
case MM_STATUS_TICK_UPDATE:
DBGPRINTF("play.tickupdate");
break;

case MM_STATUS_DONE:
DBGPRINTF("play.done");
break;
case MM_STATUS_FRAME :
DBGPRINTF("frame got");
break;
case MM_STATUS_PAUSE:
DBGPRINTF("play.pause");
break;

case MM_STATUS_START:
case MM_STATUS_RESUME:
DBGPRINTF("play.playing");
break;

case MM_STATUS_SEEK:
break;

case MM_STATUS_ABORT:
DBGPRINTF("play.finalabort");;
break;

case MM_STATUS_SEEK_FAIL:
case MM_STATUS_PAUSE_FAIL:
case MM_STATUS_RESUME_FAIL:
DBGPRINTF("play.seekabort");
break;

default:
//DBGPRINTF("play.unhandled_status");
break;

}

break;
}

default:
DBGPRINTF("unhandled command");
break;
}

void MediaControl::MediaNotifyCallback( void* pUser, AEEMediaCmdNotify * pCmdNotify)
{
//DBGPRINTF("MediaNotifyCallback");

if( pCmdNotify->nSubCmd == MM_PARM_VOLUME )
return;

switch (pCmdNotify->nCmd)
{
case MM_CMD_GETTOTALTIME:
{
DBGPRINTF("nCmd == MM_CMD_GETTOTALTIME");

break;
}
case MM_CMD_PLAY:
{
switch (pCmdNotify->nStatus)
{
case MM_STATUS_TICK_UPDATE:
DBGPRINTF("play.tickupdate");
break;

case MM_STATUS_DONE:
DBGPRINTF("play.done");
break;
case MM_STATUS_FRAME :
DBGPRINTF("frame got");
break;
case MM_STATUS_PAUSE:
DBGPRINTF("play.pause");
break;

case MM_STATUS_START:
case MM_STATUS_RESUME:
DBGPRINTF("play.playing");
break;

case MM_STATUS_SEEK:
break;

case MM_STATUS_ABORT:
DBGPRINTF("play.finalabort");;
break;

case MM_STATUS_SEEK_FAIL:
case MM_STATUS_PAUSE_FAIL:
case MM_STATUS_RESUME_FAIL:
DBGPRINTF("play.seekabort");
break;

default:
//DBGPRINTF("play.unhandled_status");
break;

}

break;
}

default:
DBGPRINTF("unhandled command");
break;
}

Hi 
Using IMedia_SetMeidaParam with nParmID MM_MP4_PARM_RTSP_STREAM_CONVERT i can able to store stream buffer in a local file. In simulator it is working fine. but in device api return value is giving SUCCESS and it is not saving in device application's directory.
Do we need to add any extra dependency to save?
Here i'm using BREW MP QRD6240 device.

Hi 
Using IMedia_SetMeidaParam with nParmID MM_MP4_PARM_RTSP_STREAM_CONVERT i can able to store stream buffer in a local file. In simulator it is working fine. but in device api return value is giving SUCCESS and it is not saving in device application's directory.
Do we need to add any extra dependency to save?
Here i'm using BREW MP QRD6240 device.