asticode / go-astiav

Golang ffmpeg and libav C bindings
MIT License
393 stars 45 forks source link

Implementation for SWS scale #33

Closed Cacsjep closed 9 months ago

Cacsjep commented 9 months ago

Hi

I am starting with implementation sws scale, hope we can start here as a draft so that we add this to go-astiv =)

br

asticode commented 9 months ago

Let me know when your draft is done so that I know when to start reviewing it 👍

Cacsjep commented 9 months ago

done it works for my application gg, hope its fit to your needs =)

Cacsjep commented 9 months ago

I did some improvments based on your feedback on my hw_context pr :)

Br

Cacsjep commented 9 months ago

ok this was a lot, hope i dont miss anything

Cacsjep commented 9 months ago

I think it would also be cool to have one setter for width and height, because most of time user would be change both, currently we would call updateContext twice.

func (ssc *SoftwareScaleContext) SetSourceResolution(w int, h int) error {
    ssc.srcW = C.int(w)
    ssc.srcH = C.int(h)
    return ssc.updateContext()
}

func (ssc *SoftwareScaleContext) SetDestinationResolution(w int, h int) error {
    ssc.dstW = C.int(w)
    ssc.dstH = C.int(h)
    return ssc.updateContext()
}

I think its better to have this and not calling it twice so i add it and let me know if this ok for you =)

Cacsjep commented 9 months ago

ok done lets go to next round ;)

asticode commented 9 months ago

Great, I'll merge the PR and make minor adjustments 👍

Cacsjep commented 9 months ago

Perfect, thank you for letting me contribute =)