bytedeco/javacv

AVFormatContext call_back()?

Open

#463 opened on Jul 25, 2016

View on GitHub
 (9 comments) (0 reactions) (0 assignees)Java (1,583 forks)batch import
help wantedquestion

Repository metrics

Stars
 (6,985 stars)
PR merge metrics
 (No merged PRs in 30d)

Description

i want to stop the av_read_frame(), but i do not know how to call the call_back() to interrupt, here is my code, but it don't work...

AVFormatContext pFormatCtx = new AVFormatContext(null);

 AVIOInterruptCB avioInterruptCB = pFormatCtx.interrupt_callback();
        avioInterruptCB.callback(new AVIOInterruptCB.Callback_Pointer() {
            public int call(Pointer p) {

                 try {
                    TimeUnit.SECONDS.sleep(10);
                }catch (Exception e) {
                    logger.info("TimeUnit Exception: {}" , e);
                }
               return 1;
             }
         });

Contributor guide