Author Topic: @Chris: programming issue: pause&updateview (for cutting marks)  (Read 7466 times)

Offline macfly

  • Full Member
  • ***
  • Posts: 27
    • ICQ Messenger - 4569876
    • View Profile
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.

Offline MartenR

  • Hero Member
  • *****
  • Posts: 789
    • View Profile
Re: @Chris: programming issue: pause&updateview (for cutting marks)
« Reply #1 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

Offline Chris

  • Administrator
  • Hero Member
  • *****
  • Posts: 543
    • View Profile
    • Email
Re: @Chris: programming issue: pause&updateview (for cutting marks)
« Reply #2 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 ...
« Last Edit: January 08, 2007, 22:03:13 by Chris »

Offline macfly

  • Full Member
  • ***
  • Posts: 27
    • ICQ Messenger - 4569876
    • View Profile
Re: @Chris: programming issue: pause&updateview (for cutting marks)
« Reply #3 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.

Offline macfly

  • Full Member
  • ***
  • Posts: 27
    • ICQ Messenger - 4569876
    • View Profile
Re: @Chris: programming issue: pause&updateview (for cutting marks)
« Reply #4 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.

Offline MartenR

  • Hero Member
  • *****
  • Posts: 789
    • View Profile
Re: @Chris: programming issue: pause&updateview (for cutting marks)
« Reply #5 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

Offline macfly

  • Full Member
  • ***
  • Posts: 27
    • ICQ Messenger - 4569876
    • View Profile
Re: @Chris: programming issue: pause&updateview (for cutting marks)
« Reply #6 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?

Offline Chris

  • Administrator
  • Hero Member
  • *****
  • Posts: 543
    • View Profile
    • Email
Re: @Chris: programming issue: pause&updateview (for cutting marks)
« Reply #7 on: February 08, 2007, 19:35:08 »
I will look at this when I next get chance to have a go at the code.

Offline Chris

  • Administrator
  • Hero Member
  • *****
  • Posts: 543
    • View Profile
    • Email
Re: @Chris: programming issue: pause&updateview (for cutting marks)
« Reply #8 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.

Offline macfly

  • Full Member
  • ***
  • Posts: 27
    • ICQ Messenger - 4569876
    • View Profile
Re: @Chris: programming issue: pause&updateview (for cutting marks)
« Reply #9 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 :)
« Last Edit: February 23, 2007, 18:35:05 by macfly »

Offline macfly

  • Full Member
  • ***
  • Posts: 27
    • ICQ Messenger - 4569876
    • View Profile
Re: @Chris: programming issue: pause&updateview (for cutting marks)
« Reply #10 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:
  • 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.

Offline shaddi

  • Jr. Member
  • **
  • Posts: 1
    • View Profile
    • Email
Re: @Chris: programming issue: pause&updateview (for cutting marks)
« Reply #11 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....