138 Commits
0.4.9 ... 0.5.2

Author SHA1 Message Date
Johns
9a2b6f860a Version 0.5.2 released. 2012-11-15 22:30:55 +01:00
10075aa501 Fix 3d OSD position. 2012-11-05 23:13:42 +01:00
Johns
cb91c779d3 Correct offsets for 3D OSD. Allow 1920x1200 OSD. 2012-11-05 12:03:50 +01:00
Johns
aad3742670 Log subtitle clear. 2012-11-01 14:12:31 +01:00
Johns
1b23074de7 Ignore empty options. 2012-10-31 10:20:07 +01:00
Johns
78015d90fb 3D update. 2012-10-30 16:53:40 +01:00
0286c434b4 Add support to change OSD for 3d SBS/TB streams. 2012-10-30 16:50:31 +01:00
Johns
6e9e641453 Comment how to change the error recognition. 2012-10-30 12:11:25 +01:00
Johns
d36e4c22b6 Removes debug output slipped into GIT. 2012-10-30 12:10:25 +01:00
Johns
7e4657e615 Use software decoder for still-pictures. 2012-10-29 23:06:00 +01:00
Johns
84e8e58c91 Don't show black picture during still-pictures. 2012-10-29 19:29:43 +01:00
Johns
141eb5cf71 Flush X11 output buffer before close. 2012-10-29 17:24:58 +01:00
Johns
a9e664ac52 Add Feature #1103: change audio without vdr restart. 2012-10-29 16:00:45 +01:00
Johns
30952face4 Fix bug #1089: vdpau wrong number of mpeg refs. 2012-10-24 15:38:09 +02:00
Johns
0519aff4d8 Removed double comment. 2012-10-19 15:38:05 +02:00
Johns
92b4203644 Fix bug: possible endless loop in pes audio parser. 2012-10-19 15:36:41 +02:00
Johns
f640ebdeb5 Report correct size in cSoftHdDevice::GetVideoSize. 2012-10-10 17:26:49 +02:00
Johns
de7c4b2a96 Workaround for bug #1069.
Option -s (start in suspended mode) does not work anymore.
2012-10-06 19:16:10 +02:00
Johns
0cf4598f68 Jpeg isn't longer used. 2012-09-15 21:40:04 +02:00
Johns
80dfa4a80f Close all filehandles before exec.
Add stillpicture debug.
Some small stillpicture fixes.
2012-09-15 21:38:54 +02:00
Johns
0a78944996 Fix bug: hue menu entry changes brightness. 2012-09-14 16:53:13 +02:00
Johns
142c3b16f6 Fix bug: didn't compile without vdpau support. 2012-09-11 00:24:27 +02:00
Johns
73fe963c36 Add picture adjustment support for vdpau. 2012-09-03 16:39:33 +02:00
Johns
a61cbcb65a Add PTS to render too slow message. 2012-08-29 17:00:36 +02:00
Johns
3df9acc034 Add number of buffered video output frames to info. 2012-08-28 19:15:11 +02:00
Johns
d9c9061a7c Reset closing only, if trickspeed is set. 2012-08-18 15:53:14 +02:00
Johns
e9fbe6b54f Need get_format for software decoder. 2012-08-17 10:35:52 +02:00
Johns
5e93fb2756 Fix bug: VA-API trickspeed. 2012-08-17 10:33:10 +02:00
Johns
e02c1fa5f9 Revert "mpeg_vdpau" back to "mpegvideo_vdpau". 2012-08-14 16:02:44 +02:00
Johns
c07ec82e6d Fix bug: Can't use software decoder with VDPAU. 2012-08-13 16:57:36 +02:00
Johns
ecb48a5d63 Resume plugin, if dummy player looses control. 2012-08-09 16:22:06 +02:00
Johns
9efc73144d Removes old audio code (!USE_AUDIORING). 2012-08-08 22:58:57 +02:00
a920da652b Osd work:
Use -DOSD_DEBUG to debug OSD.
Fix bug #909: Subtitles destroy menu.
Fix bug #1003: Subtitles overlapping.
2012-08-07 16:46:23 +02:00
Johns
9ec077ec8a VA-API/XvBA backend improvements. 2012-07-27 19:15:48 +02:00
Johns
8b0d8d8446 Free used X11 resources colormap, pixmap, cursor. 2012-07-25 16:07:36 +02:00
Johns
15583a79c4 FreeBSD compatibility fix. 2012-07-09 17:17:16 +02:00
Johns
2cdce610d6 Fix bug: spelling USE_VAPI wrong, missing function. 2012-07-06 00:04:08 +02:00
Johns
2d6d151b85 Fix compiler warnings. 2012-07-05 23:59:28 +02:00
Johns
ca4f519a1f Force ffmpeg with hardware codec support. 2012-07-05 17:10:05 +02:00
Johns
583b6f246e Release Version 0.5.1 2012-07-03 16:36:53 +02:00
Johns
e6ce7832ba Add commandline support to disable hardware decoder. 2012-07-03 15:48:44 +02:00
Johns
696bb8e934 Display frame statistics in plugin menu. 2012-07-02 17:05:36 +02:00
Johns
3bb7782d40 Remove not working hotkeys from setup menu. 2012-07-02 15:20:14 +02:00
Johns
b5162bae5c Fix bug: 100% CPU use during playback. 2012-06-30 15:40:33 +02:00
Johns
d486fb2ca1 Fix bug: audio use 100% CPU during pause. 2012-06-30 00:19:36 +02:00
Johns
73d65968ae Remove video display format until it is working. 2012-06-29 15:23:17 +02:00
Johns
3be69730f0 Suggested change. 2012-06-29 15:13:38 +02:00
Johns
6f1c4d6ef6 Video_get_format AudioVideoReady feeds old PTS. 2012-06-27 21:47:30 +02:00
Johns
6aa8601f7d Guard audio skip against old PTS values. 2012-06-27 21:22:25 +02:00
Johns
0f62a521f4 Improved audio skip, after channel switch. 2012-06-25 17:30:30 +02:00
Johns
57af986367 Setup add preview of collapsed tree. 2012-06-23 16:47:04 +02:00
Johns
a2311748ca Removed gcc 4.6 warnings.
avcodec_flush_buffers crash fix.
2012-06-22 19:28:48 +02:00
Johns
2c5a14ae4a Removed gcc 4.6 warnings. Va sync experiment. 2012-06-22 19:27:15 +02:00
Johns
ed1e16dccf Removed warnings and old code. 2012-06-22 19:12:00 +02:00
Johns
da9886e9f1 Fix bug: dvd plugin times out. Readme update. 2012-06-08 15:27:42 +02:00
Johns
32527f832e Makes OSD size configurable. 2012-05-21 15:34:33 +02:00
Johns
57bbd02c57 Fix bug: Black screen is sometimes not shown. 2012-05-17 16:52:08 +02:00
Johns
940849d03f Safer 4:3 detection, 4:3 crop correction. 2012-05-17 16:50:40 +02:00
Johns
c112b850d8 Fix bug: 100% cpu use.
Fix bug: audio/video out of sync after jump in recordings.
2012-05-16 20:35:35 +02:00
Johns
752ee356fa Poll input buffers, if display buffers are full. 2012-05-13 18:33:24 +02:00
Johns
43e70b6a3f Reduce errors during suspend mode. 2012-05-13 16:58:45 +02:00
Johns
541754a619 Support display with non-square pixels. 2012-05-10 16:03:56 +02:00
Johns
3772b2160c Initial ADTS (AAC+) support. 2012-05-09 20:16:46 +02:00
Johns
465c68d839 Fix bug #959: log flooded with service messages. 2012-05-03 15:26:58 +02:00
aca508114b Adds VDR DFAtmo Plugin support. 2012-04-30 14:47:08 +02:00
Johns
49ae1c7211 Fix bug: PTS are 1/90ms and use AudioVideoDelay. 2012-04-30 13:56:26 +02:00
Johns
0cf110da81 Less logging. 2012-04-28 12:38:41 +02:00
Johns
8d5ff6f6fb Skip audio to sync with video. 2012-04-28 12:24:03 +02:00
Johns
5456164dce Mute pass-through, if volume is 0. 2012-04-27 12:31:40 +02:00
Johns
6dd7c2680a Skip audio sync while trick play. 2012-04-26 15:33:51 +02:00
Johns
3b5c1adef2 Fix bug: don't normalize or compress AC3 samples. 2012-04-24 16:02:07 +02:00
Johns
47d840bbff Force black picture after start or suspend. 2012-04-22 21:01:34 +02:00
Johns
207871fd9b Make audio ring buffer size a multiple of 3,5,7,8. 2012-04-22 17:17:54 +02:00
Johns
ebe0beb400 Add upmix from 5 to 6 channels. 2012-04-21 16:45:56 +02:00
Johns
93ddd26a4a Fix bug: alloca wrong size for audio buffer. 2012-04-21 15:47:50 +02:00
Johns
e30e1e5aad Handle jump in stream like stream start. 2012-04-21 12:59:04 +02:00
Johns
d26c34f34f Always compile audio drift correction.
Add audio drift correction configuration to the setup.
2012-04-20 18:28:25 +02:00
24a8c7f763 Add support for svdr command "stat". 2012-04-20 16:51:04 +02:00
Johns
3e39ffd5e0 New audio ring buffer code, now OSS part. 2012-04-20 16:05:40 +02:00
Johns
53f22a2ed2 Made showing black picture configurable. 2012-04-20 15:40:14 +02:00
Johns
44ca71fedb Adds audio normalize support. 2012-04-19 16:01:20 +02:00
Johns
8039e8ae04 New audio filters next part. 2012-04-19 00:47:34 +02:00
Johns
79e78bf235 Show black picture, if no video stream available.
New audio ring code.
New audio filters (first part).
2012-04-17 16:45:27 +02:00
Johns
c9ef8b759a Fix bug: autocrop toggle didn't work. 2012-04-15 23:03:40 +02:00
Johns
80db7c6656 Setup split into foldable sections. 2012-04-15 22:59:52 +02:00
Johns
3ba18d8720 Add -D option to getopt. 2012-04-15 14:46:57 +02:00
Johns
2ffcb874bb Adds show cursor on mouse move + hide after 200ms. 2012-04-14 21:58:14 +02:00
Johns
5b765f02bd Add Hot-key support for auto-crop enable/disable. 2012-04-14 21:25:44 +02:00
Johns
2c52955ac0 Adds detached start mode. 2012-04-14 21:16:01 +02:00
Johns
09d8588588 Fix buf: VDPAU looses preemption callback. 2012-04-12 15:38:22 +02:00
Johns
71f786711b Fix bug: X11 server keeps sending USR1 signals. 2012-04-12 15:37:19 +02:00
Johns
deea34eb5e Show message for hot-keys. 2012-04-11 18:20:08 +02:00
Johns
1f14af6590 Fix bug: playback errors with old PES recordings. 2012-04-11 12:16:00 +02:00
Johns
aeae505bd4 Adds Hot-key support for 4:3 zoom modes. 2012-04-11 12:15:12 +02:00
Johns
e10e62dcf7 Release Version 0.5.0. 2012-04-07 20:21:55 +02:00
Johns
2a1793c98e Use config value to change audio/video delay. 2012-04-07 13:43:51 +02:00
Johns
30d4586448 Change audio/video delay with hot-key. 2012-04-07 00:15:57 +02:00
Johns
aa4debc9c8 Enable/disable/toggle fullscreen with hot-key. 2012-04-06 14:38:51 +02:00
ac2e10a308 Cutting pixels configured for each resolution. 2012-04-05 22:51:20 +02:00
Johns
c986d285ea Buffer less video and audio. 2012-04-05 15:47:59 +02:00
Johns
8612044b9b Move suspend on inactivity to houesekeeping. 2012-04-05 15:43:32 +02:00
Johns
c19b86411a Update documents. 2012-04-05 15:42:48 +02:00
Johns
9165052d5e Fix gcc error bug (also for VA-API). 2012-04-03 16:36:06 +02:00
Johns
413983a666 Calling TrickSpeed without decoder can happen. 2012-04-01 17:04:16 +02:00
Johns
f86fa4edd7 VDR 1.7.27 suggested change. 2012-04-01 17:02:15 +02:00
Johns
7f8110557f Fix gcc error bug. 2012-03-31 23:20:06 +02:00
Johns
c9b344a3fd Audio/Video sync rewrite.
Trick-speed support moved to video module.
Reduce video messages.
2012-03-31 21:27:54 +02:00
Johns
b41f934c37 Faster VdpauBlackSurface version. 2012-03-30 17:19:31 +02:00
Johns
6058f3da56 Fix bug: VideoSetPts wrong position. 2012-03-30 16:04:25 +02:00
689d75b808 Add VideoSkipPixels support. 2012-03-26 20:49:18 +02:00
Johns
bd4503f30b More debug for flush buffers. Bigger audio buffer. 2012-03-23 18:43:20 +01:00
Johns
24ba8175a3 Disable suspend on inactivity until player fixed. 2012-03-22 16:06:32 +01:00
Johns
fe24cbb182 mp3 needs 100% cpu again! 2012-03-20 16:36:42 +01:00
Johns
6eff8fa818 Forgot VDPAU in requires. 2012-03-19 17:15:21 +01:00
Johns
552a994db3 Add optional argument to ATTA svdrp commmand. 2012-03-15 15:42:51 +01:00
Johns
d24f19bc2d More SVDRP commands help. 2012-03-14 15:07:08 +01:00
Johns
7b570c507c Cleanups. 2012-03-12 17:58:19 +01:00
Johns
09ba3e2993 Let inactivity suspend wakeup with remote keys. 2012-03-11 14:12:49 +01:00
Johns
d0f825f831 Comments added. 2012-03-10 17:46:00 +01:00
Johns
47d2896468 Better Poll(), flush video buffers after replay. 2012-03-10 17:05:41 +01:00
Johns
f59425ac57 AudioGetDelay returns signed value and cleanups. 2012-03-10 15:00:58 +01:00
Johns
1acdeee913 Adds ffmpeg 0.8.7 bug workaround:
Single nal end seq aren't consumed and an endless loop entered.
2012-03-09 21:47:06 +01:00
Johns
c2938c7ef3 Wakeup display to show OSD for remote learning. 2012-03-09 12:08:56 +01:00
Johns
d65fe88c83 Support switching the primary device with svdrp. 2012-03-08 15:28:10 +01:00
Johns
7d3f4f4434 Disable and reenable screen saver and DPMS. 2012-03-08 15:25:10 +01:00
Johns
acc35fe30c Video cleanup.
Add noop video output module.
Move VideoThread check into lock/unlock functions.
Add support for choosing video output module.
2012-03-07 15:31:43 +01:00
Johns
ee5804fed7 Handle snd_pcm_wait timeouts. 2012-03-07 15:13:07 +01:00
Johns
1cbaddf75c Need extra space in ring buffer for sequence end. 2012-03-06 18:37:40 +01:00
Johns
226760490b VADisplayAttribDirectSurface removed. 2012-03-06 16:56:26 +01:00
Johns
7931909e28 Workaround should be for abs. 2012-03-06 15:39:29 +01:00
Johns
129c139ed7 Fix fast backward with some h264 streams. 2012-03-06 15:38:30 +01:00
Johns
340816d763 Make soft start sync setup menu configurable. 2012-03-06 12:16:47 +01:00
Johns
d6c6818ecf Workaround for av_resample_compensate ffmpeg bug.
FFmpeg commit a67cb012e6947fb238193afc0f18114f6e20818c or
1b9ca38d9d06d319fffd61d27e4eb385d6572ba8 breaks av_resample_compensate.
Only big sample_delta compensation_distance ratios are now working.
2012-03-05 20:38:43 +01:00
Johns
181a0bb372 Move grab unsupported warning to low-level. 2012-03-05 20:10:23 +01:00
Johns
f2d4163899 Fix bug: NAL end of sequence is 10 and not 0x10.
Cleanup, remove old cruft.
Add support for pes recordings.
2012-03-05 20:05:56 +01:00
Johns
4cc98d7937 Move time-stamp printing to misc.h. 2012-03-05 17:34:10 +01:00
Johns
3812fa8d38 Fix bug: AudioEnqueue crash without sound card. 2012-03-05 15:06:46 +01:00
Johns
da5c5cd5fd Version 0.4.9 released. 2012-03-04 22:36:14 +01:00
19 changed files with 5518 additions and 2377 deletions

