Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implementation for SWS scale #33

Merged
merged 18 commits into from
Jan 30, 2024
Merged

Implementation for SWS scale #33

merged 18 commits into from
Jan 30, 2024

Conversation

Cacsjep
Copy link
Contributor

@Cacsjep Cacsjep commented Jan 21, 2024

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
Copy link
Owner

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

@Cacsjep Cacsjep changed the title Draft implementation for SWS scale Implementation for SWS scale Jan 22, 2024
@Cacsjep
Copy link
Contributor Author

Cacsjep commented Jan 22, 2024

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

Cacsjep and others added 3 commits January 23, 2024 18:11
Change scaling example to an similar libav example
Update readme
Add func to UpdateScalingParameters
Rename AllocSwsContext to SwsGetContext
Using a type for scaling algos/flags
@Cacsjep
Copy link
Contributor Author

Cacsjep commented Jan 23, 2024

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

Br

Copy link
Owner

@asticode asticode left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this PR! Here's my first review 👍

README.md Show resolved Hide resolved
sws_context.go Outdated Show resolved Hide resolved
sws_context.go Outdated Show resolved Hide resolved
sws_context.go Outdated Show resolved Hide resolved
sws_context.go Outdated Show resolved Hide resolved
examples/scaling/main.go Outdated Show resolved Hide resolved
examples/scaling/main.go Outdated Show resolved Hide resolved
examples/scaling/main.go Outdated Show resolved Hide resolved
examples/scaling/main.go Outdated Show resolved Hide resolved
examples/scaling/main.go Outdated Show resolved Hide resolved
Now using sws context flags
Restructer sws context and adding ned simpler methods to update the ctx
Update the example
Update the test
@Cacsjep
Copy link
Contributor Author

Cacsjep commented Jan 25, 2024

ok this was a lot, hope i dont miss anything

Get/Set source w,h,pixfmt
Get/Set dst w,h,pixfmt
Get/Set sws flags
@Cacsjep
Copy link
Contributor Author

Cacsjep commented Jan 25, 2024

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 Cacsjep requested a review from asticode January 25, 2024 17:05
internal/cmd/flags/main.go Show resolved Hide resolved
software_scale_context.go Outdated Show resolved Hide resolved
software_scale_context.go Outdated Show resolved Hide resolved
software_scale_context_flag.go Outdated Show resolved Hide resolved
software_scale_context.go Outdated Show resolved Hide resolved
software_scale_context_test.go Outdated Show resolved Hide resolved
software_scale_context_test.go Outdated Show resolved Hide resolved
software_scale_context_test.go Outdated Show resolved Hide resolved
software_scale_context_test.go Outdated Show resolved Hide resolved
software_scale_context_test.go Outdated Show resolved Hide resolved
Reorder flags, and update them
# Update Example
Use renaming function to create sws context
Clean up
Use new framdata image funcs
# Sws scale context
New way to update the context
Use sws_scale_frame instead of sws_scale
Reordering funcs for get and set
# Sws sclate context flag
Add "Flag" for algo name
# Update sws test
@Cacsjep
Copy link
Contributor Author

Cacsjep commented Jan 27, 2024

ok done lets go to next round ;)

Copy link
Owner

@asticode asticode left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Almost done! 👍

software_scale_context.go Outdated Show resolved Hide resolved
software_scale_context.go Outdated Show resolved Hide resolved
software_scale_context_test.go Show resolved Hide resolved
software_scale_context_test.go Outdated Show resolved Hide resolved
examples/scaling/main.go Outdated Show resolved Hide resolved
Simpfy sws update
Use c.int for sws flags
update test
@asticode
Copy link
Owner

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

@asticode asticode merged commit f836d58 into asticode:master Jan 30, 2024
3 checks passed
@Cacsjep
Copy link
Contributor Author

Cacsjep commented Jan 30, 2024

Perfect, thank you for letting me contribute =)

@Cacsjep Cacsjep deleted the sws branch January 30, 2024 09:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants