locked
GoToNextFrameAsync Lags

    Question

  • I'm writing some frames to GIF file using BitmapEncoder. GoToNextFrameAsync runs very fast on most frames (<100ms), but sometimes will lag for several seconds on one frame.

    A;

    create_task(gifEncoder->GoToNextFrameAsync()).then([this]()
      {
       B;
      });

    //long time between A and B ,may be up to 30 seconds lag

    What may be wrong?

    Or can I set the thread priority?

    Thanks!


    • Edited by Raptor K Friday, June 28, 2013 2:16 PM
    Friday, June 28, 2013 11:23 AM

Answers

  • Hi Raptor K,

    I dont think set thread priority will make sense, but you can give a try.

    And can you try to use a for-loop instead of the .then() to see if the lag still exist?

    Good luck


    James He
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Tuesday, July 09, 2013 2:13 AM
    Moderator

All replies

  • Hi Raptor K,

    I dont think set thread priority will make sense, but you can give a try.

    And can you try to use a for-loop instead of the .then() to see if the lag still exist?

    Good luck


    James He
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Tuesday, July 09, 2013 2:13 AM
    Moderator
  • How can I use a for-loop with the -Async API ?

    When I use synchronous API (wic encoder) with for-loop, there is no such problem. Just an about 1 second lag on UI thread.


    Win8 Developer QQ Group 95331609

    Wednesday, July 10, 2013 2:32 AM