Compare commits

..

188 Commits

Author SHA1 Message Date
Johns
6dfa88aecf Preparations for new ffmpeg VDPAU API. 2015-11-03 11:39:41 +01:00
Johns
ee2311d252 Fix compile error with opengl and without va-api. 2015-10-06 18:28:34 +02:00
Johns
4fa4f6616a Added VDPAU multi decoder loop changes to VA-API code. 2015-10-05 08:54:19 +02:00
Johns
5dc5601576 Fix comment spelling. 2015-10-01 15:46:38 +02:00
Johns
9e56747a56 Disabled old code before removement. 2015-10-01 12:48:37 +02:00
Johns
5b90137050 Handle change of audio ac3 downmix direct. 2015-09-30 12:24:26 +02:00
Johns
f47ee3a201 Speedup queuing output surface, when decoder buffers are full. 2015-09-30 11:27:10 +02:00
Johns
93981031aa Calculate queued output surfaces and show them in info message. 2015-09-30 11:16:50 +02:00
Johns
509329c90a Add support for new API of vdr 2.3.1. 2015-09-24 14:31:51 +02:00
Johns
8c347fdf1d Fix bug: EnableDPMSatBlackScreen only available with USE_SCREENSAVER. 2015-08-26 10:11:49 +02:00
Johns
06b8f77327 H264_EOS_TRICKSPEED and USE_MPEG_COMPLETE enabled as default. 2015-08-17 13:14:44 +02:00
master_red
700c8e8767 Configurable enable DPMS, while black screen is displayed. 2015-08-10 15:32:25 +02:00
Johns
ec58e45607 Fix bug: wrong and crash, if vdr draws pixmaps outside OSD. 2015-06-30 10:12:09 +02:00
Johns
396d5fac05 Fix bug: wrong version number check for av_frame_alloc(), ... 2015-06-19 01:06:52 +02:00
Johns
f0d31ad33c Fixed typing error. 2015-04-22 12:35:42 +02:00
Johns
e0f4a99b99 Workaround for ffmpeg 2.6 artifacts. 2015-04-22 12:14:15 +02:00
Johns
a1939eb6cb Fix bug: brightness and .. are calculated wrong. 2015-03-10 10:44:29 +01:00
Johns
28555643a5 Add automatic frame rate detection for older ffmpeg versions. 2015-03-10 10:38:00 +01:00
Johns
2866e328c6 Fix bug: destroyed vdpau surfaces still used in queue. 2015-03-10 10:31:49 +01:00
Johns
915dff8714 Fix bug: need signed char, if compiler has unsigned chars. 2015-03-10 10:20:53 +01:00
Johns
ca0181b1b1 Try smaller audio puffer, if default size fails. 2015-03-10 10:14:37 +01:00
Johns
a36221dea7 Fix bug: center cut-out didn't use cut off pixels. 2015-03-10 10:10:14 +01:00
Johns
4e72638766 Fix bug #2058: support for Make.plgcfg. 2015-03-10 09:43:09 +01:00
Johns
93ea660a38 Fix for compile with vdr 2.1.10, for older vdr versions. 2015-02-16 15:18:59 +01:00
jinx
73ce4ba803 Enable toggle AC3 downmix. 2015-02-16 10:02:27 +01:00
Johns
1d06c5ba59 Compile with vdr 2.1.10 2015-02-12 10:30:50 +01:00
Johns
2ceeb6db40 Fix bug: AVCodecContext.framerate not supported.
Older versions of ffmpeg have no member framerate in AVCodecContext.
2015-02-09 11:50:41 +01:00
Johns
4f4d304479 Use video stream frame rate for A/V sync.
Use the video stream frame rate and not the fixed 50Hz for A/V sync.
2015-02-06 09:50:54 +01:00
Antti Seppälä
9f134c1b6d Corrected black surface for va-api. 2014-10-16 14:16:01 +02:00
Johns
0adc02dd78 Newer va-api intel drivers support PutImage. 2014-10-16 14:05:17 +02:00
Johns
46e9f23355 Use more portable fork for vfork. 2014-10-16 12:54:21 +02:00
Johns
ac1d5250c8 Fix crash with VA-API vdpau backend. 2014-10-13 15:16:05 +02:00
mini73
c2556eb90a Fix bug: random rubbish at the end of letter. 2014-10-11 16:56:24 +02:00
Johns
a3c0052c4b Fix audio thread close race condition. 2014-09-23 12:36:39 +02:00
Johns
8b7402a397 Support ffmpeg new AVFrame API in the audio codec. 2014-08-13 12:04:39 +02:00
Johns
4a4de36878 Newer version of msgfmt force this. 2014-07-14 11:39:01 +02:00
Johns
37f409cb9a Use GCC built-in functions for atomic operations. 2014-06-25 15:17:00 +02:00
Johns
5207af6b2d Fix last commit. 2014-06-04 19:32:44 +02:00
Johns
90538ebfa9 Support detach or suspend in plugin menu. 2014-06-04 14:49:18 +02:00
Johns
ac7672053a Fix out of sync with ffmpeg >= 2.2.
This workaround for some special ffmpeg versions, conflicts with latest ffmpeg.
2014-05-30 10:18:20 +02:00
Johns
0cdedb88ac Fix "make clean-plugins". 2014-04-17 14:33:12 +02:00
Johns
42bbb763fd Fix compile with newer libav. 2014-02-27 14:20:25 +01:00
Johns
5bf2a9b761 No conf and rc file in git. 2014-02-18 12:26:03 +01:00
Johns
b7d372aa39 Audio flush only with audio. 2014-02-18 10:12:34 +01:00
Johns
3d3a88e76c Fix OSD bugs. 2014-02-12 14:37:35 +01:00
Johns
450c9b6309 Add some VA-API VPP info outputs. 2014-02-04 14:46:22 +01:00
Johns
23ab3707dc Remove build files for old unstable VDR. 2014-01-30 10:47:03 +01:00
hd.brummy
b3f0fe9fea Update gentoo ebuild. 2014-01-30 10:42:17 +01:00
Johns
f73f7a28f3 Fix spelling in arguments help. 2014-01-30 10:36:53 +01:00
Johns
340e10a0eb Add Workaround for alsa blocking audio device. 2014-01-29 10:07:07 +01:00
mini73
a45b9a3abe Fix bug: learing x11 remote keys fails. 2014-01-24 11:31:57 +01:00
Johns
590bae406a USE_BITMAP shouldn't be the default. 2014-01-14 14:59:44 +01:00
Johns
501d46793f Fix alternative OSD support with VDPAU bitmap surfaces. 2014-01-14 14:59:01 +01:00
Johns
978fc59aba Add support for umlauts in input fields. 2014-01-08 16:57:08 +01:00
Johns
aee9bbed90 Fix compile error with VDR 2.1.3. 2014-01-07 12:34:54 +01:00
Johns
8577292c50 Fix bug: memory leak. 2014-01-06 16:51:37 +01:00
Johns
a74a8e1c74 Added libswresample as required for ffmpeg. 2013-12-04 10:25:32 +01:00
Johns
e2a65cbf76 Missing change for PIP close, clear. 2013-12-04 10:12:31 +01:00
Johns
35a1dde089 ClearOnSwitch added to readme. 2013-12-04 10:10:09 +01:00
Johns
7ffbfea224 PIP close clears the last used PIP channel. 2013-12-04 10:01:36 +01:00
Johns
bb70c75656 Fix bug: -DOSD_DEBUG uses old (deleted) variable. 2013-11-23 16:51:30 +01:00
Johns
cfda3ba39d Fix bug: Option softhddevice.BlackPicture has no effect. 2013-11-23 16:48:02 +01:00
Dr. Seltsam
0e40f5f872 Add support to configure and clear buffers on channel switch. 2013-11-05 16:46:46 +01:00
Johns
fb2a7f9959 CLOCK_REALTIME -> CLOCK_MONOTONIC to allow time changes. 2013-10-08 10:18:04 +02:00
Johns
e3b32861b0 Add function VideoStreamOpen and always use VideoStreamClose. 2013-10-08 10:13:38 +02:00
Johns
58a76439ee Softer audio/video sync. 2013-09-30 20:54:27 +02:00
Johns
a13c25d309 Add function GetStats to the video output module. 2013-08-07 10:29:44 +02:00
Johns
5265e68aa9 Add function ResetStart to the video output module. 2013-08-06 12:16:30 +02:00
Johns
11121b5bdd Add function SetClosing to the video output module. 2013-08-04 17:43:11 +02:00
Johns
d8e96c7871 Generalize GetVaapiContext to GetHwAccelContext. 2013-08-03 17:27:52 +02:00
Johns
8ff65a011a Add compile time configurable trickspeed packets dump. 2013-07-29 19:14:32 +02:00
Johns
171a3f4dc9 Fix bug #1410: wrong spelled AC-3 and E-AC-3. 2013-07-26 16:55:33 +02:00
Johns
93357fb1cd Add compile time selectable h264 trickspeed workaround. 2013-07-24 20:06:05 +02:00
Johns
c646007db1 Use ffmpeg new names AVCodecID, AV_CODEC_... . 2013-07-18 17:08:47 +02:00
Johns
7615305960 Fix bug: video lagging behind after recording stop. 2013-07-16 16:39:46 +02:00
Johns
cc1e2de58b Reduce PES error messages. 2013-07-15 17:00:22 +02:00
Johns
738e9402d2 Report synced as info and not as debug message. 2013-07-15 16:58:36 +02:00
Johns
34fd275b42 Fix bug #1392: Wrong value for mixing LFE. 2013-07-08 14:36:08 +02:00
Johns
64c11efc1b Fix bug: wrong grab size, introduced with AMD VDPAU. 2013-05-16 20:28:44 +02:00
Johns
ebb8482226 Use VDR SPU decoder as default. 2013-05-15 10:07:30 +02:00
Johns
833112eaa9 Fix bug: grab image negative quality isn't 100. 2013-05-14 12:32:09 +02:00
Johns
3022920b40 Don't forget PIP documentation. 2013-05-10 16:33:37 +02:00
Johns
c1d3b9d048 Support AMD VDPAU with surface != requested size. 2013-05-10 15:53:26 +02:00
Johns
4fe1c43c08 Removes VA-API enabled as default.
Removes studio levels environment setting.
2013-04-23 20:46:36 +02:00
Johns
7a5e696bc4 Fix opengl and opengl threads bugs. 2013-04-17 16:35:51 +02:00
Johns
8f99f80d44 Initial opengl support with va-api only. 2013-04-16 16:44:42 +02:00
Johns
c0286b3ab4 Fix "broken driver" message if empty ring buffer. 2013-04-15 16:55:15 +02:00
Johns
9dd248f9d0 Enable seamless audio track change. 2013-04-11 12:03:38 +02:00
Johns
238224efc8 Better to unlock after the free and zero. 2013-04-10 15:04:09 +02:00
Johns
5b35e70b94 Fix bug #1302: Unsupported pixel format crash. 2013-04-08 16:42:47 +02:00
Johns
857546a3a5 Fix the fix, when sillpicture is called in suspend. 2013-04-06 14:24:08 +02:00
Johns
a1b77b1502 Fixes PIP Y translation. 2013-04-03 16:53:45 +02:00
Johns
7ef5667598 Patch was not 100% correct, fixed. 2013-04-03 16:51:27 +02:00
Johns
4e3f5f5414 Fix crash, when sillpicture is called in suspend mode. 2013-04-03 16:48:00 +02:00
Johns
23b0e0d599 Add workaround for zero width+height and ffmpeg >= 1.2. 2013-04-03 16:47:21 +02:00
Johns
eab051f5e6 Release Version 0.6.0. 2013-03-17 15:53:01 +01:00
anbr
e058302a08 Update german translation. 2013-03-17 15:51:11 +01:00
Johns
efcf3a1d2d Fix Bug #1286: typo. 2013-03-12 23:27:09 +01:00
Johns
1f0d5878b1 Adds H264 only hardware decoder for still-pictures. 2013-03-11 16:32:00 +01:00
Johns
f09a37a941 Enable optional VDR-SPU deocder support. 2013-03-11 12:18:11 +01:00
Johns
a7562eb2be Removes "static" warning. 2013-03-06 17:31:01 +01:00
cyril
a747829ffb Adds raise softhddevice video window support. 2013-03-06 17:07:30 +01:00
Johns
7db63875d0 Adds optional only complete mpeg packets support. 2013-03-06 10:30:27 +01:00
Johns
637c04655a Fixes text of EAC-3 pass-through setup. 2013-03-05 14:39:13 +01:00
Johns
9954b939ef Try to connect to X11 server, when start fails. 2013-02-27 16:48:42 +01:00
Johns
e65572c2e2 Updated ebuild for new vdr-plugin-2.eclass. 2013-02-25 16:40:44 +01:00
Johns
b3ddc47cb5 Removes "unused parameter" warnings. 2013-02-25 16:39:32 +01:00
Johns
4d9e3a71f4 More informations in short description. 2013-02-25 16:34:28 +01:00
Johns
21e4f4ee04 Workaround for ffmpeg 1.1.x get_format bug. 2013-02-25 16:33:40 +01:00
Johns
746746d5b7 Workaround for ffmpeg 1.1.2 bug. 2013-02-25 16:32:52 +01:00
Johns
936566c642 Show vaapi droped/missed messages with info level. 2013-02-23 15:56:24 +01:00
Johns
d6f557c6f7 Removes warnings, when compiles without VDPAU. 2013-02-15 15:58:49 +01:00
Johns
2d2ea53d16 Quote spaces to get correct ouput. 2013-02-13 22:47:16 +01:00
Johns
bccd959833 Fix .pot file generation, support _ and _N macros. 2013-02-13 22:46:08 +01:00
Johns
240fc17471 Store pass-through on/off state in setup. 2013-02-13 17:23:18 +01:00
Johns
7b2caac901 Fix bug: still old CodecPassthroughAC3 used. 2013-02-12 22:03:52 +01:00
Johns
56aae221e7 Adds missing USE_SCREENSAVER to old Makefile. 2013-02-12 18:11:40 +01:00
Johns
54255e7b57 Try to use HBR (High Bit-Rate) for EAC3. 2013-02-11 23:40:09 +01:00
Johns
2cd667fb44 Improved pass-through (PCM+EAC3) support. 2013-02-11 16:53:51 +01:00
Johns
145d65ff01 Debug time for channel switch. 2013-02-11 15:11:52 +01:00
Johns
8faff0fd1e Try to detect wrong Makefile use. 2013-02-11 14:41:19 +01:00
Johns
d31ff55b12 Clear buffers quicker, when replay stops. 2013-02-08 21:03:06 +01:00
Johns
d4535a34c9 Fix xcb deadlock while closing PIP decoder.
Close video decoder from inside the decoder thread,
otherwise xcb hangs in a lock.
2013-02-07 16:54:16 +01:00
Johns
ebd2f85f90 Update for new Makefiles. 2013-02-07 10:17:48 +01:00
Johns
dce7ef9110 Adds PIP hot-key support. 2013-02-06 16:27:25 +01:00
Johns
780e2989ae Makes audio mixer optional. 2013-02-06 16:02:22 +01:00
Johns
2661fdf333 Plugin needs -D_GNU_SOURCE. 2013-01-30 18:04:53 +01:00
Johns
2557418e81 No longer needed. 2013-01-29 20:48:04 +01:00
Johns
b48e0d0638 Support VDR 1.7.36 new build system. 2013-01-29 17:04:50 +01:00
Johns
2c27d83b9e Makes buffers soft limit configurable. 2013-01-28 23:13:23 +01:00
Johns
8b22585748 Never trust the docs: fix ffmpeg downsample. 2013-01-26 00:18:59 +01:00
Johns
7ed6975330 Support upsampling 3,5 to 8 channels.
Improve next ring buffer handling.
Improve audio/video sync debug.
2013-01-25 17:05:53 +01:00
Johns
d5e111238d Improves VDPAU dissplay preemption handling. 2013-01-25 16:55:25 +01:00
Sibbi
2733e47af7 Add modifiers to X11 remote key names. 2013-01-25 16:52:23 +01:00
Johns
f9998e7664 Add audio compatibility with >=ffmpeg 1.1. 2013-01-24 21:42:39 +01:00
Johns
04286fb2ad Add video compatibility with >=ffmpeg 1.1. 2013-01-23 21:54:56 +01:00
Johns
cd82ee8e4a Fix bug: no sound with video output "none". 2013-01-22 17:18:18 +01:00
Johns
a1f17199d6 Crop setup is done by VdpauSetupOutput. 2013-01-22 17:08:44 +01:00
Johns
849ca7cfd6 Stronger H264/Mpeg detection tests. 2013-01-12 19:13:43 +01:00
Johns
308742a927 React faster only with mpeg. 2013-01-11 18:54:45 +01:00
Johns
1a730ef90b Fix build without USE_PIP. 2013-01-09 00:39:27 +01:00
Johns
d59c2ad40b Must guard CodecVideoDecode. 2013-01-08 23:52:41 +01:00
Johns
3366faece2 Fixes close PIP threading bug. 2013-01-08 21:11:46 +01:00
Johns
2bb2875cd7 Update PIP only, when visible. 2013-01-07 19:31:05 +01:00
Johns
e88403d044 Close pip before switching channel. 2013-01-07 17:47:05 +01:00
Johns
11293e8dc1 Split mpeg packets in receiver thread. 2013-01-07 16:55:42 +01:00
Johns
3bcc3d280e fprints only when building debug version. 2013-01-06 19:17:02 +01:00
Johns
55587c86f0 Switch PIP to only available channels. 2013-01-06 19:15:46 +01:00
Johns
7cc74795be Fix bug: missing external reference with -DUSE_PIP. 2013-01-06 19:14:46 +01:00
Johns
534b4094b5 Fix thread exit problem. 2013-01-06 14:47:00 +01:00
Johns
7cd025a023 Cosmetic cleanups. 2013-01-06 14:06:08 +01:00
Johns
b14a67b601 New features documented. 2013-01-05 23:16:03 +01:00
Johns
b24409323d Fix detach and attach bug. 2013-01-05 22:48:01 +01:00
Johns
9ec2716026 PIP function update. 2013-01-05 20:47:14 +01:00
Johns
fa09d940c5 Fix PIP threading problems. 2013-01-05 20:44:54 +01:00
Johns
d4702b9a9e Include softhddevice.cpp in indent target.
Fix constconst after indent.  Hello GNU who many years until it will be
fixed?
2013-01-05 19:49:59 +01:00
Johns
6a3a560857 Adds PIP channel switch functions. 2013-01-05 17:17:50 +01:00
Johns
8ee1e84b2e Restore video position, when PIP closes. 2013-01-05 16:37:25 +01:00
Johns
7e96a292eb First video surface clears complete window. 2013-01-05 15:41:57 +01:00
Johns
d89ada9aad Makes PIP+Video position configurable. 2013-01-04 21:50:55 +01:00
Johns
59d1a6b1f2 Adds function to stop PIP. 2013-01-04 18:50:14 +01:00
Johns
1a744a8eb8 Sync to audio only with the first video stream. 2013-01-04 18:04:53 +01:00
Johns
78100cba00 Use second stream for PIP. 2013-01-04 15:56:26 +01:00
Johns
b54ddd4549 Enable more than 1 vdpau video stream. 2013-01-04 15:54:32 +01:00
Johns
d42475f2dc Prepared reentrant video stream. 2013-01-03 18:52:34 +01:00
Johns
7cf6c1ab2b va-api has problems with h264 interlace. 2013-01-03 01:03:22 +01:00
Johns
06b8e3d784 Fix video size not updated for VAAPI. 2013-01-02 23:59:46 +01:00
horchi
63c22a13cf Adds VDR SeduAtmo Plugin support. 2013-01-01 17:58:54 +01:00
Johns
3d5e59a6e5 Support multiple streams with ScaleVideo. 2013-01-01 15:21:28 +01:00
Johns
acf377ec60 Makes 4:3 and 16:9 display format configurable.
Don't use DVB display format.
2013-01-01 14:48:51 +01:00
Zoolook
87c1c7be84 Add support for new vdr ScaleVideo API. 2013-01-01 12:51:08 +01:00
Johns
5bacd0cf7b Comments cleanup. 2013-01-01 12:40:12 +01:00
Johns
b1beb49798 Add support for old PES HDTV recording. 2013-01-01 12:09:54 +01:00
Johns
33b14be516 Change VideoSetOutputPosition to work OSD relative. 2012-12-31 17:51:43 +01:00
Johns
3907f3eb2f Change +%d to %+d, which is more general. 2012-12-31 17:11:22 +01:00
Johns
00d314dcd1 Disable trickspeed hack, to prevent ffmpeg crash. 2012-12-31 14:03:19 +01:00
Johns
9719fef55b Fix video size not updated, when window size change. 2012-12-30 17:05:42 +01:00
Johns
9b69045a20 Use 1 surface reserve. 2012-12-24 12:59:35 +01:00
Johns
966ff4229a Better video stream window position support. 2012-12-24 12:23:16 +01:00
Johns
e0c0c2021f Need LOCALEDIR to build as user. 2012-12-24 11:56:10 +01:00
Johns
a3907d11a5 Spam syslog with a/v sync infos. 2012-12-24 11:55:32 +01:00
Johns
b94d19e7b8 Make clear what downmix is enabled. 2012-12-24 11:53:16 +01:00
Johns
943ee22aa5 Makes X11 server arguments configurable. 2012-12-14 17:24:54 +01:00
Johns
b6154a988f Fix build with NO_TS_AUDIO. 2012-12-14 17:04:50 +01:00
Johns
932871dea9 Use vdr-plugin-2. 2012-11-30 20:46:13 +01:00
Johns
5ec6963398 Missing space added. 2012-11-25 00:38:32 +01:00
Johns
b04323704d Missing space added. 2012-11-25 00:35:39 +01:00
FireFly
38011d51b6 Add german translation. 2012-11-18 21:17:09 +01:00
20 changed files with 7394 additions and 1976 deletions

