Isaac Connor
da13e5f1a7
Clean up error case return code
2026-01-27 09:00:01 -05:00
Isaac Connor
70c4d7bacd
Remove ::decode which is no good. Move hw transfer stuff to transfer_hwframe and needs_hw_transfer
2026-01-26 15:11:38 -05:00
Isaac Connor
31c76557be
Return a y-image for any suitable format that has a y-plane. Specifically this allows NV12 to work.
2026-01-26 13:18:14 -05:00
Isaac Connor
b79f8b7b51
Add get_y-image
2026-01-26 12:54:31 -05:00
Isaac Connor
518c8d8de0
Fixup hwtransfer when using hwaccel
2026-01-25 18:00:49 -05:00
Isaac Connor
e8adc89e0c
Add send_packet and receive_frame, as we move towards deprecating send_packet_receive_frame
2026-01-22 21:43:19 -05:00
Isaac Connor
db4cb94455
Add analyzed to zm_packet
2026-01-16 15:48:56 -05:00
Isaac Connor
509e189bfd
Handle unlocking an unlocked packet
2026-01-16 11:55:03 -05:00
Isaac Connor
ca375c11ab
Fix Whitespace
2026-01-15 12:46:23 -05:00
Isaac Connor
131b5caee0
Update to RAII style ZMPacketLock. Rename snap to packet in zm_monitor. Keep hw_frame in packet."
2026-01-15 12:46:23 -05:00
Isaac Connor
643fe97b25
Deprecate zm_av_frame_alloc
2025-09-18 14:48:52 -04:00
Isaac Connor
8cdc173cbb
Join lines
2025-07-08 17:45:20 -04:00
Aaron Kling
c4683d90a9
Format code using astyle google format
...
Commands used:
astyle --style=google --indent=spaces=2 --keep-one-line-blocks src/*.cpp
astyle --style=google --indent=spaces=2 --keep-one-line-blocks src/*.h
2024-03-26 13:43:58 -05:00
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