News:

Latest versions:
Server plugin: 0.5.1
MVP dongle: 0.5.2
Raspberry Pi client: 0.5.2
Windows client: 0.5.2-1

Main Menu

@Chris: programming issue: pause&updateview (for cutting marks)

Started by macfly, January 07, 2007, 19:10:32

Previous topic - Next topic

macfly

Hi Chris,

right now i'm surfing the code to get an idea of implementing the full cutting marks support.

For this feature, i need the following behaviour:
from any state,

  • jump to a specific location in the recording (no problem, using switchState(S_JUMP, newFrame))
  • switch to pause mode (no problem, either with switchState(S_PAUSE_P))
  • and then update the video on screen <- there is my problem

something stupid like player->jumpToMark(nextMark); player->play(); player->pause(); does not work.

could you give me some hints on how to make this work?

btw: could you tell me the difference between S_PAUSE_P and S_PAUSE_I ?

thank you (oh, and happy new year),
Friedhelm.

MartenR

Hi,
maybe I can answer you also.
I think you have to feed one Iframe like in the fastforward mode to the device like in threadFeedScan().

S_PAUSE_P means pause in playbackmode and S_PAUSE_I means pause in i frame mode.

Marten

Chris

Yes, just what I would have said ;)

Basically you need an atomic function that jumps to a specific frame and places in on screen and ends up in S_PAUSE_I. I think this is going to require another state adding to the state system because the current S_JUMP goes to play mode straight after. Let me know if you want me to do this.

Or maybe a variable list of parameters to switchState so S_JUMP can be told whether to end in S_PLAY or S_PAUSE_I ...

macfly

thank you both for your answers. I'll try to figure out for myself, how to implement this.
I'll ask for help if i'm stuck.

Friedhelm.

macfly

OK, i'm stuck.  ???

i modified switchState, so that one can jump into S_PAUSE_I-Mode. The Implementation of this part calls threadFeedPause() (a new implementation similar to threadFeedScan, but without scanning).

threadFeedPause looks like this:

void Player::threadFeedPause()
{
  ULONG baseFrameNumber = 0;
  ULONG nextiframeNumber = 0;
  ULONG iframeNumber = 0;
  ULONG iframeLength = 0;
  ULLONG filePos;
  UINT amountReceived;
  UINT videoLength;
  baseFrameNumber = currentFrameNumber;
  if (!vdr->getNextIFrame(baseFrameNumber, 1, &filePos, &nextiframeNumber, &iframeLength))
    return;

  vdr->getNextIFrame(nextiframeNumber, 0, &filePos, &iframeNumber, &iframeLength);

  baseFrameNumber = iframeNumber;
  threadBuffer = vdr->getBlock(filePos, iframeLength, &amountReceived);
  videoLength = demuxer->stripAudio(threadBuffer, amountReceived);
  video->displayIFrame(threadBuffer, videoLength);

  currentFrameNumber = iframeNumber;
  free(threadBuffer);
  threadBuffer = NULL;
}

but this damn video->displayIFrame simply does not update the screen!
I guess, i did not understand some essentials in playback. Could one please assist me in this issue?

regards,
Friedhelm.

MartenR

For me your code looks fine.
The only thing that comes to my mind is, if the video device is in playback mode, thus was play called before by the player and no reset or stop in your previous function.

But maybe chris can help more, my knowledge to mvp device goes only so far that I can emulate them in the windows part.

Marten

macfly

Hello again,

i did not made any advance in this issue. Chris, do you have a idea, why my threadFeedPause does not display the correct still image?

Chris

I will look at this when I next get chance to have a go at the code.

Chris

Done. You probably don't want to know how close you were to having it working :)

You can now call jumpToFrameP(int newFrame) on the player object and it will jump, pause and display.

It's in CVS.

macfly

 :D

I'll look & learn.

thank you very much!


update: I just collapsed. thank you for your comment. I had to read it three times to believe it :)

macfly

Hey Chris, one more question.

what do you think about what buttons should be used for cutting marks? I know, that you want the colorbuttons for skipping back and forward, and that ok. The numbers are reserved for jumping to 10%, 20%, ... 90%. OK, too.

But for cuttingmarks to work, i need buttons for:

  • toggle a mark
  • moving mark to left
  • moving mark to right
  • jumping to next mark
  • jumping to previous mark
  • opening a menu (for recording commands, defined on server)

My first idea was: when playing, use the normal buttons, when in pause-mode, redefine numberbuttons for mark-editing.
But i think, this is not very usefull.
My next idea was, using a button for toggleing playback and editing-mode. Maybe indicated by a sticky progressbar with different colors.

What do you think about this?

regards,
Friedhelm.

shaddi

Sorry for putting this ancient topic back on top but has somebody implemented this feature to VOMP?
This is the only feature im missing from VOMP....