Isaac Connor
723f546b28
Actually return nothing when we hit EOF
2025-11-11 14:10:34 -05:00
Isaac Connor
331738f7b1
Fix zm_av_frame_alloc deprecation
2025-09-22 10:05:54 -04:00
Isaac Connor
14134a270d
Move code around to be better.. Don't read_frame unless we actually need to send_packet
2025-09-22 10:00:29 -04:00
Isaac Connor
e4547aeef4
Don't guess time_base, don't pkt_guard
2025-09-22 09:59:30 -04:00
Isaac Connor
3725794c69
Stop opening codecs upon success. Do retreive_frame before send_packet.
2025-09-22 09:57:27 -04:00
Isaac Connor
546ea73b32
Fix warning
2025-09-22 09:54:08 -04:00
Isaac Connor
a77dcfe193
handle when codec is not in our list of supported codecs. Specifically audio for example. Handle when no codec was found.
2025-09-22 09:53:52 -04:00
Isaac Connor
a977cd5d4d
Adjust heuristic for seeking ahead
2025-09-22 09:53:26 -04:00
Isaac Connor
0372a0dd33
Cleanup constructor and add the new codec_data stuff to try out multiple codecs
2025-09-22 09:52:25 -04:00
Isaac Connor
643fe97b25
Deprecate zm_av_frame_alloc
2025-09-18 14:48:52 -04:00
Steve Gilvarry
88227105b8
Removing avcodec_close, avcodec_free_context is replacement and been around since 2014, so should be no reason to version test.
2024-09-14 11:06:55 +10: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
219af38127
Fix use of deprecated pkt_duration
2024-01-16 16:41:05 -05:00
Isaac Connor
cc377edfe7
After seeking forward, if we've gone too far, seek backwards
2023-10-16 16:55:35 -04:00
Isaac Connor
943f9714b9
Add debug for timebase conversion
2023-10-16 16:36:30 -04:00
Isaac Connor
11214cb9c9
Add debug for returned frame decision
2023-10-16 14:05:25 -04:00
Isaac Connor
6e8efe6332
Increase debug level when packet is not for our stream, which is common when audio is present.
2023-10-16 12:16:36 -04:00
Isaac Connor
4f08ad59cc
Remove redundant debugging of video frames including treating one as audio
2023-08-02 13:56:06 -04:00
Isaac Connor
62c084b225
Make the setting to default time base warning into a debug
2023-01-04 12:44:34 -05:00
Isaac Connor
9e8d2a8428
Remove extra debug
2022-12-07 12:27:02 -05:00
Isaac Connor
a26c9f0935
Handle case where time_base is not set in the codec. Fixes h265 not playing right. Don't eek until a significant difference in time. Lots more debug output. Pass codec when initialising codec context. Mostly this fixes playback of h265
2022-08-16 15:16:22 -04: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
acbdf1854d
Add guard to handle resetting AVPacket after use.
...
Also handle allocation failures.
2022-07-29 14:56:38 -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
9334001247
Convert frame->pts to stream pts. Add a seek if jumping a long way into the mp4
2022-07-13 18:47:27 -04:00
Isaac Connor
c832fabafd
solve ccpcheck complaints
2022-01-09 14:43:23 -05:00
Peter Keresztes Schmidt
707975e567
Monitor: Convert API to std::chrono
2021-06-13 23:22:49 +02: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
e8b761d2bf
cppcheck cleanups
2021-04-20 11:04:27 -04:00
Isaac Connor
dab89622af
Not having a video stream isn't actually bad. Change log to debug
2021-04-11 13:29:24 -04:00
Isaac Connor
e31c87193d
Make Open() return 1 instead of 0
2021-03-03 09:55:57 -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
d594fbcd49
Some fixes for unused code (will be used in future)
2021-01-26 18:29:34 -05:00
Isaac Connor
e226618300
better debug of video/audio frames
2021-01-26 12:21:51 -05:00
Isaac Connor
8d52baeee2
Merge branch 'master' into rtsp_server
...
Cleanup Analysis a bit. We can't skip packets just because they are audio. Clean up the state machine transitions a bit to make them a little more readable.
Change logic of PrimeCapture, success MUST return 1. 0 means no error but also no success.
Debugging and braces improvements in local_camera.
2020-12-17 10:16:54 -05:00
Isaac Connor
2eda49333f
Merge branch 'master' into zma_to_thread
2020-10-20 16:20:29 -04:00
Isaac Connor
268e364cfd
handle the paused case
2020-10-09 10:21:00 -04:00
Isaac Connor
1aadeb2206
free the context as well.
2020-10-08 16:46:03 -04:00
Isaac Connor
a39a656373
Merge branch 'master' into zma_to_thread
2020-09-29 11:02:40 -04:00
Isaac Connor
4126f96b40
clean up sendFrame a bit introducing send_file and send_buffer utility functions
2020-09-07 11:19:47 -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
7575afc8d5
Merge branch 'master' into zma_to_thread
2020-07-21 17:38:32 -04:00
Isaac Connor
4ff341a0f5
Merge branch 'master' into zma_to_thread
2020-05-02 18:03:42 -04:00
Isaac Connor
434f34f027
use delete[] instead of delete.
2020-04-30 11:04:55 -04:00
Isaac Connor
ae9a5766f5
Merge branch 'release-1.34' into fix_zms
2020-04-26 18:19:30 -04:00
Isaac Connor
1c197db619
Merge branch 'master' into rate_dropdown
2020-01-07 14:49:58 -05:00
Isaac Connor
16a73d6d5a
don't seek back when not neccesary
2019-12-13 18:12:33 -05:00
Isaac Connor
5fcd6361bc
fix segfault reading frames for .mp4 in zms
2019-12-13 17:47:18 -05:00
Isaac Connor
3b9b49c44d
wip work on fixing zms mp4 to mjpeg
2019-12-02 15:51:03 -05:00