Isaac Connor
b3a262fc9b
Fix crash due to using unrotated y-channel image. Put the y-image creation in ::Decode, stored in ZMPacket.
2022-11-22 12:38:48 -05:00
Doug Nazar
f4dd897ef4
Convert AVFrame* to custom unique_ptr (av_frame_ptr).
...
Switch all owning AVFrame* variables to av_frame_ptr for
automatic cleanup.
Use AVBufferRef to store frame data in AVFrame where appropriate
so that it can be freed automatically with it's AVFrame.
Handle allocation errors.
2022-07-30 13:21:11 -04:00
Doug Nazar
110cc436a3
Switch from av_init_packet() to av_packet_alloc()
...
Remove all uses of deprecated av_init_packet() and switch any stack
based AVPackets to unique_ptrs allocated with av_packet_alloc().
Ensure that all code paths call av_packet_unref() after use to reset
before next usage.
2022-07-29 14:56:26 -04:00
Isaac Connor
a7bed00275
Introduce a quick function to return the amount of ram a zmpacket is using
2022-06-17 13:26:49 -04:00
Isaac Connor
4154731f13
test for ctx->sw_pix_fmt being AV_PIX_FMT_NONE before trying to do do hwdevice transfer
2022-04-18 18:06:05 -04:00
Isaac Connor
30fa641186
initialize video_first_pts and when setting it need to specify microseconds otherwise we get nanoseconds. White space.
2021-09-21 14:29:05 -04:00
Peter Keresztes Schmidt
707975e567
Monitor: Convert API to std::chrono
2021-06-13 23:22:49 +02:00
Isaac Connor
84035ef4f7
Adjust debug logging
2021-06-08 16:54:41 -04:00
Peter Keresztes Schmidt
2d71743372
FFmpeg: Remove code paths required only by 2.8 and older
...
With Xenial support dropped we require FFmpeg 3.2 and newer.
2021-06-05 20:40:12 +02:00
Isaac Connor
4fcdeb7287
Fix alignment in get_out_frame. Fixes #3233 . If width % 32 then we can't use the more efficient 32 aligned scaling.
2021-05-21 10:37:51 -04:00
Isaac Connor
68fb87c861
Remove debug
2021-05-17 16:32:33 -04:00
Isaac Connor
3cd9bdccd5
style and performance improvements reported by cppcheck
2021-05-09 16:39:38 -04:00
Isaac Connor
2cf6ad8089
Switch ZMPacket * to a shared_ptr<ZMPacket>. This is so that in LockedPacket we can unlock and then notify and be confident that packet_ won't have been deleted. Change ZMPacket->timestamp to be a timeval instead of timeval *. This might not have been necessary but I like it. No longer cuse the ZMPacket object to wrap the shared image buffers and timestamps. Use a vector for image_buffers.
2021-05-08 21:14:20 -04:00
Isaac Connor
3645ccea1b
Make vaapi accelerated encoding work
2021-05-04 20:20:33 -04:00
Isaac Connor
b6af846664
add missing initializers
2021-04-20 17:09:14 -04:00
Isaac Connor
9903e909af
Rework locking in ZMPacket by using a new class called ZMLockedPacket.
2021-03-15 17:05:30 -04:00
Isaac Connor
b238a2bc25
Implement decoder thread, locking is broken
2021-03-15 15:08:43 -04:00
Isaac Connor
e0d54a6d11
remove deprecated reset and tidy up a bit
2021-03-13 16:30:41 -05:00
Isaac Connor
b87d859f72
Set the packet's stream_index to the packetqueue stream. Rename get_ functions to get
2021-03-03 12:06:34 -05:00
Isaac Connor
64c601fc7b
Must fix_deprecations on both values
2021-02-22 20:40:30 -05:00
Isaac Connor
730cd815d3
Add frame format to debug logging. Use fix_deprecated_fmt to fix when ctx->fmt is yuvj420p instead of yuv420p
2021-02-22 15:48:16 -05:00
Isaac Connor
e562888ed0
Fix crash when decoder returns 0 and when are using hwaccel
2021-02-19 21:03:10 -05:00
Isaac Connor
ed6fc9fca6
use av_frame_copy_props to copy frame members instead of doing it manually
2021-02-19 12:44:24 -05:00
Peter Keresztes Schmidt
938676b129
ffmpeg: exit dumpPacket early if debug logging is not enabled
2021-02-07 11:58:17 +01:00
Peter Keresztes Schmidt
0dbc39ee25
Cleanup and reorganize includes
...
With this commit a unified structure for includes is introduced.
The general rules:
* Only include what you need
* Include wherever possible in the cpp and forward-declare in the header
The includes are sorted in a local to global fashion. This means for the include order:
0. If cpp file: The corresponding h file and an empty line
1. Includes from the project sorted alphabetically
2. System/library includes sorted alphabetically
3. Conditional includes
2021-02-04 18:02:01 +01:00
Isaac Connor
fdadacac6c
set packet.size and data because av_init_packet don't do that
2021-01-31 21:31:33 -05:00
Isaac Connor
b93aab6a11
turn off hwtransfer direct to image. Too compliated for now with not enough benefit
2021-01-30 12:34:29 -05:00
Isaac Connor
4bd813d980
Don't try to transfer image when there is no image available
2021-01-28 10:22:14 -05:00
Isaac Connor
2baa22dc85
Fix case when hwaccel not compiled in
2021-01-28 10:16:58 -05:00
Isaac Connor
608afcbbd2
return bytes consumed by decode
2021-01-27 16:12:49 -05:00
Isaac Connor
5b7fc210fe
Only use direct to rgb0 when image colours are 4
2021-01-12 14:12:09 -05:00
Isaac Connor
f7be54fe11
Add detecting target pixfmt and if rgb0 is supported, use it to do the transfer direct to the Image.
2021-01-11 13:46:50 -05:00
Isaac Connor
09264a52ff
use zm_av_send_packet_receive_frame and fixup hwaccel support
2021-01-11 13:46:50 -05:00
Isaac Connor
b3ca0ac2d9
add missing and mix order of Packet initializers
2021-01-11 13:46:50 -05:00
Isaac Connor
284b9f963f
Merge branch 'master' into zma_to_thread
2020-12-29 12:18:26 -05:00
Isaac Connor
3f2d088f8c
Delete image if image_index == -1
2020-12-27 12:00:45 -05:00
Isaac Connor
aaf4b37439
spacing, don't need to set packet.size=0
2020-12-07 15:53:09 -05:00
Isaac Connor
a39a656373
Merge branch 'master' into zma_to_thread
2020-09-29 11:02:40 -04:00
Peter Keresztes Schmidt
8f980a1168
Convert NULL/0 to nullptr
...
The 0 -> nullptr changes should definitely improve readability.
2020-08-26 22:03:40 +02:00
Isaac Connor
448294f593
wip
2019-02-25 10:21:43 -05:00
Isaac Connor
28dafd5931
Merge branch 'storageareas' into zma_to_thread
2018-12-26 12:02:00 -05:00
Isaac Connor
36f7e9abb1
Merge h265 and begin work on swsresample
2018-11-21 09:46:14 -05:00
Isaac Connor
b16cd7ec84
Merge branch 'h265' into zma_to_thread
2018-11-20 12:38:17 -05:00
Isaac Connor
cd3046abb3
Merge branch 'storageareas' into zma_to_thread
2018-04-14 11:03:08 -04:00
Isaac Connor
0ea6fd9807
Merge branch 'storageareas' into zma_to_thread
2017-12-19 14:06:58 -05:00
Isaac Connor
887235c746
move dumpPacket to zm_ffmpeg
2017-12-19 09:59:04 -05:00
Isaac Connor
0865201e1e
seems to work
2017-12-01 07:26:34 -05:00
Isaac Connor
f2efc80f22
works?
2017-11-30 14:37:36 -05:00
Isaac Connor
8e494ef431
Merge branch 'storageareas' into zma_to_thread
2017-11-23 08:40:49 -05:00
Isaac Connor
24a0d717c5
wip
2017-11-21 19:55:40 -05:00