Up to [DVB] / libsoftmpeg / src
Request diff between arbitrary revisions
Keyword substitution: kv
Default branch: MAIN
- remove individual xxx_handle_ts_packet() functions for audio and video - handle ts packet filtering in softmpeg.c, do some sanity checks against payload_len => enhances stability on very broken reception
- fixed pes header calculation, thanks to Bryce Nichols
- follow latest changes in libavcodec
- make debug message less verbose
- include SOFTMPEG_DEBUG_AVSYNC if build with "--enable-debug" - make some debug messages more verbose - simplify / fix calculation of additional wait cycles to compensate non-50Hz timings - adjust high watermark down to 50% (66% before) - simplify handling in audio_playout
- fix stupid bug in pes playback: PTS information wasn't resetted for every PES paket, so packets with wrong timing informations were put to softmpeg core, leading to nearly unusable playback behaviour
- only clear the screen on a decoder_stop() not on a skip
- rip out all fusionsound stuff from main audio.c, put it to a_fusionsound.c, put a lean api around it - check for availble audio ouput "devices" in audio.c, support fusionsound, follow changes in audio.c - add copyright headers to all of the new files - make all functions static in v_directfb.c
- rip out all DirectFB functionality from video.c and put it into a separate file v_directfb.c
- don't terminate feed thread in case of EOF, useful for timeshift - handle skip to begin of file gracefully
- make skip calculation a little more robust
- added el-cheapo skipping mode SOFTMPEG_SKIP, which can skip a specified amount of seconds
- replace ..._pause() function with a more generic softmpeg_decoder_set_mode() function - follow these changes in demo application
- added a simple pause function. basically works, but won't work this way with rewind/fast forward
- remove another debugging message
- make sure to set the fd to O_NONBLOCK, so that the feed thread doesn't block in read() - add softmpeg_decoder_hard_resync(), call that if audio.c detects pts skew and other weird stuff where a resync is necessary - extend softmpeg_decoder_set_pids() so you can specify an fd. the polling thread will use this new fd afterwards. useful for switching between live-tv and recordings - fixed some debug messages in audio.c
- add callback function to softmpeg_decoder_polling_thread_create(). if data has been processed you are called back; this is useful if you'd like to implement pvr functionality with softmpeg
- implement audio_set_volume() for easier and safer muting/unmuting - add structure init to video_create()/audio_create() - move inital_sync handling to function
- add directfb and fusionsound to the "required" list of the package config file - small debug message fix in audio.c - explicitely call softmpeg_decoder_stop() in softmpeg_decoder_set_pids(), otherwise the decoder core gets messed up seriously due to changed pids et. al. - call DirectFBInit() if we are called before any other programs has initialized DirectFB, so that we can give out a proper error message
- shuffle around some debug messages: - replace AUDIO_PES with AUDIO_DEBUG and VIDEO_PES with VIDEO_DEBUG to make debugging a/v desyncing easier - add debug messages that the pts of every video frame and the pts of every audio chunk - disable VIDEO_PES and AUDIO_PES messages by default, the produce too much noise when debugging - if the audio buffer has not enough data, make sure that we insert enough silence, make sure that our ->len information is accurate, otherwise audio underflow occurs when enough data is lost
- create one global softmpeg singleton object, prevent applications from creating more than one softmpeg decoder instance - add softmpeg_get_current_softmpeg_context(): useful for applications where the softmpeg decoder has been opened by another context, but you don't want to pass around pointers to that context (dirty) - add softmpeg_decoder_set_av_sync(): useful for playback, video is simply played out, only synced to the vertical blank, needs testing - VIDEO_THRESHOLD is used at various places when avsync is turned off, needs testing
- fix calculation of delay when high watermark is reached - remove some dead code - don't sleep inside the handler, but return appropriate delay in ms to the caller
- apply changes suggested by Carsten Kroll: - audio stream id is 5 bits, not 4 - don't assume the pes packet length is correct if we encounter an unsupported pes packet type
- make the various softmpeg_decoder_process_...() functions use an unsigned char to ease byte stream parsing - fix calculation of delay in ms, when audio data is feeded too fast - don't abort when an audio delay is necessary, but return the delay insead (tststs...) - make softmpeg_decoder_process_pes_data() aware that multiple pes packets can be send, don't rely that each chunk only contains one video or one audio pes packet -- this basically fixes reccoding playback in vdr
- accidently turned on audio debugging again - remove some debugging stuff - make sure to query the playback interface only when it's available
- add mutex to protect the FusionSound stream, needed because the stream may be changed anytime when the sample rate changes - don't exit(-1) when audio decoding fails (usefull for vdr...) - add a avsync_thread for long term av sync, currently it only fetches some informations and prints it out - don't let the feed thread catch any signals
- disable SOFMPEG_AUDIO_DEBUG by default again - enhance the audio experience while zapping: mute the FusionSound stream before zapping, unmute it when a/v sync is achieved - enhance the video experience while zapping: blank the video before zapping - lock access to the audio setting with video mutex - add a couple of sanity checks to check_and_write_audio_pes() to make the code more robust - check for multiple creation of the feed thread, wait for init using sched_yield() - upon softmpec_decoder_stop(), set alls pids to 0x1fff, so nothing is decoded anymore - fix debug output if VIDEO_AVSYNC() is used
- disable MPEG_PES_TO_FRAME debugging by default - skip pes headers for all pes packets, not only for the ones conatining a pts - add new VIDEO_PES_TO_FRAME_DEBUG, use VIDEO_PES() for debugging messages - add define MAX_VIDEO_MPEG_FRAME_SIZE, currently 128kB (hints are welcome) - actually implement video_handle_pes_data()
- make is_pes_packet_start() return the stream identifier in case it is a pes packet start - make raw audio pes buffer use malloc() instead of a static array - add audio_decoder_destroy(), use it in softmpeg core - change all AUDIO_PES_TO_FRAME_DEBUG message to use new AUDIO_PES() - move sync logic from audio_handle_pes_data() to separate function - fix pes deconding for raw pes frames (like vdr spits out)
- remove some obsolete debug messages from demo application - add c++ foo to external softmpeg header file - split packet handling into ts handling and pes packet handling for both audio and video (pes handling isn't working yet) - remove some commonly used pes header parsing stuff to internal.h
DOKs last changes: - fix return code handling for feed thread - use softmpeg_sleep() to sleep if audio buffer is filled too much (useful for file playback) Other changes: - add SOFTMPEG_FATAL() which terminates execution (currently only used if avcodec cannot be reinitialized, although it was initialized before) - remove some dead code that was only used in the very beginning - change lots of fprintf()s from critical erros to SOFTMPEG_ERROR - remove old style pprintf() - add a couple of "fixme"s for important things to do -
some more of DOKs changes: - add SOFTMPEG_DEBUG(), SOFTMPEG_ERROR() and SOFTMPEG_WARN() macros inspired from DirectFB - replace audio printf()s with SOFTMPEG_DEBUG_AUDIO macro (maps to SOFTMPEG_DEBUG()) - replace fixed prebuffering delay with low/mid/high watermarks (should be in 16.16 percent though) change code accordingly - remove bogus "manual prebuffering" hack (fixed in FusionSound) - add "DFBBoolean playing;" to audio_decocer, keep track of current playback status - add softmpeg_sleep() replacement for dozens of nanosleep() calls - add softmpeg_get_millis() replacement for gettimeofday() calls - compile fix for missing variable in video.c caused by last checking
- apply DOKs cosmetic changes
Avoid endless loop in feed thread. Added myself to the copyright headers.
Stabilized A/V sync and decoding by using correct arrangements of Flip(), WaitForSync(), SetField() and fine tuned timings. Automatically use deinterlacing if supported. Increased audio prebuffering from 25% to 50%. Use SCHED_RR for feed thread. Use dfb_memcpy() by adding a hackish extern declaration for it. Enhanced debugging output. Cleaned up demo application code.
Initial release. It's done.