Loggytronic Forum

VOMP => VOMP General / MVP => Topic started by: macfly on January 07, 2007, 19:10:32

Title: @Chris: programming issue: pause&updateview (for cutting marks)
Post by: macfly on January 07, 2007, 19:10:32
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,

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.
Title: Re: @Chris: programming issue: pause&updateview (for cutting marks)
Post by: MartenR on January 08, 2007, 07:17:07
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
Title: Re: @Chris: programming issue: pause&updateview (for cutting marks)
Post by: Chris on January 08, 2007, 22:01:10
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 ...
Title: Re: @Chris: programming issue: pause&updateview (for cutting marks)
Post by: macfly on January 09, 2007, 08:12:32
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.
Title: Re: @Chris: programming issue: pause&updateview (for cutting marks)
Post by: macfly on January 22, 2007, 13:29:33
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.
Title: Re: @Chris: programming issue: pause&updateview (for cutting marks)
Post by: MartenR on January 22, 2007, 18:28:06
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
Title: Re: @Chris: programming issue: pause&updateview (for cutting marks)
Post by: macfly on February 07, 2007, 19:24:10
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?
Title: Re: @Chris: programming issue: pause&updateview (for cutting marks)
Post by: Chris on February 08, 2007, 19:35:08
I will look at this when I next get chance to have a go at the code.
Title: Re: @Chris: programming issue: pause&updateview (for cutting marks)
Post by: Chris on February 10, 2007, 17:01:41
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.
Title: Re: @Chris: programming issue: pause&updateview (for cutting marks)
Post by: macfly on February 23, 2007, 18:27:13
 :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 :)
Title: Re: @Chris: programming issue: pause&updateview (for cutting marks)
Post by: macfly on February 23, 2007, 19:23:17
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:

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.
Title: Re: @Chris: programming issue: pause&updateview (for cutting marks)
Post by: shaddi on January 10, 2012, 08:23:43
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....