Commit Graph

4 Commits

Author SHA1 Message Date
Cacsjep
f836d58883
Implementation for SWS scale (#33)
* Draft implementation for SWS scale

* Update go.mod

* Revert "Update go.mod"

This reverts commit 760fb8c427.

* Renaming to AllocSwsContext and remove ChangeResolution this should handled by users

* update example to use new name and remove ChangeResolution

* Follow scaling example from libav, update readme, improve sws

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

* Fix Errors in scale example

* Review Changes

Now using sws context flags
Restructer sws context and adding ned simpler methods to update the ctx
Update the example
Update the test

* Correctly handle error for buffer alloc in PrepareDestinationFrameForScaling

* Add more getter and setter for sws

Get/Set source w,h,pixfmt
Get/Set dst w,h,pixfmt
Get/Set sws flags

* Adding resolution get/set

* Use CachedContext when updating sws ctx

* Review changes

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

* fix fmt error args bug

* Review Changes

Simpfy sws update
Use c.int for sws flags
update test
2024-01-30 10:25:15 +01:00
Cacsjep
767f28bc3d
Implementation for HW Context (#32)
* Adding HW Context

* Check for hw pixel format and transfer data on ReciveFrame when its hw pixel format

* Remove hw_decoding example and update demuxing_dec example

* unref hw_device_ctx, and improve example

Unref correctly hw_device_ctx on free
decoding example has now a flag for hw decoding
Use error on hw context because its good to know the error that happen
Add a method to list supported hw codecs so user could check if system has a specif hwcodec before the create a hw context

* Fix test to use err, and update hw with device to also return error

* revert changes in demux example

* Add/Modify according to review

Seperate Hardware Device Context and Test
Renaming HW to Hardware
Create dedicated hardware_decoding Example
Update Readme
Add TransferHardwareData to frame.go
Add SetHardwareDeviceContext to codec_context.go

* Review changes

add HardwareConfigs to codec
create codec_hardware_config
create codec_hardware_config_method_flag
update example
update flags
better error handling in TransferHardwareData
update CreateHardwareDeviceContext, better null handling
remove hw ctx test because it fails when no nvidia is present
some reordering of conss in hardware_device_type

* Minor tweaks (review changes)

HardwareConfigs only returns a slice an no error anymore
remove if HardwareDeviceType checking in codec.go this should be done by user
order codec hw_config_method_flags constants alphabetically
some small changes in example
##  hardware_device_context.go
change link
update optionsC
2024-01-24 18:23:12 +01:00
Quentin Renard
0c13906bfc Moved bit flags to astikit 2023-10-03 12:20:41 +02:00
Quentin Renard
477b147104 Initial commit 2022-02-13 19:08:18 +01:00