2
.gitignore vendored
View File

@@ -4,7 +4,7 @@
.*.swp .*.swp
.gdb_history .gdb_history
# work directory # work directory
chaos .chaos
# generated files # generated files
.dependencies .dependencies
libvdr-softhddevice.so* libvdr-softhddevice.so*

137
ChangeLog
View File

@@ -1,6 +1,141 @@
User johns User johns
Date: Date: Thu Nov 15 22:28:55 CET 2012
Release Version 0.5.2
User maverick-me
Date: Mon Nov 5 23:13:42 CET 2012
Fix 3d OSD position.
User maverick-me
Date: Tue Oct 30 16:50:25 CET 2012
Add support to change the OSD for 3d SBS/TB streams.
User johns
Date: Tue Oct 30 12:11:25 CEST 2012
Use software decoder for still-pictures.
Add Feature #1103: change audio devices without vdr restart.
Fix bug #1089: Vdpau decoder used wrong number of mpeg reference frames.
Fix bug: with some streams endless loop in pes audio parser.
Report correct video size in cSoftHdDevice::GetVideoSize.
Add picture adjustment support for vdpau.
Revert "mpeg_vdpau" back to "mpegvideo_vdpau".
Fix bug: Can't use software decoder with VDPAU.
Resume plugin, if suspend control stops.
Removes old audio code (!USE_AUDIORING).
Use -DOSD_DEBUG to debug OSD.
User arttupii
Date: Tue Aug 7 16:46:23 2012 +0200
Fix bug #909: Subtitles destroy menu.
Fix bug #1003: Subtitles overlapping.
User johns
Date: Fri Jul 27 19:15:48 CEST 2012
Free used X11 resources colormap, pixmap, cursor.
Fix bug: spelling USE_VAPI wrong, missing functions.
User johns
Date: Tue Jul 3 16:35:46 CEST 2012
Release Version 0.5.1
Add commandline support to disable hardware decoder.
Display frame statistics in plugin menu.
Fix bug: 100% CPU use during playback.
Fix bug: audio use 100% CPU during pause.
Guard audio skip against old PTS values.
Improved audio skip, after channel switch.
Setup add preview of collapsed tree.
Fix bug: dvd plugin times out.
Makes OSD size configurable.
Support display with non-square pixels.
Initial ADTS (AAC+) support.
Fix bug #959: log flooded with service messages.
User durchflieger
Date: Mon Apr 30 14:46:51 CEST 2012
Adds VDR DFAtmo Plugin support.
User johns
Date: Mon Apr 30 13:56:26 CEST 2012
Fix bug: don't normalize or compress pass-through samples.
Make audio ring buffer size a multiple of 3,5,7,8.
Add reset ring buffer support.
Fix bug: alloca wrong size for audio buffer.
Handle jump in stream like stream start.
Always compile audio drift correction.
Add audio drift correction configuration to the setup.
User mini73
Date: Fri Apr 20 16:51:14 CEST 2012
Add support for svdr command "stat".
User johns
Date: Fri Apr 20 16:05:40 CEST 2012
Made showing black picture configurable.
Show black picture, if no video stream is available.
Setup split into foldable sections.
Adds show cursor on pointer move and hide after 200ms.
Adds Hot-key support for auto-crop enable/disable/toggle.
Adds detached start mode.
Fix bug: VDPAU looses preemption callback.
Fix bug: X11 server keeps sending USR1 signals, which confuses suspend.
Show message for hot-keys.
Fix bug: playback errors with old PES recordings.
Adds Hot-key support for 4:3 zoom modes.
User johns
Date: Sat Apr 7 20:21:16 CEST 2012
Release Version 0.5.0
Change audio/video delay with hot-key.
Enable/disable/toggle fullscreen with hot-key (Feature #930).
User: CafeDelMar
Date: Thu Apr 5 22:44:06 CEST 2012
Cutting pixels are now configured for each resolution.
User johns
Date: Thu Apr 5 15:47:59 CEST 2012
Buffer less video and audio.
Fix 100% cpu use, with mp3 plugin.
Audio/Video sync rewrite, trick-speed support moved to video.
Faster VdpauBlackSurface version.
Fix bug: VideoSetPts wrong position for multi frame packets.
User: CafeDelMar
Date: Mon Mar 26 20:45:54 CEST 2012
Add VideoSkipPixels support.
User johns
Date: Fri Mar 23 18:43:20 CET 2012
Add optional argument (display) to ATTA svdrp commmand.
Wakeup display to show OSD for remote learning mode.
Support switching the primary device with svdrp.
Disable and reenable screen saver and DPMS.
Video source code cleanup.
Fix fast backward with some h264 streams.
Make soft start sync setup menu configurable.
Fix bug: StillPicture NAL end of sequence is 10 and not 0x10.
Fix bug: AudioEnqueue crash without sound card.
User johns
Date: Sun Mar 4 22:35:36 CET 2012
Release Version 0.4.9
Experimental ac3 audio drift correction support. Experimental ac3 audio drift correction support.
Removes LPCM detection from TS parser. Removes LPCM detection from TS parser.
Rewrote video/audio start code. Rewrote video/audio start code.

View File

@@ -18,9 +18,7 @@ GIT_REV = $(shell git describe --always 2>/dev/null)
### Configuration (edit this for your needs) ### Configuration (edit this for your needs)
CONFIG := #-DDEBUG CONFIG := #-DDEBUG #-DOSD_DEBUG
#CONFIG += -DUSE_AUDIO_DRIFT_CORRECTION # build new audio drift code
#CONFIG += -DUSE_AC3_DRIFT_CORRECTION # build new ac-3 drift code
CONFIG += -DAV_INFO -DAV_INFO_TIME=3000 # debug a/v sync CONFIG += -DAV_INFO -DAV_INFO_TIME=3000 # debug a/v sync
#CONFIG += -DHAVE_PTHREAD_NAME # supports new pthread_setname_np #CONFIG += -DHAVE_PTHREAD_NAME # supports new pthread_setname_np
#CONFIG += -DNO_TS_AUDIO # disable ts audio parser #CONFIG += -DNO_TS_AUDIO # disable ts audio parser
@@ -37,7 +35,7 @@ CXX ?= g++
CFLAGS ?= -g -O2 -W -Wall -Wextra -Winit-self \ CFLAGS ?= -g -O2 -W -Wall -Wextra -Winit-self \
-Wdeclaration-after-statement \ -Wdeclaration-after-statement \
-ftree-vectorize -msse3 -flax-vector-conversions -ftree-vectorize -msse3 -flax-vector-conversions
CXXFLAGS ?= -g -O2 -W -Wall -Wextra -Woverloaded-virtual CXXFLAGS ?= -g -O2 -W -Wall -Wextra -Werror=overloaded-virtual
### The directory environment: ### The directory environment:
@@ -47,7 +45,7 @@ TMPDIR ?= /tmp
### Make sure that necessary options are included: ### Make sure that necessary options are included:
include $(VDRDIR)/Make.global -include $(VDRDIR)/Make.global
### Allow user defined options to overwrite defaults: ### Allow user defined options to overwrite defaults:

View File

@@ -20,24 +20,25 @@ $Id$
A software and GPU emulated HD output device plugin for VDR. A software and GPU emulated HD output device plugin for VDR.
o Video VA-API/VA-API (with intel, nvidia and amd backend supported) o Video decoder CPU / VA-API / VDPAU
o Video CPU/VA-API o Video output VA-API / VDPAU
o Video VDPAU/VDPAU o Audio FFMpeg / Alsa / Analog
o Video CPU/VDPAU o Audio FFMpeg / Alsa / Digital
o Audio FFMpeg/Alsa/Analog o Audio FFMpeg / OSS / Analog
o Audio FFMpeg/Alsa/Digital o HDMI/SPDIF pass-through
o Audio FFMpeg/OSS/Analog o Software volume, compression, normalize and channel resample
o HDMI/SPDIF Passthrough o YaepgHD support
o VA-API bob software deinterlace o Software deinterlacer Bob (VA-API only)
o Auto-crop o Autocrop
o Grab image (VDPAU only)
o Suspend
o Letterbox, Stretch and Center cut-out video display modes
o atmo light support with plugin http://github.com/durchflieger/DFAtmo
o planned: Video VA-API/Opengl o planned: Video decoder VA-API Branch: vaapi-ext/staging
o planned: Video VDPAU/Opengl o planned: Video output XvBA / Opengl / Xv
o planned: Video CPU/Xv o planned: VA-API grab image
o planned: Video CPU/Opengl
o planned: Improved Software Deinterlacer (yadif or/and ffmpeg filters) o planned: Improved Software Deinterlacer (yadif or/and ffmpeg filters)
o planned: Video XvBA/XvBA
o planned: atmo light support
To compile you must have the 'requires' installed. To compile you must have the 'requires' installed.
@@ -107,12 +108,17 @@ Setup: /etc/vdr/setup.conf
------ ------
Following is supported: Following is supported:
softhddevice.MakePrimary = 1 softhddevice.MakePrimary = 0
0 = no change, 1 make softhddevice primary at start 0 = no change, 1 make softhddevice primary at start
softhddevice.HideMainMenuEntry = 0 softhddevice.HideMainMenuEntry = 0
0 = show softhddevice main menu entry, 1 = hide entry 0 = show softhddevice main menu entry, 1 = hide entry
softhddevice.Osd.Width = 0
0 = auto (=display, unscaled) n = fixed osd size scaled for display
softhddevice.Osd.Height = 0
0 = auto (=display, unscaled) n = fixed osd size scaled for display
<res> of the next parameters is 576i, 720p, 1080i_fake or 1080i. <res> of the next parameters is 576i, 720p, 1080i_fake or 1080i.
1080i_fake is 1280x1080 or 1440x1080 1080i_fake is 1280x1080 or 1440x1080
1080i is "real" 1920x1080 1080i is "real" 1920x1080
@@ -137,6 +143,12 @@ Setup: /etc/vdr/setup.conf
-1000 .. 1000 noise reduction level (0 off, -1000 max blur, -1000 .. 1000 noise reduction level (0 off, -1000 max blur,
1000 max sharp) 1000 max sharp)
softhddevice.<res>.CutTopBottom = 0
Cut 'n' pixels at at top and bottom of the video picture.
softhddevice.<res>.CutLeftRight = 0
Cut 'n' pixels at at left and right of the video picture.
softhddevice.AudioDelay = 0 softhddevice.AudioDelay = 0
+n or -n ms +n or -n ms
delay audio or delay video delay audio or delay video
@@ -150,6 +162,29 @@ Setup: /etc/vdr/setup.conf
0 = none, 1 = downmix 0 = none, 1 = downmix
downmix AC-3 to stero. downmix AC-3 to stero.
softhddevice.AudioSoftvol = 0
0 = off, use hardware volume control
1 = on, use software volume control
softhddevice.AudioNormalize = 0
0 = off, 1 = enable audio normalize
softhddevice.AudioMaxNormalize = 0
maximal volume factor/1000 of the normalize filter
softhddevice.AudioCompression = 0
0 = off, 1 = enable audio compression
softhddevice.AudioMaxCompression = 0
maximal volume factor/1000 of the compression filter
softhddevice.AudioStereoDescent = 0
reduce volume level (/1000) for stereo sources
softhddevice.AudioBufferTime = 0
0 = default (336 ms)
1 - 1000 = size of the buffer in ms
softhddevice.AutoCrop.Interval = 0 softhddevice.AutoCrop.Interval = 0
0 disables auto-crop 0 disables auto-crop
n each 'n' frames auto-crop is checked. n each 'n' frames auto-crop is checked.
@@ -166,10 +201,9 @@ Setup: /etc/vdr/setup.conf
32bit RGBA background color 32bit RGBA background color
(Red * 16777216 + Green * 65536 + Blue * 256 + Alpha) (Red * 16777216 + Green * 65536 + Blue * 256 + Alpha)
or hex RRGGBBAA or hex RRGGBBAA
grey = 2155905279 grey 127 * 16777216 + 127 * 65536 + 127 * 256 => 2139062016
in the setup menu this is entered as (24bit RGB and 8bit Alpha)
softhddevice.SkipLines = 0 (Red * 65536 + Green * 256 + Blue)
skip 'n' lines at top and bottom of the video picture.
softhddevice.StudioLevels = 0 softhddevice.StudioLevels = 0
0 use PC levels (0-255) with vdpau. 0 use PC levels (0-255) with vdpau.
@@ -186,6 +220,14 @@ Setup: /etc/vdr/setup.conf
0 disable 60Hz display mode 0 disable 60Hz display mode
1 enable 60Hz display mode 1 enable 60Hz display mode
softhddevice.SoftStartSync = 0
0 disable soft start of audio/video sync
1 enable soft start of audio/video sync
softhddevice.BlackPicture = 0
0 disable black picture during channel switch
1 enable black picture during channel switch
VideoDisplayFormat = ? VideoDisplayFormat = ?
0 pan and scan 0 pan and scan
1 letter box 1 letter box
@@ -238,6 +280,18 @@ Keymacros:
@softhddevice Blue 1 0 disable pass-through @softhddevice Blue 1 0 disable pass-through
@softhddevice Blue 1 1 enable pass-through @softhddevice Blue 1 1 enable pass-through
@softhddevice Blue 1 2 toggle pass-through @softhddevice Blue 1 2 toggle pass-through
@softhddevice Blue 1 3 decrease audio delay by 10ms
@softhddevice Blue 1 4 increase audio delay by 10ms
@softhddevice Blue 2 0 disable fullscreen
@softhddevice Blue 2 1 enable fullscreen
@softhddevice Blue 2 2 toggle fullscreen
@softhddevice Blue 2 3 disable auto-crop
@softhddevice Blue 2 4 enable auto-crop
@softhddevice Blue 2 5 toggle auto-crop
@softhddevice Blue 3 0 stretch 4:3 to 16:9
@softhddevice Blue 3 1 letter box 4:3 in 16:9
@softhddevice Blue 3 2 center cut-out 4:3 to 16:9
@softhddevice Blue 3 9 rotate 4:3 to 16:9 zoom mode
Running: Running:
-------- --------
@@ -249,6 +303,11 @@ Warning:
-------- --------
libav is not supported, expect many bugs with it. libav is not supported, expect many bugs with it.
Known Bugs:
-----------
VA-API doesn't v-sync 1080i streams
vdr-image not working
Requires: Requires:
--------- ---------
media-video/ffmpeg (version >=0.7) media-video/ffmpeg (version >=0.7)
@@ -275,6 +334,11 @@ Requires:
x11-libs/xvba-video x11-libs/xvba-video
XVBA Backend for Video Acceleration (VA) API XVBA Backend for Video Acceleration (VA) API
http://www.freedesktop.org/wiki/Software/vaapi http://www.freedesktop.org/wiki/Software/vaapi
x11-libs/libvdpau
VDPAU wrapper and trace libraries
http://www.freedesktop.org/wiki/Software/VDPAU
x11-libs/libxcb, x11-libs/libxcb,
X C-language Bindings library X C-language Bindings library
http://xcb.freedesktop.org http://xcb.freedesktop.org

37
Todo
View File

@@ -19,31 +19,31 @@ GNU Affero General Public License for more details.
$Id: $ $Id: $
missing: missing:
software deinterlace (yadif, ...) more software deinterlace (yadif, ...)
software decoder with software deinterlace more software decoder with software deinterlace
suspend output / energie saver: stop and restart X11 suspend output / energie saver: stop and restart X11
suspend plugin didn't restore full-screen (is this wanted?) suspend plugin didn't restore full-screen (is this wanted?)
Option deinterlace off / deinterlace force! Option deinterlace off / deinterlace force!
ColorSpace aren't configurable with the gui. ColorSpace aren't configurable with the gui.
Replay of old vdr 1.6 recordings. works for me: restart vdr not working, when started x11 was killed.
svdrp support for hot-keys.
crash:
AudioPlayHandlerThread -> pthread_cond_wait
video: video:
subtitle not cleared subtitle not cleared
subtitle could be asyncron subtitle could be asyncron
reduce warnings after channel switch
grab image with hardware and better scaling support grab image with hardware and better scaling support
hard channel switch
yaepghd changed position is lost on channel switch yaepghd changed position is lost on channel switch
pause (live tv) has sometime problems with SAT1 HD Pro7 HD pause (live tv) has sometime problems with SAT1 HD Pro7 HD
radio show black background radio show black background
radio no need to wait on video buffers radio no need to wait on video buffers
starting with radio and own X11 server, shows no video
some low-bandwidth tv channels have hiccups.
check start with 24Hz display rate
crash with ffmpeg without vaapi and vdpau.
vdpau: vdpau:
software decoder path not working software deinterlace path not working.
OSD looses transparency, during channel switch.
OSD looses transparency, while moving cut marks.
libva: libva:
yaepghd (VaapiSetOutputPosition) support yaepghd (VaapiSetOutputPosition) support
@@ -53,9 +53,10 @@ libva:
still many: (workaround export NO_MPEG_HW=1) still many: (workaround export NO_MPEG_HW=1)
[drm:i915_hangcheck_elapsed] *ERROR* Hangcheck timer elapsed... GPU hung [drm:i915_hangcheck_elapsed] *ERROR* Hangcheck timer elapsed... GPU hung
[drm:i915_wait_request] *ERROR* i915_wait_request returns -11 ... [drm:i915_wait_request] *ERROR* i915_wait_request returns -11 ...
missing OSD support for 3d SBS / Top-Bottom streams, like VPDAU.
libva: branch vaapi-ext libva: branch vaapi-ext / staging
add support for vaapi-ext add support for vaapi-ext / staging
libva-intel-driver: libva-intel-driver:
deinterlace only supported with vaapi-ext deinterlace only supported with vaapi-ext
@@ -73,27 +74,23 @@ libva-vdpau-driver:
libva-xvba-driver: libva-xvba-driver:
x11: x11:
disable screensaver
skip multiple configure-notify, handle only the last one. skip multiple configure-notify, handle only the last one.
support embedded mode support embedded mode
audio: audio:
Combine alsa+oss ringbuffer code.
Make alsa thread/polled and oss thread/polled output module runtime Make alsa thread/polled and oss thread/polled output module runtime
selectable. selectable.
software volume support (could be done with asound.conf)
Mute should do a real mute and not only set volume to zero. Mute should do a real mute and not only set volume to zero.
Starting suspended and muted, didn't register the mute. Starting suspended and muted, didn't register the mute.
Relaxed audio sync checks at end of packet and already in sync Relaxed audio sync checks at end of packet and already in sync
samplerate problem resume/suspend. samplerate problem resume/suspend.
only wait for video start, if video is running. only wait for video start, if video is running.
Not primary device, don't use and block audio/video. Not primary device, don't use and block audio/video.
multiple open of audio device, reduce them.
Not all channel conversions are written (f.e. 2->3 ... 5->6 ...)
audio/alsa: audio/alsa:
better downmix of >2 channels on 2 channel hardware
remix support of unsupported sample rates remix support of unsupported sample rates
libav supports only resample of mono to 2 channels
ffmpeg didn't support resample of 5 to 2 channels
audio/oss: audio/oss:
alsa oss emulation mixer "pcm" not working alsa oss emulation mixer "pcm" not working
@@ -108,7 +105,7 @@ playback of recording
replay/pause need 100% cpu (fixed?) replay/pause need 100% cpu (fixed?)
plugins: plugins:
mp3 plugin needs 100% cpu (OSD updates?) mp3 plugin needs 100% cpu (bad ::Poll)
setup: setup:
Setup of decoder type. Setup of decoder type.
@@ -120,6 +117,7 @@ setup:
unsorted: unsorted:
stoping vdr while plugin is suspended opens and closes a window. stoping vdr while plugin is suspended opens and closes a window.
svdrp prim: support plugin names for device numbers.
future features (not planed for 1.0 - 1.5) future features (not planed for 1.0 - 1.5)
@@ -127,7 +125,6 @@ future features (not planed for 1.0 - 1.5)
video out with opengl video out with opengl
video out with xvba video out with xvba
software decoder for xv / opengl software decoder for xv / opengl
atmolight support
multistream handling multistream handling
pip support pip support
save and use auto-crop with channel zapping save and use auto-crop with channel zapping

2376
audio.c

File diff suppressed because it is too large Load Diff

View File

@@ -32,7 +32,7 @@ extern void AudioFlushBuffers(void); ///< flush audio buffers
extern void AudioPoller(void); ///< poll audio events/handling extern void AudioPoller(void); ///< poll audio events/handling
extern int AudioFreeBytes(void); ///< free bytes in audio output extern int AudioFreeBytes(void); ///< free bytes in audio output
extern int AudioUsedBytes(void); ///< used bytes in audio output extern int AudioUsedBytes(void); ///< used bytes in audio output
extern uint64_t AudioGetDelay(void); ///< get current audio delay extern int64_t AudioGetDelay(void); ///< get current audio delay
extern void AudioSetClock(int64_t); ///< set audio clock base extern void AudioSetClock(int64_t); ///< set audio clock base
extern int64_t AudioGetClock(); ///< get current audio clock extern int64_t AudioGetClock(); ///< get current audio clock
extern void AudioSetVolume(int); ///< set volume extern void AudioSetVolume(int); ///< set volume
@@ -42,6 +42,10 @@ extern void AudioPlay(void); ///< play audio
extern void AudioPause(void); ///< pause audio extern void AudioPause(void); ///< pause audio
extern void AudioSetBufferTime(int); ///< set audio buffer time extern void AudioSetBufferTime(int); ///< set audio buffer time
extern void AudioSetSoftvol(int); ///< enable/disable softvol
extern void AudioSetNormalize(int, int); ///< set normalize parameters
extern void AudioSetCompression(int, int); ///< set compression parameters
extern void AudioSetStereoDescent(int); ///< set stereo loudness descent
extern void AudioSetDevice(const char *); ///< set PCM audio device extern void AudioSetDevice(const char *); ///< set PCM audio device
extern void AudioSetDeviceAC3(const char *); ///< set pass-through device extern void AudioSetDeviceAC3(const char *); ///< set pass-through device

148
codec.c
View File

@@ -33,11 +33,17 @@
/// compile with passthrough support (stable, ac3 only) /// compile with passthrough support (stable, ac3 only)
#define USE_PASSTHROUGH #define USE_PASSTHROUGH
/// compile audio drift correction support (experimental) /// compile audio drift correction support (experimental)
#define noUSE_AUDIO_DRIFT_CORRECTION #define USE_AUDIO_DRIFT_CORRECTION
/// compile AC3 audio drift correction support (experimental)
#define USE_AC3_DRIFT_CORRECTION
#include <stdio.h> #include <stdio.h>
#include <unistd.h> #include <unistd.h>
#ifdef __FreeBSD__
#include <sys/endian.h>
#else
#include <endian.h> #include <endian.h>
#endif
#include <sys/types.h> #include <sys/types.h>
#include <sys/stat.h> #include <sys/stat.h>
@@ -357,22 +363,6 @@ void CodecVideoOpen(VideoDecoder * decoder, const char *name, int codec_id)
if (decoder->VideoCtx) { if (decoder->VideoCtx) {
Error(_("codec: missing close\n")); Error(_("codec: missing close\n"));
} }
//
// ffmpeg compatibility hack
//
#if 1 || (LIBAVCODEC_VERSION_INT <= AV_VERSION_INT(52,96,0))
if (name) {
if (!strcmp(name, "h264video_vdpau")) {
name = "h264_vdpau";
} else if (!strcmp(name, "mpeg4video_vdpau")) {
name = "mpeg4_vdpau";
} else if (!strcmp(name, "vc1video_vdpau")) {
name = "vc1_vdpau";
} else if (!strcmp(name, "wmv3video_vdpau")) {
name = "wmv3_vdpau";
}
}
#endif
if (name && (video_codec = avcodec_find_decoder_by_name(name))) { if (name && (video_codec = avcodec_find_decoder_by_name(name))) {
Debug(3, "codec: vdpau decoder found\n"); Debug(3, "codec: vdpau decoder found\n");
@@ -395,6 +385,17 @@ void CodecVideoOpen(VideoDecoder * decoder, const char *name, int codec_id)
Fatal(_("codec: can't open video codec!\n")); Fatal(_("codec: can't open video codec!\n"));
} }
#else #else
if (video_codec->capabilities & (CODEC_CAP_HWACCEL_VDPAU |
CODEC_CAP_HWACCEL)) {
Debug(3, "codec: video mpeg hack active\n");
// HACK around badly placed checks in mpeg_mc_decode_init
// taken from mplayer vd_ffmpeg.c
decoder->VideoCtx->slice_flags =
SLICE_FLAG_CODED_ORDER | SLICE_FLAG_ALLOW_FIELD;
decoder->VideoCtx->thread_count = 1;
decoder->VideoCtx->active_thread_type = 0;
}
if (avcodec_open2(decoder->VideoCtx, video_codec, NULL) < 0) { if (avcodec_open2(decoder->VideoCtx, video_codec, NULL) < 0) {
pthread_mutex_unlock(&CodecLockMutex); pthread_mutex_unlock(&CodecLockMutex);
Fatal(_("codec: can't open video codec!\n")); Fatal(_("codec: can't open video codec!\n"));
@@ -412,7 +413,7 @@ void CodecVideoOpen(VideoDecoder * decoder, const char *name, int codec_id)
} }
if (video_codec->capabilities & CODEC_CAP_TRUNCATED) { if (video_codec->capabilities & CODEC_CAP_TRUNCATED) {
Debug(3, "codec: video can use truncated packets\n"); Debug(3, "codec: video can use truncated packets\n");
// we do not send complete frames // we send incomplete frames, for old PES recordings
decoder->VideoCtx->flags |= CODEC_FLAG_TRUNCATED; decoder->VideoCtx->flags |= CODEC_FLAG_TRUNCATED;
} }
// FIXME: own memory management for video frames. // FIXME: own memory management for video frames.
@@ -428,6 +429,7 @@ void CodecVideoOpen(VideoDecoder * decoder, const char *name, int codec_id)
} }
#endif #endif
//decoder->VideoCtx->debug = FF_DEBUG_STARTCODE; //decoder->VideoCtx->debug = FF_DEBUG_STARTCODE;
//decoder->VideoCtx->err_recognition |= AV_EF_EXPLODE;
if (video_codec->capabilities & CODEC_CAP_HWACCEL_VDPAU) { if (video_codec->capabilities & CODEC_CAP_HWACCEL_VDPAU) {
// FIXME: get_format never called. // FIXME: get_format never called.
@@ -441,6 +443,7 @@ void CodecVideoOpen(VideoDecoder * decoder, const char *name, int codec_id)
decoder->VideoCtx->thread_count = 1; decoder->VideoCtx->thread_count = 1;
decoder->VideoCtx->active_thread_type = 0; decoder->VideoCtx->active_thread_type = 0;
} else { } else {
decoder->VideoCtx->get_format = Codec_get_format;
decoder->VideoCtx->hwaccel_context = decoder->VideoCtx->hwaccel_context =
VideoGetVaapiContext(decoder->HwDecoder); VideoGetVaapiContext(decoder->HwDecoder);
} }
@@ -547,6 +550,11 @@ void CodecVideoDecode(VideoDecoder * decoder, const AVPacket * avpkt)
Debug(4, "%s: %p %d -> %d %d\n", __FUNCTION__, pkt->data, pkt->size, used, Debug(4, "%s: %p %d -> %d %d\n", __FUNCTION__, pkt->data, pkt->size, used,
got_frame); got_frame);
if (used < 0) {
Debug(3, "codec: bad video frame\n");
return;
}
if (got_frame) { // frame completed if (got_frame) { // frame completed
//DisplayPts(video_ctx, frame); //DisplayPts(video_ctx, frame);
VideoRenderFrame(decoder->HwDecoder, video_ctx, frame); VideoRenderFrame(decoder->HwDecoder, video_ctx, frame);
@@ -557,7 +565,15 @@ void CodecVideoDecode(VideoDecoder * decoder, const AVPacket * avpkt)
Debug(4, "codec: %8d incomplete interlaced frame %d bytes used\n", Debug(4, "codec: %8d incomplete interlaced frame %d bytes used\n",
video_ctx->frame_number, used); video_ctx->frame_number, used);
} }
#if 1
// old code to support truncated or multi frame packets
if (used != pkt->size) { if (used != pkt->size) {
// ffmpeg 0.8.7 dislikes our seq_end_h264 and enters endless loop here
if (used == 0 && pkt->size == 5 && pkt->data[4] == 0x0A) {
Warning("codec: ffmpeg 0.8.x workaround used\n");
return;
}
if (used >= 0 && used < pkt->size) { if (used >= 0 && used < pkt->size) {
// some tv channels, produce this // some tv channels, produce this
Debug(4, Debug(4,
@@ -565,10 +581,11 @@ void CodecVideoDecode(VideoDecoder * decoder, const AVPacket * avpkt)
used, pkt->size); used, pkt->size);
pkt->size -= used; pkt->size -= used;
pkt->data += used; pkt->data += used;
// FIXME: align problem?
goto next_part; goto next_part;
} }
Debug(3, "codec: bad frame %d\n", used);
} }
#endif
} }
/** /**
@@ -578,7 +595,9 @@ void CodecVideoDecode(VideoDecoder * decoder, const AVPacket * avpkt)
*/ */
void CodecVideoFlushBuffers(VideoDecoder * decoder) void CodecVideoFlushBuffers(VideoDecoder * decoder)
{ {
avcodec_flush_buffers(decoder->VideoCtx); if (decoder->VideoCtx) {
avcodec_flush_buffers(decoder->VideoCtx);
}
} }
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
@@ -626,6 +645,11 @@ struct _audio_decoder_
int RemainCount; ///< number of remaining samples int RemainCount; ///< number of remaining samples
}; };
#ifdef USE_AUDIO_DRIFT_CORRECTION
static char CodecAudioDrift; ///< flag: enable audio-drift correction
#else
static const int CodecAudioDrift = 0;
#endif
#ifdef USE_PASSTHROUGH #ifdef USE_PASSTHROUGH
//static char CodecPassthroughPCM; ///< pass pcm through (unsupported) //static char CodecPassthroughPCM; ///< pass pcm through (unsupported)
static char CodecPassthroughAC3; ///< pass ac3 through static char CodecPassthroughAC3; ///< pass ac3 through
@@ -723,8 +747,8 @@ void CodecAudioOpen(AudioDecoder * audio_decoder, const char *name,
if (audio_codec->capabilities & CODEC_CAP_TRUNCATED) { if (audio_codec->capabilities & CODEC_CAP_TRUNCATED) {
Debug(3, "codec: audio can use truncated packets\n"); Debug(3, "codec: audio can use truncated packets\n");
// we do not send complete frames // we send only complete frames
audio_decoder->AudioCtx->flags |= CODEC_FLAG_TRUNCATED; // audio_decoder->AudioCtx->flags |= CODEC_FLAG_TRUNCATED;
} }
audio_decoder->SampleRate = 0; audio_decoder->SampleRate = 0;
audio_decoder->Channels = 0; audio_decoder->Channels = 0;
@@ -768,8 +792,23 @@ void CodecAudioClose(AudioDecoder * audio_decoder)
} }
} }
/**
** Set audio drift correction.
**
** @param mask enable mask (PCM, AC3)
*/
void CodecSetAudioDrift(int mask)
{
#ifdef USE_AUDIO_DRIFT_CORRECTION
CodecAudioDrift = mask & 3;
#endif
(void)mask;
}
/** /**
** Set audio pass-through. ** Set audio pass-through.
**
** @param mask enable mask (PCM, AC3)
*/ */
void CodecSetAudioPassthrough(int mask) void CodecSetAudioPassthrough(int mask)
{ {
@@ -786,6 +825,10 @@ void CodecSetAudioPassthrough(int mask)
*/ */
void CodecSetAudioDownmix(int onoff) void CodecSetAudioDownmix(int onoff)
{ {
if (onoff == -1) {
CodecDownmix ^= 1;
return;
}
CodecDownmix = onoff; CodecDownmix = onoff;
} }
@@ -795,6 +838,10 @@ void CodecSetAudioDownmix(int onoff)
** ffmpeg L R C Ls Rs -> alsa L R Ls Rs C ** ffmpeg L R C Ls Rs -> alsa L R Ls Rs C
** ffmpeg L R C LFE Ls Rs -> alsa L R Ls Rs C LFE ** ffmpeg L R C LFE Ls Rs -> alsa L R Ls Rs C LFE
** ffmpeg L R C LFE Ls Rs Rl Rr -> alsa L R Ls Rs C LFE Rl Rr ** ffmpeg L R C LFE Ls Rs Rl Rr -> alsa L R Ls Rs C LFE Rl Rr
**
** @param buf[IN,OUT] sample buffer
** @param size size of sample buffer in bytes
** @param channels number of channels interleaved in sample buffer
*/ */
static void CodecReorderAudioFrame(int16_t * buf, int size, int channels) static void CodecReorderAudioFrame(int16_t * buf, int size, int channels)
{ {
@@ -873,7 +920,7 @@ static void CodecAudioSetClock(AudioDecoder * audio_decoder, int64_t pts)
audio_decoder->LastDelay = delay; audio_decoder->LastDelay = delay;
audio_decoder->Drift = 0; audio_decoder->Drift = 0;
audio_decoder->DriftFrac = 0; audio_decoder->DriftFrac = 0;
Debug(3, "codec/audio: inital delay %zd ms\n", delay / 90); Debug(3, "codec/audio: inital delay %" PRId64 "ms\n", delay / 90);
return; return;
} }
// collect over some time // collect over some time
@@ -897,9 +944,10 @@ static void CodecAudioSetClock(AudioDecoder * audio_decoder, int64_t pts)
audio_decoder->LastDelay = delay; audio_decoder->LastDelay = delay;
if (0) { if (0) {
Debug(3, "codec/audio: interval P:%5zdms T:%5zdms D:%4zdms %f %d\n", Debug(3,
pts_diff / 90, tim_diff / (1000 * 1000), delay / 90, drift / 90.0, "codec/audio: interval P:%5" PRId64 "ms T:%5" PRId64 "ms D:%4"
audio_decoder->DriftCorr); PRId64 "ms %f %d\n", pts_diff / 90, tim_diff / (1000 * 1000),
delay / 90, drift / 90.0, audio_decoder->DriftCorr);
} }
// underruns and av_resample have the same time :((( // underruns and av_resample have the same time :(((
if (abs(drift) > 10 * 90) { if (abs(drift) > 10 * 90) {
@@ -907,17 +955,17 @@ static void CodecAudioSetClock(AudioDecoder * audio_decoder, int64_t pts)
Debug(3, "codec/audio: drift(%6d) %3dms reset\n", Debug(3, "codec/audio: drift(%6d) %3dms reset\n",
audio_decoder->DriftCorr, drift / 90); audio_decoder->DriftCorr, drift / 90);
audio_decoder->LastDelay = 0; audio_decoder->LastDelay = 0;
#ifdef DEBUG
corr = 0; // keep gcc happy
#endif
} else { } else {
drift += audio_decoder->Drift; drift += audio_decoder->Drift;
audio_decoder->Drift = drift; audio_decoder->Drift = drift;
corr = (10 * audio_decoder->HwSampleRate * drift) / (90 * 1000); corr = (10 * audio_decoder->HwSampleRate * drift) / (90 * 1000);
#if defined(USE_PASSTHROUGH) && !defined(USE_AC3_DRIFT_CORRECTION)
// SPDIF/HDMI passthrough // SPDIF/HDMI passthrough
if (!CodecPassthroughAC3 if ((CodecAudioDrift & 2) && (!CodecPassthroughAC3
|| audio_decoder->AudioCtx->codec_id != CODEC_ID_AC3) || audio_decoder->AudioCtx->codec_id != CODEC_ID_AC3)) {
#endif
{
audio_decoder->DriftCorr = -corr; audio_decoder->DriftCorr = -corr;
} }
@@ -931,12 +979,23 @@ static void CodecAudioSetClock(AudioDecoder * audio_decoder, int64_t pts)
if (audio_decoder->AvResample && audio_decoder->DriftCorr) { if (audio_decoder->AvResample && audio_decoder->DriftCorr) {
int distance; int distance;
distance = (pts_diff * audio_decoder->HwSampleRate) / (90 * 1000); // try workaround for buggy ffmpeg 0.10
if (abs(audio_decoder->DriftCorr) < 2000) {
distance = (pts_diff * audio_decoder->HwSampleRate) / (900 * 1000);
} else {
distance = (pts_diff * audio_decoder->HwSampleRate) / (90 * 1000);
}
av_resample_compensate(audio_decoder->AvResample, av_resample_compensate(audio_decoder->AvResample,
audio_decoder->DriftCorr / 10, distance); audio_decoder->DriftCorr / 10, distance);
} }
Debug(3, "codec/audio: drift(%6d) %8dus %5d\n", audio_decoder->DriftCorr, if (1) {
drift * 1000 / 90, corr); static int c;
if (!(c++ % 10)) {
Debug(3, "codec/audio: drift(%6d) %8dus %5d\n",
audio_decoder->DriftCorr, drift * 1000 / 90, corr);
}
}
} }
/** /**
@@ -950,10 +1009,6 @@ static void CodecAudioUpdateFormat(AudioDecoder * audio_decoder)
int err; int err;
int isAC3; int isAC3;
audio_ctx = audio_decoder->AudioCtx;
audio_decoder->PassthroughAC3 = CodecPassthroughAC3;
// FIXME: use swr_convert from swresample (only in ffmpeg!) // FIXME: use swr_convert from swresample (only in ffmpeg!)
if (audio_decoder->ReSample) { if (audio_decoder->ReSample) {
audio_resample_close(audio_decoder->ReSample); audio_resample_close(audio_decoder->ReSample);
@@ -965,9 +1020,16 @@ static void CodecAudioUpdateFormat(AudioDecoder * audio_decoder)
audio_decoder->RemainCount = 0; audio_decoder->RemainCount = 0;
} }
audio_ctx = audio_decoder->AudioCtx;
Debug(3, "codec/audio: format change %dHz %d channels %s\n",
audio_ctx->sample_rate, audio_ctx->channels,
CodecPassthroughAC3 ? "pass-through" : "");
audio_decoder->SampleRate = audio_ctx->sample_rate; audio_decoder->SampleRate = audio_ctx->sample_rate;
audio_decoder->HwSampleRate = audio_ctx->sample_rate; audio_decoder->HwSampleRate = audio_ctx->sample_rate;
audio_decoder->Channels = audio_ctx->channels; audio_decoder->Channels = audio_ctx->channels;
audio_decoder->PassthroughAC3 = CodecPassthroughAC3;
// SPDIF/HDMI passthrough // SPDIF/HDMI passthrough
if (CodecPassthroughAC3 && audio_ctx->codec_id == CODEC_ID_AC3) { if (CodecPassthroughAC3 && audio_ctx->codec_id == CODEC_ID_AC3) {
audio_decoder->HwChannels = 2; audio_decoder->HwChannels = 2;
@@ -1008,7 +1070,7 @@ static void CodecAudioUpdateFormat(AudioDecoder * audio_decoder)
} }
// prepare audio drift resample // prepare audio drift resample
#ifdef USE_AUDIO_DRIFT_CORRECTION #ifdef USE_AUDIO_DRIFT_CORRECTION
if (!isAC3) { if ((CodecAudioDrift & 1) && !isAC3) {
if (audio_decoder->AvResample) { if (audio_decoder->AvResample) {
Error(_("codec/audio: overwrite resample\n")); Error(_("codec/audio: overwrite resample\n"));
} }
@@ -1034,13 +1096,12 @@ static void CodecAudioUpdateFormat(AudioDecoder * audio_decoder)
** **
** @param audio_decoder audio decoder data ** @param audio_decoder audio decoder data
** @param data samples data ** @param data samples data
** @param count number of samples ** @param count number of bytes in sample data
**
*/ */
void CodecAudioEnqueue(AudioDecoder * audio_decoder, int16_t * data, int count) void CodecAudioEnqueue(AudioDecoder * audio_decoder, int16_t * data, int count)
{ {
#ifdef USE_AUDIO_DRIFT_CORRECTION #ifdef USE_AUDIO_DRIFT_CORRECTION
if (audio_decoder->AvResample) { if ((CodecAudioDrift & 1) && audio_decoder->AvResample) {
int16_t buf[(AVCODEC_MAX_AUDIO_FRAME_SIZE * 3) / 4 + int16_t buf[(AVCODEC_MAX_AUDIO_FRAME_SIZE * 3) / 4 +
FF_INPUT_BUFFER_PADDING_SIZE] __attribute__ ((aligned(16))); FF_INPUT_BUFFER_PADDING_SIZE] __attribute__ ((aligned(16)));
int16_t buftmp[MAX_CHANNELS][(AVCODEC_MAX_AUDIO_FRAME_SIZE * 3) / 4]; int16_t buftmp[MAX_CHANNELS][(AVCODEC_MAX_AUDIO_FRAME_SIZE * 3) / 4];
@@ -1152,7 +1213,6 @@ void CodecAudioDecode(AudioDecoder * audio_decoder, const AVPacket * avpkt)
// update audio clock // update audio clock
if (avpkt->pts != (int64_t) AV_NOPTS_VALUE) { if (avpkt->pts != (int64_t) AV_NOPTS_VALUE) {
CodecAudioSetClock(audio_decoder, avpkt->pts); CodecAudioSetClock(audio_decoder, avpkt->pts);
} }
// FIXME: must first play remainings bytes, than change and play new. // FIXME: must first play remainings bytes, than change and play new.
if (audio_decoder->PassthroughAC3 != CodecPassthroughAC3 if (audio_decoder->PassthroughAC3 != CodecPassthroughAC3
@@ -1196,7 +1256,7 @@ void CodecAudioDecode(AudioDecoder * audio_decoder, const AVPacket * avpkt)
buf_sz = 6144; buf_sz = 6144;
#ifdef USE_AC3_DRIFT_CORRECTION #ifdef USE_AC3_DRIFT_CORRECTION
if (1) { if (CodecAudioDrift & 2) {
int x; int x;
x = (audio_decoder->DriftFrac + x = (audio_decoder->DriftFrac +

10
codec.h
View File

@@ -67,8 +67,14 @@ extern void CodecAudioOpen(AudioDecoder *, const char *, int);
/// Close audio codec. /// Close audio codec.
extern void CodecAudioClose(AudioDecoder *); extern void CodecAudioClose(AudioDecoder *);
/// Decode an audio packet. /// Set audio drift correction.
extern void CodecAudioDecodeOld(AudioDecoder *, const AVPacket *); extern void CodecSetAudioDrift(int);
/// Set audio pass-through.
extern void CodecSetAudioPassthrough(int);
/// Set audio downmix.
extern void CodecSetAudioDownmix(int);
/// Decode an audio packet. /// Decode an audio packet.
extern void CodecAudioDecode(AudioDecoder *, const AVPacket *); extern void CodecAudioDecode(AudioDecoder *, const AVPacket *);

25
misc.h
View File

@@ -107,6 +107,31 @@ static inline void Syslog(const int level, const char *format, ...)
#define Debug(level, fmt...) /* disabled */ #define Debug(level, fmt...) /* disabled */
#endif #endif
#ifndef AV_NOPTS_VALUE
#define AV_NOPTS_VALUE INT64_C(0x8000000000000000)
#endif
/**
** Nice time-stamp string.
**
** @param ts dvb time stamp
*/
static inline const char *Timestamp2String(int64_t ts)
{
static char buf[4][16];
static int idx;
if (ts == (int64_t) AV_NOPTS_VALUE) {
return "--:--:--.---";
}
idx = (idx + 1) % 3;
snprintf(buf[idx], sizeof(buf[idx]), "%2d:%02d:%02d.%03d",
(int)(ts / (90 * 3600000)), (int)((ts / (90 * 60000)) % 60),
(int)((ts / (90 * 1000)) % 60), (int)((ts / 90) % 1000));
return buf[idx];
}
/** /**
** Get ticks in ms. ** Get ticks in ms.
** **

View File

@@ -48,6 +48,18 @@ struct _ring_buffer_
atomic_t Filled; ///< how many of the buffer is used atomic_t Filled; ///< how many of the buffer is used
}; };
/**
** Reset ring buffer pointers.
**
** @param rb Ring buffer to reset read/write pointers.
*/
void RingBufferReset(RingBuffer * rb)
{
rb->ReadPointer = rb->Buffer;
rb->WritePointer = rb->Buffer;
atomic_set(&rb->Filled, 0);
}
/** /**
** Allocate a new ring buffer. ** Allocate a new ring buffer.
** **
@@ -69,10 +81,8 @@ RingBuffer *RingBufferNew(size_t size)
} }
rb->Size = size; rb->Size = size;
rb->ReadPointer = rb->Buffer;
rb->WritePointer = rb->Buffer;
rb->BufferEnd = rb->Buffer + size; rb->BufferEnd = rb->Buffer + size;
atomic_set(&rb->Filled, 0); RingBufferReset(rb);
return rb; return rb;
} }
@@ -89,7 +99,7 @@ void RingBufferDel(RingBuffer * rb)
/** /**
** Advance write pointer in ring buffer. ** Advance write pointer in ring buffer.
** **
** @param rb Ring buffer to adance write pointer. ** @param rb Ring buffer to advance write pointer.
** @param cnt Number of bytes to be adavanced. ** @param cnt Number of bytes to be adavanced.
** **
** @returns Number of bytes that could be advanced in ring buffer. ** @returns Number of bytes that could be advanced in ring buffer.
@@ -198,7 +208,7 @@ size_t RingBufferGetWritePointer(RingBuffer * rb, void **wp)
/** /**
** Advance read pointer in ring buffer. ** Advance read pointer in ring buffer.
** **
** @param rb Ring buffer to adance read pointer. ** @param rb Ring buffer to advance read pointer.
** @param cnt Number of bytes to be advanced. ** @param cnt Number of bytes to be advanced.
** **
** @returns Number of bytes that could be advanced in ring buffer. ** @returns Number of bytes that could be advanced in ring buffer.

View File

@@ -23,13 +23,16 @@
/// @addtogroup Ringbuffer /// @addtogroup Ringbuffer
/// @{ /// @{
///< ring buffer typedef /// ring buffer typedef
typedef struct _ring_buffer_ RingBuffer; typedef struct _ring_buffer_ RingBuffer;
///< create new ring buffer /// reset ring buffer pointers
extern void RingBufferReset(RingBuffer *);
/// create new ring buffer
extern RingBuffer *RingBufferNew(size_t); extern RingBuffer *RingBufferNew(size_t);
///< free ring buffer /// free ring buffer
extern void RingBufferDel(RingBuffer *); extern void RingBufferDel(RingBuffer *);
/// write into ring buffer /// write into ring buffer

File diff suppressed because it is too large Load Diff

View File

@@ -51,6 +51,10 @@ extern "C"
/// C plugin set play mode /// C plugin set play mode
extern int SetPlayMode(int); extern int SetPlayMode(int);
/// C plugin get current system time counter
extern int64_t GetSTC(void);
/// C plugin get video stream size and aspect
extern void GetVideoSize(int *, int *, double *);
/// C plugin set trick speed /// C plugin set trick speed
extern void TrickSpeed(int); extern void TrickSpeed(int);
/// C plugin clears all video and audio data from the device /// C plugin clears all video and audio data from the device
@@ -79,6 +83,8 @@ extern "C"
extern int Start(void); extern int Start(void);
/// C plugin stop code /// C plugin stop code
extern void Stop(void); extern void Stop(void);
/// C plugin house keeping
extern void Housekeeping(void);
/// C plugin main thread hook /// C plugin main thread hook
extern void MainThreadHook(void); extern void MainThreadHook(void);
@@ -86,6 +92,9 @@ extern "C"
extern void Suspend(int, int, int); extern void Suspend(int, int, int);
/// Resume plugin /// Resume plugin
extern void Resume(void); extern void Resume(void);
/// Get decoder statistics
extern void GetStats(int *, int *, int *, int *);
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif

File diff suppressed because it is too large Load Diff

50
softhddevice_service.h Normal file
View File

@@ -0,0 +1,50 @@
///
/// @file softhddev_service.h @brief software HD device service header file.
///
/// Copyright (c) 2012 by durchflieger. All Rights Reserved.
///
/// Contributor(s):
///
/// License: AGPLv3
///
/// This program is free software: you can redistribute it and/or modify
/// it under the terms of the GNU Affero General Public License as
/// published by the Free Software Foundation, either version 3 of the
/// License.
///
/// This program is distributed in the hope that it will be useful,
/// but WITHOUT ANY WARRANTY; without even the implied warranty of
/// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
/// GNU Affero General Public License for more details.
///
/// $Id$
//////////////////////////////////////////////////////////////////////////////
#pragma once
#define ATMO_GRAB_SERVICE "SoftHDDevice-AtmoGrabService-v1.0"
#define OSD_3DMODE_SERVICE "SoftHDDevice-Osd3DModeService-v1.0"
enum
{ GRAB_IMG_RGBA_FORMAT_B8G8R8A8 };
typedef struct
{
int structSize;
// request data
int analyseSize;
int clippedOverscan;
// reply data
int imgType;
int imgSize;
int width;
int height;
void *img;
} SoftHDDevice_AtmoGrabService_v1_0_t;
typedef struct
{
int Mode;
} SoftHDDevice_Osd3DModeService_v1_0_t;

View File

@@ -21,7 +21,7 @@ SRC_URI=""
LICENSE="AGPL-3" LICENSE="AGPL-3"
SLOT="0" SLOT="0"
KEYWORDS="~x86 ~amd64" KEYWORDS="~x86 ~amd64"
IUSE="vaapi vdpau alsa oss yaepg opengl jpeg" IUSE="vaapi vdpau alsa oss yaepg opengl debug"
DEPEND=">=x11-libs/libxcb-1.8 DEPEND=">=x11-libs/libxcb-1.8
x11-libs/xcb-util x11-libs/xcb-util
@@ -36,11 +36,10 @@ DEPEND=">=x11-libs/libxcb-1.8
dev-util/pkgconfig dev-util/pkgconfig
yaepg? ( >=media-video/vdr-1.7.23[yaepg] ) yaepg? ( >=media-video/vdr-1.7.23[yaepg] )
!yaepg? ( >=media-video/vdr-1.7.23 ) !yaepg? ( >=media-video/vdr-1.7.23 )
vdpau? ( x11-libs/libvdpau ) vdpau? ( x11-libs/libvdpau virtual/ffmpeg[vdpau] )
vaapi? ( x11-libs/libva ) vaapi? ( x11-libs/libva virtual/ffmpeg[vaapi] )
alsa? ( media-libs/alsa-lib ) alsa? ( media-libs/alsa-lib )
oss? ( sys-kernel/linux-headers ) oss? ( sys-kernel/linux-headers )
jpeg? ( virtual/jpeg )
" "
src_prepare() { src_prepare() {
@@ -55,7 +54,7 @@ src_compile() {
use vaapi && myconf="${myconf} -DUSE_VAAPI" use vaapi && myconf="${myconf} -DUSE_VAAPI"
use alsa && myconf="${myconf} -DUSE_ALSA" use alsa && myconf="${myconf} -DUSE_ALSA"
use oss && myconf="${myconf} -DUSE_OSS" use oss && myconf="${myconf} -DUSE_OSS"
use jpeg && myconf="${myconf} -DUSE_JPEG" use debug && myconf="${myconf} -DDEBUG"
emake all CC="$(tc-getCC)" CFLAGS="${CFLAGS}" \ emake all CC="$(tc-getCC)" CFLAGS="${CFLAGS}" \
LDFLAGS="${LDFLAGS}" CONFIG="${myconf}" LIBDIR="." || die LDFLAGS="${LDFLAGS}" CONFIG="${myconf}" LIBDIR="." || die

2638
video.c

File diff suppressed because it is too large Load Diff

67
video.h
View File

@@ -34,7 +34,9 @@ typedef struct _video_hw_decoder_ VideoHwDecoder;
// Variables // Variables
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
extern char VideoHardwareDecoder; ///< flag use hardware decoder
extern char VideoIgnoreRepeatPict; ///< disable repeat pict warning extern char VideoIgnoreRepeatPict; ///< disable repeat pict warning
extern int VideoAudioDelay; ///< audio/video delay
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
// Prototypes // Prototypes
@@ -77,12 +79,36 @@ extern void VideoPollEvent(void);
/// Wakeup display handler. /// Wakeup display handler.
extern void VideoDisplayWakeup(void); extern void VideoDisplayWakeup(void);
/// Set video device.
extern void VideoSetDevice(const char *);
/// Get video driver name.
extern const char *VideoGetDriverName(void);
/// Set video geometry. /// Set video geometry.
extern int VideoSetGeometry(const char *); extern int VideoSetGeometry(const char *);
/// Set 60Hz display mode. /// Set 60Hz display mode.
extern void VideoSet60HzMode(int); extern void VideoSet60HzMode(int);
/// Set soft start audio/video sync.
extern void VideoSetSoftStartSync(int);
/// Set show black picture during channel switch.
extern void VideoSetBlackPicture(int);
/// Set brightness adjustment.
extern void VideoSetBrightness(int);
/// Set contrast adjustment.
extern void VideoSetContrast(int);
/// Set saturation adjustment.
extern void VideoSetSaturation(int);
/// Set hue adjustment.
extern void VideoSetHue(int);
/// Set video output position. /// Set video output position.
extern void VideoSetOutputPosition(int, int, int, int); extern void VideoSetOutputPosition(int, int, int, int);
@@ -113,8 +139,11 @@ extern void VideoSetDenoise(int[]);
/// Set sharpen. /// Set sharpen.
extern void VideoSetSharpen(int[]); extern void VideoSetSharpen(int[]);
/// Set skip lines. /// Set cut top and bottom.
extern void VideoSetSkipLines(int); extern void VideoSetCutTopBottom(int[]);
/// Set cut left and right.
extern void VideoSetCutLeftRight(int[]);
/// Set studio levels. /// Set studio levels.
extern void VideoSetStudioLevels(int); extern void VideoSetStudioLevels(int);
@@ -137,19 +166,47 @@ extern void VideoOsdDrawARGB(int, int, int, int, const uint8_t *);
/// Get OSD size. /// Get OSD size.
extern void VideoGetOsdSize(int *, int *); extern void VideoGetOsdSize(int *, int *);
extern int64_t VideoGetClock(void); ///< Get video clock. /// Set OSD size.
extern void VideoSetOsdSize(int, int);
/// Set Osd 3D Mode
extern void VideoSetOsd3DMode(int);
/// Set video clock.
extern void VideoSetClock(VideoHwDecoder *, int64_t);
/// Get video clock.
extern int64_t VideoGetClock(const VideoHwDecoder *);
/// Set closing flag.
extern void VideoSetClosing(VideoHwDecoder *);
/// Reset start of frame counter
extern void VideoResetStart(VideoHwDecoder *);
/// Set trick play speed.
extern void VideoSetTrickSpeed(VideoHwDecoder *, int);
/// Grab screen. /// Grab screen.
extern uint8_t *VideoGrab(int *, int *, int *, int); extern uint8_t *VideoGrab(int *, int *, int *, int);
/// Grab screen raw.
extern uint8_t *VideoGrabService(int *, int *, int *);
/// Get decoder statistics.
extern void VideoGetStats(VideoHwDecoder *, int *, int *, int *, int *);
/// Get video stream size
extern void VideoGetVideoSize(VideoHwDecoder *, int *, int *, int *, int *);
extern void VideoOsdInit(void); ///< Setup osd. extern void VideoOsdInit(void); ///< Setup osd.
extern void VideoOsdExit(void); ///< Cleanup osd. extern void VideoOsdExit(void); ///< Cleanup osd.
extern void VideoInit(const char *); ///< Setup video module. extern void VideoInit(const char *); ///< Setup video module.
extern void VideoExit(void); ///< Cleanup and exit video module. extern void VideoExit(void); ///< Cleanup and exit video module.
extern void VideoFlushInput(void); ///< Flush video input buffers. extern int VideoPollInput(void); ///< Poll video input buffers.
extern int VideoDecode(void); ///< Decode video input buffers. extern int VideoDecodeInput(void); ///< Decode video input buffers.
extern int VideoGetBuffers(void); ///< Get number of input buffers. extern int VideoGetBuffers(void); ///< Get number of input buffers.
/// @} /// @}