214
ChangeLog
View File

@ -1,3 +1,217 @@
User johns
Date:
Preparations for new ffmpeg VDPAU API.
Added VDPAU multi decoder loop changes to VA-API code.
Reenabled VA-API auto detection.
Check and enforce USE_PIP is defined, for new code.
Fix comment spelling.
Disabled old code before removement.
Handle change of audio ac3 downmix direct.
Speedup queuing output surface, when decoder buffers are full.
Fix bug: info shows wrong decoded video surfaces.
Calculate queued output surfaces and show them in info message.
Add support for new API of vdr 2.3.1.
Fix bug: EnableDPMSatBlackScreen only available with USE_SCREENSAVER.
- H264_EOS_TRICKSPEED and USE_MPEG_COMPLETE enabled as default.
User master_red
Date: Mon Aug 10 15:29:33 CEST 2015
Configurable enable DPMS, while black screen is displayed.
User johns
Date: Tue Jun 30 10:12:09 CET 2015
Fix bug: wrong and crash, if vdr draws pixmaps outside OSD.
Fix bug: wrong version number check for av_frame_alloc(), ...
Workaround for ffmpeg 2.6 artifacts.
Fix bug: brightness and .. are calculated wrong.
Add automatic frame rate detection for older ffmpeg versions.
Fix bug: destroyed vdpau surfaces still used in queue.
Fix bug: need signed char, if compiler has unsigned chars.
Try smaller audio puffer, if default size fails.
Fix bug: center cut-out didn't use cut off pixels.
Fix bug #2058: support for Make.plgcfg.
Fix for compile with vdr 2.1.10, for older vdr versions.
User jinx
Date: Mon Feb 16 09:58:06 CET 2015
Enable toggle AC3 downmix.
User johns
Date: Thu Feb 12 10:30:50 CET 2015
Compile with vdr 2.1.10.
Fix bug: AVCodecContext.framerate not supported.
Use video stream frame rate for A/V sync.
User Antti Seppälä
Date: Thu Oct 16 14:15:15 CEST 2014
Corrected black surface for va-api.
User johns
Date: Thu Oct 16 14:05:17 CEST 2014
Newer va-api intel drivers support PutImage.
Use more portable fork for vfork.
Fix crash with VA-API vdpau backend.
User mini73
Date: Sat Oct 11 16:53:18 CEST 2014
Fix bug: random rubbish at the end of letter.
User johns
Date: Tue Sep 23 12:36:39 CEST 2014
Fix audio thread close race condition.
Support ffmpeg new AVFrame API in the audio codec.
Config for automatic AES parameters.
Use GCC built-in functions for atomic operations.
User master_red
Date: Wed Jun 4 14:44:32 CEST 2014
Support detach or suspend in plugin menu.
User johns
Date: Fri May 30 10:18:20 CEST 2014
Fix "make clean-plugins".
Fix compile with newer libav.
Fix OSD bugs.
Add some VA-API VPP info outputs.
Remove build files for old unstable VDR.
User hd.brummy
Date: Thu Jan 30 10:40:49 CET 2014
Update gentoo ebuild.
User johns
Date: Thu Jan 30 10:36:53 CET 2014
Fix spelling in arguments help.
Add Workaround for alsa blocking audio device.
Improves thread handling for audio flush and close.
User mini73
Date: Fri Jan 24 11:30:49 CET 2014
Fix bug: learing x11 remote keys fails.
Add support for umlauts in input fields.
User johns
Date: Tue Jan 14 14:59:44 CET 2014
Fix alternative OSD support with VDPAU bitmap surfaces.
Fix compile error with VDR 2.1.3.
Fix bug: memory leak.
PIP close clears the last used PIP channel.
Fix bug: -DOSD_DEBUG uses old (deleted) variable.
Fix bug: Option softhddevice.BlackPicture has no effect.
User Dr. Seltsam
Date: Tue Nov 5 16:46:34 CET 2013
Add support to configure and clear buffers on channel switch.
User johns
Date: Tue Oct 8 10:18:04 CET 2013
CLOCK_REALTIME -> CLOCK_MONOTONIC to allow time changes.
Add function VideoStreamOpen and always use VideoStreamClose.
Softer audio/video sync.
Add function GetStats to the video output module.
Add function ResetStart to the video output module.
Add function SetClosing to the video output module.
Generalize GetVaapiContext to GetHwAccelContext.
Add compile time configurable trickspeed packets dump.
Fix bug #1410: wrong spelled AC-3 and E-AC-3.
Add compile time selectable h264 trickspeed workaround.
Use ffmpeg new names AVCodecID, AV_CODEC_... .
Fix bug: video lagging behind after recording stop.
Reduce PES error messages.
Fix bug #1392: Wrong value for mixing LFE.
Fix bug: wrong grab size, introduced with AMD VDPAU.
Use VDR SPU decoder as default.
Fix bug: grab image negative quality isn't the default 100.
Support AMD VDPAU with surface size != requested size.
Add cache for auto-crop buffer.
Fix opengl and opengl threads bugs.
Initial opengl support with va-api only.
Fix "broken driver" message if empty ring buffer.
Enable seamless audio track change.
Fix bug #1302: Unsupported pixel format crash.
Fix the fix, when sillpicture is called in suspend mode.
Fix crash, when sillpicture is called in suspend mode.
Add workaround for zero width+height and ffmpeg >= 1.2.
User johns
Date: Sun Mar 17 15:52:42 CET 2013
Release Version 0.6.0
Adds H264 only hardware decoder for still-pictures.
Enable optional VDR-SPU deocder support.
User anbr
Date: Sun Mar 17 15:49:46 CET 2013
Update german translation.
User cyril
Date: Wed Mar 6 17:05:10 CET 2013
Adds raise softhddevice video window support.
User johns
Date: Wed Mar 6 10:30:27 CET 2013
Adds optional only complete mpeg packets support.
Fixes text of EAC-3 pass-through setup.
Try to start or connect to X11 server with -xx.
Try to use HBR (High Bit-Rate) for EAC3.
Improved pass-through (PCM+EAC3) support.
Support VDR 1.7.36 new build system.
Improves VDPAU display preemption handling.
Add modifiers to X11 remote key names (from Sibbi).
Add compatibility with >=ffmpeg 1.1.
Adds PIP (Picture-in-Picture) support.
Split mpeg packets in receiver thread.
User horchi
Date: Tue Jan 1 17:58:54 CET 2013
Adds VDR SeduAtmo Plugin support.
User johns
Date: Tue Jan 1 15:21:28 CET 2013
Support multiple streams with ScaleVideo.
Makes 4:3 and 16:9 display format configurable.
Don't use DVB display format.
User Zoolook
Date: Tue Jan 1 12:49:19 CET 2013
Add support for new vdr ScaleVideo API.
User johns
Date: Tue Jan 1 12:40:12 CET 2013
Add support for old PES HDTV recording.
Disable trickspeed hack, to prevent ffmpeg crash.
Makes X11 server arguments configurable.
Add german translation.
User FireFly
Date: Sun Nov 18 21:15:50 CET 2012
Add german translation.
User johns
Date: Thu Nov 15 22:28:55 CET 2012

