Code Monkey home page Code Monkey logo

Comments (26)

pubpy2015 avatar pubpy2015 commented on May 10, 2024 1

Problems solved

Sleep 1 milisecond here:
image

Add SignalToStop() method in DecoderContext.cs
image

call Signal ToStop() before Stop():
image

Video test:

fixed.mp4

from flyleaf.

pubpy2015 avatar pubpy2015 commented on May 10, 2024

image

from flyleaf.

pubpy2015 avatar pubpy2015 commented on May 10, 2024

image

from flyleaf.

SuRGeoNix avatar SuRGeoNix commented on May 10, 2024

player.Stop() requires re-opening. You use Stop as Pause? Do you get the error when you first time click Stop?

from flyleaf.

pubpy2015 avatar pubpy2015 commented on May 10, 2024

I am using player.Open(rtsp ur) on Play button and player.Stop() on Stop button:
image

from flyleaf.

SuRGeoNix avatar SuRGeoNix commented on May 10, 2024

@pubpy2015 You and your rtsp mess :) You try to Stop before it actually opened. that's the issue...

I knew that some locks are required during open/stop/dispose etc... I guess I will add them

from flyleaf.

SuRGeoNix avatar SuRGeoNix commented on May 10, 2024

I guess that was it, let me know if otherwise. I've not finished with locks yet, because I was planning to update Player.cs and Plugins but nice catch. I will need to come back on this one as Stop should ideally cancel previous Open for faster Stop.

from flyleaf.

SuRGeoNix avatar SuRGeoNix commented on May 10, 2024

One more thing. It's your responsibility to Stop the Player before Open. So generally, consider doing player.Stop(); also on your button1

from flyleaf.

pubpy2015 avatar pubpy2015 commented on May 10, 2024

I am trying on new code version. Better but it will make app hang in short time.
Sometime still error here:
image

Can you set player/demuxer status to Stopping and break open thread ?

from flyleaf.

SuRGeoNix avatar SuRGeoNix commented on May 10, 2024

Did you try to Stop before Open at button1?

from flyleaf.

pubpy2015 avatar pubpy2015 commented on May 10, 2024

No, if place Stop before Open, app will no crash but hang in more time.
If rtsp source is not available, you must wait more time before you can click Stop button.
Incase of app have multiple players, it is not convenient.
I am seeing you have DemuxInterrupt property and Stopping status. can you using this to break Open thread ?
image
image

from flyleaf.

SuRGeoNix avatar SuRGeoNix commented on May 10, 2024

What exactly are you doing? Pressing Open/Stop buttons all the time? I mean is this a real scenario or you just try hard to crash it?

from flyleaf.

pubpy2015 avatar pubpy2015 commented on May 10, 2024

I am doing an application like that:
image

each camera have 2 video streams, mainstream with higher resolution and substream with lower resolution.
In multiview mode, Flyleaf control will connect to substream of each camera.
when user double click to open camera1, application will stop substream of all cameras and open camera 1 with mainstream. Double click again will stop mainstream of camera1 and open substream of all cameras. => It will require open /stop continous in short time.

from flyleaf.

SuRGeoNix avatar SuRGeoNix commented on May 10, 2024

OK I think I've fixed the whole pyramid there of Start/Stop with also fast abort of opening

from flyleaf.

pubpy2015 avatar pubpy2015 commented on May 10, 2024

Yes, better performance but sometime still error here:
ảnh

from flyleaf.

SuRGeoNix avatar SuRGeoNix commented on May 10, 2024

My first problem is that I cannot easily test this. The second problem is that I still believe that it's not the proper way of doing this. However, give it a try but consider finding a better way of implementing this?

from flyleaf.

SuRGeoNix avatar SuRGeoNix commented on May 10, 2024

@pubpy2015 Do you still have issues with this one, I will re-code some parts on version 3.2 (unfortunately not time for that currently).

from flyleaf.

pubpy2015 avatar pubpy2015 commented on May 10, 2024

Yes,

if rtsp source is ready, the problem here:
ảnh

If rtsp source is not available, the problem here:
ảnh

(you can try with any fake rtsp url, ex: rtsp://123.14.15.16:8554/live/c1234)

from flyleaf.

pubpy2015 avatar pubpy2015 commented on May 10, 2024

other problem is FlyLeaf control not redraw when resize:
ảnh

from flyleaf.

SuRGeoNix avatar SuRGeoNix commented on May 10, 2024

What do you mean 'if rtsp source is ready' ?
The resize issue is for the designer only right?

from flyleaf.

pubpy2015 avatar pubpy2015 commented on May 10, 2024

What do you mean 'if rtsp source is ready' ?
this mean rtsp source 'online' and can play by player.

The resize issue is for the designer only right?
Yes.

from flyleaf.

pubpy2015 avatar pubpy2015 commented on May 10, 2024

other problem is FlyLeaf control not redraw when resize:
ảnh

Add below code in Flyleaf user control constructor will fix this problem:
// set double buffer
this.SetStyle(ControlStyles.UserPaint | ControlStyles.OptimizedDoubleBuffer | ControlStyles.AllPaintingInWmPaint | ControlStyles.SupportsTransparentBackColor, true);

from flyleaf.

SuRGeoNix avatar SuRGeoNix commented on May 10, 2024

Nice, sorry but didn't have time lately to help you out with this one. I will included it on the next update (I will review general start/stop and memory leaks)

from flyleaf.

SuRGeoNix avatar SuRGeoNix commented on May 10, 2024

Give another try with the latest version (3.1.9) and let me know if you still catch any crash!

from flyleaf.

pubpy2015 avatar pubpy2015 commented on May 10, 2024

It works well in most cases.
Very rarely does this error:

image
image

from flyleaf.

SuRGeoNix avatar SuRGeoNix commented on May 10, 2024

Nice should be also fixed

from flyleaf.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.