244
Makefile
View File

@ -6,152 +6,209 @@
# The official name of this plugin.
# This name will be used in the '-P...' option of VDR to load the plugin.
# By default the main source file also carries this name.
# IMPORTANT: the presence of this macro is important for the Make.config
# file. So it must be defined, even if it is not used here!
#
PLUGIN = softhddevice
### Configuration (edit this for your needs)
# support alsa audio output module
ALSA ?= $(shell pkg-config --exists alsa && echo 1)
# support OSS audio output module
OSS ?= 1
# support VDPAU video output module
VDPAU ?= $(shell pkg-config --exists vdpau && echo 1)
# support VA-API video output module (deprecated)
VAAPI ?= $(shell pkg-config --exists libva && echo 1)
# support glx output
OPENGL ?= $(shell pkg-config --exists gl glu && echo 1)
# screensaver disable/enable
SCREENSAVER ?= 1
# use ffmpeg libswresample
SWRESAMPLE ?= $(shell pkg-config --exists libswresample && echo 1)
# use libav libavresample
ifneq ($(SWRESAMPLE),1)
AVRESAMPLE ?= $(shell pkg-config --exists libavresample && echo 1)
endif
CONFIG := # -DDEBUG #-DOSD_DEBUG # enable debug output+functions
#CONFIG += -DSTILL_DEBUG=2 # still picture debug verbose level
CONFIG += -DAV_INFO -DAV_INFO_TIME=3000 # info/debug a/v sync
CONFIG += -DUSE_PIP # PIP support
#CONFIG += -DHAVE_PTHREAD_NAME # supports new pthread_setname_np
#CONFIG += -DNO_TS_AUDIO # disable ts audio parser
#CONFIG += -DUSE_TS_VIDEO # build new ts video parser
CONFIG += -DUSE_MPEG_COMPLETE # support only complete mpeg packets
CONFIG += -DH264_EOS_TRICKSPEED # insert seq end packets for trickspeed
#CONDIF += -DDUMP_TRICKSPEED # dump trickspeed packets
#CONFIG += -DUSE_BITMAP # VDPAU, use bitmap surface for OSD
CONFIG += -DUSE_VDR_SPU # use VDR SPU decoder.
#CONFIG += -DUSE_SOFTLIMIT # (tobe removed) limit the buffer fill
### The version number of this plugin (taken from the main source file):
VERSION = $(shell grep 'static const char \*const VERSION *=' $(PLUGIN).cpp | awk '{ print $$7 }' | sed -e 's/[";]//g')
GIT_REV = $(shell git describe --always 2>/dev/null)
### Configuration (edit this for your needs)
CONFIG := #-DDEBUG #-DOSD_DEBUG
CONFIG += -DAV_INFO -DAV_INFO_TIME=3000 # debug a/v sync
#CONFIG += -DHAVE_PTHREAD_NAME # supports new pthread_setname_np
#CONFIG += -DNO_TS_AUDIO # disable ts audio parser
#CONFIG += -DUSE_TS_VIDEO # build new ts video parser
CONFIG += $(shell pkg-config --exists vdpau && echo "-DUSE_VDPAU")
CONFIG += $(shell pkg-config --exists libva && echo "-DUSE_VAAPI")
CONFIG += $(shell pkg-config --exists alsa && echo "-DUSE_ALSA")
CONFIG += -DUSE_OSS
### The C++ compiler and options:
CC ?= gcc
CXX ?= g++
CFLAGS ?= -g -O2 -W -Wall -Wextra -Winit-self \
-Wdeclaration-after-statement \
-ftree-vectorize -msse3 -flax-vector-conversions
CXXFLAGS ?= -g -O2 -W -Wall -Wextra -Werror=overloaded-virtual
### The directory environment:
VDRDIR ?= ../../..
LIBDIR ?= ../../lib
# Use package data if installed...otherwise assume we're under the VDR source directory:
PKGCFG = $(if $(VDRDIR),$(shell pkg-config --variable=$(1) $(VDRDIR)/vdr.pc),$(shell PKG_CONFIG_PATH="$$PKG_CONFIG_PATH:../../.." pkg-config --variable=$(1) vdr))
LIBDIR = $(call PKGCFG,libdir)
LOCDIR = $(call PKGCFG,locdir)
PLGCFG = $(call PKGCFG,plgcfg)
#
TMPDIR ?= /tmp
### Make sure that necessary options are included:
### The compiler options:
-include $(VDRDIR)/Make.global
export CFLAGS = $(call PKGCFG,cflags)
export CXXFLAGS = $(call PKGCFG,cxxflags)
ifeq ($(CFLAGS),)
$(warning CFLAGS not set)
endif
ifeq ($(CXXFLAGS),)
$(warning CXXFLAGS not set)
endif
### The version number of VDR's plugin API:
APIVERSION = $(call PKGCFG,apiversion)
### Allow user defined options to overwrite defaults:
-include $(VDRDIR)/Make.config
### The version number of VDR's plugin API (taken from VDR's "config.h"):
APIVERSION = $(shell sed -ne '/define APIVERSION/s/^.*"\(.*\)".*$$/\1/p' $(VDRDIR)/config.h)
-include $(PLGCFG)
### The name of the distribution archive:
ARCHIVE = $(PLUGIN)-$(VERSION)
PACKAGE = vdr-$(ARCHIVE)
### Includes, Defines and dependencies (add further entries here):
### The name of the shared object file:
INCLUDES += -I$(VDRDIR)/include
SOFILE = libvdr-$(PLUGIN).so
DEFINES += $(CONFIG) -D_GNU_SOURCE -DPLUGIN_NAME_I18N='"$(PLUGIN)"' \
### Parse softhddevice config
ifeq ($(ALSA),1)
CONFIG += -DUSE_ALSA
_CFLAGS += $(shell pkg-config --cflags alsa)
LIBS += $(shell pkg-config --libs alsa)
endif
ifeq ($(OSS),1)
CONFIG += -DUSE_OSS
endif
ifeq ($(VDPAU),1)
CONFIG += -DUSE_VDPAU
_CFLAGS += $(shell pkg-config --cflags vdpau)
LIBS += $(shell pkg-config --libs vdpau)
endif
ifeq ($(VAAPI),1)
CONFIG += -DUSE_VAAPI
_CFLAGS += $(shell pkg-config --cflags libva-x11 libva)
LIBS += $(shell pkg-config --libs libva-x11 libva)
ifeq ($(OPENGL),1)
_CFLAGS += $(shell pkg-config --cflags libva-glx)
LIBS += $(shell pkg-config --libs libva-glx)
endif
endif
ifeq ($(OPENGL),1)
CONFIG += -DUSE_GLX
_CFLAGS += $(shell pkg-config --cflags gl glu)
LIBS += $(shell pkg-config --libs gl glu)
endif
ifeq ($(SCREENSAVER),1)
CONFIG += -DUSE_SCREENSAVER
_CFLAGS += $(shell pkg-config --cflags xcb-screensaver xcb-dpms)
LIBS += $(shell pkg-config --libs xcb-screensaver xcb-dpms)
endif
ifeq ($(SWRESAMPLE),1)
CONFIG += -DUSE_SWRESAMPLE
_CFLAGS += $(shell pkg-config --cflags libswresample)
LIBS += $(shell pkg-config --libs libswresample)
endif
ifeq ($(AVRESAMPLE),1)
CONFIG += -DUSE_AVRESAMPLE
_CFLAGS += $(shell pkg-config --cflags libavresample)
LIBS += $(shell pkg-config --libs libavresample)
endif
_CFLAGS += $(shell pkg-config --cflags libavcodec x11 x11-xcb xcb xcb-icccm)
LIBS += -lrt $(shell pkg-config --libs libavcodec x11 x11-xcb xcb xcb-icccm)
### Includes and Defines (add further entries here):
INCLUDES +=
DEFINES += -DPLUGIN_NAME_I18N='"$(PLUGIN)"' -D_GNU_SOURCE $(CONFIG) \
$(if $(GIT_REV), -DGIT_REV='"$(GIT_REV)"')
_CFLAGS = $(DEFINES) $(INCLUDES) \
$(shell pkg-config --cflags libavcodec) \
`pkg-config --cflags x11 x11-xcb xcb xcb-xv xcb-shm xcb-dpms xcb-atom\
xcb-screensaver xcb-randr xcb-glx xcb-icccm xcb-keysyms`\
`pkg-config --cflags gl glu` \
$(if $(findstring USE_VDPAU,$(CONFIG)), \
`pkg-config --cflags vdpau`) \
$(if $(findstring USE_VAAPI,$(CONFIG)), \
`pkg-config --cflags libva-x11 libva-glx libva`) \
$(if $(findstring USE_ALSA,$(CONFIG)), \
`pkg-config --cflags alsa`)
### Make it standard
#override _CFLAGS += -Werror
override CXXFLAGS += $(_CFLAGS)
override CFLAGS += $(_CFLAGS)
LIBS += -lrt \
$(shell pkg-config --libs libavcodec) \
`pkg-config --libs x11 x11-xcb xcb xcb-xv xcb-shm xcb-dpms xcb-atom\
xcb-screensaver xcb-randr xcb-glx xcb-icccm xcb-keysyms`\
`pkg-config --libs gl glu` \
$(if $(findstring USE_VDPAU,$(CONFIG)), \
`pkg-config --libs vdpau`) \
$(if $(findstring USE_VAAPI,$(CONFIG)), \
`pkg-config --libs libva-x11 libva-glx libva`) \
$(if $(findstring USE_ALSA,$(CONFIG)), \
`pkg-config --libs alsa`)
override CXXFLAGS += $(_CFLAGS) $(DEFINES) $(INCLUDES) \
-g -W -Wall -Wextra -Winit-self -Werror=overloaded-virtual
override CFLAGS += $(_CFLAGS) $(DEFINES) $(INCLUDES) \
-g -W -Wall -Wextra -Winit-self -Wdeclaration-after-statement
### The object files (add further files here):
OBJS = $(PLUGIN).o softhddev.o video.o audio.o codec.o ringbuffer.o
SRCS = $(wildcard $(OBJS:.o=.c)) $(PLUGIN).cpp
### The main target:
all: libvdr-$(PLUGIN).so i18n
### Implicit rules:
#
#%.o: %.cpp
# $(CXX) $(CXXFLAGS) -c $(DEFINES) $(INCLUDES) $<
all: $(SOFILE) i18n
### Dependencies:
MAKEDEP = $(CC) -MM -MG
MAKEDEP = $(CXX) -MM -MG
DEPFILE = .dependencies
$(DEPFILE): Makefile
@$(MAKEDEP) $(DEFINES) $(INCLUDES) $(SRCS) >$@
$(OBJS): Makefile
@$(MAKEDEP) $(CXXFLAGS) $(SRCS) > $@
-include $(DEPFILE)
### Internationalization (I18N):
PODIR = po
LOCALEDIR = $(VDRDIR)/locale
I18Npo = $(wildcard $(PODIR)/*.po)
I18Nmsgs = $(addprefix $(LOCALEDIR)/, $(addsuffix /LC_MESSAGES/vdr-$(PLUGIN).mo, $(notdir $(foreach file, $(I18Npo), $(basename $(file))))))
I18Nmo = $(addsuffix .mo, $(foreach file, $(I18Npo), $(basename $(file))))
I18Nmsgs = $(addprefix $(DESTDIR)$(LOCDIR)/, $(addsuffix /LC_MESSAGES/vdr-$(PLUGIN).mo, $(notdir $(foreach file, $(I18Npo), $(basename $(file))))))
I18Npot = $(PODIR)/$(PLUGIN).pot
%.mo: %.po
msgfmt -c -o $@ $<
$(I18Npot): $(wildcard *.cpp) $(wildcard *.c)
$(I18Npot): $(SRCS)
xgettext -C -cTRANSLATORS --no-wrap --no-location -k -ktr -ktrNOOP \
-k_ -k_N --package-name=VDR --package-version=$(VDRVERSION) \
--msgid-bugs-address='<see README>' -o $@ $^
-k_ -k_N --package-name=vdr-$(PLUGIN) --package-version=$(VERSION) \
--msgid-bugs-address='<see README>' -o $@ `ls $^`
%.po: $(I18Npot)
msgmerge -U --no-wrap --no-location --backup=none -q $@ $<
msgmerge -U --no-wrap --no-location --backup=none -q -N $@ $<
@touch $@
$(I18Nmsgs): $(LOCALEDIR)/%/LC_MESSAGES/vdr-$(PLUGIN).mo: $(PODIR)/%.mo
@mkdir -p $(dir $@)
cp $< $@
$(I18Nmsgs): $(DESTDIR)$(LOCDIR)/%/LC_MESSAGES/vdr-$(PLUGIN).mo: $(PODIR)/%.mo
install -D -m644 $< $@
.PHONY: i18n
i18n: $(I18Nmsgs) $(I18Npot)
i18n: $(I18Nmo) $(I18Npot)
install-i18n: $(I18Nmsgs)
### Targets:
libvdr-$(PLUGIN).so: $(OBJS) Makefile
$(CXX) $(CXXFLAGS) $(LDFLAGS) -shared -fPIC $(OBJS) -o $@ $(LIBS)
@cp --remove-destination $@ $(LIBDIR)/$@.$(APIVERSION)
$(OBJS): Makefile
$(SOFILE): $(OBJS)
$(CXX) $(CXXFLAGS) $(LDFLAGS) -shared $(OBJS) $(LIBS) -o $@
install-lib: $(SOFILE)
install -D $^ $(DESTDIR)$(LIBDIR)/$^.$(APIVERSION)
install: install-lib install-i18n
dist: $(I18Npo) clean
@-rm -rf $(TMPDIR)/$(ARCHIVE)
@ -162,19 +219,20 @@ dist: $(I18Npo) clean
@echo Distribution package created as $(PACKAGE).tgz
clean:
@-rm -f $(OBJS) $(DEPFILE) *.so *.tgz core* *~ $(PODIR)/*.mo $(PODIR)/*.pot
@-rm -f $(PODIR)/*.mo $(PODIR)/*.pot
@-rm -f $(OBJS) $(DEPFILE) *.so *.tgz core* *~
install: libvdr-$(PLUGIN).so
cp --remove-destination libvdr-$(PLUGIN).so \
/usr/lib/vdr/plugins/libvdr-$(PLUGIN).so.$(APIVERSION)
## Private Targets:
HDRS= $(wildcard *.h)
indent:
for i in $(wildcard $(OBJS:.o=.c)) $(HDRS); do \
indent $$i; unexpand -a $$i > $$i.up; mv $$i.up $$i; \
for i in $(SRCS) $(HDRS); do \
indent $$i; \
unexpand -a $$i | sed -e s/constconst/const/ > $$i.up; \
mv $$i.up $$i; \
done
video_test: video.c Makefile
$(CC) -DVIDEO_TEST -DVERSION='"$(VERSION)"' $(CFLAGS) $(LDFLAGS) $< $(LIBS) \
-o $@
$(CC) -DVIDEO_TEST -DVERSION='"$(VERSION)"' $(CFLAGS) $(LDFLAGS) $< \
$(LIBS) -o $@

View File

@ -1,6 +1,6 @@
@file README.txt @brief A software HD output device for VDR
Copyright (c) 2011, 2012 by Johns. All Rights Reserved.
Copyright (c) 2011 - 2013 by Johns. All Rights Reserved.
Contributor(s):
@ -20,25 +20,27 @@ $Id$
A software and GPU emulated HD output device plugin for VDR.
o Video decoder CPU / VA-API / VDPAU
o Video output VA-API / VDPAU
o Video decoder CPU / VDPAU
o Video output VDPAU
o Audio FFMpeg / Alsa / Analog
o Audio FFMpeg / Alsa / Digital
o Audio FFMpeg / OSS / Analog
o HDMI/SPDIF pass-through
o Software volume, compression, normalize and channel resample
o YaepgHD support
o VDR ScaleVideo API
o Software deinterlacer Bob (VA-API only)
o Autocrop
o Grab image (VDPAU only)
o Suspend
o Suspend / Dettach
o Letterbox, Stretch and Center cut-out video display modes
o atmo light support with plugin http://github.com/durchflieger/DFAtmo
o PIP (Picture-in-Picture) (VDPAU only)
o planned: Video decoder VA-API Branch: vaapi-ext/staging
o planned: Video output XvBA / Opengl / Xv
o planned: VA-API grab image
o planned: Improved Software Deinterlacer (yadif or/and ffmpeg filters)
o planned: Remove VA-API decoder and output support
o planned: Video decoder OpenMax
o planned: Video output Opengl / Xv
o planned: Improved software deinterlacer (yadif or/and ffmpeg filters)
o XvBa support is no longer planned (use future Radeon UVD VDPAU)
To compile you must have the 'requires' installed.
@ -56,8 +58,8 @@ Install:
git clone git://projects.vdr-developer.org/vdr-plugin-softhddevice.git
cd vdr-plugin-softhddevice
make VDRDIR=<path-to-your-vdr-files> LIBDIR=.
gentoo: make VDRDIR=/usr/include/vdr LIBDIR=.
make
make install
2a) tarball
@ -66,10 +68,11 @@ Install:
tar vxf vdr-softhddevice-*.tar.bz2
cd softhddevice-*
make VDRDIR=<path-to-your-vdr-files> LIBDIR=.
make
make install
You can edit Makefile to enable/disable VDPAU / VA-API / Alsa / OSS
support.
support. The default is to autodetect as much as possible.
Setup: environment
------
@ -81,14 +84,12 @@ Setup: environment
if set don't use the hardware decoders
NO_MPEG_HW=1
if set don't use the hardware decoder for mpeg1/2
STUDIO_LEVELS=1
if set use studio levels with vdpau (deprecated use setup)
only if alsa is configured
ALSA_DEVICE=default
alsa PCM device name
ALSA_AC3_DEVICE=
alsa AC3/pass-though device name
ALSA_PASSTHROUGH_DEVICE=
alsa pass-though (AC-3,E-AC-3,DTS,...) device name
ALSA_MIXER=default
alsa control device name
ALSA_MIXER_CHANNEL=PCM
@ -97,8 +98,8 @@ Setup: environment
only if oss is configured
OSS_AUDIODEV=/dev/dsp
oss dsp device name
OSS_AC3_AUDIODEV=
oss AC3/pass-though device name
OSS_PASSTHROUGHDEV=
oss pass-though (AC-3,E-AC-3,DTS,...) device name
OSS_MIXERDEV=/dev/mixer
oss mixer device name
OSS_MIXER_CHANNEL=pcm
@ -128,7 +129,7 @@ Setup: /etc/vdr/setup.conf
softhddevice.<res>.Deinterlace = 0
0 = bob, 1 = weave, 2 = temporal, 3 = temporal_spatial, 4 = software
(only 0, 1 supported with vaapi)
(only 0, 1, 4 supported with VA-API)
softhddevice.<res>.SkipChromaDeinterlace = 0
0 = disabled, 1 = enabled (for slower cards, poor qualität)
@ -154,13 +155,17 @@ Setup: /etc/vdr/setup.conf
delay audio or delay video
softhddevice.AudioPassthrough = 0
0 = none, 1 = AC-3
0 = none, 1 = PCM, 2 = MPA, 4 = AC-3, 8 = EAC-3, -X disable
for AC-3 the pass-through device is used.
for PCM/AC-3/EAC-3 the pass-through device is used and the audio
stream is passed undecoded to the output device.
z.b. 12 = AC-3+EAC-3, 13 = PCM+AC-3+EAC-3
note: MPA/DTS/TrueHD/... aren't supported yet
negative values disable passthrough
softhddevice.AudioDownmix = 0
0 = none, 1 = downmix
downmix AC-3 to stero.
Use ffmpeg/libav downmix of AC-3/EAC-3 audio to stereo.
softhddevice.AudioSoftvol = 0
0 = off, use hardware volume control
@ -228,11 +233,45 @@ Setup: /etc/vdr/setup.conf
0 disable black picture during channel switch
1 enable black picture during channel switch
VideoDisplayFormat = ?
softhddevice.ClearOnSwitch = 0
0 keep video und audio buffers during channel switch
1 clear video and audio buffers on channel switch
softhddevice.Video4to3DisplayFormat = 1
0 pan and scan
1 letter box
2 center cut-out
softhddevice.VideoOtherDisplayFormat = 1
0 pan and scan
1 pillar box
2 center cut-out
softhddevice.pip.X = 79
softhddevice.pip.Y = 78
softhddevice.pip.Width = 18
softhddevice.pip.Height = 18
PIP pip window position and size in percent.
softhddevice.pip.VideoX = 0
softhddevice.pip.VideoY = 0
softhddevice.pip.VideoWidth = 0
softhddevice.pip.VideoHeight = 0
PIP video window position and size in percent.
softhddevice.pip.Alt.X = 0
softhddevice.pip.Alt.Y = 50
softhddevice.pip.Alt.Width = 0
softhddevice.pip.Alt.Height = 50
PIP alternative pip window position and size in percent.
softhddevice.pip.Alt.VideoX = 0
softhddevice.pip.Alt.VideoY = 0
softhddevice.pip.Alt.VideoWidth = 0
softhddevice.pip.Alt.VideoHeight = 50
PIP alternative video window position and size in percent.
Setup: /etc/vdr/remote.conf
------
@ -282,6 +321,7 @@ Keymacros:
@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 1 5 toggle ac3 mixdown
@softhddevice Blue 2 0 disable fullscreen
@softhddevice Blue 2 1 enable fullscreen
@softhddevice Blue 2 2 toggle fullscreen
@ -305,14 +345,19 @@ Warning:
Known Bugs:
-----------
VA-API doesn't v-sync 1080i streams
VA-API doesn't v-sync h264 interlaced streams
vdr-image not working
Requires:
---------
media-video/vdr (version >=1.7.xx)
Video Disk Recorder - turns a pc into a powerful set top box
for DVB.
http://www.tvdr.de/
media-video/ffmpeg (version >=0.7)
Complete solution to record, convert and stream audio and
video. Includes libavcodec.
video. Includes libavcodec and libswresample.
http://ffmpeg.org
media-libs/alsa-lib
Advanced Linux Sound Architecture Library
@ -320,7 +365,7 @@ Requires:
or
kernel support for oss/oss4 or alsa oss emulation
x11-libs/libva
x11-libs/libva (deprecated)
Video Acceleration (VA) API for Linux
http://www.freedesktop.org/wiki/Software/vaapi
x11-libs/libva-intel-driver

20
Todo
View File

@ -1,6 +1,6 @@
@file Todo @brief A software HD output device for VDR
Copyright (c) 2011, 2012 by Johns. All Rights Reserved.
Copyright (c) 2011 - 2013 by Johns. All Rights Reserved.
Contributor(s):
@ -19,6 +19,9 @@ GNU Affero General Public License for more details.
$Id: $
missing:
documentation of the PIP hotkeys.
svdrp help page missing PIP hotkeys.
svdrp stat: add X11 crashed status.
more software deinterlace (yadif, ...)
more software decoder with software deinterlace
suspend output / energie saver: stop and restart X11
@ -39,11 +42,16 @@ video:
some low-bandwidth tv channels have hiccups.
check start with 24Hz display rate
crash with ffmpeg without vaapi and vdpau.
still-picture of PES recordings should use VideoMpegEnqueue.
convert PIX_FMT_... PixelFormat to new names AV_PIX_FMT_..., AVPixelFormat.
atmo service support 3D grab
no warnings during still picture
vdpau:
software deinterlace path not working.
OSD looses transparency, during channel switch.
OSD looses transparency, while moving cut marks.
ffmpeg >=1.2 supports same API like VA-API.
libva:
yaepghd (VaapiSetOutputPosition) support
@ -54,6 +62,8 @@ libva:
[drm:i915_hangcheck_elapsed] *ERROR* Hangcheck timer elapsed... GPU hung
[drm:i915_wait_request] *ERROR* i915_wait_request returns -11 ...
missing OSD support for 3d SBS / Top-Bottom streams, like VPDAU.
PIP support / multistream handling
VA-AP VaapiCleanup crash after channel without video.
libva: branch vaapi-ext / staging
add support for vaapi-ext / staging
@ -110,23 +120,21 @@ plugins:
setup:
Setup of decoder type.
Setup of output type.
Setup of display type.
Setup 4:3 zoom type
Some setup parameters are not used until restart.
Can a notice be added to the setup menu?
unsorted:
stoping vdr while plugin is suspended opens and closes a window.
svdrp prim: support plugin names for device numbers.
Workaround exists: hangup PipVideoStream -> Vdpau_get_format -> xcb -> poll
+ lock DecoderLockMutex
check compiletime and runtime ffmpeg/libav version during init.
future features (not planed for 1.0 - 1.5)
video out with xv
video out with opengl
video out with xvba
software decoder for xv / opengl
multistream handling
pip support
save and use auto-crop with channel zapping
upmix stereo to AC-3 (supported by alsa plugin)

410
audio.c
View File

@ -1,7 +1,7 @@
///
/// @file audio.c @brief Audio module
///
/// Copyright (c) 2009 - 2012 by Johns. All Rights Reserved.
/// Copyright (c) 2009 - 2014 by Johns. All Rights Reserved.
///
/// Contributor(s):
///
@ -40,6 +40,7 @@
//#define USE_ALSA ///< enable alsa support
//#define USE_OSS ///< enable OSS support
#define USE_AUDIO_THREAD ///< use thread for audio playback
#define USE_AUDIO_MIXER ///< use audio module mixer
#include <stdio.h>
#include <stdint.h>
@ -87,7 +88,7 @@
#endif
#endif
#include <alsa/iatomic.h> // portable atomic_t
#include "iatomic.h" // portable atomic_t
#include "ringbuffer.h"
#include "misc.h"
@ -122,13 +123,16 @@ static const AudioModule NoopModule; ///< forward definition of noop module
//----------------------------------------------------------------------------
char AudioAlsaDriverBroken; ///< disable broken driver message
char AudioAlsaNoCloseOpen; ///< disable alsa close/open fix
char AudioAlsaCloseOpenDelay; ///< enable alsa close/open delay fix
static const char *AudioModuleName; ///< which audio module to use
/// Selected audio module.
static const AudioModule *AudioUsedModule = &NoopModule;
static const char *AudioPCMDevice; ///< PCM device name
static const char *AudioAC3Device; ///< AC3 device name
static const char *AudioPassthroughDevice; ///< Passthrough device name
static char AudioAppendAES; ///< flag automatic append AES
static const char *AudioMixerDevice; ///< mixer device name
static const char *AudioMixerChannel; ///< mixer channel name
static char AudioDoingInit; ///> flag in init, reduce error
@ -145,6 +149,7 @@ static int AudioBufferTime = 336; ///< audio buffer time in ms
static pthread_t AudioThread; ///< audio play thread
static pthread_mutex_t AudioMutex; ///< audio condition mutex
static pthread_cond_t AudioStartCond; ///< condition variable
static char AudioThreadStop; ///< stop audio thread
#else
static const int AudioThread; ///< dummy audio thread
#endif
@ -163,7 +168,6 @@ static int AudioStereoDescent; ///< volume descent for stereo
static int AudioVolume; ///< current volume (0 .. 1000)
extern int VideoAudioDelay; ///< import audio/video delay
extern int VideoGetBuffers(void); ///< Get number of input buffers.
/// default ring buffer size ~2s 8ch 16bit (3 * 5 * 7 * 8)
static const unsigned AudioRingBufferSize = 3 * 5 * 7 * 8 * 2 * 1000;
@ -178,7 +182,7 @@ enum _audio_rates
//Audio88200, ///< 88.2Khz
//Audio96000, ///< 96.0Khz
//Audio176400, ///< 176.4Khz
//Audio192000, ///< 192.0Khz
Audio192000, ///< 192.0Khz
AudioRatesMax ///< max index
};
@ -188,9 +192,9 @@ static int AudioRatesInHw[AudioRatesMax];
/// input to hardware channel matrix
static int AudioChannelMatrix[AudioRatesMax][9];
/// rates tables
/// rates tables (must be sorted by frequency)
static const unsigned AudioRatesTable[AudioRatesMax] = {
44100, 48000,
44100, 48000, 192000
};
//----------------------------------------------------------------------------
@ -401,6 +405,8 @@ static void AudioSoftAmplifier(int16_t * samples, int count)
}
}
#ifdef USE_AUDIO_MIXER
/**
** Upmix mono to stereo.
**
@ -484,7 +490,7 @@ static void AudioSurround2Stereo(const int16_t * in, int in_chan, int frames,
r += in[3] * 200; // Rs
l += in[4] * 300; // C
r += in[4] * 300;
l += in[5] * 300; // LFE
l += in[5] * 100; // LFE
r += in[5] * 100;
break;
case 7: // 7.0
@ -547,6 +553,13 @@ static void AudioUpmix(const int16_t * in, int in_chan, int frames,
/**
** Resample ffmpeg sample format to hardware format.
**
** FIXME: use libswresample for this and move it to codec.
** FIXME: ffmpeg to alsa conversion is already done in codec.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 Rl Rr -> alsa L R Ls Rs C LFE Rl Rr
**
** @param in input sample buffer
** @param in_chan nr. of input channels
** @param frames number of frames in sample buffer
@ -582,6 +595,9 @@ static void AudioResample(const int16_t * in, int in_chan, int frames,
AudioSurround2Stereo(in, in_chan, frames, out);
break;
case 5 * 8 + 6:
case 3 * 8 + 8:
case 5 * 8 + 8:
case 6 * 8 + 8:
AudioUpmix(in, in_chan, frames, out, out_chan);
break;
@ -594,6 +610,8 @@ static void AudioResample(const int16_t * in, int in_chan, int frames,
}
}
#endif
//----------------------------------------------------------------------------
// ring buffer
//----------------------------------------------------------------------------
@ -606,7 +624,7 @@ static void AudioResample(const int16_t * in, int in_chan, int frames,
typedef struct _audio_ring_ring_
{
char FlushBuffers; ///< flag: flush buffers
char UseAc3; ///< flag: use ac3 pass-through
char Passthrough; ///< flag: use pass-through (AC-3, ...)
int16_t PacketSize; ///< packet size
unsigned HwSampleRate; ///< hardware sample rate in Hz
unsigned HwChannels; ///< hardware number of channels
@ -624,29 +642,34 @@ static atomic_t AudioRingFilled; ///< how many of the ring is used
static unsigned AudioStartThreshold; ///< start play, if filled
/**
** Add sample-rate, number of channel change to ring.
** Add sample-rate, number of channels change to ring.
**
** @param sample_rate sample-rate frequency
** @param channels number of channels
** @param use_ac3 use ac3/pass-through device
** @param passthrough use /pass-through (AC-3, ...) device
**
** @retval -1 error
** @retval 0 okay
**
** @note this function shouldn't fail. Checks are done during AudoInit.
*/
static int AudioRingAdd(unsigned sample_rate, int channels, int use_ac3)
static int AudioRingAdd(unsigned sample_rate, int channels, int passthrough)
{
unsigned u;
// search supported sample-rates
for (u = 0; u < AudioRatesMax; ++u) {
if (AudioRatesTable[u] == sample_rate) {
goto found;
}
if (AudioRatesTable[u] > sample_rate) {
break;
}
}
if (u == AudioRatesMax) { // unsupported sample-rate
Error(_("audio: %dHz sample-rate unsupported\n"), sample_rate);
return -1;
}
Error(_("audio: %dHz sample-rate unsupported\n"), sample_rate);
return -1; // unsupported sample-rate
found:
if (!AudioChannelMatrix[u][channels]) {
Error(_("audio: %d channels unsupported\n"), channels);
return -1; // unsupported nr. of channels
@ -659,9 +682,8 @@ static int AudioRingAdd(unsigned sample_rate, int channels, int use_ac3)
}
AudioRingWrite = (AudioRingWrite + 1) % AUDIO_RING_MAX;
// FIXME: don't flush buffers here
AudioRing[AudioRingWrite].FlushBuffers = 1;
AudioRing[AudioRingWrite].UseAc3 = use_ac3;
AudioRing[AudioRingWrite].FlushBuffers = 0;
AudioRing[AudioRingWrite].Passthrough = passthrough;
AudioRing[AudioRingWrite].PacketSize = 0;
AudioRing[AudioRingWrite].InSampleRate = sample_rate;
AudioRing[AudioRingWrite].InChannels = channels;
@ -670,6 +692,9 @@ static int AudioRingAdd(unsigned sample_rate, int channels, int use_ac3)
AudioRing[AudioRingWrite].PTS = INT64_C(0x8000000000000000);
RingBufferReset(AudioRing[AudioRingWrite].RingBuffer);
Debug(3, "audio: %d ring buffer prepared\n",
atomic_read(&AudioRingFilled) + 1);
atomic_inc(&AudioRingFilled);
#ifdef USE_AUDIO_THREAD
@ -817,8 +842,9 @@ static int AlsaPlayRingbuffer(void)
if (!avail) { // full or buffer empty
break;
}
// muting ac3, can produce disturbance
if (AudioMute || (AudioSoftVolume && !AudioRing[AudioRingRead].UseAc3)) {
// muting pass-through AC-3, can produce disturbance
if (AudioMute || (AudioSoftVolume
&& !AudioRing[AudioRingRead].Passthrough)) {
// FIXME: quick&dirty cast
AudioSoftAmplifier((int16_t *) p, avail);
// FIXME: if not all are written, we double amplify them
@ -917,7 +943,6 @@ static int AlsaThread(void)
return -1;
}
for (;;) {
pthread_testcancel();
if (AudioPaused) {
return 1;
}
@ -965,23 +990,43 @@ static int AlsaThread(void)
/**
** Open alsa pcm device.
**
** @param use_ac3 use ac3/pass-through device
** @param passthrough use pass-through (AC-3, ...) device
*/
static snd_pcm_t *AlsaOpenPCM(int use_ac3)
static snd_pcm_t *AlsaOpenPCM(int passthrough)
{
const char *device;
snd_pcm_t *handle;
int err;
// &&|| hell
if (!(use_ac3 && ((device = AudioAC3Device)
|| (device = getenv("ALSA_AC3_DEVICE"))))
if (!(passthrough && ((device = AudioPassthroughDevice)
|| (device = getenv("ALSA_PASSTHROUGH_DEVICE"))))
&& !(device = AudioPCMDevice) && !(device = getenv("ALSA_DEVICE"))) {
device = "default";
}
if (!AudioDoingInit) { // reduce blabla during init
Info(_("audio/alsa: using %sdevice '%s'\n"), use_ac3 ? "ac3 " : "",
device);
Info(_("audio/alsa: using %sdevice '%s'\n"),
passthrough ? "pass-through " : "", device);
}
//
// for AC3 pass-through try to set the non-audio bit, use AES0=6
//
if (passthrough && AudioAppendAES) {
#if 0
// FIXME: not yet finished
char *buf;
const char *s;
int n;
n = strlen(device);
buf = alloca(n + sizeof(":AES0=6") + 1);
strcpy(buf, device);
if (!(s = strchr(buf, ':'))) {
// no alsa parameters
strcpy(buf + n, ":AES=6");
}
Debug(3, "audio/alsa: try '%s'\n", buf);
#endif
}
// open none blocking; if device is already used, we don't want wait
if ((err =
@ -1148,7 +1193,7 @@ static int64_t AlsaGetDelay(void)
**
** @param freq sample frequency
** @param channels number of channels
** @param use_ac3 use ac3/pass-through device
** @param passthrough use pass-through (AC-3, ...) device
**
** @retval 0 everything ok
** @retval 1 didn't support frequency/channels combination
@ -1156,7 +1201,7 @@ static int64_t AlsaGetDelay(void)
**
** @todo FIXME: remove pointer for freq + channels
*/
static int AlsaSetup(int *freq, int *channels, int use_ac3)
static int AlsaSetup(int *freq, int *channels, int passthrough)
{
snd_pcm_uframes_t buffer_size;
snd_pcm_uframes_t period_size;
@ -1164,20 +1209,26 @@ static int AlsaSetup(int *freq, int *channels, int use_ac3)
int delay;
if (!AlsaPCMHandle) { // alsa not running yet
// FIXME: if open fails for ac3, we never recover
// FIXME: if open fails for fe. pass-through, we never recover
return -1;
}
if (1) { // close+open to fix HDMI no sound bug
if (!AudioAlsaNoCloseOpen) { // close+open to fix HDMI no sound bug
snd_pcm_t *handle;
handle = AlsaPCMHandle;
// FIXME: need lock
// no lock needed, thread exit in main loop only
//Debug(3, "audio: %s [\n", __FUNCTION__);
AlsaPCMHandle = NULL; // other threads should check handle
snd_pcm_close(handle);
if (!(handle = AlsaOpenPCM(use_ac3))) {
if (AudioAlsaCloseOpenDelay) {
usleep(50 * 1000); // 50ms delay for alsa recovery
}
// FIXME: can use multiple retries
if (!(handle = AlsaOpenPCM(passthrough))) {
return -1;
}
AlsaPCMHandle = handle;
//Debug(3, "audio: %s ]\n", __FUNCTION__);
}
for (;;) {
@ -1186,21 +1237,29 @@ static int AlsaSetup(int *freq, int *channels, int use_ac3)
AlsaUseMmap ? SND_PCM_ACCESS_MMAP_INTERLEAVED :
SND_PCM_ACCESS_RW_INTERLEAVED, *channels, *freq, 1,
96 * 1000))) {
// try reduced buffer size (needed for sunxi)
// FIXME: alternativ make this configurable
if ((err =
snd_pcm_set_params(AlsaPCMHandle, SND_PCM_FORMAT_S16,
AlsaUseMmap ? SND_PCM_ACCESS_MMAP_INTERLEAVED :
SND_PCM_ACCESS_RW_INTERLEAVED, *channels, *freq, 1,
72 * 1000))) {
/*
if ( err == -EBADFD ) {
snd_pcm_close(AlsaPCMHandle);
AlsaPCMHandle = NULL;
continue;
}
*/
/*
if ( err == -EBADFD ) {
snd_pcm_close(AlsaPCMHandle);
AlsaPCMHandle = NULL;
continue;
}
*/
if (!AudioDoingInit) {
Error(_("audio/alsa: set params error: %s\n"),
snd_strerror(err));
if (!AudioDoingInit) {
Error(_("audio/alsa: set params error: %s\n"),
snd_strerror(err));
}
// FIXME: must stop sound, AudioChannels ... invalid
return -1;
}
// FIXME: must stop sound, AudioChannels ... invalid
return -1;
}
break;
}
@ -1434,7 +1493,7 @@ static int OssPlayRingbuffer(void)
break; // bi.bytes could become negative!
}
if (AudioSoftVolume && !AudioRing[AudioRingRead].UseAc3) {
if (AudioSoftVolume && !AudioRing[AudioRingRead].Passthrough) {
// FIXME: quick&dirty cast
AudioSoftAmplifier((int16_t *) p, bi.bytes);
// FIXME: if not all are written, we double amplify them
@ -1499,7 +1558,6 @@ static int OssThread(void)
for (;;) {
struct pollfd fds[1];
pthread_testcancel();
if (AudioPaused) {
return 1;
}
@ -1541,22 +1599,22 @@ static int OssThread(void)
/**
** Open OSS pcm device.
**
** @param use_ac3 use ac3/pass-through device
** @param passthrough use pass-through (AC-3, ...) device
*/
static int OssOpenPCM(int use_ac3)
static int OssOpenPCM(int passthrough)
{
const char *device;
int fildes;
// &&|| hell
if (!(use_ac3 && ((device = AudioAC3Device)
|| (device = getenv("OSS_AC3_AUDIODEV"))))
if (!(passthrough && ((device = AudioPassthroughDevice)
|| (device = getenv("OSS_PASSTHROUGHDEV"))))
&& !(device = AudioPCMDevice) && !(device = getenv("OSS_AUDIODEV"))) {
device = "/dev/dsp";
}
if (!AudioDoingInit) {
Info(_("audio/oss: using %sdevice '%s'\n"), use_ac3 ? "ac3 " : "",
device);
Info(_("audio/oss: using %sdevice '%s'\n"),
passthrough ? "pass-through " : "", device);
}
if ((fildes = open(device, O_WRONLY)) < 0) {
@ -1703,15 +1761,15 @@ static int64_t OssGetDelay(void)
/**
** Setup OSS audio for requested format.
**
** @param sample_rate sample rate/frequency
** @param sample_rate sample rate/frequency
** @param channels number of channels
** @param use_ac3 use ac3/pass-through device
** @param passthrough use pass-through (AC-3, ...) device
**
** @retval 0 everything ok
** @retval 1 didn't support frequency/channels combination
** @retval -1 something gone wrong
*/
static int OssSetup(int *sample_rate, int *channels, int use_ac3)
static int OssSetup(int *sample_rate, int *channels, int passthrough)
{
int ret;
int tmp;
@ -1719,17 +1777,17 @@ static int OssSetup(int *sample_rate, int *channels, int use_ac3)
audio_buf_info bi;
if (OssPcmFildes == -1) { // OSS not ready
// FIXME: if open fails for ac3, we never recover
// FIXME: if open fails for fe. pass-through, we never recover
return -1;
}
if (1) { // close+open for pcm / ac3
if (1) { // close+open for pcm / AC-3
int fildes;
fildes = OssPcmFildes;
OssPcmFildes = -1;
close(fildes);
if (!(fildes = OssOpenPCM(use_ac3))) {
if (!(fildes = OssOpenPCM(passthrough))) {
return -1;
}
OssPcmFildes = fildes;
@ -1910,13 +1968,14 @@ static void NoopSetVolume( __attribute__ ((unused))
/**
** Noop setup.
**
** @param freq sample frequency
** @param channels number of channels
** @param freq sample frequency
** @param channels number of channels
** @param passthrough use pass-through (AC-3, ...) device
*/
static int NoopSetup( __attribute__ ((unused))
int *channels, __attribute__ ((unused))
int *freq, __attribute__ ((unused))
int use_ac3)
int passthrough)
{
return -1;
}
@ -1954,16 +2013,17 @@ static const AudioModule NoopModule = {
*/
static int AudioNextRing(void)
{
int use_ac3;
int passthrough;
int sample_rate;
int channels;
size_t used;
// update audio format
// not always needed, but check if needed is too complex
use_ac3 = AudioRing[AudioRingRead].UseAc3;
passthrough = AudioRing[AudioRingRead].Passthrough;
sample_rate = AudioRing[AudioRingRead].HwSampleRate;
channels = AudioRing[AudioRingRead].HwChannels;
if (AudioUsedModule->Setup(&sample_rate, &channels, use_ac3)) {
if (AudioUsedModule->Setup(&sample_rate, &channels, passthrough)) {
Error(_("audio: can't set channels %d sample-rate %dHz\n"), channels,
sample_rate);
// FIXME: handle error
@ -1976,12 +2036,18 @@ static int AudioNextRing(void)
AudioResetCompressor();
AudioResetNormalizer();
Debug(3, "audio: a/v next buf(%d,%4zdms)\n", atomic_read(&AudioRingFilled),
(RingBufferUsedBytes(AudioRing[AudioRingRead].RingBuffer) * 1000)
/ (AudioRing[AudioRingWrite].HwSampleRate *
AudioRing[AudioRingWrite].HwChannels * AudioBytesProSample));
// stop, if not enough in next buffer
if (AudioStartThreshold >=
RingBufferUsedBytes(AudioRing[AudioRingRead].RingBuffer)) {
return 1;
used = RingBufferUsedBytes(AudioRing[AudioRingRead].RingBuffer);
if (AudioStartThreshold * 4 < used || (AudioVideoIsReady
&& AudioStartThreshold < used)) {
return 0;
}
return 0;
return 1;
}
/**
@ -1993,6 +2059,12 @@ static void *AudioPlayHandlerThread(void *dummy)
{
Debug(3, "audio: play thread started\n");
for (;;) {
// check if we should stop the thread
if (AudioThreadStop) {
Debug(3, "audio: play thread stopped\n");
return PTHREAD_CANCELED;
}
Debug(3, "audio: wait on start condition\n");
pthread_mutex_lock(&AudioMutex);
AudioRunning = 0;
@ -2003,46 +2075,59 @@ static void *AudioPlayHandlerThread(void *dummy)
pthread_mutex_unlock(&AudioMutex);
Debug(3, "audio: ----> %dms start\n", (AudioUsedBytes() * 1000)
/ (!AudioRing[AudioRingRead].HwSampleRate +
!AudioRing[AudioRingRead].HwChannels +
AudioRing[AudioRingRead].HwSampleRate *
AudioRing[AudioRingRead].HwChannels * AudioBytesProSample));
/ (!AudioRing[AudioRingWrite].HwSampleRate +
!AudioRing[AudioRingWrite].HwChannels +
AudioRing[AudioRingWrite].HwSampleRate *
AudioRing[AudioRingWrite].HwChannels * AudioBytesProSample));
do {
int filled;
int read;
int flush;
int err;
int i;
// check if we should stop the thread
if (AudioThreadStop) {
Debug(3, "audio: play thread stopped\n");
return PTHREAD_CANCELED;
}
// look if there is a flush command in the queue
flush = 0;
filled = atomic_read(&AudioRingFilled);
read = AudioRingRead;
while (filled--) {
i = filled;
while (i--) {
read = (read + 1) % AUDIO_RING_MAX;
if (AudioRing[read].FlushBuffers) {
AudioRing[read].FlushBuffers = 0;
AudioRingRead = read;
atomic_set(&AudioRingFilled, filled);
// handle all flush in queue
flush = 1;
flush = filled - i;
}
}
if (flush) {
Debug(3, "audio: flush %d ring buffer(s)\n", flush);
AudioUsedModule->FlushBuffers();
atomic_sub(flush, &AudioRingFilled);
if (AudioNextRing()) {
Debug(3, "audio: break after flush\n");
break;
}
Debug(3, "audio: continue after flush\n");
}
// try to play some samples
err = AudioUsedModule->Thread();
err = 0;
if (RingBufferUsedBytes(AudioRing[AudioRingRead].RingBuffer)) {
err = AudioUsedModule->Thread();
}
// underrun, check if new ring buffer is available
if (!err) {
int use_ac3;
int passthrough;
int sample_rate;
int channels;
int old_use_ac3;
int old_passthrough;
int old_sample_rate;
int old_channels;
@ -2052,20 +2137,21 @@ static void *AudioPlayHandlerThread(void *dummy)
}
Debug(3, "audio: next ring buffer\n");
old_use_ac3 = AudioRing[AudioRingRead].UseAc3;
old_passthrough = AudioRing[AudioRingRead].Passthrough;
old_sample_rate = AudioRing[AudioRingRead].HwSampleRate;
old_channels = AudioRing[AudioRingRead].HwChannels;
atomic_dec(&AudioRingFilled);
AudioRingRead = (AudioRingRead + 1) % AUDIO_RING_MAX;
use_ac3 = AudioRing[AudioRingRead].UseAc3;
passthrough = AudioRing[AudioRingRead].Passthrough;
sample_rate = AudioRing[AudioRingRead].HwSampleRate;
channels = AudioRing[AudioRingRead].HwChannels;
Debug(3, "audio: thread channels %d frequency %dHz %s\n",
channels, sample_rate, use_ac3 ? "ac3" : "pcm");
channels, sample_rate, passthrough ? "pass-through" : "");
// audio config changed?
if (old_use_ac3 != use_ac3 || old_sample_rate != sample_rate
if (old_passthrough != passthrough
|| old_sample_rate != sample_rate
|| old_channels != channels) {
// FIXME: wait for buffer drain
if (AudioNextRing()) {
@ -2090,6 +2176,7 @@ static void *AudioPlayHandlerThread(void *dummy)
*/
static void AudioInitThread(void)
{
AudioThreadStop = 0;
pthread_mutex_init(&AudioMutex, NULL);
pthread_cond_init(&AudioStartCond, NULL);
pthread_create(&AudioThread, NULL, AudioPlayHandlerThread, NULL);
@ -2103,10 +2190,12 @@ static void AudioExitThread(void)
{
void *retval;
Debug(3, "audio: %s\n", __FUNCTION__);
if (AudioThread) {
if (pthread_cancel(AudioThread)) {
Error(_("audio: can't queue cancel play thread\n"));
}
AudioThreadStop = 1;
AudioRunning = 1; // wakeup thread, if needed
pthread_cond_signal(&AudioStartCond);
if (pthread_join(AudioThread, &retval) || retval != PTHREAD_CANCELED) {
Error(_("audio: can't cancel play thread\n"));
}
@ -2144,7 +2233,6 @@ void AudioEnqueue(const void *samples, int count)
{
size_t n;
int16_t *buffer;
int frames;
#ifdef noDEBUG
static uint32_t last_tick;
@ -2166,28 +2254,40 @@ void AudioEnqueue(const void *samples, int count)
AudioRing[AudioRingWrite].PacketSize = count;
Debug(3, "audio: a/v packet size %d bytes\n", count);
}
if (AudioRing[AudioRingWrite].UseAc3) {
buffer = (void *)samples;
} else {
//
// Convert / resample input to hardware format
//
// audio sample modification allowed and needed?
buffer = (void *)samples;
if (!AudioRing[AudioRingWrite].Passthrough && (AudioCompression
|| AudioNormalize
|| AudioRing[AudioRingWrite].InChannels !=
AudioRing[AudioRingWrite].HwChannels)) {
int frames;
// resample into ring-buffer is too complex in the case of a roundabout
// just use a temporary buffer
frames =
count / (AudioRing[AudioRingWrite].InChannels *
AudioBytesProSample);
buffer =
alloca(frames * AudioRing[AudioRingWrite].HwChannels *
AudioBytesProSample);
#ifdef USE_AUDIO_MIXER
// Convert / resample input to hardware format
AudioResample(samples, AudioRing[AudioRingWrite].InChannels, frames,
buffer, AudioRing[AudioRingWrite].HwChannels);
#else
#ifdef DEBUG
if (AudioRing[AudioRingWrite].InChannels !=
AudioRing[AudioRingWrite].HwChannels) {
Debug(3, "audio: internal failure channels mismatch\n");
return;
}
#endif
memcpy(buffer, samples, count);
#endif
count =
frames * AudioRing[AudioRingWrite].HwChannels *
AudioBytesProSample;
// resample into ring-buffer is too complex in the case of a roundabout
// just use a temporary buffer
if (AudioCompression) { // in place operation
AudioCompressor(buffer, count);
}
@ -2276,11 +2376,12 @@ void AudioVideoReady(int64_t pts)
(used * 90 * 1000) / (AudioRing[AudioRingWrite].HwSampleRate *
AudioRing[AudioRingWrite].HwChannels * AudioBytesProSample);
Debug(3, "audio: a/v buf:%4zdms %s|%s = %dms video ready\n",
Debug(3, "audio: a/v sync buf(%d,%4zdms) %s|%s = %dms %s\n",
atomic_read(&AudioRingFilled),
(used * 1000) / (AudioRing[AudioRingWrite].HwSampleRate *
AudioRing[AudioRingWrite].HwChannels * AudioBytesProSample),
Timestamp2String(audio_pts), Timestamp2String(pts),
(int)(pts - audio_pts) / 90);
Timestamp2String(pts), Timestamp2String(audio_pts),
(int)(pts - audio_pts) / 90, AudioRunning ? "running" : "ready");
if (!AudioRunning) {
int skip;
@ -2291,7 +2392,7 @@ void AudioVideoReady(int64_t pts)
pts - 15 * 20 * 90 - AudioBufferTime * 90 - audio_pts +
VideoAudioDelay;
#ifdef DEBUG
printf("%dms %dms %dms\n", (int)(pts - audio_pts) / 90,
fprintf(stderr, "%dms %dms %dms\n", (int)(pts - audio_pts) / 90,
VideoAudioDelay / 90, skip / 90);
#endif
// guard against old PTS
@ -2304,7 +2405,7 @@ void AudioVideoReady(int64_t pts)
AudioSkip = skip - used;
skip = used;
}
Debug(3, "audio: advance %dms %d/%zd\n",
Debug(3, "audio: sync advance %dms %d/%zd\n",
(skip * 1000) / (AudioRing[AudioRingWrite].HwSampleRate *
AudioRing[AudioRingWrite].HwChannels *
AudioBytesProSample), skip, used);
@ -2372,10 +2473,26 @@ void AudioFlushBuffers(void)
int old;
int i;
if (atomic_read(&AudioRingFilled) >= AUDIO_RING_MAX) {
// wait for space in ring buffer, should never happen
for (i = 0; i < 24 * 2; ++i) {
if (atomic_read(&AudioRingFilled) < AUDIO_RING_MAX) {
break;
}
Debug(3, "audio: flush out of ring buffers\n");
usleep(1 * 1000); // avoid hot polling
}
if (atomic_read(&AudioRingFilled) >= AUDIO_RING_MAX) {
// FIXME: We can set the flush flag in the last wrote ring buffer
Error(_("audio: flush out of ring buffers\n"));
return;
}
}
old = AudioRingWrite;
AudioRingWrite = (AudioRingWrite + 1) % AUDIO_RING_MAX;
AudioRing[AudioRingWrite].FlushBuffers = 1;
AudioRing[AudioRingWrite].UseAc3 = AudioRing[old].UseAc3;
AudioRing[AudioRingWrite].Passthrough = AudioRing[old].Passthrough;
AudioRing[AudioRingWrite].HwSampleRate = AudioRing[old].HwSampleRate;
AudioRing[AudioRingWrite].HwChannels = AudioRing[old].HwChannels;
AudioRing[AudioRingWrite].InSampleRate = AudioRing[old].InSampleRate;
@ -2389,12 +2506,13 @@ void AudioFlushBuffers(void)
atomic_inc(&AudioRingFilled);
// FIXME: wait for flush complete?
// FIXME: wait for flush complete needed?
for (i = 0; i < 24 * 2; ++i) {
if (!AudioRunning) { // wakeup thread to flush buffers
AudioRunning = 1;
pthread_cond_signal(&AudioStartCond);
}
// FIXME: waiting on zero isn't correct, but currently works
if (!atomic_read(&AudioRingFilled)) {
break;
}
@ -2487,7 +2605,7 @@ int64_t AudioGetClock(void)
// delay zero, if no valid time stamp
if ((delay = AudioGetDelay())) {
if (AudioRing[AudioRingRead].UseAc3) {
if (AudioRing[AudioRingRead].Passthrough) {
return AudioRing[AudioRingRead].PTS + 0 * 90 - delay;
}
return AudioRing[AudioRingRead].PTS + 0 * 90 - delay;
@ -2507,7 +2625,7 @@ void AudioSetVolume(int volume)
AudioMute = !volume;
// reduce loudness for stereo output
if (AudioStereoDescent && AudioRing[AudioRingRead].InChannels == 2
&& !AudioRing[AudioRingRead].UseAc3) {
&& !AudioRing[AudioRingRead].Passthrough) {
volume -= AudioStereoDescent;
if (volume < 0) {
volume = 0;
@ -2524,18 +2642,20 @@ void AudioSetVolume(int volume)
/**
** Setup audio for requested format.
**
** @param freq sample frequency
** @param channels number of channels
** @param use_ac3 use ac3/pass-through device
** @param freq sample frequency
** @param channels number of channels
** @param passthrough use pass-through (AC-3, ...) device
**
** @retval 0 everything ok
** @retval 1 didn't support frequency/channels combination
** @retval -1 something gone wrong
**
** @todo add support to report best fitting format.
*/
int AudioSetup(int *freq, int *channels, int use_ac3)
int AudioSetup(int *freq, int *channels, int passthrough)
{
Debug(3, "audio: setup channels %d frequency %dHz %s\n", *channels, *freq,
use_ac3 ? "ac3" : "pcm");
passthrough ? "pass-through" : "");
// invalid parameter
if (!freq || !channels || !*freq || !*channels) {
@ -2543,7 +2663,7 @@ int AudioSetup(int *freq, int *channels, int use_ac3)
// FIXME: set flag invalid setup
return -1;
}
return AudioRingAdd(*freq, *channels, use_ac3);
return AudioRingAdd(*freq, *channels, passthrough);
}
/**
@ -2679,7 +2799,7 @@ void AudioSetDevice(const char *device)
**
** @note this is currently usable with alsa only.
*/
void AudioSetDeviceAC3(const char *device)
void AudioSetPassthroughDevice(const char *device)
{
if (!AudioModuleName) {
AudioModuleName = "alsa"; // detect alsa/OSS
@ -2689,7 +2809,7 @@ void AudioSetDeviceAC3(const char *device)
AudioModuleName = "oss";
}
}
AudioAC3Device = device;
AudioPassthroughDevice = device;
}
/**
@ -2704,6 +2824,20 @@ void AudioSetChannel(const char *channel)
AudioMixerChannel = channel;
}
/**
** Set automatic AES flag handling.
**
** @param onoff turn setting AES flag on or off
*/
void AudioSetAutoAES(int onoff)
{
if (onoff < 0) {
AudioAppendAES ^= 1;
} else {
AudioAppendAES = onoff;
}
}
/**
** Initialize audio output module.
**
@ -2748,10 +2882,16 @@ void AudioInit(void)
// Check which channels/rates/formats are supported
// FIXME: we force 44.1Khz and 48Khz must be supported equal
// FIXME: should use bitmap of channels supported in RatesInHw
// FIXME: use loop over sample-rates
freq = 44100;
AudioRatesInHw[Audio44100] = 0;
for (chan = 1; chan < 9; ++chan) {
if (AudioUsedModule->Setup(&freq, &chan, 0)) {
int tchan;
int tfreq;
tchan = chan;
tfreq = freq;
if (AudioUsedModule->Setup(&tfreq, &tchan, 0)) {
AudioChannelsInHw[chan] = 0;
} else {
AudioChannelsInHw[chan] = chan;
@ -2761,16 +2901,39 @@ void AudioInit(void)
freq = 48000;
AudioRatesInHw[Audio48000] = 0;
for (chan = 1; chan < 9; ++chan) {
int tchan;
int tfreq;
if (!AudioChannelsInHw[chan]) {
continue;
}
if (AudioUsedModule->Setup(&freq, &chan, 0)) {
AudioChannelsInHw[chan] = 0;
tchan = chan;
tfreq = freq;
if (AudioUsedModule->Setup(&tfreq, &tchan, 0)) {
//AudioChannelsInHw[chan] = 0;
} else {
AudioChannelsInHw[chan] = chan;
AudioRatesInHw[Audio48000] |= (1 << chan);
}
}
freq = 192000;
AudioRatesInHw[Audio192000] = 0;
for (chan = 1; chan < 9; ++chan) {
int tchan;
int tfreq;
if (!AudioChannelsInHw[chan]) {
continue;
}
tchan = chan;
tfreq = freq;
if (AudioUsedModule->Setup(&tfreq, &tchan, 0)) {
//AudioChannelsInHw[chan] = 0;
} else {
AudioChannelsInHw[chan] = chan;
AudioRatesInHw[Audio192000] |= (1 << chan);
}
}
// build channel support and conversion table
for (u = 0; u < AudioRatesMax; ++u) {
for (chan = 1; chan < 9; ++chan) {
@ -2852,13 +3015,18 @@ void AudioInit(void)
*/
void AudioExit(void)
{
const AudioModule *module;
Debug(3, "audio: %s\n", __FUNCTION__);
#ifdef USE_AUDIO_THREAD
if (AudioUsedModule->Thread) { // supports threads
AudioExitThread();
}
#endif
AudioUsedModule->Exit();
module = AudioUsedModule;
AudioUsedModule = &NoopModule;
module->Exit();
AudioRingExit();
AudioRunning = 0;
AudioPaused = 0;
@ -2905,7 +3073,7 @@ static void PrintVersion(void)
#ifdef GIT_REV
"(GIT-" GIT_REV ")"
#endif
",\n\t(c) 2009 - 2012 by Johns\n"
",\n\t(c) 2009 - 2013 by Johns\n"
"\tLicense AGPLv3: GNU Affero General Public License version 3\n");
}
@ -2962,7 +3130,7 @@ int main(int argc, char *const argv[])
return -1;
default:
PrintVersion();
fprintf(stderr, "Unkown option '%c'\n", optopt);
fprintf(stderr, "Unknown option '%c'\n", optopt);
return -1;
}
break;

View File

@ -1,7 +1,7 @@
///
/// @file audio.h @brief Audio module headerfile
///
/// Copyright (c) 2009 - 2012 by Johns. All Rights Reserved.
/// Copyright (c) 2009 - 2014 by Johns. All Rights Reserved.
///
/// Contributor(s):
///
@ -48,8 +48,11 @@ 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 AudioSetDeviceAC3(const char *); ///< set pass-through device
/// set pass-through device
extern void AudioSetPassthroughDevice(const char *);
extern void AudioSetChannel(const char *); ///< set mixer channel
extern void AudioSetAutoAES(int); ///< set automatic AES flag handling
extern void AudioInit(void); ///< setup audio module
extern void AudioExit(void); ///< cleanup and exit audio module
@ -58,5 +61,7 @@ extern void AudioExit(void); ///< cleanup and exit audio module
//----------------------------------------------------------------------------
extern char AudioAlsaDriverBroken; ///< disable broken driver message
extern char AudioAlsaNoCloseOpen; ///< disable alsa close/open fix
extern char AudioAlsaCloseOpenDelay; ///< enable alsa close/open delay fix
/// @}

922
codec.c

File diff suppressed because it is too large Load Diff

23
codec.h
View File

@ -1,7 +1,7 @@
///
/// @file codec.h @brief Codec module headerfile
///
/// Copyright (c) 2009 - 2012 by Johns. All Rights Reserved.
/// Copyright (c) 2009 - 2013, 2015 by Johns. All Rights Reserved.
///
/// Contributor(s):
///
@ -23,6 +23,16 @@
/// @addtogroup Codec
/// @{
//----------------------------------------------------------------------------
// Defines
//----------------------------------------------------------------------------
#define CodecPCM 0x01 ///< PCM bit mask
#define CodecMPA 0x02 ///< MPA bit mask (planned)
#define CodecAC3 0x04 ///< AC-3 bit mask
#define CodecEAC3 0x08 ///< E-AC-3 bit mask
#define CodecDTS 0x10 ///< DTS bit mask (planned)
//----------------------------------------------------------------------------
// Typedefs
//----------------------------------------------------------------------------
@ -33,6 +43,13 @@ typedef struct _video_decoder_ VideoDecoder;
/// Audio decoder typedef.
typedef struct _audio_decoder_ AudioDecoder;
//----------------------------------------------------------------------------
// Variables
//----------------------------------------------------------------------------
/// Flag prefer fast xhannel switch
extern char CodecUsePossibleDefectFrames;
//----------------------------------------------------------------------------
// Prototypes
//----------------------------------------------------------------------------
@ -44,7 +61,7 @@ extern VideoDecoder *CodecVideoNewDecoder(VideoHwDecoder *);
extern void CodecVideoDelDecoder(VideoDecoder *);
/// Open video codec.
extern void CodecVideoOpen(VideoDecoder *, const char *, int);
extern void CodecVideoOpen(VideoDecoder *, int);
/// Close video codec.
extern void CodecVideoClose(VideoDecoder *);
@ -62,7 +79,7 @@ extern AudioDecoder *CodecAudioNewDecoder(void);
extern void CodecAudioDelDecoder(AudioDecoder *);
/// Open audio codec.
extern void CodecAudioOpen(AudioDecoder *, const char *, int);
extern void CodecAudioOpen(AudioDecoder *, int);
/// Close audio codec.
extern void CodecAudioClose(AudioDecoder *);

97
iatomic.h Normal file
View File

@ -0,0 +1,97 @@
///
/// @file iatomic.h @brief Misc function header file
///
/// Copyright (c) 2014 by Johns. 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$
//////////////////////////////////////////////////////////////////////////////
/// @addtogroup iatomic
/// @{
#define GCC_VERSION (__GNUC__ * 10000 \
+ __GNUC_MINOR__ * 100 \
+ __GNUC_PATCHLEVEL__)
// gcc before 4.7 didn't support atomic builtins,
// use alsa atomic functions.
#if GCC_VERSION < 40700
#include <alsa/iatomic.h>
#else
//////////////////////////////////////////////////////////////////////////////
// Defines
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
// Declares
//////////////////////////////////////////////////////////////////////////////
///
/// atomic type, 24 bit useable,
///
typedef volatile int atomic_t;
//////////////////////////////////////////////////////////////////////////////
// Prototypes
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
// Inlines
//////////////////////////////////////////////////////////////////////////////
///
/// Set atomic value.
///
#define atomic_set(ptr, val) \
__atomic_store_n(ptr, val, __ATOMIC_SEQ_CST)
///
/// Read atomic value.
///
#define atomic_read(ptr) \
__atomic_load_n(ptr, __ATOMIC_SEQ_CST)
///
/// Increment atomic value.
///
#define atomic_inc(ptr) \
__atomic_add_fetch(ptr, 1, __ATOMIC_SEQ_CST)
///
/// Decrement atomic value.
///
#define atomic_dec(ptr) \
__atomic_sub_fetch(ptr, 1, __ATOMIC_SEQ_CST)
///
/// Add to atomic value.
///
#define atomic_add(val, ptr) \
__atomic_add_fetch(ptr, val, __ATOMIC_SEQ_CST)
///
/// Subtract from atomic value.
///
#define atomic_sub(val, ptr) \
__atomic_sub_fetch(ptr, val, __ATOMIC_SEQ_CST)
#endif
/// @}

View File

@ -1,2 +0,0 @@
#!/bin/sh
exec make VDRDIR=/usr/include/vdr LIBDIR=. "$@"

1421
po/de_DE.po Normal file

File diff suppressed because it is too large Load Diff

View File

@ -1,7 +1,7 @@
///
/// @file ringbuffer.c @brief Ringbuffer module
///
/// Copyright (c) 2009, 2011 by Johns. All Rights Reserved.
/// Copyright (c) 2009, 2011, 2014 by Johns. All Rights Reserved.
///
/// Contributor(s):
///
@ -30,8 +30,7 @@
#include <stdlib.h>
#include <string.h>
#include <alsa/iatomic.h>
#include "iatomic.h"
#include "ringbuffer.h"
/// ring buffer structure

File diff suppressed because it is too large Load Diff

View File

@ -1,7 +1,7 @@
///
/// @file softhddev.h @brief software HD device plugin header file.
///
/// Copyright (c) 2011 - 2012 by Johns. All Rights Reserved.
/// Copyright (c) 2011 - 2015 by Johns. All Rights Reserved.
///
/// Contributor(s):
///
@ -25,7 +25,8 @@ extern "C"
{
#endif
/// C callback feed key press
extern void FeedKeyPress(const char *, const char *, int, int);
extern void FeedKeyPress(const char *, const char *, int, int,
const char *);
/// C plugin get osd size and ascpect
extern void GetOsdSize(int *, int *, double *);
@ -33,7 +34,8 @@ extern "C"
/// C plugin close osd
extern void OsdClose(void);
/// C plugin draw osd pixmap
extern void OsdDrawARGB(int, int, int, int, const uint8_t *);
extern void OsdDrawARGB(int, int, int, int, int, const uint8_t *, int,
int);
/// C plugin play audio packet
extern int PlayAudio(const uint8_t *, int, uint8_t);
@ -41,6 +43,8 @@ extern "C"
extern int PlayTsAudio(const uint8_t *, int);
/// C plugin set audio volume
extern void SetVolumeDevice(int);
/// C plugin reset channel id (restarts audio)
extern void ResetChannelId(void);
/// C plugin play video packet
extern int PlayVideo(const uint8_t *, int);
@ -95,6 +99,19 @@ extern "C"
/// Get decoder statistics
extern void GetStats(int *, int *, int *, int *);
/// C plugin scale video
extern void ScaleVideo(int, int, int, int);
/// Set Pip position
extern void PipSetPosition(int, int, int, int, int, int, int, int);
/// Pip start
extern void PipStart(int, int, int, int, int, int, int, int);
/// Pip stop
extern void PipStop(void);
/// Pip play video packet
extern int PipPlayVideo(const uint8_t *, int);
extern const char *X11DisplayName; ///< x11 display name
#ifdef __cplusplus
}
#endif

File diff suppressed because it is too large Load Diff

View File

@ -1,7 +1,7 @@
///
/// @file softhddevice.h @brief software HD device plugin header file.
///
/// Copyright (c) 2011 by Johns. All Rights Reserved.
/// Copyright (c) 2011, 2014 by Johns. All Rights Reserved.
///
/// Contributor(s):
///

View File

@ -23,6 +23,7 @@
#pragma once
#define ATMO_GRAB_SERVICE "SoftHDDevice-AtmoGrabService-v1.0"
#define ATMO1_GRAB_SERVICE "SoftHDDevice-AtmoGrabService-v1.1"
#define OSD_3DMODE_SERVICE "SoftHDDevice-Osd3DModeService-v1.0"
enum
@ -48,3 +49,17 @@ typedef struct
{
int Mode;
} SoftHDDevice_Osd3DModeService_v1_0_t;
typedef struct
{
// request/reply data
int width;
int height;
// reply data
int size;
void *img;
} SoftHDDevice_AtmoGrabService_v1_1_t;

View File

@ -1,74 +1,73 @@
# Copyright 1999-2012 Gentoo Foundation
# Copyright 1999-2014 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $
EAPI="3"
EAPI="5"
inherit eutils vdr-plugin
inherit vdr-plugin-2 git-2
if [[ ${PV} == "9999" ]] ; then
inherit git-2
EGIT_REPO_URI="git://projects.vdr-developer.org/vdr-plugin-softhddevice.git"
else
SRC_URI="http://projects.vdr-developer.org/attachments/download/838/${P}.tgz"
fi
RESTRICT="test"
EGIT_REPO_URI="git://projects.vdr-developer.org/vdr-plugin-softhddevice.git"
KEYWORDS=""
DESCRIPTION="A software and GPU emulated HD output device plugin for VDR."
DESCRIPTION="VDR Plugin: Software and GPU emulated HD output device"
HOMEPAGE="http://projects.vdr-developer.org/projects/show/plg-softhddevice"
SRC_URI=""
LICENSE="AGPL-3"
SLOT="0"
KEYWORDS="~x86 ~amd64"
IUSE="vaapi vdpau alsa oss yaepg opengl debug"
IUSE="alsa +debug opengl oss vaapi vdpau xscreensaver"
DEPEND=">=x11-libs/libxcb-1.8
x11-libs/xcb-util
x11-libs/xcb-util-wm
x11-libs/xcb-util-keysyms
x11-libs/xcb-util-renderutil
x11-libs/libX11
opengl? ( virtual/opengl )
>=virtual/ffmpeg-0.7
sys-devel/gettext
sys-devel/make
dev-util/pkgconfig
yaepg? ( >=media-video/vdr-1.7.23[yaepg] )
!yaepg? ( >=media-video/vdr-1.7.23 )
vdpau? ( x11-libs/libvdpau virtual/ffmpeg[vdpau] )
vaapi? ( x11-libs/libva virtual/ffmpeg[vaapi] )
alsa? ( media-libs/alsa-lib )
oss? ( sys-kernel/linux-headers )
"
RDEPEND=">=media-video/vdr-2
x11-libs/libX11
>=x11-libs/libxcb-1.8
x11-libs/xcb-util-wm
x11-libs/xcb-util-keysyms
x11-libs/xcb-util-renderutil
alsa? ( media-libs/alsa-lib )
opengl? ( virtual/opengl )
vaapi? ( x11-libs/libva
virtual/ffmpeg[vaapi] )
vdpau? ( x11-libs/libvdpau
virtual/ffmpeg[vdpau] )"
DEPEND="${RDEPEND}
virtual/pkgconfig
x11-libs/xcb-util"
src_prepare() {
vdr-plugin_src_prepare
REQUIRED_USE="opengl? ( vaapi )
|| ( vaapi vdpau )
|| ( alsa oss )"
#VDR_CONFD_FILE="${FILESDIR}/confd-0.6.0"
#VDR_RCADDON_FILE="${FILESDIR}/rc-addon-0.6.0.sh"
pkg_setup() {
vdr-plugin-2_pkg_setup
append-cppflags -DHAVE_PTHREAD_NAME
use debug && append-cppflags -DDEBUG -DOSD_DEBUG
}
src_prepare() {
vdr-plugin-2_src_prepare
src_compile() {
local myconf
BUILD_PARAMS+=" ALSA=$(usex alsa 1 0)"
BUILD_PARAMS+=" OPENGL=$(usex opengl 1 0)"
BUILD_PARAMS+=" OSS=$(usex oss 1 0)"
BUILD_PARAMS+=" VAAPI=$(usex vaapi 1 0)"
BUILD_PARAMS+=" VDPAU=$(usex vdpau 1 0)"
BUILD_PARAMS+=" SCREENSAVER=$(usex xscreensaver 1 0)"
myconf="-DHAVE_PTHREAD_NAME"
use vdpau && myconf="${myconf} -DUSE_VDPAU"
use vaapi && myconf="${myconf} -DUSE_VAAPI"
use alsa && myconf="${myconf} -DUSE_ALSA"
use oss && myconf="${myconf} -DUSE_OSS"
use debug && myconf="${myconf} -DDEBUG"
emake all CC="$(tc-getCC)" CFLAGS="${CFLAGS}" \
LDFLAGS="${LDFLAGS}" CONFIG="${myconf}" LIBDIR="." || die
if has_version ">=media-video/ffmpeg-0.8"; then
BUILD_PARAMS+=" SWRESAMPLE=1"
fi
if has_version ">=media-video/libav-0.8"; then
BUILD_PARAMS+=" AVRESAMPLE=1"
fi
}
src_install() {
vdr-plugin_src_install
vdr-plugin-2_src_install
dodoc README.txt
#dodir /etc/vdr/plugins || die
#insinto /etc/vdr/plugins
#fowners -R vdr:vdr /etc/vdr || die
#insinto /etc/conf.d
#doins vdr.softhddevice
nonfatal dodoc ChangeLog Todo
}

2993
video.c

File diff suppressed because it is too large Load Diff

47
video.h
View File

@ -1,7 +1,7 @@
///
/// @file video.h @brief Video module header file
///
/// Copyright (c) 2009 - 2012 by Johns. All Rights Reserved.
/// Copyright (c) 2009 - 2015 by Johns. All Rights Reserved.
///
/// Contributor(s):
///
@ -30,31 +30,35 @@
/// Video hardware decoder typedef
typedef struct _video_hw_decoder_ VideoHwDecoder;
/// Video output stream typedef
typedef struct __video_stream__ VideoStream;
//----------------------------------------------------------------------------
// Variables
//----------------------------------------------------------------------------
extern char VideoHardwareDecoder; ///< flag use hardware decoder
extern signed char VideoHardwareDecoder; ///< flag use hardware decoder
extern char VideoIgnoreRepeatPict; ///< disable repeat pict warning
extern int VideoAudioDelay; ///< audio/video delay
extern char ConfigStartX11Server; ///< flag start the x11 server
//----------------------------------------------------------------------------
// Prototypes
//----------------------------------------------------------------------------
/// Allocate new video hardware decoder.
extern VideoHwDecoder *VideoNewHwDecoder(void);
extern VideoHwDecoder *VideoNewHwDecoder(VideoStream *);
/// Deallocate video hardware decoder.
extern void VideoDelHwDecoder(VideoHwDecoder *);
#ifdef LIBAVCODEC_VERSION
/// Get and allocate a video hardware surface.
extern unsigned VideoGetSurface(VideoHwDecoder *);
extern unsigned VideoGetSurface(VideoHwDecoder *, const AVCodecContext *);
/// Release a video hardware surface
extern void VideoReleaseSurface(VideoHwDecoder *, unsigned);
#ifdef LIBAVCODEC_VERSION
/// Callback to negotiate the PixelFormat.
extern enum PixelFormat Video_get_format(VideoHwDecoder *, AVCodecContext *,
const enum PixelFormat *);
@ -63,8 +67,8 @@ extern enum PixelFormat Video_get_format(VideoHwDecoder *, AVCodecContext *,
extern void VideoRenderFrame(VideoHwDecoder *, const AVCodecContext *,
const AVFrame *);
/// Get ffmpeg vaapi context.
extern struct vaapi_context *VideoGetVaapiContext(VideoHwDecoder *);
/// Get hwaccel context for ffmpeg.
extern void *VideoGetHwAccelContext(VideoHwDecoder *);
#ifdef AVCODEC_VDPAU_H
/// Draw vdpau render state.
@ -110,13 +114,16 @@ extern void VideoSetSaturation(int);
extern void VideoSetHue(int);
/// Set video output position.
extern void VideoSetOutputPosition(int, int, int, int);
extern void VideoSetOutputPosition(VideoHwDecoder *, int, int, int, int);
/// Set video mode.
extern void VideoSetVideoMode(int, int, int, int);
/// Set display format.
extern void VideoSetDisplayFormat(int);
/// Set 4:3 display format.
extern void VideoSet4to3DisplayFormat(int);
/// Set other display format.
extern void VideoSetOtherDisplayFormat(int);
/// Set video fullscreen mode.
extern void VideoSetFullscreen(int);
@ -161,7 +168,8 @@ extern void VideoSetAutoCrop(int, int, int);
extern void VideoOsdClear(void);
/// Draw an OSD ARGB image.
extern void VideoOsdDrawARGB(int, int, int, int, const uint8_t *);
extern void VideoOsdDrawARGB(int, int, int, int, int, const uint8_t *, int,
int);
/// Get OSD size.
extern void VideoGetOsdSize(int *, int *);
@ -205,8 +213,19 @@ extern void VideoOsdExit(void); ///< Cleanup osd.
extern void VideoInit(const char *); ///< Setup video module.
extern void VideoExit(void); ///< Cleanup and exit video module.
extern int VideoPollInput(void); ///< Poll video input buffers.
extern int VideoDecodeInput(void); ///< Decode video input buffers.
extern int VideoGetBuffers(void); ///< Get number of input buffers.
/// Poll video input buffers.
extern int VideoPollInput(VideoStream *);
/// Decode video input buffers.
extern int VideoDecodeInput(VideoStream *);
/// Get number of input buffers.
extern int VideoGetBuffers(const VideoStream *);
/// Set DPMS at Blackscreen switch
extern void SetDPMSatBlackScreen(int);
/// Raise the frontend window
extern int VideoRaiseWindow(void);
/// @}