1089 Commits

Author SHA1 Message Date
Thilo Graf
6b15c22726 update version to 1.3.0 mpx
osmioplus4k added
2020-02-16 11:13:25 +01:00
Markus Volk
f9bb987a43 add osmioplus4k stb 2020-02-16 08:40:39 +01:00
DboxOldie
8f53e0d2d9 reduce arm ifndef warning 2020-02-13 22:00:18 +01:00
Frankenstone
64d853f245 ca_ci.cpp: fix -fpermissive error on aarch64 only arm/mips hardware, thx flk ;-) 2020-02-13 22:00:01 +01:00
Frankenstone
d0c12909c9 Revert "ca_ci.cpp: fix -fpermissive error on aarch64" 2020-02-13 09:56:15 +01:00
BPanther
1b4c5dc1f8 vuplus_arm: fix dmx_source 2020-02-13 09:55:52 +01:00
Markus Volk
f4bc510536 libarmbox/video.cpp: add missing defines
VIDEO_GET_FRAME_RATE was dropped in 4.19 kernel
2020-02-10 14:13:09 +01:00
Markus Volk
7cab06c525 linuxdvb_mipsel.c: add missing define AUDIO_GET_PTS has been removed from kernel 4.8 2020-02-10 10:43:44 +01:00
Markus Volk
a9251b30d1 dmx_hal.h: add needed defines DMX_SET_SOURCE and dmx_source enum removed on 4.14 kernel 2020-02-10 10:43:38 +01:00
BPanther
e22c3033af sh4 fix mp3 (thx DBoxOldie) 2020-02-07 17:44:21 +01:00
BPanther
83437c3656 patch for sh4 and actual ffmpeg versions (thx DBoxOldie) 2020-02-07 17:44:15 +01:00
MarkusVolk
5e3736a0a8 ca_ci.cpp: supplement to 9a9372931a 2020-02-07 10:12:25 +01:00
Markus Volk
9a9372931a ca_ci.cpp: fix -fpermissive error on aarch64
2020-02-06 19:43:08 +01:00
Jacek Jendrzej
0e82fc5325 playback_libeplayer3.cpp: fix compil warning 2020-02-04 17:15:06 +01:00
Thilo Graf
3c2ccc6fee libgeneric-pc: fix possible compiler warning Wunused-parameter 2020-01-28 09:58:41 +01:00
BPanther
34fc6368c4 arm/mips: more zappingmode options 2020-01-28 09:33:08 +01:00
BPanther
b6fe299ee6 fix vuuno4k 2020-01-22 20:32:20 +01:00
DboxOldie
3d6077b3af fix build for no ci stb 2020-01-22 20:32:04 +01:00
BPanther
660c99317c vuplus: relevant pids routing - fix 2020-01-19 13:49:25 +01:00
BPanther
1db0ffb694 vuplus: relevant pids routing - fix 2020-01-19 13:49:16 +01:00
BPanther
0875e2c853 vuplus: relevant pids routing - fix 2020-01-19 13:49:08 +01:00
BPanther
f14212783b vuplus: relevant pids routing 2020-01-19 13:49:05 +01:00
svenhoefer
c14601465a - fix defines
Signed-off-by: Thilo Graf <dbt@novatux.de>
2020-01-19 13:48:51 +01:00
TangoCash
1920c37be5 - libarmbox: try to fix cec 2020-01-19 13:48:34 +01:00
DboxOldie
8658177951 small fix dvbci 2020-01-19 13:48:22 +01:00
BPanther
6eb082c12a vuplus: dvb wait delay for ci response 2020-01-19 13:48:08 +01:00
BPanther
a76f914d9b ci "extra_high" for vuplus 2020-01-19 13:47:46 +01:00
BPanther
32361d734e arm/mips: eplayer3 binary disabled 2020-01-14 12:31:58 +01:00
BPanther
fd8cc781dd dmx.cpp: fix debug 2020-01-14 12:31:56 +01:00
Thilo Graf
52213f9a21 fix pick error, remove wrong package name 2020-01-14 12:31:52 +01:00
svenhoefer
9c422e5713 - Revert first try to fix hdmi-cec
Signed-off-by: Thilo Graf <dbt@novatux.de>
2020-01-14 12:31:48 +01:00
Jacek Jendrzej
84ad5a2019 exteplayer.c:fix heap buffer overflow 2020-01-14 10:31:40 +01:00
Jacek Jendrzej
8ff9d03679 fix compiler warnings 2020-01-09 16:54:07 +01:00
Jacek Jendrzej
5791880e4c libgeneric-pc/clutterfb.cpp: sync keys with glfb.cpp 2020-01-06 13:34:41 +01:00
Thilo Graf
60f6a1f4be lib cleanup and sync for mips vu support 2020-01-05 21:11:50 +01:00
Thilo Graf
ed84d0ac6e libspark: fix pick error 2020-01-05 21:11:50 +01:00
Thilo Graf
92f912e541 libraspi: add missing links to generic-pc 2020-01-05 21:11:50 +01:00
vanhofen
5802a2ed1e - acinclude: resort 2020-01-05 21:11:50 +01:00
BPanther
7f329670fc some more devices for vu 2020-01-05 21:11:50 +01:00
svenhoefer
7a650421bf - libarmbox: align modification of /proc/stb/frontend/fbc/fcc to the proc_put calls above
Signed-off-by: Thilo Graf <dbt@novatux.de>
2020-01-05 21:11:50 +01:00
svenhoefer
fb8bb36cf7 - libarmbox: remove still picture while zapping
Conflicts:
	libarmbox/init.cpp

Signed-off-by: Thilo Graf <dbt@novatux.de>
2020-01-05 21:11:50 +01:00
svenhoefer
15ed156bd3 - vuplus: fix volume 0
Signed-off-by: Thilo Graf <dbt@novatux.de>
2020-01-05 21:11:50 +01:00
max_10
6e45d7affa - hardware_caps: bre2ze4k disable display has statusline 2020-01-05 21:11:50 +01:00
max_10
0f85aa4f60 - libeplayer3: fix __inline is not at beginning of declaration [-Wold-style-declaration] 2020-01-05 21:11:50 +01:00
svenhoefer
69a371a709 - vuplus: allow to control led brightness for zero4k and uno4k
maybe this is also usefull for the other vuplus4k boxes

 Conflicts:
	libarmbox/hardware_caps.c

Signed-off-by: Thilo Graf <dbt@novatux.de>

TODO: 	Maybe this commit makes behavior broken on boxes with line display eg. hd51.
	Observed in relation with simple_display.cpp, see neutrino source.
2020-01-05 20:59:46 +01:00
max_10
f26097e1fc - add h7
Conflicts:
	acinclude.m4
2020-01-05 20:42:27 +01:00
Thilo Graf
5979389a2c libgeneric-pc: fix possible linker error
undefined reference to symbol 'aio_error@@GLIBC_2.2.5'
.../x86_64-linux-gnu/librt.so: error adding symbols: DSO missing ...
2020-01-05 20:41:32 +01:00
Jacek Jendrzej
c4e474a48e libarmbox/video.cpp: image_to_mpeg2 fix memleak 2020-01-05 17:45:32 +01:00
Jacek Jendrzej
db244f0b8a libeplayer3-arm:playback.c reduce log errors 2020-01-03 21:54:48 +01:00
Jacek Jendrzej
c25f68eda1 av_dict_free avio_opts; fix memleak 2020-01-03 20:09:42 +01:00
Jacek Jendrzej
68fa79b83f libeplayer3-arm: malloc player once on neutrino start 2020-01-01 19:02:41 +01:00
Jacek Jendrzej
3b0bad6f54 libeplayer3-arm:playback.c: avoid use after free 2020-01-01 18:58:30 +01:00
Jacek Jendrzej
4d6eef9433 libarmbox/playback_libeplayer3: fix audio track select, broken pointer size 2019-12-29 19:59:39 +01:00
Jacek Jendrzej
f0f1a282bf libarmbox: stop player before free it 2019-12-29 11:48:50 +01:00
Jacek Jendrzej
603fba2500 playback arm: add option to play szSecondFile (audio) 2019-11-03 18:30:13 +01:00
Jacek Jendrzej
639762e1b3 subtitle: fix debug compil 2019-11-03 18:27:06 +01:00
Thilo Graf
2b32057d88 update version to 1.2.0 mpx
zgemma h7, vuduo4k, vuzero4k added
2019-10-27 11:28:15 +01:00
BPanther
643e31d127 fix vuzero4k 2019-10-27 11:28:14 +01:00
svenhoefer
89795e0ac9 - acinclude.m4: sort helpstrings and code (start with generic and end up with armbox and mipsbox)
Signed-off-by: Thilo Graf <dbt@novatux.de>
2019-10-27 11:28:12 +01:00
svenhoefer
08fcc53323 - acinclude.m4: add boxmodel generic (not really needed; just for better readability)
Signed-off-by: Thilo Graf <dbt@novatux.de>

Conflicts:
	acinclude.m4
2019-10-27 11:28:11 +01:00
TangoCash
ddfc274773 silence ffmpeg 2019-10-27 11:28:10 +01:00
TangoCash
f88e4e9451 fix segfaults on some HEVC/h265 files 2019-10-27 11:28:09 +01:00
max_10
4024d92c22 - vuduo4k added 2019-10-27 11:28:07 +01:00
max_10
64822e3f16 - vuzero4k added
Conflicts:
	configure.ac
2019-10-27 11:28:05 +01:00
svenhoefer
9821a03061 - fix SNDCTL_DSP_RESET handling for bre2ze4k and h7
Signed-off-by: GetAway <get-away@t-online.de>
2019-10-27 10:40:32 +01:00
GetAway
6e1b833522 supplement to commit f4ef056
- libarm clipplay-retry, thx DboxOldie
2019-10-23 22:43:12 +02:00
Markus Volk
a43f47cfff libstb hal add zgemma h7 stb models
Signed-off-by: Markus Volk <f_l_k@t-online.de>
Signed-off-by: GetAway <get-away@t-online.de>
2019-10-23 22:12:07 +02:00
Jacek Jendrzej
60106b3fb3 libarmbox: remove unnecessary while 2019-08-04 19:50:47 +02:00
Jacek Jendrzej
13e00bae72 fix chapter 2019-07-29 20:16:51 +02:00
Jacek Jendrzej
d4c09e2bb9 disable chapter, need fix 2019-07-29 20:00:23 +02:00
Jacek Jendrzej
011843ef91 libeplayer3-arm: fix chapter 2019-07-29 18:11:02 +02:00
Jacek Jendrzej
6b64c065d2 libeplayer3-arm: fix mem leak uri on open error 2019-07-29 11:05:36 +02:00
Jacek Jendrzej
e27822382d try to fix segfault on open/close 2019-07-22 19:48:51 +02:00
Jacek Jendrzej
42ac0f8229 enable abortRequested for http and isPlaying is 0, some dash urls hangs (ffmpeg timeouut is broken ?) 2019-07-19 18:00:02 +02:00
Jacek Jendrzej
119aefaf82 possible mem leak 2019-07-19 18:00:02 +02:00
Thilo Graf
a3f7195688 clutterfb.cpp: avoid possible memleak 2019-07-16 11:03:50 +02:00
Jacek Jendrzej
bc01e812e6 avoid segfault 2019-07-14 19:06:15 +02:00
Jacek Jendrzej
a22d54a164 avoid segfault 2019-07-14 19:05:11 +02:00
Jacek Jendrzej
d975c90d34 fix segfault on strdup 2019-07-14 19:04:24 +02:00
max_10
070cfa7223 - libgeneric-pc: fix build with --enable-clutter 2019-06-27 15:49:33 +02:00
Thilo Graf
5caaa055bd Revert "libgeneric: add missing header files, required with --enable-clutter"
This reverts commit 7fea151f3e.
2019-06-27 15:49:24 +02:00
Thilo Graf
7fea151f3e libgeneric: add missing header files, required with --enable-clutter 2019-06-25 19:59:46 +02:00
Jacek Jendrzej
809833f99a generic-pc: reduce warnings 2019-06-20 20:48:12 +02:00
Jacek Jendrzej
8992afc489 generic-pc: reduce ffmpeg warnings 2019-06-20 20:39:38 +02:00
GetAway
a7401f47ff flv2mpeg4_ffmpeg.c: fix warning unused parameter 2019-06-18 18:35:04 +02:00
GetAway
731505ddf2 ffmpeg: fix error duplicate ‘const’ declaration specifier 2019-06-18 18:24:25 +02:00
GetAway
c8eda96620 libstb_hal: Suppress implicit-fallthrough warnings from GCC 7 2019-06-14 21:03:10 +02:00
GetAway
9dc3e7b768 surpress sprintf() warning when compiling with newer gcc
and -Werror=format-overflow
2019-06-14 20:16:02 +02:00
max_10
6fc257e3ae - libdvbci: add CA_SET_PID, for kernels > 4.14 2019-05-26 21:53:37 +02:00
max_10
f9ff2988d0 - libdvbci: no define CA_SET_DESCR_DATA, read from linux/dvb/ca.h
Conflicts:
	libdvbci/descrambler.cpp
2019-05-26 21:53:36 +02:00
max_10
c8ef8405b1 - libgeneric-pc: reduce ffmpeg warnings 2019-05-26 21:53:35 +02:00
Jacek Jendrzej
84e2b58fdc generic-pc: avoid segfault 2019-05-11 19:43:39 +02:00
Jacek Jendrzej
f42c7d86af generic-pc: avoid segfault 2019-05-09 18:05:59 +02:00
BPanther
dfb48f114f vusolo4k enable fcc 2019-04-28 20:07:51 +02:00
svenhoefer
a90ec77f11 - fill COPYING file with GPLv2
Signed-off-by: Thilo Graf <dbt@novatux.de>
2019-04-28 20:07:49 +02:00
svenhoefer
6454033995 - add missing empty INSTALL file
Signed-off-by: Thilo Graf <dbt@novatux.de>
2019-04-28 20:07:48 +02:00
svenhoefer
170da9756e - configure.ac: add foreign switch to AM_INIT_AUTOMAKE macro
Signed-off-by: Thilo Graf <dbt@novatux.de>
2019-04-28 20:07:47 +02:00
svenhoefer
9018804c8a - configure.ac: autoupdate
Signed-off-by: Thilo Graf <dbt@novatux.de>
2019-04-28 20:07:46 +02:00
svenhoefer
e15b2580fb - Makefile.am: remove non-working pkginclude_HEADERS
Signed-off-by: Thilo Graf <dbt@novatux.de>
2019-04-28 20:07:43 +02:00
svenhoefer
302737c891 - configure.ac: remove AC_CONFIG_MACRO_DIR macro
Signed-off-by: Thilo Graf <dbt@novatux.de>
2019-04-28 20:07:42 +02:00
svenhoefer
26fc20ef70 - .gitignore: a bit more structure; inspired by https://github.com/github/gitignore
Signed-off-by: Thilo Graf <dbt@novatux.de>
2019-04-28 20:07:41 +02:00
svenhoefer
5940755332 - configure.ac: completion of "remove obsolete TUXBOX_APPS_DIRECTORY macro"
Signed-off-by: Thilo Graf <dbt@novatux.de>
2019-04-28 20:07:40 +02:00
svenhoefer
5a9c1974c2 - acinclude.m4: remove obsolete TUXBOX_APPS_DIRECTORY macro
Signed-off-by: Thilo Graf <dbt@novatux.de>
2019-04-28 20:07:38 +02:00
svenhoefer
351c377966 - acinclude.m4: align to neutrino's acinclude.m4; fix exec_prefix variable in cdk-mode too
Signed-off-by: Thilo Graf <dbt@novatux.de>
2019-04-28 20:07:37 +02:00
svenhoefer
1b89f9241f - fix indentation
Signed-off-by: Thilo Graf <dbt@novatux.de>
2019-04-28 20:07:36 +02:00
Jacek Jendrzej
973e8c3a7a try to fix unmap error,automatically unmapped don't work ? 2019-04-28 20:07:35 +02:00
Jacek Jendrzej
4c5b13c4a4 fix check mmap error, avoid possible segment fault 2019-04-28 20:07:33 +02:00
Jacek Jendrzej
005bcbdf01 libeplayer3-arm/container/container_ffmpeg.c fix possible segfault 2019-04-10 12:46:09 +02:00
max_10
265eaecd8a - bre2ze4k: fix hardware_caps
Signed-off-by: GetAway <get-away@t-online.de>
2019-03-26 09:42:54 +01:00
Frankenstone
5840f86e31 Not starting record or stream to pc, when watching live-tv via CI module and stream or record needs the module
Signed-off-by: GetAway <get-away@t-online.de>
2019-03-16 14:29:28 +01:00
FlatTV
c06a34faa8 ca_ci.cpp: No decoding using the same SID after switching to a FTA channel 2019-03-14 09:03:43 +01:00
Frankenstone
f4ef056089 - libarm clipplay-retry, thx DboxOldie 2019-03-13 08:42:47 +01:00
BPanther
453f61b8da small fix for vusolo4k 2019-03-13 08:42:37 +01:00
svenhoefer
7c17a9fa12 - libazbox/video.cpp: fix wrong brackets
Signed-off-by: Thilo Graf <dbt@novatux.de>
2019-03-13 08:40:42 +01:00
Frankenstone
d44e2b0419 libarm use ffmpeg log 2019-03-05 20:36:16 +01:00
Frankenstone
a618e70a3e armhardware reduce ffmpeg warnings part 2
- thx DbO

 Conflicts:
	libarmbox/video.cpp
2019-03-04 12:59:05 +01:00
Frankenstone
3dec38599a fix possible segfault arm hardware, thx DboxOldie 2019-03-01 22:22:30 +01:00
max_10
23ee0a2ae6 Revert "try to fix slowly close internet radio/music player"
This reverts commit 42dc38f7c9.
2019-03-01 21:39:40 +01:00
Frankenstone
84c333354e armhardware reduce ffmpeg warnings part 1
- thx DbO
2019-03-01 21:35:03 +01:00
Frankenstone
7559f1ab54 fix possible segfault, thx DboxOldie
-arm eplayer get writer segfault
2019-02-27 09:45:20 +01:00
TangoCash
519afb1035 add experimental hisilicon player for hd60 2019-02-27 09:45:20 +01:00
samsamsam
37c27cf695 Unify h263 and mpeg4 formatters 2019-02-27 09:45:20 +01:00
samsamsam
77cac9222f Add mapping of a stream type and bypass mode and try to set alternative one if main fail 2019-02-27 09:45:20 +01:00
max_10
cb7c9874e8 - fix-compiler-warnings 2019-02-27 09:45:20 +01:00
samsamsam
32bc62a65b Attempt to add MJPEG support 2019-02-27 09:45:20 +01:00
samsamsam
a3e9180edd Improve Zgemma H9S playback start with new drivers, deploy version v54 2019-02-27 09:45:20 +01:00
samsamsam
4e11cb9a92 Fix VP9 playback for the Octagon SF4008 2019-02-27 09:45:20 +01:00
samsamsam
c298f20a69 Improve playback of VP9 codec 2019-02-27 09:45:20 +01:00
redblue-pkt
0435571728 fix commit b750bbe3eb
Signed-off-by: Thilo Graf <dbt@novatux.de>

Commit was:
arm: finally fix play next file
adab40123e
2019-02-27 09:45:20 +01:00
max_10
d8b3a2d5b4 libeplayer3-arm: debug issue shortened 2019-02-27 09:45:20 +01:00
max_10
72367605fc mpeg4p2_ffmpeg: fix shadows a global declaration 2019-02-27 09:45:20 +01:00
samsamsam
0500967a2a Improve seeks on playback with multi AV context - when option 2019-02-27 09:45:20 +01:00
samsamsam
6ee43d0121 libavformat option was not set for the second context. 2019-02-27 09:45:20 +01:00
samsamsam
a7e749dc67 Fix compilation of the linuxdvb_fake.c 2019-02-27 09:45:20 +01:00
samsamsam
f58a34e220 Refactoring debug code
Conflicts:
	libeplayer3-arm/container/container_ffmpeg.c
2019-02-27 09:45:20 +01:00
Charles Duco
99844a02dd added webvtt support 2019-02-27 09:45:20 +01:00
redblue-pkt
5f71277215 armbox: eplayer3 add read-count 2019-02-27 09:45:20 +01:00
redblue-pkt
0b92f90ce2 fastforward: move VIDEO_CONTINUE from playback.c to linuxdvb_mipsel.c 2019-02-27 09:45:20 +01:00
redblue-pkt
89a891ddbb LinuxDvbAudioMute replace AUDIO_STOP, AUDIO_PLAY to AUDIO_SET_MUTE 2019-02-27 09:45:20 +01:00
GetAway
06f46400c2 arm: fix black screen in channel swiching
this fixes wrong commit e20d1913
2019-02-26 18:28:43 +01:00
Jacek Jendrzej
f5c1a7c9a3 try fix to call container_ffmpeg_stop on file EOF 2019-02-22 21:32:23 +01:00
Jacek Jendrzej
167c259649 fix memleak , free unused track.aacbuf 2019-02-22 15:23:26 +01:00
Jacek Jendrzej
e51ad20c46 workaround for double malloc if container_ffmpeg_stop is not called after file play to end 2019-02-21 19:46:27 +01:00
Markus Volk
e9c53684e3 fix commit: fix for build with openssl 1.1
1ce6f8c629

Signed-off-by: Markus Volk <f_l_k@t-online.de>
Signed-off-by: Thilo Graf <dbt@novatux.de>
2019-02-16 12:37:48 +01:00
Thilo Graf
1ce6f8c629 libdvbci: fix for build with openssl 1.1
error: invalid use of incomplete type 'DH' {aka 'struct dh_st'}
2019-02-15 21:40:15 +01:00
Jacek Jendrzej
97db720210 try to fix unmap error,automatically unmapped don't work ? 2019-01-14 10:44:13 +01:00
Jacek Jendrzej
cf1884f1fc fix check mmap error, avoid possible segment fault 2019-01-13 20:13:55 +01:00
Jacek Jendrzej
4730206966 fix generic build 2019-01-13 12:46:19 +01:00
GetAway
4f15222d9c ShowPicture: return boolean expression 2019-01-12 11:47:33 +01:00
Thilo Graf
0b6120d170 version_hal: simplify methodes
adopt method names similar to cs name convention
2019-01-02 17:24:10 +01:00
Thilo Graf
21561e233a configure: remove config from separat include dir
Not really needed
2019-01-02 17:19:56 +01:00
Thilo Graf
b693517e3c configure: add missing entry
build was broken
2019-01-01 20:38:43 +01:00
redblue-pkt
adab40123e arm: finally fix play next file 2019-01-01 15:51:04 +01:00
redblue-pkt
e20d19138e arm: add black screen in channel swiching 2019-01-01 15:50:59 +01:00
Thilo Graf
f07fcb26cd Makefile.am: fix generic build
wrong defined directory
2019-01-01 15:50:56 +01:00
svenhoefer
5f3fc84a2d - hal-debug: replace some more libtriple shortcuts
Signed-off-by: Thilo Graf <dbt@novatux.de>
2019-01-01 15:50:51 +01:00
Thilo Graf
d72d198740 cs_api.h: fix define of different macro
__CS_API_H__ is used as header guard-, build was broken
2019-01-01 15:50:47 +01:00
svenhoefer
038d2288cc - unify defines in header files
Signed-off-by: Thilo Graf <dbt@novatux.de>
2019-01-01 15:50:45 +01:00
svenhoefer
a7221f4d8c - includes: better error messages
Signed-off-by: Thilo Graf <dbt@novatux.de>
2019-01-01 15:50:41 +01:00
svenhoefer
77d5cafd32 - init: align init/exit function names
Signed-off-by: Thilo Graf <dbt@novatux.de>
2019-01-01 15:50:39 +01:00
svenhoefer
3da91b1463 - rename lt_debug => hal_debug; it's not only libtriple debugging
Signed-off-by: Thilo Graf <dbt@novatux.de>

- debuglevel fixed
2019-01-01 15:50:37 +01:00
svenhoefer
8d4a39566a - libarmbox: fix boxvendor VU+
Signed-off-by: Thilo Graf <dbt@novatux.de>
2019-01-01 15:50:33 +01:00
BPanther
1a5f51f80c vusolo4k tuner fix 2019-01-01 15:50:30 +01:00
svenhoefer
89000ffda3 - rename init_td.h => init.h
Signed-off-by: Thilo Graf <dbt@novatux.de>
2019-01-01 15:50:28 +01:00
svenhoefer
18f895ed6d - re-split ca.h/ca_ci.h for a better transparency
Signed-off-by: Thilo Graf <dbt@novatux.de>
2019-01-01 15:50:24 +01:00
svenhoefer
3921988f22 - remove some more obsolete compatibility headers
Signed-off-by: Thilo Graf <dbt@novatux.de>
2019-01-01 15:50:19 +01:00
svenhoefer
2ad621326b - align includes and Makefiles to directory changes
Signed-off-by: Thilo Graf <dbt@novatux.de>
2019-01-01 15:50:14 +01:00
svenhoefer
335dbdd2ea - move libeplayer3-sh4 code to libeplayer3-sh4 directory; ...
rename library to libeplayer3_sh4.la

Signed-off-by: Thilo Graf <dbt@novatux.de>
2019-01-01 15:50:12 +01:00
svenhoefer
89e4134873 - Makefile.am: put commented libtest lines together
Signed-off-by: Thilo Graf <dbt@novatux.de>
2019-01-01 15:50:09 +01:00
svenhoefer
635ec1617b - move generic-pc code to libgeneric-pc directory
Signed-off-by: Thilo Graf <dbt@novatux.de>
2019-01-01 15:50:07 +01:00
svenhoefer
aba7114188 - move raspi code to libraspi directory
Signed-off-by: Thilo Graf <dbt@novatux.de>
2019-01-01 15:50:02 +01:00
svenhoefer
ec28791f79 - move azbox code to libazbox directory
Signed-off-by: Thilo Graf <dbt@novatux.de>
2019-01-01 15:49:59 +01:00
svenhoefer
72a8f6cf73 - fix last commit; generic/playback_lib.h was changed by mistake
Signed-off-by: Thilo Graf <dbt@novatux.de>
2019-01-01 15:49:56 +01:00
svenhoefer
871bbcc86f - unify handling of playback header
Signed-off-by: Thilo Graf <dbt@novatux.de>
2019-01-01 15:49:51 +01:00
svenhoefer
e478e35f0e - unify handling of ca header
Signed-off-by: Thilo Graf <dbt@novatux.de>
2019-01-01 15:49:02 +01:00
svenhoefer
e84e5c8647 - remove obsolete compatibility headers
Signed-off-by: Thilo Graf <dbt@novatux.de>
2019-01-01 15:48:18 +01:00
Thilo Graf
b87250108c version_hal.cpp/h: add methodes to get package data 2019-01-01 15:46:26 +01:00
Thilo Graf
71197a55d9 configure: add additional config header
config.h was not usable with neutrino.
2019-01-01 15:29:47 +01:00
Thilo Graf
90aabf766b .gitignore: ignore some unneeded config and local stuff 2019-01-01 15:29:43 +01:00
GetAway
2d90952e28 libarmbox: introduce has_button_vformat 2018-12-01 10:38:17 +01:00
TangoCash
d92f990091 add support for wwio bre2ze4k 2018-11-23 09:28:15 +01:00
TangoCash
736d4c6edc add first experimental support for ax hd60
Signed-off-by: Thilo Graf <dbt@novatux.de>
2018-11-01 20:44:49 +01:00
TangoCash
698585e1cb liabarmbox: hdmi_cec return volume in percent, correct msg length
Signed-off-by: Thilo Graf <dbt@novatux.de>
2018-10-20 14:18:58 +02:00
TangoCash
1a2fd80b53 libeplayer3-arm: fix h265 playback
Signed-off-by: Thilo Graf <dbt@novatux.de>
2018-10-16 08:45:03 +02:00
TangoCash
3057e3aa4d libarmbox: hdmi_cec add option to regulate audio systems volume via CEC, better log readability
Signed-off-by: Thilo Graf <dbt@novatux.de>
2018-10-14 13:51:07 +02:00
TangoCash
53f752a014 libarmbox: hdmi_cec switch debug log to INIT (not used by armbox elsewhere), to debug hdmi_cec separatly from video
Signed-off-by: Thilo Graf <dbt@novatux.de>
2018-10-11 09:50:19 +02:00
TangoCash
7c40bbf4f1 libarmbox: hdmi_cec fix device
Signed-off-by: Thilo Graf <dbt@novatux.de>
2018-10-11 09:34:03 +02:00
TangoCash
08984d1c35 libarmbox: hmdi_cec emit received keys, report power status
Signed-off-by: Thilo Graf <dbt@novatux.de>
2018-10-10 09:14:56 +02:00
TangoCash
b047bcdcf2 libarmbox: hdmi_cec typo
Signed-off-by: Thilo Graf <dbt@novatux.de>
2018-10-10 09:14:56 +02:00
TangoCash
ae74e313ef libarmbox: hdmi_cec fixx segfault on DDT, align log
Signed-off-by: Thilo Graf <dbt@novatux.de>
2018-10-10 09:14:56 +02:00
TangoCash
6427cf09a8 libarmbox: hdmi_cec better readability
Signed-off-by: Thilo Graf <dbt@novatux.de>
2018-10-10 09:14:56 +02:00
TangoCash
97ca22c7fa libarmbox: hdmi_cec add some more output
Signed-off-by: Thilo Graf <dbt@novatux.de>
2018-10-10 09:14:56 +02:00
TangoCash
d58558c82a libarmbox: fix hdmi_cec handling
Signed-off-by: Thilo Graf <dbt@novatux.de>
2018-10-10 09:14:56 +02:00
TangoCash
0621626119 libarmbox: move hdmi_cec to own class, add basic cec-remote support
cec-remote will print received commands in log for now

Signed-off-by: Thilo Graf <dbt@novatux.de>
2018-10-10 09:14:56 +02:00
Frankenstone
2820170776 arm hardware: fast forward, mute audio when passthrough AC3 / DTS
-thx DboxOldie

Signed-off-by: Thilo Graf <dbt@novatux.de>
2018-10-10 09:14:56 +02:00
TangoCash
c58e9b9eb7 arm another fix fastforward
Signed-off-by: Thilo Graf <dbt@novatux.de>
2018-10-06 20:44:38 +02:00
max_10
9e9d4ca39b Revert "update audio streamtype"
This reverts commit 803aa065fc6ff33f69a5cc9a6e420e7d80c5638c.
2018-10-06 20:33:00 +02:00
max_10
84fe2aa10c Revert "update video streamtype"
This reverts commit d6b32edaa7d0cd1eb035e3404a12dee2359037ea.
2018-10-06 20:32:38 +02:00
redblue-pkt
950f804f3f fix no sound after play video 2018-10-05 13:58:29 +02:00
redblue-pkt
dde77e1b5c add codec info 2018-10-05 13:58:25 +02:00
redblue-pkt
4806fe87b0 update SetColorFormat() 2018-10-05 13:58:22 +02:00
Thilo Graf
2a5d3d23f2 libarmbox/video.cpp: fix possible broken build
possible error:

"error: '0' flag ignored with precision and '%X' gnu_printf format [-Werror=format=]"
2018-10-05 13:58:11 +02:00
redblue-pkt
1e674880f3 update SetControl() 2018-10-04 23:39:48 +02:00
redblue-pkt
a6614a7cdd update video streamtype 2018-10-04 23:39:46 +02:00
redblue-pkt
18ee150d60 update audio streamtype 2018-10-04 23:39:44 +02:00
redblue-pkt
42dc38f7c9 try to fix slowly close internet radio/music player 2018-10-04 23:39:41 +02:00
redblue-pkt
5c733a1ac1 fix mute, sound volume 2018-10-04 23:39:39 +02:00
redblue-pkt
2cc698c3ec fix fastforward 2018-10-04 23:39:37 +02:00
redblue-pkt
e5724161b0 fix segfault in backward 2018-10-04 23:39:33 +02:00
BPanther
df7a030d06 update hwcaps for hl101 (thx sid8796)
Signed-off-by: Thilo Graf <dbt@novatux.de>

I tryed to reduce the mess of commits.
2018-10-04 23:38:43 +02:00
BPanther
ad385ab627 sh4 hwcaps update 2018-10-04 22:50:57 +02:00
BPanther
6cf28c8d10 fix vusolo4k 2018-10-04 22:50:51 +02:00
BPanther
0a6d33c327 fix vusolo4k 2018-10-04 22:50:48 +02:00
BPanther
e962d40349 vusolo4k: more tuner fix 2018-10-04 22:50:46 +02:00
BPanther
3a4cded5d8 vusolo4k: more tuner 2018-10-04 22:50:43 +02:00
Frankenstone
ccc243eafe workaround arm hardware, timshift time in vfd
- thx DBoxOldie
2018-10-04 22:50:35 +02:00
TangoCash
7a796b445b silence ! 2018-10-04 22:50:32 +02:00
TangoCash
d52aa714ce silent output 2018-10-04 22:50:30 +02:00
redblue-pkt
87ffb80f3d fix backward 2018-10-04 22:50:24 +02:00
max_10
ec76737c03 fix segfault subtitles selection - but not yet ready 2018-10-04 22:50:18 +02:00
max_10
cf45b80334 generic-pc: rework glfb (thx seife) 2018-10-04 22:49:59 +02:00
Stefan Seyfried
c8c7f0c45f generic-pc: add alternative clutter based framebuffer
Add a framebuffer implementation based on clutter instead of "raw"
OpenGL. The performance is slightly worse, but it might bring some
platform abstraction and other benefits for the future.
2018-10-04 22:49:56 +02:00
Stefan Seyfried
9a5bc535b4 generic-pc: don't crash in getAudioInfo if no codec is set 2018-10-04 22:49:51 +02:00
svenhoefer
8a87094b11 - generic-pc/audio.cpp: add default-section to c->codec_id switch ...
to avoid compiler warnings
2018-10-04 22:49:48 +02:00
Jacek Jendrzej
1d4329a505 fix audio video rate info 2018-10-04 22:49:43 +02:00
max_10
b7d195ecaa fix mutex revert 2018-10-04 22:49:39 +02:00
max_10
bdf8de2c42 Revert "add mutex and thread abstraction"
This reverts commit 78dd12e2dd.
2018-10-04 22:49:07 +02:00
max_10
b08367d83a Revert "add mutex and thread abstraction to common files"
This reverts commit 626c785081.
2018-10-04 22:49:02 +02:00
max_10
745b3054ba Revert "add changed files"
This reverts commit c37263f594.
2018-10-04 22:48:59 +02:00
max_10
bc7be9dd74 Revert "fix thread namespace"
This reverts commit 3ef2eeb8aa.
2018-10-04 22:48:54 +02:00
max_10
1aece863c1 Revert "move libthread to libstb-hal"
This reverts commit 95ee7f9e98.
2018-10-04 22:48:05 +02:00
max_10
10710b9b53 Revert "change libeplayer3 to own thread class"
This reverts commit 9ed0a0d244.
2018-10-04 22:33:16 +02:00
max_10
89ab7c86dc Revert "changed raspi to own thread class"
This reverts commit 467f6976f7.
2018-10-04 22:33:13 +02:00
max_10
b3d05f59bf Revert "fix missing compiler include"
This reverts commit 047d3158c5.
2018-10-04 22:33:09 +02:00
BPanther
04fd634c0d small fix 2018-10-04 22:32:26 +02:00
max_10
83f8661c7b [libarmbox] libeplayer3-arm code format 2018-10-04 22:29:43 +02:00
max_10
6886c61e10 [libarmbox] libeplayer3-arm code format 2018-10-04 22:29:40 +02:00
max_10
4dc1decaf4 [libarmbox] fix last commit 2018-10-04 22:29:37 +02:00
max_10
f8e5b9a4a0 [libarmbox] add libeplayer3-arm --enable-flv2mpeg4 2018-10-04 22:29:34 +02:00
max_10
9c5221298b [libarmbox] Change Makefile.am 2018-10-04 22:29:27 +02:00
max_10
5402933900 [libarmbox] playback_libeplayer3.cpp code format 2018-10-04 22:29:25 +02:00
TangoCash
477bbc064c add frontpanel xres for sh4 (thx dbo) 2018-10-04 22:27:43 +02:00
BPanther
360661992e vusolo4k: small fix - but not yet ready 2018-10-03 19:23:57 +02:00
Frankenstone
8e37565740 fix CEC TV ON after deepstandby
- init 4 / init 3
2018-10-03 19:23:28 +02:00
Jacek Jendrzej
1219df131d reset seek position at the end of playback 2018-09-01 12:59:15 +02:00
Jacek Jendrzej
eaca615348 fix possible segfault 2018-07-28 14:24:12 +02:00
Jacek Jendrzej
e77090de83 fix framerate 29970 signalisatiom (by bazi98) 2018-05-31 13:55:54 +02:00
Jacek Jendrzej
626ed6a31b fix signalisation bitrate 599940 (by bazi98) 2018-05-30 10:40:58 +02:00
Jacek Jendrzej
511f0a5011 fix getAspectRatio for movieplayer 2018-05-29 18:37:58 +02:00
Jacek Jendrzej
148a6298da fix framerate for movieplayer 2018-05-29 18:06:21 +02:00
Jacek Jendrzej
6739acbdd4 set av input on start 2018-05-29 16:32:47 +02:00
Jacek Jendrzej
1d7e6dc1dc fix CEC TV ON after deepstandby 2018-05-25 17:05:09 +02:00
Jacek Jendrzej
5a2865d01c use enum for setAVInput 2018-05-19 19:21:22 +02:00
Jacek Jendrzej
f182216d94 add av input switch in deep/standby 2018-05-19 18:34:26 +02:00
Jacek Jendrzej
cfbec0b292 use SetCECState in deepstandby 2018-05-18 12:50:12 +02:00
Jacek Jendrzej
8bd666f27e Revert "this break play video ->try to fix set blank video"
This reverts commit c1049db9c6.
2018-05-18 11:45:08 +02:00
Jacek Jendrzej
c1049db9c6 try to fix set blank video -> http://dbox2world.net/thread/12965-hdmi-ausgang-im-standby-richtig-abschalten/ 2018-05-17 18:51:02 +02:00
Thilo Graf
3cf039c72b update to version 1.0.4-mpx 2018-04-27 08:35:49 +02:00
GetAway
eaf3e5c4b0 fix possible segfault
Signed-off-by: Thilo Graf <dbt@novatux.de>
2018-04-27 08:16:36 +02:00
GetAway
c7e6effcdf fix HD51 mix-up letterbox<->panscan
Signed-off-by: Thilo Graf <dbt@novatux.de>
2018-04-27 08:16:34 +02:00
max_10
110ad775e6 fix-compiler-warnings 2018-04-20 20:21:01 +02:00
samsamsam
f9b108577c Fix typo
Signed-off-by: max_10 <max_10@gmx.de>
2018-04-20 20:20:13 +02:00
samsamsam
55ced53561 Fix typo
Signed-off-by: max_10 <max_10@gmx.de>
2018-04-20 20:19:57 +02:00
samsamsam
0783d816b0 Add buffering for SH4
Signed-off-by: max_10 <max_10@gmx.de>
2018-04-20 20:19:19 +02:00
max_10
b35e8af698 bugfix-last-commits 2018-04-12 02:26:59 +02:00
samsamsam
193a2d305c Fix wrong playback file name
Signed-off-by: max_10 <max_10@gmx.de>
2018-04-12 02:26:56 +02:00
samsamsam
f380103bfc Add possibility to provide moov atom data as separate file.
This will allow playback of MP4 files which are under download and
moov atom is located at the end of file.

Signed-off-by: max_10 <max_10@gmx.de>
2018-04-12 02:25:49 +02:00
Thilo Graf
449438e144 generic-pc/dmx.cpp: fix possible compile error
Unused variable
2018-04-10 22:55:07 +02:00
TangoCash
cc09186911 fix generic compile 2018-04-10 22:35:39 +02:00
max_10
704bcc5a21 libeplayer3-arm: insert original blank lines from exteplayer3.git, for better merge 2018-04-10 22:19:03 +02:00
samsamsam
d00c87b361 Improve STOP command in the buffering mode
Signed-off-by: max_10 <max_10@gmx.de>
2018-04-10 22:18:55 +02:00
samsamsam
923698bbe1 Linux DVB output - workaround for BUG? in the DVB drivers
Signed-off-by: max_10 <max_10@gmx.de>
2018-04-10 22:18:51 +02:00
samsamsam
98195bba11 Replace the AAC Main object type to the AAC LC in the ADTS header - workaround for no audio on some TS'streams
Signed-off-by: max_10 <max_10@gmx.de>
2018-04-10 22:18:47 +02:00
samsamsam
93f61a89f6 Linux DVB output for STBs based on Broadcom - replace active pooling by select (ready to write)
Signed-off-by: max_10 <max_10@gmx.de>
2018-04-10 22:18:38 +02:00
samsamsam
2878ec69bc Add buffering for Linux DVB outputs
Signed-off-by: max_10 <max_10@gmx.de>
2018-04-10 22:18:34 +02:00
samsamsam
b0e666e1cb Do not wait in the FFMPEG thread.
Signed-off-by: max_10 <max_10@gmx.de>
2018-04-10 22:18:28 +02:00
max_10
5ccc49af32 all: clean up pwrmngr header file 2018-03-23 10:06:05 +01:00
max_10
6a3abc86d8 all: clean up cDemux headers 2018-03-23 10:05:55 +01:00
max_10
f4ad480fc0 armbox: fix video policy again
Conflicts:
	libarmbox/video.cpp
2018-03-23 10:05:26 +01:00
Thilo Graf
1d210b8de7 libeplayer3-arm/container/container_ffmpeg.c: add missing code parts
fix some pick errors
2018-03-22 17:51:00 +01:00
Thilo Graf
19a166bf93 libeplayer3-arm/playback/playback.c: add missing parts for backward play 2018-03-22 17:50:53 +01:00
max_10
ad45a46137 container_ffmpeg: fix Write from incompatible pointer type 2018-03-22 17:50:47 +01:00
samsamsam
c150fe7bd6 Set discard flag to all not active streams, do not process packets from discarded streams
Conflicts:
	libeplayer3-arm/container/container_ffmpeg.c
2018-03-22 17:50:35 +01:00
Jacek Jendrzej
8aa8152d09 fix commit 06f9a1b694 2018-03-22 13:38:29 +01:00
Thilo Graf
06f9a1b694 libarmbox/video.cpp: fix possible compile error
error: unused variable 'r' [-Werror=unused-variable]
2018-03-14 10:02:14 +01:00
samsamsam
c5920200b6 h264 writer - Revert not intended test change 2018-03-13 22:10:28 +01:00
samsamsam
8267a8c76d h264 writer - do not inject prive codec data if the Sequence Parameter Set (SPS) and the Picture Parameter Set (PPS) are available in the bitstreamThis should fix playback of stream http://www.djing.com/tv/live.m3u8 2018-03-13 22:10:25 +01:00
svenhoefer
828b4b439a - introduce caps.has_button_timer
Signed-off-by: Thilo Graf <dbt@novatux.de>
2018-03-13 22:10:02 +01:00
BPanther
8095d83353 missing brightness added for ufs922, hdbox, octagon1008, mini2, av7500 2018-03-13 22:06:06 +01:00
max_10
cb275626b1 libeplayer3-arm: cleanup types, use Context_t in commands 2018-03-13 22:05:50 +01:00
max_10
71905680a6 libeplayer3-arm: reduce compiler warnings 2018-03-13 22:00:16 +01:00
Jacek Jendrzej
0285b4e898 add screenshot for hd51 2018-02-26 18:10:20 +01:00
Jacek Jendrzej
f43dc68b5c supplement to b232a8f225, fix segfault with only audio stream 2018-02-11 12:01:19 +01:00
Jacek Jendrzej
e570611a8d remove isContainerRunning, this break next file play aufter eof stop 2018-02-10 20:41:24 +01:00
Jacek Jendrzej
b232a8f225 fix OUTPUT_PLAY error handling 2018-02-10 20:34:01 +01:00
max_10
e5d24ce4ed libeplayer3-arm: reduce compiler warnings 2018-02-09 15:15:39 +01:00
Frankenstone
0bd3f48ff2 arm different tuner authorization (thx DboxOldie) 2018-02-02 18:17:24 +01:00
Thilo Graf
ac95d67e89 update to version 1.0.3-mpx 2018-01-21 15:25:59 +01:00
Thilo Graf
9395b18f89 libarmbox/video.cpp: add missing lines in setBlank()
Fix lost lines in pick 'add armbox'
2018-01-21 14:37:33 +01:00
Thilo Graf
a8c886d166 libarmbox/hardware_caps.c: add missing init for caps.display_can_deepstandby 2018-01-21 14:37:31 +01:00
Thilo Graf
4ecbe7733b libarmbox/playback_gst.cpp: minor format changes 2018-01-21 14:37:29 +01:00
Thilo Graf
0ad071c97b libarmbox/playback_gst.cpp: small format changes 2018-01-21 14:37:26 +01:00
Jacek Jendrzej
a28ebe6eae Revert "return false in decoder have no time"
This reverts commit 6f006f1ce9.
2018-01-21 01:03:06 +01:00
Jacek Jendrzej
0e1d7fe1b5 return false in decoder have no time 2018-01-21 01:03:05 +01:00
Jacek Jendrzej
c0963b38f0 fix null list 2018-01-21 01:03:03 +01:00
Jacek Jendrzej
e4d7f02317 fix get play position 2018-01-21 01:03:02 +01:00
Frankenstone
ee18fd5c8a libeplayer3-arm: fix fast forward (thx DboxOldie) 2018-01-21 01:03:01 +01:00
max_10
bfb3de420f Revert "libeplayer3: switch off the teletext sub"
This reverts commit 96bd1c5c9f631ceb272dd4afb4667e8a976c8620.
2018-01-21 01:02:58 +01:00
max_10
8fe7fd7a3c libeplayer3-arm: Code formatting 2018-01-21 01:02:57 +01:00
max_10
5ccdc663b2 libeplayer3-arm: eliminate some warnings 2018-01-21 01:02:46 +01:00
max_10
c5dc767b64 adding SLOWMOTION, FASTBACKWARD and FASTFORWARD are not working properly yet. 2018-01-21 01:02:44 +01:00
TangoCash
0290cefdee fix last commit 2018-01-21 01:02:42 +01:00
TangoCash
136306c6d5 generic gestreamer align to armbox 2018-01-21 01:02:39 +01:00
max_10
65a67f7919 test 2018-01-21 01:02:38 +01:00
max_10
233e756d04 Revert "Revert "libeplayer3: switch off the teletext sub""
This reverts commit a2fc1d51ee.
2018-01-21 01:02:37 +01:00
Jacek Jendrzej
d275525164 Revert "return false in decoder have no time"
This reverts commit 6f006f1ce9.
2018-01-21 01:02:35 +01:00
Jacek Jendrzej
5f230f4d38 return false in decoder have no time 2018-01-21 01:02:34 +01:00
max_10
f41378c492 libarmbox: fix resolution icon in infoviewer 2018-01-21 01:02:32 +01:00
max_10
8f242002a9 armbox: Cosmetics replace spaces with tabs and delete unnecessary tabs 2018-01-21 01:02:31 +01:00
max_10
15b4162b58 armbox eplayer: fix playing files with subtitles
Signed-off-by: Thilo Graf <dbt@novatux.de>

Conflicts:
	libeplayer3-arm/manager/subtitle.c

additional format fixes, solved conflicts and clean up
2018-01-20 22:55:34 +01:00
max_10
5930dca63f libeplayer3-arm: audio.c delete newline 2018-01-20 22:42:18 +01:00
max_10
4e1855eb75 generic-pc: switch to ffmpeg 3.0 API 2018-01-20 22:39:07 +01:00
max_10
fbad9e1bc4 libarmbox/video: Workaround Channel Change No Black Picture when Show Picture was active. 2018-01-20 22:38:32 +01:00
max_10
f793f03267 libeplayer3-arm: fixes segfault on internet streams (thx DboxOldie) 2018-01-20 22:36:06 +01:00
Frankenstone
fc5c510334 libeplayer3-arm: fix fast forward (thx DboxOldie)
Conflicts:
	libeplayer3-arm/playback/playback.c

Signed-off-by: Thilo Graf <dbt@novatux.de>
2018-01-20 22:34:41 +01:00
TangoCash
3e166e6123 armbox eplayer: fix init jump 2018-01-11 19:51:05 +01:00
max_10
c8a4716085 fix ci arm auth (thx DboxOldie) 2018-01-11 19:50:39 +01:00
svenhoefer
32a693a51b - fix build for generic-pc
Signed-off-by: Thilo Graf <dbt@novatux.de>
2018-01-11 19:09:37 +01:00
max_10
1ac7e9202c libeplayer3-arm: update Makefile.am 2018-01-11 13:13:27 +01:00
max_10
32f64c474d libeplayer3-arm: eliminate some warnings 2018-01-11 13:03:18 +01:00
max_10
f72e8edc2e libeplayer3-arm: Code formatting 2018-01-11 13:02:22 +01:00
Frankenstone
0cdc859110 fix ci arm hardware (thx DboxOldie) 2018-01-07 19:30:17 +01:00
max_10
e6c29f2545 armbox eplayer: remove writeReverseData (unused) 2018-01-07 19:30:15 +01:00
Jacek Jendrzej
d2bb71dcab remove double AV_CODEC_ID_EAC3 2018-01-03 19:33:40 +01:00
max_10
db374e2225 armbox eplayer: noprobe for ts (thx DboxOldie) 2018-01-03 16:55:50 +01:00
max_10
6ae2a21f9c armbox eplayer: increase wait time (thx DboxOldie) 2018-01-03 16:55:44 +01:00
max_10
b5744e2728 armbox eplayer: eplayer3 Binary adaptation to the changed manager list (thx DboxOldie) 2018-01-03 16:55:37 +01:00
TangoCash
3b25b464c3 armbox eplayer: fix playing files with subtitles 2018-01-03 16:55:26 +01:00
svenhoefer
c88157d559 - add some missing members for ARM_HARDWARE; mostly dummy functions
Signed-off-by: Thilo Graf <dbt@novatux.de>
2018-01-02 14:01:01 +01:00
max_10
96bb5eb255 libeplayer3-arm: Code formatting 2017-12-28 19:53:18 +01:00
max_10
9b48c84176 libarmbox: Code formatting playback_libeplayer3 2017-12-28 19:53:05 +01:00
max_10
dfafcfa01c armbox eplayer: add eplayer3 bin 2017-12-28 19:52:48 +01:00
max_10
ac5aacd704 Code formatting 2017-12-28 19:52:39 +01:00
TangoCash
3d8987513d eplayer armbox: fix webtv (thx dbo) 2017-12-28 19:52:12 +01:00
Thilo Graf
ea00f01dcc update version 1.0.2-mpx
eplayer beta
2017-12-21 10:54:07 +01:00
TangoCash
ef4260b6b2 armbox eplayer: reactivate audio, subtitle and chapters 2017-12-21 10:43:24 +01:00
TangoCash
3d6689cfca armbox eplayer: add chapter.c 2017-12-21 10:43:19 +01:00
TangoCash
2a7f1bb1fa armbox eplayer: add chapters 2017-12-21 10:43:13 +01:00
TangoCash
f5c1ff725f armbox eplayer: align to last commits 2017-12-21 10:43:06 +01:00
TangoCash
c15484e01a armbox eplayer: use other tracklist 2017-12-21 10:42:54 +01:00
TangoCash
e5a50e7126 armbox eplayer: add metadata 2017-12-21 10:42:48 +01:00
TangoCash
6bc9d6a949 armbox eplayer: small fix TTX 2017-12-21 10:42:37 +01:00
max_10
3ca9c451a4 libeplayer3-arm: fix playback (thx DboxOldie) 2017-12-21 10:42:12 +01:00
max_10
011f009ece fix video policy 2017-12-21 10:41:26 +01:00
TangoCash
f9b1b8aa58 fix close files 2017-12-21 10:41:15 +01:00
svenhoefer
5d1406b93c - Makefile: disable libstb_hal_test stuff; this completes 188f10dd86
Signed-off-by: Thilo Graf <dbt@novatux.de>
2017-12-21 10:39:31 +01:00
TangoCash
09aa5e9ac5 generic gestreamer align to armbox 2017-12-21 10:38:34 +01:00
TangoCash
fea27b6160 gstreamer: increase seek accuracy 2017-12-21 10:36:54 +01:00
svenhoefer
228b58137c - generic-pc/audio: fix segfault in getAudioInfo() function
Signed-off-by: Thilo Graf <dbt@novatux.de>
2017-12-18 19:49:41 +01:00
TangoCash
c2a574aa4b fix compile 2017-12-18 19:47:21 +01:00
max_10
b75f8393c2 add libeplayer3-arm test 2017-12-18 19:47:06 +01:00
max_10
f28d013972 acinclude: some more minor format changes 2017-12-18 19:46:46 +01:00
max_10
7f081bee8c libeplayer3: code format 2017-12-18 19:46:34 +01:00
max_10
c0ef130e8e armbox: fix write value hex
Signed-off-by: Thilo Graf <dbt@novatux.de>

ax needs hex
2017-12-04 10:39:12 +01:00
Jacek Jendrzej
f5e07c5704 fix max apids 2017-11-23 09:29:40 +01:00
Jacek Jendrzej
188f10dd86 disable test 2017-11-23 08:56:38 +01:00
Jacek Jendrzej
3ac8fa2080 write m2v direct to device 2017-11-22 10:10:01 +01:00
TangoCash
8a3ba60e14 align gststreamer findallpids to eplayers logic 2017-11-21 09:52:58 +01:00
TangoCash
6af94cc719 porting av converter to sh4 2017-11-21 09:52:58 +01:00
Jacek Jendrzej
03446f4122 fix possible memleak 2017-11-17 16:20:42 +01:00
Jacek Jendrzej
6649d6250a convert pix fmt 2017-11-17 15:29:20 +01:00
Jacek Jendrzej
545fb415b2 fix logic and possible memleak 2017-11-17 06:34:13 +01:00
Jacek Jendrzej
e0effa50e2 fix last commit 2017-11-16 19:10:40 +01:00
Jacek Jendrzej
702b8d6085 check alloc AVFormatContext 2017-11-16 19:09:16 +01:00
Jacek Jendrzej
193fcf4ea1 fix close fp 2017-11-16 18:58:13 +01:00
Jacek Jendrzej
e86301004a convert jpg to m2v with libavcodec, need --enable-demuxer=image2 2017-11-16 18:51:01 +01:00
TangoCash
d016c7315e cleanup 2017-11-16 15:06:43 +01:00
TangoCash
afa6b14f46 cleanup 2017-11-16 15:06:43 +01:00
TangoCash
cde1e655f3 fix 0648 caid issue (dbo!!!) 2017-11-14 18:04:54 +01:00
Jacek Jendrzej
32a72a7357 sync with oher repo 2017-11-14 15:24:03 +01:00
Jacek Jendrzej
0b9575ff7f fix merge error 2017-11-14 15:13:13 +01:00
Jacek Jendrzej
5662d18602 fix last commit 2017-11-14 12:55:11 +01:00
Jacek Jendrzej
ceb1620bcd remove double keys 2017-11-14 11:33:38 +01:00
vanhofen
70cdad0db1 - add display_has_statusline member
Signed-off-by: Jacek Jendrzej <satbaby@kawaii.com>
2017-11-14 09:43:22 +01:00
vanhofen
6c0d55da96 - generic-pc: add our proven keymap to glfb 2017-11-14 09:41:02 +01:00
Jacek Jendrzej
64828627ac try to fix possible race condition 2017-11-13 09:44:47 +01:00
Jacek Jendrzej
fc5d505995 init mpegts 2017-11-12 08:58:18 +01:00
Jacek Jendrzej
dcce5347b1 Revert "return false in decoder have no time"
This reverts commit 6f006f1ce9.
2017-11-12 08:57:41 +01:00
Jacek Jendrzej
b67c8b39b5 fix last commit, broken check logic 2017-11-11 17:08:51 +01:00
Jacek Jendrzej
50904a1825 check if tag is gst list 2017-11-11 16:55:02 +01:00
Jacek Jendrzej
6f006f1ce9 return false in decoder have no time 2017-11-11 16:52:38 +01:00
Jacek Jendrzej
2864b81fe2 try to fix freeze with subtitle file , use gst_element_get_state only if need 2017-11-11 16:29:28 +01:00
TangoCash
bc4a9b3329 fix missing close fd (thx dbo) 2017-11-11 15:23:05 +01:00
Jacek Jendrzej
2bbb8a9044 move gchar * sourceName = gst_object_get_name(source); 2017-11-10 16:17:40 +01:00
Jacek Jendrzej
be5bf56314 check m_stream_tags if not NULL 2017-11-10 12:50:15 +01:00
Jacek Jendrzej
d9b7971e30 add check if children not NULL 2017-11-10 12:37:46 +01:00
Jacek Jendrzej
b75667176b fix memleak, init and compil 2017-11-10 12:25:58 +01:00
TangoCash
1e8e9bcc4d gstreamer playback: fix possible race condition 2017-11-10 12:20:28 +01:00
TangoCash
54341f0c48 gstreamer playback: fix possible segfault 2017-11-10 12:20:28 +01:00
TangoCash
31a73a2bd5 gstreamer playback: remove subtitles until fully supported 2017-11-08 10:18:15 +01:00
TangoCash
a811b733d4 gstreamer playback: fix possible segfaults 2017-11-08 10:18:15 +01:00
TangoCash
f170c38f10 CI: fix some caid issues (thx dboxoldie) 2017-11-08 10:18:15 +01:00
Thilo Graf
0040c0d0af Merge branch 'master' of https://github.com/TangoCash/libstb-hal-cst-next.git into mpx
update version 1.0.1

 Conflicts:
	include/hardware_caps.h
	libarmbox/hardware_caps.c
	libduckbox/hardware_caps.c
	libspark/hardware_caps.c
2017-11-06 15:22:18 +01:00
max_10
a513b0bf38 ci: armbox fix cpu load 2017-11-06 00:03:40 +01:00
TangoCash
cdbe044627 fix compile #2 2017-11-05 16:58:19 +01:00
TangoCash
b5820fadde fix compile 2017-11-05 16:57:11 +01:00
max_10
8886015bac armbox: add dvbci (thx DboxOldie) 2017-11-05 16:02:44 +01:00
TangoCash
dfeace50a5 armbox: tryfix cec 2017-11-05 14:25:01 +01:00
TangoCash
7c919eaf32 Merge branch 'master' of github.com:Duckbox-Developers/libstb-hal-cst-next 2017-11-05 13:55:23 +01:00
TangoCash
71c9c9d8e3 ci: let stbhal handle close 2017-11-05 13:54:42 +01:00
TangoCash
97f7c230e3 gstreamer playback, cleanup, fix real pid handling 2017-11-04 11:13:48 +01:00
TangoCash
28aa5147c6 gstreamer playback, avoid segfault 2017-11-03 22:35:08 +01:00
TangoCash
cccd010efb gstreamer playback, fix possible segfault #2 2017-11-03 22:30:24 +01:00
TangoCash
161feb4cf4 gstreamer playback, fix possible segfault 2017-11-03 22:25:11 +01:00
TangoCash
8218368064 update generic gstreamer 2017-11-03 21:18:53 +01:00
TangoCash
4b716df43c Merge branch 'master' of github.com:Duckbox-Developers/libstb-hal-cst-next 2017-11-03 13:44:12 +01:00
TangoCash
464838fd24 align 2017-11-03 12:12:32 +01:00
Thilo Graf
969377d8b6 version 1.0.0-mpx
hd51 support
2017-11-02 17:31:37 +01:00
Thilo Graf
917034fcd9 adjust .gitignore for untracked files 2017-11-02 17:25:49 +01:00
Thilo Graf
f9164dafb0 add default files 2017-11-02 17:23:50 +01:00
Thilo Graf
0380de3225 add update script 2017-11-02 17:23:48 +01:00
svenhoefer
5bbfc8fa6d - rename can_set_display_brightness => display_can_set_brightness
Signed-off-by: Thilo Graf <dbt@novatux.de>
2017-11-02 17:23:37 +01:00
svenhoefer
3b7613b778 - add display_can_deepstandby member
Signed-off-by: Thilo Graf <dbt@novatux.de>
2017-11-02 17:22:56 +01:00
Jacek Jendrzej
9a61e6264e fix null list 2017-11-02 14:56:04 +01:00
Jacek Jendrzej
7c4935a1c9 fix get play position 2017-11-02 14:55:52 +01:00
TangoCash
88ce7b707d gstreamer: reset pids at start 2017-11-01 10:02:38 +01:00
TangoCash
ca49904d31 gstreamer playback - get real apid from TS 2017-11-01 00:25:04 +01:00
TangoCash
a725528747 armbox: fullscreen osd ;) 2017-10-31 09:55:45 +01:00
TangoCash
5ef8f2edad gstreamer: fix lang detection 2017-10-30 21:00:23 +01:00
TangoCash
11bccbe4b7 Merge branch 'master' of github.com:Duckbox-Developers/libstb-hal-cst-next 2017-10-29 13:25:20 +01:00
max_10
f6ecb88ba0 libdvbci: log cosmetic 2017-10-28 22:29:12 +02:00
TangoCash
564e40bd72 armbox: fix get blank 2017-10-28 22:16:28 +02:00
TangoCash
b443fa07ac fixup gstreamer tags 2017-10-28 19:56:28 +02:00
TangoCash
d908c7a947 armbox: gstreamer tags support 2017-10-28 18:10:04 +02:00
TangoCash
5509c8c0c6 fix coverart 2017-10-27 23:38:20 +02:00
TangoCash
cf81628998 armbox: fix audio playback #2 2017-10-27 22:40:16 +02:00
TangoCash
f9e91b6b42 armbox: fix audio playback 2017-10-27 22:35:02 +02:00
TangoCash
f31f21be0c armbox: add video/audio pid 2017-10-27 22:21:30 +02:00
TangoCash
d70a853a05 Merge branch 'master' of github.com:Duckbox-Developers/libstb-hal-cst-next 2017-10-24 19:29:56 +02:00
Jacek Jendrzej
cb33592f3c fix get play position 2017-10-24 19:27:03 +02:00
Jacek Jendrzej
95ff777250 fix null list 2017-10-24 19:26:51 +02:00
max_10
402a0bca87 Merge remote-tracking branch 'tangocash/master' 2017-10-24 14:25:29 +02:00
max_10
2d571948d8 eDVBCISlot forgotten 2017-10-24 00:19:29 +02:00
TangoCash
d17ffb727b Merge branch 'master' of github.com:Duckbox-Developers/libstb-hal-cst-next 2017-10-23 23:38:18 +02:00
max_10
400d8f0ecd rename tSlot -> eDVBCISlot 2017-10-23 23:30:10 +02:00
TangoCash
908cbc3c7c Merge branch 'master' of github.com:Duckbox-Developers/libstb-hal-cst-next 2017-10-23 23:20:36 +02:00
max_10
c41f0ea13d modification sendDateTime 2017-10-23 23:16:18 +02:00
max_10
42811846d7 rename tSlot -> eDVBCISlot 2017-10-23 23:14:22 +02:00
Jacek Jendrzej
3ec44df06f fix uri for http 2017-10-23 20:48:39 +02:00
TangoCash
e4fca206a2 partly revert last commit 2017-10-22 11:03:04 +02:00
TangoCash
07d9206a56 armbox: fix gst playback 2017-10-22 10:46:57 +02:00
TangoCash
6f261730ff armbox: gstreamer - fix init jump, cleanup 2017-10-21 18:28:57 +02:00
Jacek Jendrzej
5ae1ba0530 rmove unused code 2017-10-20 19:41:01 +02:00
TangoCash
36cc88ad7e fix typo 2017-10-19 21:42:11 +02:00
TangoCash
0b69bc17f9 armbox: improve cec 2017-10-19 21:39:55 +02:00
TangoCash
9bdcb65a61 armbox: tryfix cec 2017-10-19 21:12:05 +02:00
TangoCash
99eb4a3c7f armbox: tryfix lost of video device after playing something with gst 2017-10-18 21:05:28 +02:00
max_10
afdef2dc28 Merge branch 'master' of github.com:Duckbox-Developers/libstb-hal-cst-next 2017-10-18 12:55:36 +02:00
max_10
fd64d23383 ca_ci: in some situations missing scambled flag (thx DboxOldie) 2017-10-18 12:54:19 +02:00
TangoCash
6d62e3c922 ca_ci: in some situations missing scambled flag (thx dbo) 2017-10-18 12:51:00 +02:00
TangoCash
0dd25ef8fb ca_ci: in some situations missing scambled flag (thx dbo) 2017-10-18 12:50:34 +02:00
TangoCash
4ccbffeb31 armbox: fix still image 2017-10-17 19:53:02 +02:00
TangoCash
18d6e271e2 armbox: fix devices 2017-10-17 18:39:21 +02:00
TangoCash
07b59f07dd armbox add missing header file 2017-10-17 18:39:10 +02:00
TangoCash
a3ecb31bc9 armbox: start implementing cec support 2017-10-17 18:00:36 +02:00
TangoCash
6268ebdb1b partly revert last commit 2017-10-15 18:06:43 +02:00
TangoCash
ec61bd0a3e armbox: let gst playback handle devices 2017-10-15 17:25:04 +02:00
TangoCash
73a12abdb8 armbox: adding header and user_agent to gst playback 2017-10-15 16:55:19 +02:00
TangoCash
fec61c7e1c armbox: gst-playback reformat code 2017-10-15 16:06:48 +02:00
TangoCash
6dcf797dba armbox: fix gst seeking 2017-10-15 15:10:18 +02:00
TangoCash
baf59692c6 fix last commit 2017-10-15 12:26:54 +02:00
TangoCash
8ad83136ce fix last commit 2017-10-15 12:25:20 +02:00
TangoCash
ba0766f0c0 fix gst playback 2017-10-15 12:23:46 +02:00
TangoCash
efc486301f armbox: enable DTS passthrough 2017-10-11 20:42:05 +02:00
TangoCash
a2fc1d51ee Revert "libeplayer3: switch off the teletext sub"
This reverts commit 1356d700be.
2017-10-08 13:14:30 +02:00
TangoCash
e465f24ead Merge branch 'master' of github.com:Duckbox-Developers/libstb-hal-cst-next 2017-10-08 12:53:06 +02:00
TangoCash
8a5b174917 Merge pull request #3 from MaxWiesel/master
:)
2017-10-08 12:44:07 +02:00
max_10
b0f09fd723 armbox: modification GetVideoSystem 2017-10-08 01:08:53 +02:00
max_10
03ca73f8f5 Merge remote-tracking branch 'tangocash/master' 2017-10-07 23:32:49 +02:00
TangoCash
c4d16f29c7 HMDI ac3 passthrough/downmix 2017-10-07 23:20:07 +02:00
TangoCash
0fc12438db armbox: remove audiomixers 2017-10-07 23:02:24 +02:00
max_10
5c0741a8e3 armbox: delete parts of sh4 code 2017-10-07 21:53:16 +02:00
max_10
86244ea952 armbox: remove dead code from cDemux 2017-10-07 21:04:31 +02:00
max_10
a5ee425996 armbox: remove videodecoder hack from dmx destructor 2017-10-07 21:02:27 +02:00
max_10
be07c1a1b7 armbox: use proc_tools 2017-10-07 21:00:08 +02:00
Stefan Seyfried
3f6cee32f4 spark: remove dead code from cDemux 2017-10-07 20:25:44 +02:00
Stefan Seyfried
9f1c5a6c59 spark: remove videodecoder hack from dmx destructor 2017-10-07 20:25:26 +02:00
Stefan Seyfried
b67a0a7e44 spark: fix race condition in cDemux
cDemux destructor was racing with Read() which did lead to all
sorts of nasty crashes because after poll returned, the dmx object
could be gone and its memory replaced with totally different things.
2017-10-07 20:25:11 +02:00
max_10
70d7730f82 fix cherry-pick 2017-10-07 20:24:51 +02:00
Stefan Seyfried
4285d9449d libspark: implement cVideo::GetVideoSystemFormatName() 2017-10-07 20:24:23 +02:00
Stefan Seyfried
1093c2b217 libspark: implement cVideo::GetVideoSystem() 2017-10-07 20:24:02 +02:00
max_10
6b2e3594fa Revert "implement GetVideoSystem"
This reverts commit 23afdef65c.
2017-10-07 20:23:32 +02:00
max_10
5ce57d6f57 Revert "align videomodes"
This reverts commit b66a63553b.
2017-10-07 20:23:15 +02:00
max_10
18f3fbd8b9 Revert "align videomodes"
This reverts commit 7f9a31d29c.
2017-10-07 20:22:40 +02:00
Stefan Seyfried
d57ac2cbdd spark/video: add missing O_CLOEXEC to memory fd 2017-10-07 20:20:44 +02:00
Stefan Seyfried
ba7a351f59 spark/video: implicitly do StopPicture() on CVideo::Start()
This seems to be what the coolstream code does.
TODO: look out for side effects (in radio mode etc...)
2017-10-07 20:19:53 +02:00
Stefan Seyfried
0d30ab013e spark: use proc_tools 2017-10-07 20:19:18 +02:00
max_10
6f914f7a45 add video_cs.h header to reduce number of #ifdefs needed 2017-10-07 19:41:49 +02:00
Stefan Seyfried
ceeb9a4f06 spark: remove dead code from cDemux 2017-10-07 18:10:20 +02:00
Stefan Seyfried
72f78ba5b7 spark: remove videodecoder hack from dmx destructor 2017-10-07 18:08:53 +02:00
Stefan Seyfried
c8f8e457f6 spark: fix race condition in cDemux
cDemux destructor was racing with Read() which did lead to all
sorts of nasty crashes because after poll returned, the dmx object
could be gone and its memory replaced with totally different things.
2017-10-07 18:06:26 +02:00
max_10
394e72444d fix cherry-pick 2017-10-07 17:49:09 +02:00
max_10
70863f46d9 acinclude: remove unused TUXBOX_APPS_* stuff 2017-10-07 17:31:46 +02:00
max_10
b26e5ee586 acinclude: remove unused boxtypes 2017-10-07 17:29:36 +02:00
Stefan Seyfried
57f9165852 libspark: implement cVideo::GetVideoSystemFormatName() 2017-10-07 17:17:11 +02:00
Stefan Seyfried
86b43b40e4 libspark: implement cVideo::GetVideoSystem() 2017-10-07 17:09:40 +02:00
max_10
ff94afb0c2 Revert "implement GetVideoSystem"
This reverts commit 23afdef65c.
2017-10-07 17:08:50 +02:00
max_10
1bd610e6e8 Revert "align videomodes"
This reverts commit b66a63553b.
2017-10-07 17:08:29 +02:00
max_10
196cbf0021 Revert "align videomodes"
This reverts commit 7f9a31d29c.
2017-10-07 17:08:04 +02:00
Stefan Seyfried
d1f2e0d286 spark/video: add missing O_CLOEXEC to memory fd 2017-10-07 17:05:13 +02:00
Stefan Seyfried
e66e7c34e9 spark/video: implicitly do StopPicture() on CVideo::Start()
This seems to be what the coolstream code does.
TODO: look out for side effects (in radio mode etc...)
2017-10-07 17:03:27 +02:00
Stefan Seyfried
f798ff9d71 spark: use proc_tools 2017-10-07 17:02:26 +02:00
max_10
754e529714 Merge remote-tracking branch 'tangocash/master' 2017-10-06 22:38:51 +02:00
TangoCash
6367dfc13f armbox: make open/close device public 2017-10-06 21:57:04 +02:00
max_10
730b2dfb3f Merge remote-tracking branch 'tangocash/master' 2017-10-05 19:26:50 +02:00
TangoCash
36e2ff6d68 re-arrange gstreamer code 2017-10-05 15:27:01 +02:00
TangoCash
cb74eae85b fix audio/video devices 2017-10-05 15:26:25 +02:00
TangoCash
63c02d0f24 fix armbox realname 2017-10-05 15:23:39 +02:00
TangoCash
3ece63839e adding 4k video settings for armbox 2017-10-01 13:35:40 +02:00
TangoCash
e5547c17ed fix generic compile 2017-10-01 12:00:48 +02:00
TangoCash
57ae0340c8 adding 4k video settings for armbox 2017-10-01 11:56:28 +02:00
max_10
b21afd56b1 libarmbox: adjustments 2017-09-26 14:16:42 +02:00
max_10
baf540d79f libarmbox: del libass LDFLAGS 2017-09-26 14:15:14 +02:00
max_10
2054081eeb libarmbox delete unnecessary code 2017-09-25 14:49:38 +02:00
max_10
5b2c79b80b Merge remote-tracking branch 'tangocash/master' 2017-09-19 18:27:01 +02:00
max_10
7cc65ef533 duplicate entry removed 2017-09-19 17:47:21 +02:00
max_10
1356d700be libeplayer3: switch off the teletext sub 2017-09-19 12:13:38 +02:00
TangoCash
b55bbce62d fix armbox vfd 2017-09-18 19:57:12 +02:00
max_10
c2b0d46a4e Merge remote-tracking branch 'tangocash/master' 2017-09-17 21:54:06 +02:00
TangoCash
63cb1f936c armbox: align to demuxes 2017-09-17 20:54:10 +02:00
TangoCash
17b3fefac8 armbox: fix PIG 2017-09-17 20:53:57 +02:00
TangoCash
7e61b2a3ea fix gst flags 2017-09-17 20:37:57 +02:00
max_10
814f92096b cs_api.h: add missing cs_get_chip_type() dummy 2017-09-15 14:29:29 +02:00
max_10
ee1ca3ff65 add video_cs.h header to reduce number of #ifdefs needed 2017-09-15 13:19:21 +02:00
max_10
f7786867c4 acinclude: add arm boxtypes 2017-09-14 23:42:04 +02:00
max_10
ab0c4a8d47 acinclude: remove unused TUXBOX_APPS_* stuff 2017-09-14 23:37:22 +02:00
max_10
7e4b69f3b9 acinclude: remove unused boxtypes 2017-09-14 23:33:45 +02:00
TangoCash
33f05feccc fix armbox frontpanel 2017-09-12 17:12:00 +02:00
TangoCash
d8c3c47b86 adding armbox 2017-09-12 16:10:27 +02:00
TangoCash
79c098ec3d Merge branch 'master' of github.com:TangoCash/libstb-hal-cst-next 2017-09-12 10:08:11 +02:00
TangoCash
1e32448978 Merge branch 'master' of github.com:Duckbox-Developers/libstb-hal-cst-next 2017-09-12 10:07:20 +02:00
max_10
88f0252368 avoid segfault when ci handler uses the cs_messenger until neutrino has not register it (thx DboxOldie) 2017-09-01 21:15:17 +02:00
TangoCash
599fd6df5a modify ac3flags 2017-07-28 16:17:30 +02:00
Jacek Jendrzej
181936ae81 fix compile 2017-07-28 16:16:43 +02:00
Jacek Jendrzej
abac47e04d generic-pc/video.cpp dont set output format with negative height size 2017-07-28 16:00:56 +02:00
TangoCash
c6bc573607 small fix for gstreamer 1.0 playback 2017-07-28 15:59:51 +02:00
TangoCash
4b70aa585c small fix for gstreamer 1.0 playback 2017-07-28 15:59:27 +02:00
TangoCash
c14e9d7713 adding initial support for gstreamer 1.0 2017-07-28 15:58:50 +02:00
Jacek Jendrzej
ad24fab431 fix compile 2017-07-15 20:06:13 +02:00
Jacek Jendrzej
2e765e73c2 generic-pc/video.cpp dont set output format with negative height size 2017-07-15 19:58:56 +02:00
TangoCash
717a2ee583 Merge branch 'master' of github.com:Duckbox-Developers/libstb-hal-cst-next 2017-06-20 20:14:05 +02:00
TangoCash
42cb750c5e fix indents and brackets 2017-06-20 18:58:09 +02:00
j00zek
dc9ef37866 correct info for dsi87 2017-06-20 18:34:22 +02:00
j00zek
b96dc38eb4 update tuners info 2017-06-20 18:32:08 +02:00
TangoCash
217a92f9ab Merge branch 'master' of github.com:Duckbox-Developers/libstb-hal-cst-next 2017-06-18 12:02:05 +02:00
TangoCash
d83f6dbfe4 re-enabled Display Brightness (thx dbo) 2017-06-17 21:02:05 +02:00
TangoCash
a2a3740c53 Merge branch 'master' of github.com:Duckbox-Developers/libstb-hal-cst-next 2017-06-09 14:27:50 +02:00
TangoCash
7f9a31d29c align videomodes 2017-06-09 14:03:09 +02:00
TangoCash
b66a63553b align videomodes 2017-06-09 14:01:47 +02:00
TangoCash
23afdef65c implement GetVideoSystem 2017-06-09 13:25:49 +02:00
TangoCash
fcfd96f8cd small fix for gstreamer 1.0 playback 2017-05-31 22:43:56 +02:00
TangoCash
a1f7fb9217 small fix for gstreamer 1.0 playback 2017-05-31 20:07:43 +02:00
TangoCash
a5198e44d2 adding initial support for gstreamer 1.0 2017-05-31 18:18:59 +02:00
TangoCash
ddc3bf3d30 -playback: fix compiling generic pc 2017-05-04 12:39:23 +02:00
TangoCash
5d72d67cca fix generic compile 2017-04-04 11:03:37 +02:00
TangoCash
ffd2fd0ce4 Merge pull request #2 from Duckbox-Developers/master
fix generic
2017-03-10 21:50:14 +01:00
TangoCash
5628130216 fix generic 2017-03-10 21:49:33 +01:00
TangoCash
44832d72fe Merge pull request #1 from Duckbox-Developers/master
adopt hw_caps
2017-03-10 21:39:48 +01:00
TangoCash
ae3cc86f0b adopt hw_caps 2017-03-10 21:38:31 +01:00
TangoCash
04d7e53c2b modify ac3flags 2016-11-18 16:07:44 +01:00
max
c4c5564b91 Merge pull request #5 from OpenAR-P/duckbox
Enable aac writer and use resmpling for some AAC streams thx Taapat  …
2016-10-31 10:28:36 +01:00
schpuntik
73483990f8 Enable aac writer and use resmpling for some AAC streams thx Taapat and technik 2016-10-31 02:06:05 +01:00
max10
19b576a45c no-stream-info 2016-09-29 20:14:13 +02:00
max10
192f42304e Improve CI handling (thx DboxOldie) 2016-09-18 18:49:44 +02:00
max10
db4a96588e fix ci-logic (thx DboxOldie) 2016-08-13 18:26:21 +02:00
max10
72f27a8fe5 ci-change-service-bug (thx DboxOldie) 2016-08-11 20:49:23 +02:00
max10
7f178d38f9 ci-alc automatically Multi-Decrypt 2016-08-05 23:23:33 +02:00
TangoCash
b60543ad6b add support for H265 supplemental #2 2016-07-24 17:47:34 +02:00
TangoCash
fe78a13e05 add support for H265 supplemental 2016-07-24 17:44:27 +02:00
TangoCash
0bed01e919 add support for H265 2016-07-24 17:14:43 +02:00
max10
37c20923ce simplyfi-c* (thx DboxOldie) 2016-07-11 16:42:18 +02:00
max10
bef98c2e91 add two-same-cip (thx DboxOldie) 2016-07-08 12:13:23 +02:00
max10
9173ae1b47 LocalTV and Entertain-TV streaming 2016-06-30 19:14:36 +02:00
max10
2e2b406af5 fix local-tv 2016-06-25 15:16:41 +02:00
max10
f953aa3b62 fix ci* **04 2016-06-20 00:23:47 +02:00
max10
ffd0f972f9 add channelid-check (thx DboxOldie) 2016-06-15 19:55:18 +02:00
max10
0215a673f5 update for spark uinput 2016-06-12 16:53:31 +02:00
max10
1feb9692c3 fix commit 8d6a7f8c3e 2016-06-05 11:20:38 +02:00
TangoCash
f87bd09bd4 Merge pull request #4 from sid8796/master
add boxmodel hl101
2016-05-14 20:00:21 +02:00
sid8796
9d7cb6de30 add boxmodel hl101 2016-05-14 19:54:05 +03:00
j00zek
63e9f9178f fix compilation with ffmpeg 3.0.1 2016-04-22 12:07:48 +02:00
max10
055fa18dbf re add old calcPts 2016-04-15 21:13:12 +02:00
max10
c340015ab2 fix input avlog thx DboxOldie 2016-04-05 20:33:23 +02:00
max10
379cc9515b Merge branch 'master' of github.com:Duckbox-Developers/libstb-hal 2016-04-03 10:46:05 +02:00
max10
8d6a7f8c3e eplayer fix init tectime aac thx DboxOldie 2016-04-03 10:44:45 +02:00
TangoCash
36f199b2fa porting cookie.patch to generic 2016-04-03 09:35:35 +02:00
max10
182baf4e57 add cookie.patch thx DboxOldie 2016-04-03 00:06:31 +02:00
TangoCash
747c5cb3f1 fix generic compile 2016-03-26 12:23:02 +01:00
TangoCash
944c27e51f fix char conversion 2016-03-26 12:19:37 +01:00
TangoCash
e73708b71c fix last commit 2016-03-26 12:09:34 +01:00
TangoCash
fd23101501 fix header 2016-03-26 12:03:13 +01:00
max10
8e99bc5cac fix spark ca (thx DboxOldie) 2016-02-24 23:27:45 +01:00
max10
741a34541f test c** 2015-12-05 17:55:22 +01:00
max10
295230d947 test c** 2015-12-02 21:49:24 +01:00
max10
92bd8b9ab9 test c** 2015-11-21 18:39:31 +01:00
max10
8a10609125 test c** 2015-11-20 15:40:19 +01:00
max10
46f67aaef0 test c** 2015-11-18 17:16:39 +01:00
max10
91b9bb6c9e test c** 2015-11-18 17:16:23 +01:00
max10
5ed2d1c73e test c** 2015-11-16 15:26:15 +01:00
max10
ca27972f16 test c** 2015-11-15 20:29:20 +01:00
TangoCash
43ded09d01 compile fix 2015-11-14 08:09:44 +01:00
max10
f7b22b485d test c** 2015-11-13 21:13:47 +01:00
max10
6ceed686a6 test c** 2015-11-12 19:31:21 +01:00
max10
9c71111851 Merge branch 'master' of github.com:Duckbox-Developers/libstb-hal 2015-11-11 12:28:12 +01:00
max10
242f8a8c88 add cuberevo_3000hd (Thx to jaro44) 2015-11-11 12:27:05 +01:00
TangoCash
94df5aeb1f fix build neutrino without c** 2015-11-10 23:21:03 +01:00
max10
9f3e34d4ad Adjustment Neutrino 2015-11-10 22:11:56 +01:00
max10
fe8b1237ac test c** 2015-11-10 15:55:48 +01:00
max10
890f4e2ea3 test c** 2015-11-10 00:08:40 +01:00
max10
0bbcfaf171 test c** 2015-11-10 00:00:04 +01:00
TangoCash
7ec6b85fa3 silence debug 2015-07-03 11:30:56 +02:00
max10
ce16e4a603 acinclude.m4: fix spark 2015-05-08 15:21:18 +02:00
Stefan Seyfried
030f06cee2 libeplayer3: try to fix dynamic linking
Conflicts:
	libeplayer3/Makefile.am
	libspark/Makefile.am

Conflicts:
	libeplayer3/Makefile.am
2015-05-04 11:28:58 +02:00
max10
5154d69a30 fix libspark/playback_libeplayer3: switch to lt_info/lt_debug 2015-05-04 11:22:30 +02:00
Stefan Seyfried
ba133fba30 spark: do not freeze/continue in GetScreenImage() 2015-05-04 11:21:12 +02:00
Stefan Seyfried
c1076ec35b fix wrong libtool initialization order
allow to build dynamic libraries (but keep static as default)
2015-05-04 11:20:58 +02:00
Stefan Seyfried
240eecde22 spark: implement GetScreenImage for video and audio
Conflicts:
	libspark/video.cpp
2015-05-04 11:20:02 +02:00
Stefan Seyfried
95cdd648c4 includes: remove *_td.h, we use is *_hal.h now 2015-05-04 11:19:37 +02:00
Stefan Seyfried
1497949fd5 libspark/playback_libeplayer3: fix EOF signalling
Conflicts:
	libspark/playback_libeplayer3.cpp
2015-05-04 11:19:05 +02:00
Stefan Seyfried
5f134156a9 libspark/playback_libeplayer3: switch to lt_info/lt_debug
Conflicts:
	libspark/playback_libeplayer3.cpp
2015-05-04 11:18:16 +02:00
Stefan Seyfried
d6d6b4a242 libeplayer3: remove absolute file names
this makes debug output nicer to read for out-of-tree builds
2015-05-04 11:14:52 +02:00
max10
13740f57b6 spark7162 without evremote2 2015-04-24 22:28:23 +02:00
max10
1bca61569e fix generic-pc: ffmpeg is deprecated 2015-04-22 14:26:19 +02:00
j00zek
b7bb43a670 [cuberevo] fix query model logic 2015-04-07 21:33:06 +02:00
TangoCash
8b534137c9 stop message flooding 2015-03-31 22:51:46 +02:00
j00zek
daa6561b62 [ariva@link200] include in libst-hal 2015-03-21 09:31:30 +01:00
j00zek
5d8fef5dc4 fix last commit 2015-03-21 08:31:21 +01:00
j00zek
c6ae1d4721 add arvia@link200 & co. 2015-03-20 22:34:28 +01:00
max10
53926a6650 Revert "AM_SILENT_RULES on"
This reverts commit 8aa0af7e18.
2015-03-20 14:41:39 +01:00
Stefan Seyfried
c44c3994f7 spark: clear video in StopPicture()
this fixes video playback after audioplayer or upnp browser

Conflicts:
	libspark/video.cpp
2015-03-17 18:41:17 +01:00
zukon
808354b31e add ipbox 9900, 99, 55 2015-03-11 11:45:42 +01:00
max10
45fda79300 remove aac is only required with gcc 4.8.3 2015-01-30 22:15:23 +01:00
max10
8aa0af7e18 AM_SILENT_RULES on 2015-01-27 22:17:54 +01:00
max10
f2ac0106f2 add cuberevo mini/250hd 2015-01-27 22:16:56 +01:00
max10
f5eca251ce fix libspark 2015-01-13 02:28:42 +01:00
smogm
047d3158c5 fix missing compiler include 2015-01-12 20:43:02 +01:00
smogm
467f6976f7 changed raspi to own thread class 2015-01-12 20:36:56 +01:00
smogm
9ed0a0d244 change libeplayer3 to own thread class 2015-01-12 20:26:52 +01:00
smogm
46166da4ec remove unnecessary Makefile.in 2015-01-12 18:47:02 +01:00
smogm
95ee7f9e98 move libthread to libstb-hal 2015-01-12 18:15:08 +01:00
smogm
3ef2eeb8aa fix thread namespace 2015-01-12 16:38:28 +01:00
smogm
c37263f594 add changed files 2015-01-11 18:12:55 +01:00
smogm
626c785081 add mutex and thread abstraction to common files 2015-01-11 17:58:37 +01:00
smogm
78dd12e2dd add mutex and thread abstraction 2015-01-11 17:52:31 +01:00
TangoCash
410b707f76 implement simple gstreamer_plackback 2015-01-03 19:24:37 +01:00
max10
da66fc3db5 fix compiler warning 2014-12-04 19:49:18 +01:00
max10
e05b1f5b85 fix compiler warning 2014-12-04 15:25:12 +01:00
max10
f3ffe33c53 Revert "so it is better thx DboxOldie"
This reverts commit 8c7441e14b.
2014-12-03 22:15:33 +01:00
max10
be0486e1c8 include/cs_frontpanel.h: fix fp_icon OCTAGON1008 2014-11-28 07:31:58 +01:00
max10
e860372343 test aac 2014-11-24 11:27:53 +01:00
max10
1c89a11f5e Revert "test old calcPts"
This reverts commit 3d4245d76d.
2014-11-24 11:07:48 +01:00
max10
4dc3ce3bd1 Revert "fix commit 3d4245d76df9bb23d2b13c7a01f10b594f81459f"
This reverts commit 3ac6db3b5a.
2014-11-24 11:07:36 +01:00
max10
c20a8fa5af Revert "disable logging"
This reverts commit 4798ce2517.
2014-11-24 11:07:22 +01:00
max10
8c7441e14b Revert "so it is better thx DboxOldie"
This reverts commit 4539ca9937.
2014-11-24 11:07:06 +01:00
max10
aa305f6cf6 Revert "test"
This reverts commit 0072b84bcb.
2014-11-24 11:06:54 +01:00
max10
0072b84bcb test 2014-11-20 22:00:23 +01:00
max10
7680e327cb fix include/cs_frontpanel.h 2014-11-12 17:05:57 +01:00
max10
4d24eac927 update include/cs_frontpanel.h 2014-11-11 23:37:17 +01:00
max10
f44923afe0 Revert "Revert "Revert "libspark/record: Implement writer thread. May or may not improve anything."""
This reverts commit a3ba152ccf.
2014-11-05 16:32:33 +01:00
max10
a3ba152ccf Revert "Revert "libspark/record: Implement writer thread. May or may not improve anything.""
This reverts commit 677776e03a.

Conflicts:
	libspark/record.cpp
2014-11-02 17:24:27 +01:00
max10
726153f71f update cs_frontpanel.h ufs922 2014-10-15 22:16:30 +02:00
max10
9cd14c07bb update cs_frontpanel.h thx DboxOldie 2014-10-15 20:51:05 +02:00
max10
4539ca9937 so it is better thx DboxOldie 2014-10-14 07:16:58 +02:00
max10
a20318bad8 record bs_dmx = 2mb / bs = 4mb 2014-10-12 17:46:42 +02:00
max10
4798ce2517 disable logging 2014-10-12 17:43:36 +02:00
max10
3ac6db3b5a fix commit 3d4245d76d 2014-10-08 23:13:26 +02:00
max10
3d4245d76d test old calcPts 2014-10-08 20:05:01 +02:00
max10
db151715a8 add aac.cpp THX DboxOldie 2014-10-08 17:14:10 +02:00
TangoCash
88f8a280fc small fix 2014-10-07 21:22:33 +02:00
max10
a40f13eb6a update gitignore 2014-10-05 18:57:44 +02:00
max10
93dce8ef8b update boxtype 2014-09-29 10:31:36 +02:00
TangoCash
53be1b06b8 cover support for getmetainfo 2014-09-21 18:56:51 +02:00
TangoCash
18814b385a fix timeshift (thx dbo) 2014-09-21 17:34:30 +02:00
max10
49829b1370 fix include 2014-09-16 19:09:28 +02:00
max10
ba13d72719 Merge remote-tracking branch 'martiis-libstb-hal/master' 2014-09-04 11:50:11 +02:00
max10
6992b116ca Merge remote-tracking branch 'martiis-libstb-hal/master' 2014-08-31 17:43:47 +02:00
martii
a8499a543b libspark/playback_libeplayer3: fix multi-program handling 2014-08-31 14:28:20 +02:00
martii
04fb4c9add libeplayer3/manager: use AVDISCARD_NONE instead of AVDISCARD_DEFAULT to disable programs 2014-08-31 12:36:22 +02:00
max10
40461c4cce Merge remote-tracking branch 'martiis-libstb-hal/master' 2014-08-25 18:48:21 +02:00
max10
9b523a87e8 Merge remote-tracking branch 'martiis-libstb-hal/master' 2014-08-25 18:43:44 +02:00
martii
8c4b1120df libeplayer3/h264: partially revert 9112c4d16d 2014-08-25 18:36:23 +02:00
martii
6c28142914 libspark/playback: don't show program selection dialog if audio or video pid is already selected 2014-08-25 17:42:30 +02:00
max10
7406f38ec9 fix typo 2014-08-22 23:06:18 +02:00
max10
d15025d6b9 Merge remote-tracking branch 'martiis-libstb-hal/master'
Conflicts:
	libspark/playback_libeplayer3.h
2014-08-22 21:25:26 +02:00
martii
9112c4d16d libeplayer3: implement multi-program support 2014-08-22 18:53:52 +02:00
martii
5fe92a546c libeplayer3/h264: simplify 2014-08-22 18:52:45 +02:00
max10
d57d4bb969 Merge remote-tracking branch 'martiis-libstb-hal/master' 2014-07-29 17:23:16 +02:00
martii
a3511c9219 libeplayer3/input: amend 545732a12b 2014-07-28 18:02:50 +02:00
martii
409501eaf0 libeplayer3/input: disable avformat logging 2014-07-27 11:09:45 +02:00
martii
545732a12b libeplayer3/input: don't modify avformat stream id 2014-07-27 10:36:43 +02:00
max10
d542e543b6 Merge remote-tracking branch 'martiis-libstb-hal/master' 2014-07-21 21:27:06 +02:00
martii
d1908cec2a fix generic compile 2014-07-21 19:35:55 +02:00
martii
67d34a37a7 libeplayer3/Makefile.am: set AUTOMAKE_OPTIONS = subdir-objects 2014-07-19 16:54:12 +02:00
martii
95b67078d1 libeplayer3/writer: minor cleanup, no binary change 2014-07-16 21:47:34 +02:00
max10
f960811a43 Merge remote-tracking branch 'martiis-neutrino-mp/master' 2014-07-07 21:18:33 +02:00
max10
677776e03a Revert "libspark/record: Implement writer thread. May or may not improve anything."
This reverts commit ada3f5e24a.
2014-07-07 21:14:22 +02:00
max10
dcbf062c43 Revert "libspark/record: remove debugging output accidently left in"
This reverts commit 55f7422715.
2014-07-07 21:13:52 +02:00
max10
38f9e896c5 Revert "libspark/record: always fill read buffer"
This reverts commit f77184cb68.
2014-07-07 21:01:47 +02:00
max10
29a5800ff9 Merge remote-tracking branch 'martiis-libstb-hal/master' 2014-06-29 18:28:16 +02:00
martii
656aef8328 libspark/audio: add mixer access methods 2014-06-29 13:00:18 +02:00
max10
c047a8d716 Merge remote-tracking branch 'martiis-libstb-hal/master' 2014-06-28 11:03:54 +02:00
martii
f77184cb68 libspark/record: always fill read buffer 2014-06-28 09:33:47 +02:00
max10
e9aa2a73bf Merge remote-tracking branch 'martiis-libstb-hal/master' 2014-06-19 12:57:53 +02:00
martii
ac92e6a38e libeplayer3/player: support bluray urls 2014-06-19 10:46:36 +02:00
max10
9206413947 Merge remote-tracking branch 'martiis-libstb-hal/master'
Conflicts:
	libspark/record.cpp
2014-06-08 23:49:58 +02:00
martii
55f7422715 libspark/record: remove debugging output accidently left in 2014-06-08 19:33:17 +02:00
martii
ada3f5e24a libspark/record: Implement writer thread. May or may not improve anything. 2014-06-08 19:27:12 +02:00
max10
db35ba0aa9 . 2014-06-05 21:15:00 +02:00
max10
48e0aeabc9 . 2014-06-04 22:20:39 +02:00
max10
76c498c2a9 . 2014-06-04 22:07:42 +02:00
max10
ad87948717 Merge remote-tracking branch 'martiis-libstb-hal/master' 2014-05-29 23:30:15 +02:00
martii
56ece5b5ea libeplayer3/input: allow access to AVFormatContext 2014-05-29 21:57:38 +02:00
max10
71ce14be99 Merge remote-tracking branch 'martiis-libstb-hal/master' 2014-05-24 14:10:29 +02:00
martii
9ac03e1046 libeplayer3/writer/pcm.cpp: break potential infinite loop 2014-05-24 13:05:16 +02:00
martii
8ae08d022c libeplayer3/input.cpp: filter duplicated messages 2014-05-24 13:04:06 +02:00
martii
81391c8998 .gitignore: add 'compile' 2014-05-24 13:02:36 +02:00
max10
df3a3db513 update cs_frontpanel.h 2014-05-19 22:38:18 +02:00
max10
03dfbc9cac Merge remote-tracking branch 'martiis-libstb-hal/master' 2014-05-03 22:49:03 +02:00
martii
5450625bc4 libeplayer3/input: no need for alloca() 2014-05-03 14:29:26 +02:00
martii
f93d4cc794 libeplayer3/input: fix SwitchVideo (unused, but anyway) 2014-05-03 12:35:59 +02:00
martii
67f034a6e8 libspark/hardware_caps: set has_SCART unconditionally 2014-05-03 09:45:17 +02:00
martii
d2de1050ba libeplayer3: limit video frame skipping to network streams 2014-05-02 15:05:47 +02:00
martii
84e5a47f24 libeplayer3: skip video until first audio frame was found 2014-05-02 14:52:10 +02:00
martii
dff15731cb libeplayer3: minor adjustments 2014-05-02 13:34:08 +02:00
max10
22ab9e6f89 [init.cpp] fix spark 2014-05-01 17:01:44 +02:00
martii
e2d9a58fc5 libspark: complement vendor ids 2014-05-01 15:06:27 +02:00
martii
c3ad6b5b23 libeplayer3: fix audio switching on already terminated playback 2014-05-01 12:52:38 +02:00
martii
6eea7139a4 libeplayer3/writer: add fd to writer class 2014-05-01 12:51:41 +02:00
martii
b767224487 libeplayer3/writer: add fd to writer class 2014-05-01 12:51:26 +02:00
martii
e2e5582c64 libeplayer3: cleanup AVFormatContext propagation to writers 2014-05-01 10:15:14 +02:00
martii
eebb7d6b39 libeplayer3/input: fix audio flush packet initialization 2014-05-01 10:01:36 +02:00
martii
18d7a15b88 libeplayer3/input: stream duration fix 2014-04-30 19:08:30 +02:00
max10
93297ca5b8 Merge remote-tracking branch 'martiis-libstb-hal/master' 2014-04-27 21:51:20 +02:00
martii
4ba8446079 libspark/init: simplify 2014-04-27 18:46:52 +02:00
martii
246f0416eb libeplayer3: remove flac writer (now handled by mp3 writer) 2014-04-27 12:52:15 +02:00
martii
6e01c872da libeplayer3: remove flac writer (now handled by mp3 writer) 2014-04-27 12:51:40 +02:00
martii
87167a7f5d libeplayer3/writer: implement decoder flushing 2014-04-27 12:45:15 +02:00
max10
4dc1171253 add libduckbox 2014-04-27 01:52:05 +02:00
max10
fcf4785716 Merge remote-tracking branch 'martiis-libstb-hal/master' 2014-04-27 00:38:54 +02:00
MaxWiesel
d7fe7683d3 Initial commit 2014-04-26 15:22:46 -07:00
martii
a76f665882 libeplayer3/writer/pcm: remove debug output 2014-04-26 19:54:42 +02:00
martii
4be41e8cf8 libeplayer3/writer/pcm: move reinit code out of packet loop 2014-04-26 19:20:32 +02:00
martii
ad8620e76a libeplayer3/writer: remove constructors/destructors from writer class 2014-04-26 14:57:22 +02:00
martii
8199257e8c libeplayer3/Makefile: minor rewrite 2014-04-26 14:56:15 +02:00
martii
07e6a4a9c1 libeplayer3: move calcPts to Input class 2014-04-26 14:54:38 +02:00
martii
55c516e2d8 libeplayer3/output: unbreak GetFrameCount() 2014-04-26 14:53:43 +02:00
martii
8b416c8c16 libeplayer3/writer/pcm: simplify 2014-04-26 14:53:02 +02:00
martii
9788b2403d libeplayer3/input: unbreak dvbsub pts calculation 2014-04-26 14:51:54 +02:00
martii
e784a6724c libeplayer3/writer/pcm: cleanup 2014-04-21 14:08:40 +02:00
martii
103037e239 libeplayer3/writer/pcm: simplify pts handling 2014-04-21 14:00:51 +02:00
martii
97440704de libeplayer3/writer/pcm: minor adjustments 2014-04-21 13:24:52 +02:00
martii
2e8a96a309 libeplayer3: minimize debug output 2014-04-18 16:20:07 +02:00
martii
b770330731 libeplayer3: fix backward mode 2014-04-18 16:09:54 +02:00
martii
91712236fe libeplayer3: use av_rescale for pts calulations 2014-04-18 11:16:44 +02:00
martii
020be569fa libeplayer3/input: disable noprobe and retry if probing fails 2014-04-18 09:48:28 +02:00
martii
2729075a35 libeplayer3: minor adjustments 2014-04-16 17:26:53 +02:00
martii
c43566e4a0 libeplayer3/writer/pcm: unbreak 2014-04-15 21:59:22 +02:00
martii
b21040d201 libeplayer3/input: don't segv in deconstructor 2014-04-15 19:47:59 +02:00
martii
2289de62e8 libeplayer3: optimizations (untested) 2014-04-15 17:12:22 +02:00
martii
8ccf1ba33b libeplayer3: use uint64_t instead of float/double for position calculations 2014-04-14 21:47:40 +02:00
martii
31230e5b19 libeplayer3/output: reset stream variables after Close() 2014-04-13 21:29:26 +02:00
martii
51b2ace4e4 libeplayer3: minor optimization 2014-04-13 19:29:07 +02:00
martii
958b5f6a2c libeplayer3/input: increase probesize 2014-04-13 16:30:33 +02:00
martii
aeec7f13a0 unbreak generic build 2014-04-13 10:07:06 +02:00
martii
7b0ea65fcd libeplayer3/input: fix AV_CODEC_ID_MP2 usage 2014-04-12 16:53:55 +02:00
martii
6b763f8393 libspark/playback_libeplayer3: no need to check for player 2014-04-12 13:11:01 +02:00
martii
79935f4821 libspark: unbreak timeshift 2014-04-11 20:12:54 +02:00
martii
51891e653f libeplayer3 adjustments 2014-04-11 18:40:39 +02:00
martii
4b681a4412 libeplayer3: cast away compiler warning 2014-04-11 14:49:42 +02:00
martii
d212bcfbc5 libeplayer3: cleanup 2014-04-11 14:20:22 +02:00
martii
9c0088b6d5 libeplayer3: ffmpeg now provides teletext details in codec->extradata 2014-04-11 14:11:36 +02:00
martii
17b828f6f2 libeplayer3: cleanup 2014-04-10 23:51:17 +02:00
martii
908ff30629 libeplayer3: work around duplicate ffmpeg stream ids by comparing stream addresses instead of pids (plus a couple of optimizations) 2014-04-10 23:35:38 +02:00
martii
98666dd735 libeplayer3/input: rename some variables 2014-04-10 20:47:44 +02:00
martii
2626355684 libeplayer3/output: remove redundant videofd check 2014-04-10 20:46:39 +02:00
martii
36869c9088 libeplayer3/writer: unsigned char => uint8_t 2014-04-10 20:45:57 +02:00
martii
b2368cc64f libeplayer3/Makefile: disable debugging flags 2014-04-09 22:07:12 +02:00
martii
b6a2310df6 libeplayer3: extend API 2014-04-09 22:06:41 +02:00
martii
708505d804 libeplayer is now C++, no more need for extern "C" to access Neutrino functions 2014-04-08 20:42:17 +02:00
martii
1b926b4921 libeplayer3: rename player thread 2014-04-08 20:24:22 +02:00
martii
af7ca7de2e libeplayer3: change compile options 2014-04-08 20:12:35 +02:00
martii
0a9b607d43 libeplayer3: track update: remove redundant teletext pid from return string 2014-04-08 20:10:05 +02:00
martii
7d49d4d32b libeplayer3: continue refresh 2014-04-08 20:02:07 +02:00
martii
42efb5c739 libeplayer3: cleanups 2014-04-07 23:00:03 +02:00
martii
82984ebd1e libeplayer3: rename files 2014-04-07 21:34:01 +02:00
martii
d8eaa8ed5b libeplayer3: remove debug.h 2014-04-07 21:28:20 +02:00
martii
b08abf6b52 libeplayer3: merge Playback to Player class 2014-04-07 21:25:30 +02:00
martii
a965fe4359 libeplayer3: implement Playback and Input classes 2014-04-07 21:01:35 +02:00
martii
cba7a708be libeplayer3: implement Playback and Input classes 2014-04-07 21:01:02 +02:00
martii
6c1f7c13bd libeplayer3: implement Manager class 2014-04-06 21:12:56 +02:00
martii
97883bde13 libeplayer3: rename linuxdvb.cpp => output.cpp 2014-04-06 18:21:31 +02:00
martii
cd3d91fa38 libeplayer3: implement Output class 2014-04-06 18:19:00 +02:00
martii
558b9410a8 libeplayer3: eliminate intermediate output layer 2014-04-06 13:30:20 +02:00
martii
e85f1dd4d1 libeplayer3: rename common.h => player.h 2014-04-06 12:13:50 +02:00
martii
1df8efeecd libeplayer3: rename common.h => player.h 2014-04-06 12:13:18 +02:00
martii
dd527fdfba libeplayer3: rename Content_t => Player 2014-04-06 12:11:40 +02:00
martii
70f58d2cf5 libeplayer3: remove unused code 2014-04-06 11:39:11 +02:00
martii
889d68740c libeplayer3: implement Writer class 2014-04-06 11:35:17 +02:00
martii
27d4c15952 libeplayer: simplify writer/pcm 2014-04-05 19:32:58 +02:00
martii
aa98de5993 libeplayer3: remove writeReverseData (unused) 2014-04-05 17:50:22 +02:00
martii
492b7f1b8d libeplayer3: cleanup pcm writer 2014-04-05 17:44:42 +02:00
martii
58b9518db1 libeplayer: cleanup writers 2014-04-05 16:40:03 +02:00
martii
5f2f008800 libeplayer3: unbreak ipcm 2014-04-05 16:34:03 +02:00
martii
1c380d1167 libeplayer3: let writers use AVPacket 2014-04-05 16:17:57 +02:00
martii
ec307c0f09 libeplayer3: c++ adjustments 2014-04-05 16:02:06 +02:00
martii
b6c1f8a5e3 libeplayer3: rename to c++ 2014-04-05 16:01:12 +02:00
martii
dbdf3b8b8e libeplayer3: delete include/aac.h (unused) 2014-04-05 13:27:13 +02:00
martii
97f95c8385 libeplayer3: remove wmv version (unused) 2014-04-05 13:26:24 +02:00
martii
6fa9a5a495 libeplayer: remove inject_raw_pcm (unused) 2014-04-05 13:24:39 +02:00
martii
21a7d427fd libeplayer3: move audio resampling to dedicated ipcm writer 2014-04-05 13:21:58 +02:00
martii
abc8d3661e libeplayer3: move width/height/framerate/timescale calculation to writers 2014-04-05 11:36:49 +02:00
martii
0895d29e2a libeplayer3: change extradata handling 2014-04-05 11:05:37 +02:00
martii
f217be304a libeplayer3: remove writer/wma.c and writer/aac.c (handled by ffmpeg instead) 2014-04-05 10:39:55 +02:00
martii
6328d3746e libeplayer3: make ffmpeg data available to manager, output and writer 2014-04-05 10:16:30 +02:00
martii
e5237866c4 libeplayer3: cleanup types 2014-04-05 10:01:52 +02:00
martii
10e201b279 libeplayer3: remove tools 2014-04-05 09:51:24 +02:00
martii
e50710dcdf libeplayer3: remove tools 2014-04-05 09:50:56 +02:00
martii
212a414a5e libeplayer/container_ffmpeg: switch to ffmpeg 2.0 API 2014-04-03 18:10:03 +02:00
martii
d2c6b63cc2 libeplayer3/container_ffmpeg: remove latestPts variable 2014-03-26 17:59:50 +01:00
martii
acef549ccd libeplayer3: more cleanups 2014-03-23 17:55:12 +01:00
martii
e08eadd574 libeplayer3: remove no longer needed teletext output handling 2014-03-23 14:46:31 +01:00
martii
daaa1ca8df libeplayer3: change teletext handling to directly inject packets in tuxtext 2014-03-23 13:54:40 +01:00
martii
4ca4f581d5 libeplayer3: cleanup unused code 2014-03-23 10:31:53 +01:00
martii
40f3aa97eb libeplayer3/container_ffmpeg: fix seek bitrate calculation 2014-03-23 10:09:17 +01:00
martii
b030449f72 libspark/hardware_caps: recognize dvfd [untested] 2014-03-22 17:23:51 +01:00
martii
65062ff495 libeplayer3/container_ffmpeg: don't set pts if audio-only 2014-03-22 14:18:37 +01:00
martii
af29c27d3a libeplayer3: initalize AVSubtitle 2014-03-22 13:27:34 +01:00
martii
ffb31db9fb libeplayer3: remove debugging output; abort if neither an audio nor a video stream is available 2014-03-22 13:26:29 +01:00
martii
c3278d9c3e cleanup 2014-03-21 23:27:37 +01:00
martii
351defa567 libeplayer3: remove subtitle.h 2014-03-21 22:37:55 +01:00
martii
9543bce812 libeplayer3/container_ffmpeg: drop subtitle.h include 2014-03-21 22:34:48 +01:00
martii
9e00f61071 libeplayer3: cleanup 2014-03-21 20:18:17 +01:00
martii
8c577d8e6f libeplayer3: subtitles will now be displayed by neutrino 2014-03-21 20:15:01 +01:00
martii
1853f87202 fix generic-pc 2014-03-16 07:40:17 +01:00
martii
d9e8e98678 libeplayer3: let neutrino handle bitmap subtitles 2014-03-16 07:29:38 +01:00
martii
12b070bc88 eplayer3: fix playback termination handling 2014-03-09 14:24:50 +01:00
martii
56b3c7e01d eplayer3: fix playback termination handling 2014-03-09 14:16:45 +01:00
Stefan Seyfried
8231b7f0db update ca.h to currently used interface 2014-02-28 18:55:42 +01:00
Stefan Seyfried
61a76eb83a include/mmi: fix spelling (but keep compatibility) 2014-02-28 18:54:24 +01:00
martii
687a244b61 [spark] video: change psi settings on demand only 2014-01-20 17:57:02 +01:00
martii
cf8f9bc8af [spark] fix setting psi controls 2014-01-19 17:24:52 +01:00
martii
1c676196af libeplayer3/libspark: cPlayback: implement retrieval of metadata 2014-01-19 12:25:35 +01:00
martii
4ab0e8f89e libeplayer3/container_ffmpeg: fix metadata access 2014-01-18 16:54:41 +01:00
martii
908464559c rename cPlayback::isPlaying() => cPlayback::IsPlaying() 2014-01-12 14:13:14 +01:00
martii
950cb9323d libspark/video: indent, no binary change 2014-01-11 13:13:51 +01:00
martii
626a48ccfb libeplayer3/playback: fix seeking/neutrino bookmarks 2013-12-28 22:44:10 +01:00
Stefan Seyfried
68f6b54413 sync seife 2013-12-28 18:36:30 +01:00
Stefan Seyfried
b802566789 libspark: add missing unistd.h includes for gcc 4.7+ 2013-12-28 18:14:41 +01:00
martii
450ac45c30 libeplayer3, libspark/playback_libeplayer3: chapter support 2013-12-23 16:47:29 +01:00
martii
2258a2fd3a libeplayer3/container_ffmpeg: only log ffmpeg errors at debug_level > 10 2013-12-17 15:39:11 +01:00
martii
4a4bb1e06f libeplayer3/container_ffmpeg: don't modify AVPacket internals (I don't believe this actually hurts, but better safe than sorry) 2013-12-15 19:23:15 +01:00
martii
9b7139ada1 libeplayer3/linuxdvb: reduce debug spam 2013-12-15 15:14:35 +01:00
martii
43b0c8c184 libspark/playback: speed up abort 2013-12-11 09:13:25 +01:00
martii
3df4924af5 libeplayer3: cleanup, indent 2013-12-09 16:47:15 +01:00
martii
f840fb0c60 libeplayer3: fix audio recoding, yt aac stuttering should be gone now 2013-12-09 12:15:37 +01:00
martii
21a984f1a1 tools/spark_fp: add flashing period option 2013-11-28 09:55:42 +01:00
martii
d43560ab2b libeplayer3/playback: disable debugging output 2013-11-23 14:40:28 +01:00
martii
8e23cdbad7 libeplayer3/ffmpeg: minor cleanup 2013-11-22 18:08:00 +01:00
martii
3e42b225f0 fix last commits 2013-11-21 23:15:35 +01:00
martii
2d652aab01 libeplayer3: run through indent, no binary change 2013-11-21 19:40:47 +01:00
martii
2c2ca45360 libeplayer3/container: fix compiler warning 2013-11-21 19:28:57 +01:00
martii
71c48b5faf libeplayer3/ffmpeg: rearrange seeking code 2013-11-21 19:25:20 +01:00
martii
df8103d5bb libeplayer3/ffmpeg: don't initialize container if context already exists 2013-11-21 18:18:13 +01:00
martii
0feee1d3b4 libeplayer3: fix seeking 2013-11-19 22:38:26 +01:00
martii
ecf5bb30fb libeplayer3/ffmpeg: add 3gp and ogm extensions 2013-11-19 19:33:33 +01:00
martii
ea558898b9 libeplayer3: modify fast-backward 2013-11-17 15:24:33 +01:00
martii
8f0f5dd29a tools/spark_fp: add option for enabling/disabling icons 2013-11-13 20:37:46 +01:00
martii
a56e611a05 libspark/audio, libeplayer3: audio type adjustments 2013-11-11 12:30:47 +01:00
martii
de39d0cdc7 libstb-hal/libspark/playback: add method for retrieving read-count 2013-11-04 14:15:21 +01:00
martii
a4f3af23bf libspark/playback: add more player checks 2013-11-03 14:31:45 +01:00
martii
7c4100b856 libspark/playback: SuspendSubtitle: check for player being valid 2013-11-03 14:28:52 +01:00
martii
539f41f46d libeplayer3: speed up termination 2013-11-02 16:02:33 +01:00
martii
8df85c94e8 unbreak generic-pc build 2013-11-02 15:12:10 +01:00
martii
773553ddb5 libspark/player, libeplayer3/ffmpeg: improve termination handling 2013-11-02 12:58:29 +01:00
martii
eda54c7cea libspark/player: use int instead of short in some places 2013-10-31 15:58:49 +01:00
martii
d13fc04473 libspark/audio: align to player2 2013-10-30 18:28:52 +01:00
martii
42bf8cb685 libspark/audio: add EAC3 support 2013-10-29 21:47:18 +01:00
martii
e44c547d78 Revert "libspark/video: enable/disable analogue output when leaving/entering standby mode (experimental and untested)"
This reverts commit 8062db2387.
2013-10-21 19:41:48 +02:00
martii
8062db2387 libspark/video: enable/disable analogue output when leaving/entering standby mode (experimental and untested) 2013-10-20 18:46:33 +02:00
martii
e065094e11 libeplayer3/ffmpeg: minor cleanup 2013-10-12 19:11:17 +02:00
martii
6f4449e1c5 Merge remote-tracking branch 'seife/master' 2013-10-06 14:41:32 +02:00
martii
848730507b sync with seife 2013-10-06 10:16:33 +02:00
martii
782bc95fd5 libspark/playback_libeplayer3: fix GetPts() 2013-10-05 10:42:21 +02:00
martii
70806da6ed libspark/audio: always use /proc/stb/avs/0/volume to set volume 2013-10-03 17:56:16 +02:00
martii
83201e0199 unbreak generic-pc build 2013-09-15 15:53:49 +02:00
martii
1756351a36 [SPARK] cVideo::ShowPicture: add optional argument for destination m2v 2013-09-06 22:23:22 +02:00
martii
938a6c4491 libspark/playback_libeplayer3: assume that libeplayer3 can handle arbitrary URLs 2013-08-18 20:03:47 +02:00
martii
19fd4c7ad2 libeplayer3/playback: convert mms urls to mmst instead of rtsp 2013-08-18 19:10:18 +02:00
martii
2477b3f497 libspark/hw_caps: check vfd version first (needed to discriminate between Pingulux and Pingulux Plus) 2013-08-18 10:52:43 +02:00
martii
2f5c51abc6 libeplayer3/manager: initialize track IDs 2013-08-16 19:50:20 +02:00
martii
124cd8e4ba libeplayer3: tracks update is now lock-free 2013-08-16 19:35:07 +02:00
martii
093862d85d libeplayer3/container_ffmpeg: mutex fix 2013-08-16 14:33:30 +02:00
martii
672b5d10d2 libeplayer3/wmv: revert to (almost) original version 2013-08-15 17:05:55 +02:00
martii
86e70db211 libspark/audio_mixer: don't try to free() stack-allocated snd_mixer_selem_id 2013-08-14 20:48:09 +02:00
martii
75e5268a3c libspark: implement SetColorFormat() 2013-08-11 12:39:20 +02:00
martii
89d1587513 libspark/dmx.cpp: print pid if addPid fails 2013-08-06 16:07:49 +02:00
martii
46a5151f07 libeplayer/text_srt: minor optimization 2013-08-04 16:42:21 +02:00
martii
5579633b0c libeplayer3: drop non-shared framebuffer support 2013-08-04 16:22:07 +02:00
martii
a9b0cee5a1 libeplayer3: unbreak srt subs 2013-08-04 16:21:39 +02:00
martii
50cc7f726c revert 286675f430 2013-08-02 15:07:15 +02:00
martii
286675f430 libeplayer3: divx fix 2013-08-02 14:37:03 +02:00
martii
6f531ed8b0 libeplayer3: cleanup 2013-08-02 12:44:51 +02:00
martii
f7d530de36 libeplayer3: vc1, wmv: use InsertPesHeader for initial PES headers, too 2013-08-02 08:37:17 +02:00
martii
b3f4ef99a1 libeplayer3/output/writer/: remove PesHeader memset (both wrong and unneeded) 2013-08-01 20:35:22 +02:00
martii
5aa75077cd libeplayer3 optimizations 2013-07-29 18:35:48 +02:00
martii
88c0ce06cb libeplayer3/container_ass: cosmetics 2013-07-28 14:40:30 +02:00
martii
95d99e1da6 libeplayer3/container_ffmpeg: cleanup 2013-07-28 13:04:20 +02:00
martii
d0d31f9998 libeplayer3/writer/framebuffer: small optimization 2013-07-28 12:33:24 +02:00
martii
2b91afacec generic-pc build fix 2013-07-28 12:20:01 +02:00
martii
3404980bc9 libeplayer3/container_ass: set thread name 2013-07-28 11:40:42 +02:00
martii
aa43e83a7c libeplayer3/pcm: cleanup 2013-07-28 10:12:36 +02:00
martii
411037021c libeplayer3/pcm: minor clean-up, no code change 2013-07-28 10:06:21 +02:00
martii
f8a789f7a6 Fix libeplayer3's broken PCM injection implementation. Jumps in movieplayer now works without losing a/v sync. 2013-07-28 09:54:39 +02:00
martii
c9e0755f02 libeplayer3/container_ffmpeg: don't flush instead of clear 2013-07-27 12:24:50 +02:00
martii
b64bdcb370 libeplayer3: use uint32_t for frame buffer access 2013-07-27 11:17:49 +02:00
martii
cf5687bc37 libeplayer3/continer_ass: crude hack to improve subtitle readability 2013-07-27 09:24:51 +02:00
martii
84b264ad87 libeplayer3/subtitles/spark: use backbuffer and blit 2013-07-27 08:12:03 +02:00
martii
441f337b48 libeplayer3/container_ass: font size adjusted 2013-07-26 22:50:26 +02:00
martii
c25b717b43 libeplayer/playback: disable subtitle init hack 2013-07-26 21:39:57 +02:00
martii
f199c329ad libeplayer3/subtitle: reduce debugging level 2013-07-26 20:29:01 +02:00
martii
35da5243e7 libeplayer3: initial attempt to unbreak ass/ssa subtitles 2013-07-26 16:59:58 +02:00
martii
c70b669a3d libeplayer/linuxdvb: cleanup 2013-07-24 21:38:31 +02:00
martii
6a658a2a6d libeplayer3/containter_ffmpeg: fix track update 2013-07-24 20:42:17 +02:00
martii
45bc6e3610 libeplayer3/container_ffmpeg: no need for copying the input packet 2013-07-23 21:45:44 +02:00
martii
c5fd4c8c3e libeplayer/container_ffmpeg: subtitle fix 2013-07-23 21:00:14 +02:00
martii
b78249cd02 libeplayer3/container_ffmpeg.c: re-order packet.data check (not sure whether this is needed at all) 2013-07-22 18:39:11 +02:00
martii
093fcac8fd libeplayer/container_ffmpeg: correct misplaced brackets 2013-07-21 19:50:14 +02:00
martii
034ab89f28 libeplayer3/container_ffmpeg: initialize stream ids, if unset 2013-07-21 19:02:58 +02:00
martii
ee3f84913a libeplayer3/container_ffmpeg: av_samples_alloc: use actual number for channels 2013-07-21 16:17:18 +02:00
martii
2a3a69b5a1 libeplayer3/container_ffmpeg: align av_samples_alloc buffer 2013-07-21 16:11:53 +02:00
martii
5db41a87e3 libeplayer3/container_ffmpeg: fix mono->stereo conversion 2013-07-21 14:54:57 +02:00
martii
b914c7bb32 libeplayer/container_ffmpeg: audio pts fix 2013-07-21 12:06:38 +02:00
martii
867e0a33e9 libeplayer3: remove outdated include/stm_ioctl.h 2013-07-20 15:36:22 +02:00
martii
1f0340cf19 container_ffmpeg: flush streams immediately after seek 2013-07-20 09:08:31 +02:00
martii
d4e42d28b4 libeplayer3: cleanup 2013-07-19 14:36:25 +02:00
martii
54e719207a libeplayer: reduce debugging output 2013-07-19 10:43:56 +02:00
martii
0c4711b209 h264: don't mess with packet length 2013-07-19 10:30:04 +02:00
martii
12b77f59a7 libeplayer3/h264: unbreak 2013-07-14 16:07:15 +02:00
martii
7438ff07b2 libeplayer3/container_ffmpeg: No attributes needed for mutex init 2013-07-14 15:17:36 +02:00
martii
ad36db9281 libeplayer3 cleanup 2013-07-14 14:55:48 +02:00
martii
c74138e765 libeplayer3/h264 cleanup 2013-07-14 13:36:19 +02:00
martii
443adcf6d0 libeplayer3: experimental h.264 playback fix 2013-07-14 13:30:50 +02:00
martii
33d6a1c7ca libeplayer3: cleanup 2013-07-14 10:04:05 +02:00
martii
fb16fc2ffb libeplayer3: use actual pids instead of indexes 2013-07-12 22:34:39 +02:00
martii
fcb9984000 ffmpeg-2.0 2013-07-10 19:27:57 +02:00
martii
1512840369 libeplayer3/container_ffmpeg: revert swr_next_pts call 2013-07-07 16:20:01 +02:00
martii
e80f8646e7 libeplayer3: minor changes 2013-07-07 15:59:55 +02:00
martii
f97060bcd6 libeplayer3: re-enable audio after seeking (still broken) 2013-07-07 10:34:29 +02:00
martii
c3ed9ba3f5 libeplayer3: need to call avcodec_free_frame after swresample, too 2013-07-06 17:06:01 +02:00
martii
5d8e40ba04 libspark/hardware_caps: lie for Pingulux SCART support 2013-06-27 21:31:15 +02:00
martii
fc9108b06a libspark/playback_libeplayer3: no need for alloca() 2013-06-26 22:37:35 +02:00
martii
178fac0e8d libspark: experimental pip changes (doesn't work; needs driver support) 2013-06-20 13:29:54 +02:00
martii
bb86b78aad sync with seife 2013-06-19 12:41:13 +02:00
martii
b8ad6fe246 libeplayer3: the mp3 handler can easily take care of vorbis data, too. 2013-06-13 20:58:08 +02:00
martii
5369d7496e libeplayer3: vorbis can easily be handled by the mp3 writer 2013-06-10 15:49:38 +02:00
martii
04cb2f24ff libeplayer3/h264: disable debugging 2013-06-10 15:11:13 +02:00
martii
9d4502b7fe libeplayer3: get rid of compiler warnings 2013-06-10 15:06:00 +02:00
martii
b5d81733f1 libeplayer3: drop legacy ffmpeg support 2013-06-10 13:13:52 +02:00
martii
db994be096 libeplayer/h264: Fix playback. 2013-06-10 12:38:47 +02:00
martii
23bea61473 cleanup 2013-06-08 15:39:35 +02:00
martii
eae9d7a7a1 libeplayer3: deactivate debugging 2013-06-08 12:34:19 +02:00
martii
6f384fc6b6 libeplayer3: cleanup 2013-06-08 12:05:36 +02:00
martii
a09c2518bc libeplayer3: further malloc-memcpy-write -> writev replacements; not fully regression tested 2013-06-08 11:15:09 +02:00
martii
8d8aa01f98 libeplayer3/h264: replace malloc/memcpy/write with writev 2013-06-08 10:19:40 +02:00
martii
e10d6a5a18 ShowPicture: revert API change 2013-06-07 16:21:04 +02:00
martii
4e439cdb41 libeplayer3: drop buffering code due to crashes 2013-06-07 15:16:29 +02:00
martii
ac072c5a41 libspark/playback: youtube URLs are easily longer than 400 bytes 2013-06-07 13:56:23 +02:00
martii
b018b10a66 sync 2013-06-01 17:21:07 +02:00
martii
8a68eb3f15 replace libavresample with libswresample 2013-06-01 13:47:47 +02:00
martii
8b533c3c59 generic-pc/glfb: use r/g/y/b keys as additional color keys 2013-06-01 12:29:30 +02:00
martii
a89b6f294e generic-pc: fix audio (2nd try) 2013-06-01 10:37:36 +02:00
martii
b8a8c07786 generic-pc: fix audio 2013-05-31 18:08:07 +02:00
martii
4e4dd50bb8 copy api changes from spark to generic 2013-05-31 13:27:04 +02:00
martii
0aec8dda78 Merge remote-tracking branch 'seife/master' 2013-05-27 17:38:35 +02:00
martii
236c2401f1 revert audio_mixer changes 2013-05-26 14:24:31 +02:00
martii
f70b1457cc libspark/audio_mixer: load alsa-lib temporarily only (fix) 2013-05-26 12:42:08 +02:00
martii
c09fc914a4 libspark/audio_mixer: load alsa-lib temporarily only 2013-05-26 10:56:08 +02:00
martii
151fd39d45 Merge remote-tracking branch 'seife/master' 2013-05-26 08:09:50 +02:00
martii
4e9395f788 libspark/video: use VIDEO_STILLPICTURE with NULL pointer to blank screen 2013-05-25 16:48:30 +02:00
martii
781cf7f389 libspark/video: ShowPicture: fix malloc size 2013-05-25 12:53:25 +02:00
martii
cde83d893d Merge remote-tracking branch 'seife/master' 2013-05-25 12:38:21 +02:00
martii
e68c20dfbe libspark/video: add missing newline 2013-05-25 11:24:32 +02:00
martii
18b798bee2 libspark/video: ShowPicture: use VIDEO_STILLPICTURE 2013-05-25 08:42:06 +02:00
martii
f88d47b0f2 libspark/video: ShowPicture: add flag to indicate that input file is already m2v and doesn't need to be converted 2013-05-18 15:29:19 +02:00
martii
a5cc6ae698 cleanup 2013-05-10 14:01:52 +02:00
martii
145b098d92 sync 2013-05-06 18:01:49 +02:00
martii
ec3f82441e Merge remote-tracking branch 'seife/master' 2013-05-04 20:52:54 +02:00
martii
ff374c6070 libeplayer reverse play: experimental adjustment to find previous I-frame 2013-04-11 17:59:22 +02:00
martii
5025a6e645 libeplayer3: fix segv 2013-04-10 20:41:44 +02:00
martii
e9be2bed37 eplayer3: subtitle fixes 2013-04-01 11:57:36 +02:00
martii
0962c08e90 crude hack for movieplayer tuxtxt integration 2013-03-31 11:55:51 +02:00
martii
f6f9f03152 libspark: drop irmp 2013-03-30 14:31:10 +01:00
martii
65b1a8e51a libspark/playback_libeplayer3: initialize return values 2013-03-30 09:39:49 +01:00
martii
2b11ad1880 teletext handling changes 2013-03-29 18:14:52 +01:00
martii
beac99d8b0 libeplayer3: dynamically update pid list 2013-03-25 20:42:36 +01:00
martii
683aa6dfd2 Merge remote-tracking branch 'seife/master' 2013-03-25 18:16:40 +01:00
martii
46754e01b1 adapt Pig() to blitter-based OSD border 2013-03-22 21:54:55 +01:00
martii
5548017dc7 libeplayer3/playback_libeplayer3: change noprobe handling 2013-03-18 18:49:00 +01:00
martii
f5c97eaf88 libeplayer/container_ffmpeg: use injected PCM for raw PCM, too 2013-03-17 09:47:18 +01:00
martii
ecd0dac595 libeplayer3/container_ffmpeg: handle .wtv extensions, too 2013-03-16 19:43:25 +01:00
martii
934296f8b7 libeplayer3/container_ffmpeg: fix WMA playback 2013-03-16 18:24:49 +01:00
martii
d02696233c libeplayer3: add callback to abort avformat_open_input 2013-03-10 15:44:30 +01:00
martii
a865a4779a libeplayer3/container_ffmpeg: cleanup 2013-03-09 16:40:54 +01:00
martii
8430f6f37c libeplayer3/container_ffmpeg: cleanup 2013-03-09 16:37:05 +01:00
martii
1a2aa05948 libeplayer3: merge buffered IO code from TDT; implement proper audio resampling 2013-03-09 14:47:34 +01:00
martii
404c0a2b2d libeplayer3/container_ffmpeg: minor cleanup 2013-03-04 19:22:47 +01:00
martii
2cd0da9170 Merge remote-tracking branch 'seife/master' 2013-03-04 17:38:14 +01:00
martii
828049ccbb libeplayer3/container_ffmpeg: no need to scale the buffer 2013-03-04 17:37:44 +01:00
martii
faeac91113 libeplayer3: this may improve recovery from broken streams 2013-03-03 20:55:39 +01:00
martii
9464d9eadb Merge remote-tracking branch 'seife/master' 2013-03-03 13:50:12 +01:00
martii
fbb9dcbb03 libeplayer3: switch back to software decoding for AAC; crude fix for PCM injection (newer ffmpeg versions return floats instead of shorts), injected PCM streams (OGG, for example), will now work again. I'd be grateful if anybody with a deeper understanding of the FFMPEG API would supply a cleaner fix ... 2013-03-03 13:38:39 +01:00
martii
3085e72c01 libeplayer: set 65535 as maximum PES length 2013-02-26 19:57:15 +01:00
martii
c964a090dd libeplayer: assume unlimited PES length for too large packets 2013-02-26 19:56:08 +01:00
martii
1d70357b45 libspark/playback: let GetPosition return false on EOF 2013-02-26 19:55:29 +01:00
martii
94b05dbdc0 sync with seife 2013-02-24 20:13:12 +01:00
martii
8a90d4311f libspark/hw caps: add 7111 stb ids 2013-02-24 11:07:14 +01:00
martii
e571a79932 libspark/hw_caps: add more stb ids, add boxtype 2013-02-24 10:46:14 +01:00
martii
a8668dc453 pic2m2v: remove verbosity level from ffmpeg due to incompatibility with the 0.8 branch 2013-02-24 09:52:16 +01:00
martii
4e13bfb4f0 remove untested code for 7162 support 2013-02-22 18:57:13 +01:00
martii
8a234a84bb hardware_caps: set CEC flag for SPARK 2013-02-12 21:18:45 +01:00
martii
366aaea114 hwcaps: add fe_offset_max for spark 2013-02-11 19:40:42 +01:00
martii
4f89348d43 spark_fp: augment usage output 2013-02-08 22:20:26 +01:00
martii
25a0179c83 spark_fp: add support for setting aotom hotkeys 2013-02-08 21:39:16 +01:00
martii
2e83762e95 spark_fp: small fix 2013-02-03 15:20:06 +01:00
martii
5d64ecf5fb sync with seife 2013-01-30 19:13:45 +01:00
martii
4929656233 fix spark_fp usage 2013-01-28 18:08:21 +01:00
martii
f744cf4d05 spark_fp: fix last patch, no binary change 2013-01-27 19:45:34 +01:00
martii
9d5cb7b443 spark_fp: re-added disabled code, no binary change 2013-01-27 19:42:07 +01:00
martii
25704f084d add support for sane aotom power-off from graugans, see http://www.dbox2-tuning.net/forum/viewtopic.php?f=69&t=50261 and corresponding driver/kernel patches 2013-01-27 19:13:27 +01:00
martii
d481adb2b8 libeplayer3: experimental fixes 2013-01-17 18:37:45 +01:00
martii
51941092e3 rename hwcap variable 2013-01-13 18:30:00 +01:00
martii
c734caa83a hwcaps: use FE_OFFSET environment variable 2012-12-26 15:45:37 +01:00
martii
39d38a38d9 revert volume calculation to original implementation 2012-12-17 16:33:07 +01:00
martii
932fba6516 libspark: work around driver bug 2012-12-16 21:21:15 +01:00
martii
4720ec559c libspark/pwrmngr: don't fall-back to default cpu frequency 2012-12-09 10:18:03 +01:00
martii
82a0c1aa10 add dmx offset to hw-caps 2012-12-08 11:58:50 +01:00
martii
079d28cc86 libspark/playback_libeplayer3: treat rtmp/mms as http stream 2012-11-14 14:20:31 +01:00
martii
6e74f47285 libeplayer/playback: initialize length to -1 2012-11-12 14:20:55 +01:00
martii
dcb1512663 libeplayer3 fix 2012-11-10 13:41:59 +01:00
martii
3d5353cbd8 libeplayer3: check for valid avContext pointer 2012-11-09 17:43:11 +01:00
martii
9150713e46 improve subtitle handling 2012-11-06 14:34:31 +01:00
martii
994bd78e4e sync 2012-11-04 18:46:58 +01:00
martii
aa0681a555 libspark/libeplayer: rudimentary subtitle support, probably unstable 2012-11-04 15:39:48 +01:00
martii
2f886cae89 fix red led recording state 2012-11-03 18:48:33 +01:00
martii
241de088cb libspark: fix volume-to-/proc/stb/avs/0/volume mapping 2012-11-01 11:45:05 +01:00
martii
aca3da1f29 get rid of most compiler warnings 2012-10-27 18:08:29 +02:00
martii
bc74c7528b enable wav payback (16 bit le) (from TDT, thanks hellmaster1024) 2012-10-27 18:07:02 +02:00
martii
669a91f8b7 sync 2012-10-12 14:42:48 +02:00
martii
9f3ac6d7d7 Merge remote-tracking branch 'seife/master' 2012-10-09 17:00:46 +02:00
martii
22d9e34f29 libeplayer3: disable noprobe hack 2012-10-04 09:42:28 +02:00
martii
e27fd37cad sync 2012-10-04 09:32:05 +02:00
martii
4e93e9cc48 sync 2012-10-01 18:35:21 +02:00
martii
eb5f5dc9ae merge 2012-09-22 16:27:06 +02:00
martii
53e9396bc1 spark input device handling: add function for reopening 2012-09-18 16:25:35 +02:00
martii
586ff9d657 Merge remote-tracking branch 'seife/master' 2012-09-18 13:33:02 +02:00
martii
462353e9dd add VFDGETVERSION support 2012-09-12 20:25:15 +02:00
martii
9c22d47bc3 audio_mixer: correct conversion 2012-09-05 20:49:47 +02:00
martii
7cd67c9fad spark: add volume control for alsa mixer 2012-09-05 19:08:45 +02:00
martii
1ccc2ee75a eplayer3 h263 fix 2012-08-31 12:33:59 +02:00
martii
260a6fcc2f cast sizeof to signed to avoid compiler warning 2012-08-16 22:10:55 +02:00
martii
2bdab523e5 Merge remote-tracking branch 'seife/master' 2012-08-16 22:05:33 +02:00
martii
d7d11fdd0d fix indent 2012-08-13 18:42:15 +02:00
martii
c2a9c1a6df libspark/video.cpp: I tend to believe that comparing signed and unsigned would break for st.st_size < 4 2012-08-12 10:04:35 +02:00
martii
92731e6fe3 libeplayer3: add support for teletext and dvbsubtitle streams 2012-08-04 13:31:28 +02:00
martii
d6bdeb0ff0 fix some movieplayer issues 2012-07-27 20:09:26 +02:00
martii
1d0e6663c4 libeplayer3: sync with tdt 2012-07-21 21:03:59 +02:00
martii
450fc1966a libspark/record.cpp: user configurable buffer sizes 2012-07-21 16:32:00 +02:00
martii
2ca16aedac Merge remote-tracking branch 'seife/master' 2012-07-15 20:13:18 +02:00
martii
3a9a21c8ee spark_fp: add options for setting led status 2012-07-14 13:15:41 +02:00
martii
fded24562f spark_fp: add options for setting led status 2012-07-14 13:12:50 +02:00
martii
d38bef08f4 spark record: set dmx to non-blocking mode, change buffer size 2012-07-13 16:31:31 +02:00
martii
b1f92d8e9c video_lib.h header adapted to match one of the previous changes 2012-07-13 16:30:43 +02:00
martii
7f45271ad2 input handling: copy input data from secondary devices to the main rc device 2012-07-13 16:29:53 +02:00
martii
bcaf83a8c7 spark powermanager: SetCpuFreq now actually does what its name says 2012-07-13 16:27:13 +02:00
martii
6e8bdf5c34 spark video: implement SetControl 2012-07-13 16:26:22 +02:00
martii
249d2964ac spark dmx: less debugging output; set buffer size 2012-07-13 16:25:48 +02:00
martii
d03f3c8fee spark audio: add support for channel specific volume 2012-07-13 16:24:18 +02:00
martii
6f1de0cd6c spark_fp: don't touch LEDs on shutdown 2012-07-13 16:23:04 +02:00
martii
752e1e4368 support newer ffmpeg versions 2012-07-13 16:22:19 +02:00
346 changed files with 59347 additions and 10208 deletions

67
.gitignore vendored
View File

@@ -1,19 +1,68 @@
/aclocal.m4
/autom4te.cache/
### http://www.gnu.org/software/automake
Makefile
Makefile.in
### http://www.gnu.org/software/autoconf
autom4te.cache
/autoscan.log
/autoscan-*.log
/aclocal.m4
/compile
/config.guess
/config.h.in
/config.log
/config.status
/config.sub
*/*-config.h
*/*-config.h.in
/configure
/compile
*.directory
/configure.scan
/depcomp
/install-sh
/ltmain.sh
/m4/
/missing
*.*~
/stamp-h*
### https://www.gnu.org/software/libtool/
/libtool
/ltmain.sh
### http://www.gnu.org/software/m4/
m4/libtool.m4
m4/ltoptions.m4
m4/ltsugar.m4
m4/ltversion.m4
m4/lt~obsolete.m4
### compiled objects and libs
.libs
*.lo
*.o
*.so
*.lai
*.la
*.a
### dependency files
.deps
*.Plo
*.Po
### diff and patch files
*.patch
*.diff
*.orig
*.rej
### system generated stuff
# dolphin
.directory
# kate
*-swp
.*.swp
### generally excluded files
*~
*.pc
git-*
go_*
### header files that fall out of the build
libstb-hal-config.h

339
COPYING
View File

@@ -0,0 +1,339 @@
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Lesser General Public License instead.) You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. You must make sure that they, too, receive or can get the
source code. And you must show them these terms so they know their
rights.
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The "Program", below,
refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language. (Hereinafter, translation is included without limitation in
the term "modification".) Each licensee is addressed as "you".
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.
1. You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.
You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
b) You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.
c) If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you provide
a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.
In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:
a) Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software interchange; or,
b) Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
c) Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)
The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable. However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.
If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.
5. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all. For example, if a patent
license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.
9. The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the Program
specifies a version number of this License which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.
10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
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 General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:
Gnomovision version 69, Copyright (C) year name of author
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, the commands you use may
be called something other than `show w' and `show c'; they could even be
mouse-clicks or menu items--whatever suits your program.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the program, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
`Gnomovision' (which makes passes at compilers) written by James Hacker.
<signature of Ty Coon>, 1 April 1989
Ty Coon, President of Vice
This General Public License does not permit incorporating your program into
proprietary programs. If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License.

2427
ChangeLog

File diff suppressed because it is too large Load Diff

0
INSTALL Normal file
View File

View File

@@ -3,15 +3,13 @@ ACLOCAL_AMFLAGS = -I m4
lib_LTLIBRARIES = libstb-hal.la
libstb_hal_la_SOURCES =
SUBDIRS = common tools
#bin_PROGRAMS = libstb-hal-test
libstb_hal_la_LIBADD = \
common/libcommon.la
libstb_hal_la_LDFLAGS = -version-info 1:0:1
libstb_hal_test_SOURCES = libtest.cpp
libstb_hal_test_LDADD = libstb-hal.la
#bin_PROGRAMS = libstb-hal-test
#libstb_hal_test_SOURCES = libtest.cpp
#libstb_hal_test_LDADD = libstb-hal.la
# there has to be a better way to do this...
if BOXTYPE_TRIPLE
@@ -19,45 +17,67 @@ SUBDIRS += libtriple
libstb_hal_la_LIBADD += \
libtriple/libtriple.la
endif
if BOXTYPE_AZBOX
SUBDIRS += azbox
SUBDIRS += libazbox
libstb_hal_la_LIBADD += \
azbox/libazbox.la
endif
if BOXTYPE_GENERIC
if BOXMODEL_RASPI
SUBDIRS += raspi
libstb_hal_la_LIBADD += \
raspi/libraspi.la
else
SUBDIRS += generic-pc
libstb_hal_la_LIBADD += \
generic-pc/libgeneric.la
endif
endif
if BOXTYPE_SPARK
SUBDIRS += libspark libeplayer3
libstb_hal_la_LIBADD += \
libspark/libspark.la \
libeplayer3/libeplayer3.la
libazbox/libazbox.la
endif
pkginclude_HEADERS = \
include/audio_hal.h \
include/ca_cs.h \
include/ca.h \
include/cs_api.h \
include/cs_types.h \
include/dmx_cs.h \
include/dmx_hal.h \
include/glfb.h \
include/hardware_caps.h \
include/init_cs.h \
include/init_td.h \
include/mmi.h \
include/playback.h \
include/playback_hal.h \
include/pwrmngr.h \
include/record_hal.h \
include/version_hal.h \
include/video_cs.h
if BOXTYPE_GENERIC
if BOXMODEL_RASPI
SUBDIRS += libraspi
libstb_hal_la_LIBADD += \
libraspi/libraspi.la
else
SUBDIRS += libgeneric-pc
libstb_hal_la_LIBADD += \
libgeneric-pc/libgeneric.la
endif
endif
if BOXTYPE_SPARK
#libstb_hal_test_LDADD += -lasound
SUBDIRS += libspark libeplayer3-sh4
libstb_hal_la_LIBADD += \
libspark/libspark.la \
libeplayer3-sh4/libeplayer3_sh4.la
endif
if BOXTYPE_DUCKBOX
#libstb_hal_test_LDADD += -lasound
SUBDIRS += libduckbox libeplayer3-sh4 libdvbci
libstb_hal_la_LIBADD += \
libduckbox/libduckbox.la \
libeplayer3-sh4/libeplayer3_sh4.la \
libdvbci/libdvbci.la
endif
if BOXTYPE_ARMBOX
if BOXMODEL_HD60
SUBDIRS += libarmbox
libstb_hal_la_LIBADD += \
libarmbox/libarmbox.la
else
#libstb_hal_test_LDADD += -lasound
SUBDIRS += libarmbox libdvbci
libstb_hal_la_LIBADD += \
libarmbox/libarmbox.la \
libdvbci/libdvbci.la
if !ENABLE_GSTREAMER_10
SUBDIRS += libeplayer3
libstb_hal_la_LIBADD += \
libeplayer3/libeplayer3.la
endif
endif
endif
if BOXTYPE_MIPSBOX
SUBDIRS += libmipsbox libdvbci
libstb_hal_la_LIBADD += \
libmipsbox/libmipsbox.la \
libdvbci/libdvbci.la
SUBDIRS += libeplayer3
libstb_hal_la_LIBADD += \
libeplayer3/libeplayer3.la
endif

2
README.md Normal file
View File

@@ -0,0 +1,2 @@
libstb-hal
==========

View File

@@ -1,24 +1,27 @@
AC_DEFUN([TUXBOX_APPS],[
AC_DEFUN([TUXBOX_APPS], [
AM_CONFIG_HEADER(config.h)
AM_MAINTAINER_MODE
AC_SYS_LARGEFILE
AC_GNU_SOURCE
AC_ARG_WITH(target,
[ --with-target=TARGET target for compilation [[native,cdk]]],
[TARGET="$withval"],[TARGET="native"])
AS_HELP_STRING([--with-target=TARGET], [target for compilation [[native,cdk]]]),
[TARGET="$withval"],
[TARGET="native"])
AC_ARG_WITH(targetprefix,
[ --with-targetprefix=PATH prefix relative to target root (only applicable in cdk mode)],
[targetprefix="$withval"],[targetprefix="NONE"])
AS_HELP_STRING([--with-targetprefix=PATH], [prefix relative to target root (only applicable in cdk mode)]),
[TARGET_PREFIX="$withval"],
[TARGET_PREFIX=""])
AC_ARG_WITH(debug,
[ --without-debug disable debugging code],
[DEBUG="$withval"],[DEBUG="yes"])
AS_HELP_STRING([--without-debug], [disable debugging code @<:@default=no@:>@]),
[DEBUG="$withval"],
[DEBUG="yes"])
if test "$DEBUG" = "yes"; then
DEBUG_CFLAGS="-g3 -ggdb"
AC_DEFINE(DEBUG,1,[Enable debug messages])
AC_DEFINE(DEBUG, 1, [enable debugging code])
fi
AC_MSG_CHECKING(target)
@@ -34,238 +37,314 @@ if test "$TARGET" = "native"; then
prefix=/usr/local
fi
targetprefix=$prefix
TARGET_PREFIX=$prefix
AC_DEFINE_UNQUOTED(TARGET_PREFIX, "$TARGET_PREFIX", [The targets prefix])
elif test "$TARGET" = "cdk"; then
AC_MSG_RESULT(cdk)
if test "$prefix" = "NONE"; then
AC_MSG_ERROR(invalid prefix, you need to specify one in cdk mode)
if test "$CC" = "" -a "$CXX" = ""; then
AC_MSG_ERROR([you need to specify variables CC or CXX in cdk])
fi
if test "$targetprefix" = "NONE"; then
targetprefix=""
if test "$CFLAGS" = "" -o "$CXXFLAGS" = ""; then
AC_MSG_ERROR([you need to specify variables CFLAGS and CXXFLAGS in cdk])
fi
if test "$prefix" = "NONE"; then
AC_MSG_ERROR([invalid prefix, you need to specify one in cdk mode])
fi
if test "$TARGET_PREFIX" != "NONE"; then
AC_DEFINE_UNQUOTED(TARGET_PREFIX, "$TARGET_PREFIX", [The targets prefix])
fi
if test "$TARGET_PREFIX" = "NONE"; then
AC_MSG_ERROR([invalid targetprefix, you need to specify one in cdk mode])
TARGET_PREFIX=""
fi
else
AC_MSG_RESULT(none)
AC_MSG_ERROR([invalid target $TARGET, choose on from native,cdk]);
fi
AC_CANONICAL_BUILD
AC_CANONICAL_HOST
])
dnl expand nested ${foo}/bar
AC_DEFUN([TUXBOX_EXPAND_VARIABLE],[__$1="$2"
for __CNT in false false false false true; do dnl max 5 levels of indirection
$1=`eval echo "$__$1"`
echo ${$1} | grep -q '\$' || break # 'grep -q' is POSIX, exit if no $ in variable
__$1="${$1}"
done
$__CNT && AC_MSG_ERROR([can't expand variable $1=$2]) dnl bail out if we did not expand
])
AC_DEFUN([TUXBOX_APPS_DIRECTORY_ONE],[
AC_ARG_WITH($1,[ $6$7 [[PREFIX$4$5]]],[
_$2=$withval
if test "$TARGET" = "cdk"; then
$2=`eval echo "${targetprefix}$withval"` # no indirection possible IMNSHO
else
$2=$withval
fi
TARGET_$2=${$2}
],[
# RFC 1925: "you can always add another level of indirection..."
TUXBOX_EXPAND_VARIABLE($2,"${$3}$5")
if test "$TARGET" = "cdk"; then
TUXBOX_EXPAND_VARIABLE(_$2,"${target$3}$5")
else
_$2=${$2}
fi
TARGET_$2=$_$2
])
dnl automake <= 1.6 don't support this
dnl AC_SUBST($2)
AC_DEFINE_UNQUOTED($2,"$_$2",$7)
AC_SUBST(TARGET_$2)
])
AC_DEFUN([TUXBOX_APPS_DIRECTORY],[
AC_REQUIRE([TUXBOX_APPS])
if test "$TARGET" = "cdk"; then
datadir="\${prefix}/share"
sysconfdir="\${prefix}/etc"
localstatedir="\${prefix}/var"
libdir="\${prefix}/lib"
targetdatadir="\${targetprefix}/share"
targetsysconfdir="\${targetprefix}/etc"
targetlocalstatedir="\${targetprefix}/var"
targetlibdir="\${targetprefix}/lib"
if test "$exec_prefix" = "NONE"; then
exec_prefix=$prefix
fi
TUXBOX_APPS_DIRECTORY_ONE(configdir,CONFIGDIR,localstatedir,/var,/tuxbox/config,
[--with-configdir=PATH ],[where to find the config files])
AC_CANONICAL_BUILD
AC_CANONICAL_HOST
AC_SYS_LARGEFILE
TUXBOX_APPS_DIRECTORY_ONE(datadir,DATADIR,datadir,/share,/tuxbox,
[--with-datadir=PATH ],[where to find data])
TUXBOX_APPS_DIRECTORY_ONE(fontdir,FONTDIR,datadir,/share,/fonts,
[--with-fontdir=PATH ],[where to find the fonts])
TUXBOX_APPS_DIRECTORY_ONE(gamesdir,GAMESDIR,localstatedir,/var,/tuxbox/games,
[--with-gamesdir=PATH ],[where games data is stored])
TUXBOX_APPS_DIRECTORY_ONE(libdir,LIBDIR,libdir,/lib,/tuxbox,
[--with-libdir=PATH ],[where to find the internal libs])
TUXBOX_APPS_DIRECTORY_ONE(plugindir,PLUGINDIR,libdir,/lib,/tuxbox/plugins,
[--with-plugindir=PATH ],[where to find the plugins])
TUXBOX_APPS_DIRECTORY_ONE(ucodedir,UCODEDIR,localstatedir,/var,/tuxbox/ucodes,
[--with-ucodedir=PATH ],[where to find the ucodes])
TUXBOX_APPS_DIRECTORY_ONE(themesdir,THEMESDIR,datadir,/share,/tuxbox/neutrino/themes,
[--with-themesdir=PATH ],[where to find the themes (don't change)])
])
dnl automake <= 1.6 needs this specifications
AC_SUBST(CONFIGDIR)
AC_SUBST(DATADIR)
AC_SUBST(FONTDIR)
AC_SUBST(GAMESDIR)
AC_SUBST(LIBDIR)
AC_SUBST(PLUGINDIR)
AC_SUBST(UCODEDIR)
AC_SUBST(THEMESDIR)
dnl end workaround
AC_DEFUN([TUXBOX_BOXTYPE],[
AC_DEFUN([TUXBOX_BOXTYPE], [
AC_ARG_WITH(boxtype,
[ --with-boxtype valid values: dbox2,tripledragon,dreambox,ipbox,coolstream,spark,azbox,generic],
AS_HELP_STRING([--with-boxtype], [valid values: generic, azbox, tripledragon, spark, duckbox, armbox, mipsbox]),
[case "${withval}" in
dbox2|dreambox|ipbox|tripledragon|coolstream|spark|azbox|generic)
generic|azbox|tripledragon|spark|duckbox|armbox|mipsbox)
BOXTYPE="$withval"
;;
dm*)
BOXTYPE="dreambox"
BOXMODEL="$withval"
;;
;;
*)
AC_MSG_ERROR([bad value $withval for --with-boxtype]) ;;
esac], [BOXTYPE="generic"])
AC_MSG_ERROR([bad value $withval for --with-boxtype])
;;
esac],
[BOXTYPE="generic"])
AC_ARG_WITH(boxmodel,
[ --with-boxmodel valid for dreambox: dm500, dm500plus, dm600pvr, dm56x0, dm7000, dm7020, dm7025
valid for ipbox: ip200, ip250, ip350, ip400],
AS_HELP_STRING([--with-boxmodel], [valid for generic: generic, raspi])
AS_HELP_STRING([], [valid for spark: spark, spark7162])
AS_HELP_STRING([], [valid for duckbox: ufs910, ufs912, ufs913, ufs922, atevio7500, fortis_hdbox, octagon1008, hs7110, hs7810a, hs7119, hs7819, dp7000, cuberevo, cuberevo_mini, cuberevo_mini2, cuberevo_250hd, cuberevo_2000hd, cuberevo_3000hd, ipbox9900, ipbox99, ipbox55, arivalink200, tf7700, hl101])
AS_HELP_STRING([], [valid for armbox: hd51, hd60, bre2ze4k, h7, vusolo4k, vuduo4k, vuultimo4k, vuuno4k, vuuno4kse, vuzero4k, osmioplus4k])
AS_HELP_STRING([], [valid for mipsbox: vuduo]),
[case "${withval}" in
dm500|dm500plus|dm600pvr|dm56x0|dm7000|dm7020|dm7025)
if test "$BOXTYPE" = "dreambox"; then
BOXMODEL="$withval"
else
AC_MSG_ERROR([unknown model $withval for boxtype $BOXTYPE])
fi
;;
ip200|ip250|ip350|ip400)
if test "$BOXTYPE" = "ipbox"; then
BOXMODEL="$withval"
else
AC_MSG_ERROR([unknown model $withval for boxtype $BOXTYPE])
fi
;;
raspi)
generic|raspi)
if test "$BOXTYPE" = "generic"; then
BOXMODEL="$withval"
else
AC_MSG_ERROR([unknown model $withval for boxtype $BOXTYPE])
fi
;;
;;
spark|spark7162)
if test "$BOXTYPE" = "spark"; then
BOXMODEL="$withval"
else
AC_MSG_ERROR([unknown model $withval for boxtype $BOXTYPE])
fi
;;
ufs910|ufs912|ufs913|ufs922|atevio7500|fortis_hdbox|octagon1008|hs7110|hs7810a|hs7119|hs7819|dp7000|cuberevo|cuberevo_mini|cuberevo_mini2|cuberevo_250hd|cuberevo_2000hd|cuberevo_3000hd|ipbox9900|ipbox99|ipbox55|arivalink200|tf7700|hl101)
if test "$BOXTYPE" = "duckbox"; then
BOXMODEL="$withval"
else
AC_MSG_ERROR([unknown model $withval for boxtype $BOXTYPE])
fi
;;
hd51|hd60|bre2ze4k|h7|vusolo4k|vuduo4k|vuultimo4k|vuuno4k|vuuno4kse|vuzero4k|osmioplus4k)
if test "$BOXTYPE" = "armbox"; then
BOXMODEL="$withval"
else
AC_MSG_ERROR([unknown model $withval for boxtype $BOXTYPE])
fi
;;
vuduo)
if test "$BOXTYPE" = "mipsbox"; then
BOXMODEL="$withval"
else
AC_MSG_ERROR([unknown model $withval for boxtype $BOXTYPE])
fi
;;
*)
AC_MSG_ERROR([unsupported value $withval for --with-boxmodel])
;;
;;
esac],
[if test "$BOXTYPE" = "dreambox" -o "$BOXTYPE" = "ipbox" && test -z "$BOXMODEL"; then
AC_MSG_ERROR([Dreambox/IPBox needs --with-boxmodel])
fi])
[BOXMODEL="generic"])
AC_SUBST(BOXTYPE)
AC_SUBST(BOXMODEL)
AM_CONDITIONAL(BOXTYPE_GENERIC, test "$BOXTYPE" = "generic")
AM_CONDITIONAL(BOXTYPE_AZBOX, test "$BOXTYPE" = "azbox")
AM_CONDITIONAL(BOXTYPE_DBOX2, test "$BOXTYPE" = "dbox2")
AM_CONDITIONAL(BOXTYPE_TRIPLE, test "$BOXTYPE" = "tripledragon")
AM_CONDITIONAL(BOXTYPE_SPARK, test "$BOXTYPE" = "spark")
AM_CONDITIONAL(BOXTYPE_DREAMBOX, test "$BOXTYPE" = "dreambox")
AM_CONDITIONAL(BOXTYPE_IPBOX, test "$BOXTYPE" = "ipbox")
AM_CONDITIONAL(BOXTYPE_COOL, test "$BOXTYPE" = "coolstream")
AM_CONDITIONAL(BOXTYPE_GENERIC, test "$BOXTYPE" = "generic")
AM_CONDITIONAL(BOXTYPE_DUCKBOX, test "$BOXTYPE" = "duckbox")
AM_CONDITIONAL(BOXTYPE_ARMBOX, test "$BOXTYPE" = "armbox")
AM_CONDITIONAL(BOXTYPE_MIPSBOX, test "$BOXTYPE" = "mipsbox")
AM_CONDITIONAL(BOXMODEL_DM500,test "$BOXMODEL" = "dm500")
AM_CONDITIONAL(BOXMODEL_DM500PLUS,test "$BOXMODEL" = "dm500plus")
AM_CONDITIONAL(BOXMODEL_DM600PVR,test "$BOXMODEL" = "dm600pvr")
AM_CONDITIONAL(BOXMODEL_DM56x0,test "$BOXMODEL" = "dm56x0")
AM_CONDITIONAL(BOXMODEL_DM7000,test "$BOXMODEL" = "dm7000" -o "$BOXMODEL" = "dm7020" -o "$BOXMODEL" = "dm7025")
# generic
AM_CONDITIONAL(BOXMODEL_GENERIC, test "$BOXMODEL" = "generic")
AM_CONDITIONAL(BOXMODEL_RASPI, test "$BOXMODEL" = "raspi")
AM_CONDITIONAL(BOXMODEL_IP200,test "$BOXMODEL" = "ip200")
AM_CONDITIONAL(BOXMODEL_IP250,test "$BOXMODEL" = "ip250")
AM_CONDITIONAL(BOXMODEL_IP350,test "$BOXMODEL" = "ip350")
AM_CONDITIONAL(BOXMODEL_IP400,test "$BOXMODEL" = "ip400")
# spark
AM_CONDITIONAL(BOXMODEL_SPARK, test "$BOXMODEL" = "spark")
AM_CONDITIONAL(BOXMODEL_SPARK7162, test "$BOXMODEL" = "spark7162")
AM_CONDITIONAL(BOXMODEL_RASPI,test "$BOXMODEL" = "raspi")
# duckbox
AM_CONDITIONAL(BOXMODEL_UFS910, test "$BOXMODEL" = "ufs910")
AM_CONDITIONAL(BOXMODEL_UFS912, test "$BOXMODEL" = "ufs912")
AM_CONDITIONAL(BOXMODEL_UFS913, test "$BOXMODEL" = "ufs913")
AM_CONDITIONAL(BOXMODEL_UFS922, test "$BOXMODEL" = "ufs922")
AM_CONDITIONAL(BOXMODEL_SPARK, test "$BOXMODEL" = "spark")
AM_CONDITIONAL(BOXMODEL_SPARK7162, test "$BOXMODEL" = "spark7162")
AM_CONDITIONAL(BOXMODEL_ATEVIO7500, test "$BOXMODEL" = "atevio7500")
AM_CONDITIONAL(BOXMODEL_FORTIS_HDBOX, test "$BOXMODEL" = "fortis_hdbox")
AM_CONDITIONAL(BOXMODEL_OCTAGON1008, test "$BOXMODEL" = "octagon1008")
AM_CONDITIONAL(BOXMODEL_HS7110, test "$BOXMODEL" = "hs7110")
AM_CONDITIONAL(BOXMODEL_HS7810A, test "$BOXMODEL" = "hs7810a")
AM_CONDITIONAL(BOXMODEL_HS7119, test "$BOXMODEL" = "hs7119")
AM_CONDITIONAL(BOXMODEL_HS7819, test "$BOXMODEL" = "hs7819")
AM_CONDITIONAL(BOXMODEL_DP7000, test "$BOXMODEL" = "dp7000")
if test "$BOXTYPE" = "dbox2"; then
AC_DEFINE(HAVE_DBOX_HARDWARE, 1, [building for a dbox2])
AM_CONDITIONAL(BOXMODEL_CUBEREVO, test "$BOXMODEL" = "cuberevo")
AM_CONDITIONAL(BOXMODEL_CUBEREVO_MINI, test "$BOXMODEL" = "cuberevo_mini")
AM_CONDITIONAL(BOXMODEL_CUBEREVO_MINI2, test "$BOXMODEL" = "cuberevo_mini2")
AM_CONDITIONAL(BOXMODEL_CUBEREVO_250HD, test "$BOXMODEL" = "cuberevo_250hd")
AM_CONDITIONAL(BOXMODEL_CUBEREVO_2000HD, test "$BOXMODEL" = "cuberevo_2000hd")
AM_CONDITIONAL(BOXMODEL_CUBEREVO_3000HD, test "$BOXMODEL" = "cuberevo_3000hd")
AM_CONDITIONAL(BOXMODEL_IPBOX9900, test "$BOXMODEL" = "ipbox9900")
AM_CONDITIONAL(BOXMODEL_IPBOX99, test "$BOXMODEL" = "ipbox99")
AM_CONDITIONAL(BOXMODEL_IPBOX55, test "$BOXMODEL" = "ipbox55")
AM_CONDITIONAL(BOXMODEL_ARIVALINK200, test "$BOXMODEL" = "arivalink200")
AM_CONDITIONAL(BOXMODEL_TF7700, test "$BOXMODEL" = "tf7700")
AM_CONDITIONAL(BOXMODEL_HL101, test "$BOXMODEL" = "hl101")
# armbox
AM_CONDITIONAL(BOXMODEL_HD51, test "$BOXMODEL" = "hd51")
AM_CONDITIONAL(BOXMODEL_HD60, test "$BOXMODEL" = "hd60")
AM_CONDITIONAL(BOXMODEL_BRE2ZE4K, test "$BOXMODEL" = "bre2ze4k")
AM_CONDITIONAL(BOXMODEL_H7, test "$BOXMODEL" = "h7")
AM_CONDITIONAL(BOXMODEL_OSMIOPLUS4K, test "$BOXMODEL" = "osmioplus4k")
AM_CONDITIONAL(BOXMODEL_VUSOLO4K, test "$BOXMODEL" = "vusolo4k")
AM_CONDITIONAL(BOXMODEL_VUDUO4K, test "$BOXMODEL" = "vuduo4k")
AM_CONDITIONAL(BOXMODEL_VUULTIMO4K, test "$BOXMODEL" = "vuultimo4k")
AM_CONDITIONAL(BOXMODEL_VUUNO4K, test "$BOXMODEL" = "vuuno4k")
AM_CONDITIONAL(BOXMODEL_VUUNO4KSE, test "$BOXMODEL" = "vuuno4kse")
AM_CONDITIONAL(BOXMODEL_VUZERO4K, test "$BOXMODEL" = "vuzero4k")
# mipsbox
AM_CONDITIONAL(BOXMODEL_VUDUO, test "$BOXMODEL" = "vuduo")
if test "$BOXTYPE" = "generic"; then
AC_DEFINE(HAVE_GENERIC_HARDWARE, 1, [building for a generic device like a standard PC])
elif test "$BOXTYPE" = "azbox"; then
AC_DEFINE(HAVE_AZBOX_HARDWARE, 1, [building for an azbox])
elif test "$BOXTYPE" = "tripledragon"; then
AC_DEFINE(HAVE_TRIPLEDRAGON, 1, [building for a tripledragon])
elif test "$BOXTYPE" = "spark"; then
AC_DEFINE(HAVE_SPARK_HARDWARE, 1, [building for a spark st7111 box])
elif test "$BOXTYPE" = "dreambox"; then
AC_DEFINE(HAVE_DREAMBOX_HARDWARE, 1, [building for a dreambox])
elif test "$BOXTYPE" = "ipbox"; then
AC_DEFINE(HAVE_IPBOX_HARDWARE, 1, [building for an ipbox])
elif test "$BOXTYPE" = "coolstream"; then
AC_DEFINE(HAVE_COOL_HARDWARE, 1, [building for a coolstream])
elif test "$BOXTYPE" = "generic"; then
AC_DEFINE(HAVE_GENERIC_HARDWARE, 1, [building for a generic device like a standard PC])
AC_DEFINE(HAVE_SPARK_HARDWARE, 1, [building for a goldenmedia 990 or edision pingulux])
AC_DEFINE(HAVE_SH4_HARDWARE, 1, [building for a sh4 box])
elif test "$BOXTYPE" = "duckbox"; then
AC_DEFINE(HAVE_DUCKBOX_HARDWARE, 1, [building for a duckbox])
AC_DEFINE(HAVE_SH4_HARDWARE, 1, [building for a sh4 box])
elif test "$BOXTYPE" = "armbox"; then
AC_DEFINE(HAVE_ARM_HARDWARE, 1, [building for an armbox])
elif test "$BOXTYPE" = "mipsbox"; then
AC_DEFINE(HAVE_MIPS_HARDWARE, 1, [building for an mipsbox])
fi
# TODO: do we need more defines?
if test "$BOXMODEL" = "dm500"; then
AC_DEFINE(BOXMODEL_DM500, 1, [dreambox 500])
elif test "$BOXMODEL" = "ip200"; then
AC_DEFINE(BOXMODEL_IP200, 1, [ipbox 200])
elif test "$BOXMODEL" = "ip250"; then
AC_DEFINE(BOXMODEL_IP250, 1, [ipbox 250])
elif test "$BOXMODEL" = "ip350"; then
AC_DEFINE(BOXMODEL_IP350, 1, [ipbox 350])
elif test "$BOXMODEL" = "ip400"; then
AC_DEFINE(BOXMODEL_IP400, 1, [ipbox 400])
if test "$BOXMODEL" = "generic"; then
AC_DEFINE(BOXMODEL_GENERIC, 1, [generic pc])
elif test "$BOXMODEL" = "raspi"; then
AC_DEFINE(BOXMODEL_RASPI, 1, [Raspberry pi])
AC_DEFINE(BOXMODEL_RASPI, 1, [raspberry pi])
elif test "$BOXMODEL" = "ufs910"; then
AC_DEFINE(BOXMODEL_UFS910, 1, [ufs910])
elif test "$BOXMODEL" = "ufs912"; then
AC_DEFINE(BOXMODEL_UFS912, 1, [ufs912])
elif test "$BOXMODEL" = "ufs913"; then
AC_DEFINE(BOXMODEL_UFS913, 1, [ufs913])
elif test "$BOXMODEL" = "ufs922"; then
AC_DEFINE(BOXMODEL_UFS922, 1, [ufs922])
elif test "$BOXMODEL" = "spark"; then
AC_DEFINE(BOXMODEL_SPARK, 1, [spark])
elif test "$BOXMODEL" = "spark7162"; then
AC_DEFINE(BOXMODEL_SPARK7162, 1, [spark7162])
elif test "$BOXMODEL" = "atevio7500"; then
AC_DEFINE(BOXMODEL_ATEVIO7500, 1, [atevio7500])
elif test "$BOXMODEL" = "fortis_hdbox"; then
AC_DEFINE(BOXMODEL_FORTIS_HDBOX, 1, [fortis_hdbox])
elif test "$BOXMODEL" = "octagon1008"; then
AC_DEFINE(BOXMODEL_OCTAGON1008, 1, [octagon1008])
elif test "$BOXMODEL" = "hs7110"; then
AC_DEFINE(BOXMODEL_HS7110, 1, [hs7110])
elif test "$BOXMODEL" = "hs7810a"; then
AC_DEFINE(BOXMODEL_HS7810A, 1, [hs7810a])
elif test "$BOXMODEL" = "hs7119"; then
AC_DEFINE(BOXMODEL_HS7119, 1, [hs7119])
elif test "$BOXMODEL" = "hs7819"; then
AC_DEFINE(BOXMODEL_HS7819, 1, [hs7819])
elif test "$BOXMODEL" = "dp7000"; then
AC_DEFINE(BOXMODEL_DP7000, 1, [dp7000])
elif test "$BOXMODEL" = "cuberevo"; then
AC_DEFINE(BOXMODEL_CUBEREVO, 1, [cuberevo])
elif test "$BOXMODEL" = "cuberevo_mini"; then
AC_DEFINE(BOXMODEL_CUBEREVO_MINI, 1, [cuberevo_mini])
elif test "$BOXMODEL" = "cuberevo_mini2"; then
AC_DEFINE(BOXMODEL_CUBEREVO_MINI2, 1, [cuberevo_mini2])
elif test "$BOXMODEL" = "cuberevo_250hd"; then
AC_DEFINE(BOXMODEL_CUBEREVO_250HD, 1, [cuberevo_250hd])
elif test "$BOXMODEL" = "cuberevo_2000hd"; then
AC_DEFINE(BOXMODEL_CUBEREVO_2000HD, 1, [cuberevo_2000hd])
elif test "$BOXMODEL" = "cuberevo_3000hd"; then
AC_DEFINE(BOXMODEL_CUBEREVO_3000HD, 1, [cuberevo_3000hd])
elif test "$BOXMODEL" = "ipbox9900"; then
AC_DEFINE(BOXMODEL_IPBOX9900, 1, [ipbox9900])
elif test "$BOXMODEL" = "ipbox99"; then
AC_DEFINE(BOXMODEL_IPBOX99, 1, [ipbox99])
elif test "$BOXMODEL" = "ipbox55"; then
AC_DEFINE(BOXMODEL_IPBOX55, 1, [ipbox55])
elif test "$BOXMODEL" = "arivalink200"; then
AC_DEFINE(BOXMODEL_ARIVALINK200, 1, [arivalink200])
elif test "$BOXMODEL" = "tf7700"; then
AC_DEFINE(BOXMODEL_TF7700, 1, [tf7700])
elif test "$BOXMODEL" = "hl101"; then
AC_DEFINE(BOXMODEL_HL101, 1, [hl101])
elif test "$BOXMODEL" = "hd51"; then
AC_DEFINE(BOXMODEL_HD51, 1, [hd51])
elif test "$BOXMODEL" = "hd60"; then
AC_DEFINE(BOXMODEL_HD60, 1, [hd60])
elif test "$BOXMODEL" = "bre2ze4k"; then
AC_DEFINE(BOXMODEL_BRE2ZE4K, 1, [bre2ze4k])
elif test "$BOXMODEL" = "h7"; then
AC_DEFINE(BOXMODEL_H7, 1, [h7])
elif test "$BOXMODEL" = "osmioplus4k"; then
AC_DEFINE(BOXMODEL_OSMIOPLUS4K, 1, [osmioplus4k])
elif test "$BOXMODEL" = "vusolo4k"; then
AC_DEFINE(BOXMODEL_VUSOLO4K, 1, [vusolo4k])
elif test "$BOXMODEL" = "vuduo4k"; then
AC_DEFINE(BOXMODEL_VUDUO4K, 1, [vuduo4k])
elif test "$BOXMODEL" = "vuultimo4k"; then
AC_DEFINE(BOXMODEL_VUULTIMO4K, 1, [vuultimo4k])
elif test "$BOXMODEL" = "vuuno4k"; then
AC_DEFINE(BOXMODEL_VUUNO4K, 1, [vuuno4k])
elif test "$BOXMODEL" = "vuuno4kse"; then
AC_DEFINE(BOXMODEL_VUUNO4KSE, 1, [vuuno4kse])
elif test "$BOXMODEL" = "vuzero4k"; then
AC_DEFINE(BOXMODEL_VUZERO4K, 1, [vuzero4k])
elif test "$BOXMODEL" = "vuduo"; then
AC_DEFINE(BOXMODEL_VUDUO, 1, [vuduo])
fi
# all vuplus BOXMODELs
case "$BOXMODEL" in
vusolo4k|vuduo4k|vuultimo4k|vuuno4k|vuuno4kse|vuzero4k|vuduo)
AC_DEFINE(BOXMODEL_VUPLUS, 1, [vuplus])
vuplus=true
;;
*)
vuplus=false
;;
esac
AM_CONDITIONAL(BOXMODEL_VUPLUS, test "$vuplus" = "true")
# all vuplus4k BOXMODELs
case "$BOXMODEL" in
vusolo4k|vuduo4k|vuultimo4k|vuuno4k|vuuno4kse|vuzero4k)
AC_DEFINE(BOXMODEL_VUPLUS4K, 1, [vuplus4k])
vuplus4k=true
;;
*)
vuplus4k=false
;;
esac
AM_CONDITIONAL(BOXMODEL_VUPLUS4K, test "$vuplus4k" = "true")
])
dnl backward compatiblity
AC_DEFUN([AC_GNU_SOURCE],
[AH_VERBATIM([_GNU_SOURCE],
[/* Enable GNU extensions on systems that have them. */
AC_DEFUN([AC_GNU_SOURCE], [
AH_VERBATIM([_GNU_SOURCE], [
/* Enable GNU extensions on systems that have them. */
#ifndef _GNU_SOURCE
# undef _GNU_SOURCE
#endif])dnl
#endif
])dnl
AC_BEFORE([$0], [AC_COMPILE_IFELSE])dnl
AC_BEFORE([$0], [AC_RUN_IFELSE])dnl
AC_DEFINE([_GNU_SOURCE])
])
AC_DEFUN([AC_PROG_EGREP],
[AC_CACHE_CHECK([for egrep], [ac_cv_prog_egrep],
[if echo a | (grep -E '(a|b)') >/dev/null 2>&1
then ac_cv_prog_egrep='grep -E'
else ac_cv_prog_egrep='egrep'
fi])
EGREP=$ac_cv_prog_egrep
AC_SUBST([EGREP])
AC_DEFUN([AC_PROG_EGREP], [
AC_CACHE_CHECK([for egrep], [ac_cv_prog_egrep], [
if echo a | (grep -E '(a|b)') >/dev/null 2>&1; then
ac_cv_prog_egrep='grep -E'
else
ac_cv_prog_egrep='egrep'
fi
])
EGREP=$ac_cv_prog_egrep
AC_SUBST([EGREP])
])

View File

@@ -1,8 +1,15 @@
#!/bin/bash
#!/bin/sh
package="libstb-hal"
srcdir=`dirname $0`
test -z "$srcdir" && srcdir=.
cd "$srcdir"
echo "Generating configuration files for $package, please wait ..."
cd $(dirname $0)
aclocal --force
libtoolize --force
autoconf --force
autoheader --force
automake --add-missing --force-missing --foreign
automake --add-missing --force-missing

View File

@@ -1,21 +0,0 @@
#include <unistd.h>
#include "init_td.h"
#include "lt_debug.h"
#define lt_debug(args...) _lt_debug(TRIPLE_DEBUG_INIT, NULL, args)
#define lt_info(args...) _lt_info(TRIPLE_DEBUG_INIT, NULL, args)
static bool initialized = false;
void init_td_api()
{
if (!initialized)
lt_debug_init();
lt_info("%s begin, initialized=%d, debug=0x%02x\n", __func__, (int)initialized, debuglevel);
initialized = true;
}
void shutdown_td_api()
{
lt_info("%s, initialized = %d\n", __func__, (int)initialized);
initialized = false;
}

View File

@@ -1,60 +0,0 @@
/*
* (C) 2010-2013 Stefan Seyfried
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* private video functions, to be used only inside libstb-hal
*/
#ifndef __video_priv__
#define __video_priv__
#include <video_hal.h>
#include <linux/dvb/video.h>
class VDec
{
public:
/* all public, used inside libstb-hal only anyways... */
int fd; /* video device fd */
/* apparently we cannot query the driver's state
=> remember it */
video_play_state_t playstate;
int video_standby;
bool stillpicture;
/* constructor & destructor */
VDec(void);
~VDec(void);
/* used directly by cVideo */
int getAspectRatio(void);
void getPictureInfo(int &width, int &height, int &rate);
int Start(void);
int Stop(bool blank = true);
int setBlank(int blank);
int SetStreamType(VIDEO_FORMAT type);
void SetSyncMode(AVSYNC_TYPE mode);
void ShowPicture(const char * fname);
void Standby(unsigned int bOn);
void Pig(int x, int y, int w, int h, int osd_w, int osd_h);
/* used internally by dmx */
int64_t GetPTS(void);
/* used internally by playback */
void openDevice(void);
void closeDevice(void);
};
#endif

View File

@@ -5,9 +5,48 @@ AM_CXXFLAGS = -fno-rtti -fno-exceptions -fno-strict-aliasing
AM_CXXFLAGS += \
-I $(top_srcdir)/include
AM_LDFLAGS = -lpthread
if BOXTYPE_DUCKBOX
AM_CXXFLAGS += \
-I $(top_srcdir)/libdvbci
endif
if BOXTYPE_ARMBOX
AM_CXXFLAGS += \
-I $(top_srcdir)/libdvbci
endif
if BOXTYPE_MIPSBOX
AM_CXXFLAGS += \
-I $(top_srcdir)/libdvbci
endif
if BOXTYPE_MIPSBOX
libcommon_la_SOURCES = \
ca.cpp \
lt_debug.c \
ca_ci.cpp
else
if BOXTYPE_DUCKBOX
libcommon_la_SOURCES = \
ca_ci.cpp
else
if BOXTYPE_ARMBOX
if BOXMODEL_HD60
libcommon_la_SOURCES = \
ca.cpp
else
libcommon_la_SOURCES = \
ca_ci.cpp
endif
else
libcommon_la_SOURCES = \
ca.cpp
endif
endif
endif
libcommon_la_SOURCES += \
hal_debug.cpp \
proc_tools.c \
pwrmngr.cpp \
version_hal.cpp

View File

@@ -1,8 +1,8 @@
#include <stdio.h>
#include "ca.h"
#include "lt_debug.h"
#define lt_debug(args...) _lt_debug(TRIPLE_DEBUG_CA, this, args)
#include "ca_hal.h"
#include "hal_debug.h"
#define hal_debug(args...) _hal_debug(HAL_DEBUG_CA, this, args)
static cCA *inst = NULL;
@@ -10,17 +10,17 @@ static cCA *inst = NULL;
/* those are all dummies for now.. */
cCA::cCA(void)
{
lt_debug("%s\n", __FUNCTION__);
hal_debug("%s\n", __FUNCTION__);
}
cCA::~cCA()
{
lt_debug("%s\n", __FUNCTION__);
hal_debug("%s\n", __FUNCTION__);
}
cCA *cCA::GetInstance()
{
_lt_debug(TRIPLE_DEBUG_CA, NULL, "%s\n", __FUNCTION__);
_hal_debug(HAL_DEBUG_CA, NULL, "%s\n", __FUNCTION__);
if (inst == NULL)
inst = new cCA();
@@ -29,82 +29,82 @@ cCA *cCA::GetInstance()
void cCA::MenuEnter(enum CA_SLOT_TYPE, uint32_t p)
{
lt_debug("%s param:%d\n", __FUNCTION__, (int)p);
hal_debug("%s param:%d\n", __FUNCTION__, (int)p);
}
void cCA::MenuAnswer(enum CA_SLOT_TYPE, uint32_t p, uint32_t /*choice*/)
{
lt_debug("%s param:%d\n", __FUNCTION__, (int)p);
hal_debug("%s param:%d\n", __FUNCTION__, (int)p);
}
void cCA::InputAnswer(enum CA_SLOT_TYPE, uint32_t p, uint8_t * /*Data*/, int /*Len*/)
{
lt_debug("%s param:%d\n", __FUNCTION__, (int)p);
hal_debug("%s param:%d\n", __FUNCTION__, (int)p);
}
void cCA::MenuClose(enum CA_SLOT_TYPE, uint32_t p)
{
lt_debug("%s param:%d\n", __FUNCTION__, (int)p);
hal_debug("%s param:%d\n", __FUNCTION__, (int)p);
}
uint32_t cCA::GetNumberCISlots(void)
{
lt_debug("%s\n", __FUNCTION__);
hal_debug("%s\n", __FUNCTION__);
return 0;
}
uint32_t cCA::GetNumberSmartCardSlots(void)
{
lt_debug("%s\n", __FUNCTION__);
hal_debug("%s\n", __FUNCTION__);
return 0;
}
void cCA::ModuleName(enum CA_SLOT_TYPE, uint32_t p, char * /*Name*/)
{
/* TODO: waht to do with *Name? */
lt_debug("%s param:%d\n", __FUNCTION__, (int)p);
hal_debug("%s param:%d\n", __FUNCTION__, (int)p);
}
bool cCA::ModulePresent(enum CA_SLOT_TYPE, uint32_t p)
{
lt_debug("%s param:%d\n", __FUNCTION__, (int)p);
hal_debug("%s param:%d\n", __FUNCTION__, (int)p);
return false;
}
void cCA::ModuleReset(enum CA_SLOT_TYPE, uint32_t p)
{
lt_debug("%s param:%d\n", __FUNCTION__, (int)p);
hal_debug("%s param:%d\n", __FUNCTION__, (int)p);
}
bool cCA::SendPMT(int, unsigned char *, int, CA_SLOT_TYPE)
{
lt_debug("%s\n", __FUNCTION__);
hal_debug("%s\n", __FUNCTION__);
return true;
}
bool cCA::SendMessage(const CA_MESSAGE *)
{
lt_debug("%s\n", __FUNCTION__);
hal_debug("%s\n", __FUNCTION__);
return true;
}
bool cCA::Start(void)
{
lt_debug("%s\n", __FUNCTION__);
hal_debug("%s\n", __FUNCTION__);
return true;
}
void cCA::Stop(void)
{
lt_debug("%s\n", __FUNCTION__);
hal_debug("%s\n", __FUNCTION__);
}
void cCA::Ready(bool p)
{
lt_debug("%s param:%d\n", __FUNCTION__, (int)p);
hal_debug("%s param:%d\n", __FUNCTION__, (int)p);
}
void cCA::SetInitMask(enum CA_INIT_MASK p)
{
lt_debug("%s param:%d\n", __FUNCTION__, (int)p);
hal_debug("%s param:%d\n", __FUNCTION__, (int)p);
}

1973
common/ca_ci.cpp Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -1,4 +1,4 @@
/* libtriple debug functions */
/* libstb-hal debug functions */
#include <stdarg.h>
#include <stdio.h>
@@ -12,7 +12,7 @@ int cnxt_debug = 0; /* compat, unused */
int debuglevel = -1;
static const char* lt_facility[] = {
static const char* hal_facility[] = {
"audio ",
"video ",
"demux ",
@@ -24,10 +24,10 @@ static const char* lt_facility[] = {
NULL
};
void _lt_info(int facility, const void *func, const char *fmt, ...)
void _hal_info(int facility, const void *func, const char *fmt, ...)
{
/* %p does print "(nil)" instead of 0x00000000 for NULL */
fprintf(stderr, "[LT:%08lx:%s] ", (long) func, lt_facility[facility]);
fprintf(stderr, "[HAL:%08lx:%s] ", (long) func, hal_facility[facility]);
va_list args;
va_start(args, fmt);
vfprintf(stderr, fmt, args);
@@ -35,22 +35,22 @@ void _lt_info(int facility, const void *func, const char *fmt, ...)
}
void _lt_debug(int facility, const void *func, const char *fmt, ...)
void _hal_debug(int facility, const void *func, const char *fmt, ...)
{
if (debuglevel < 0)
fprintf(stderr, "lt_debug: debuglevel not initialized!\n");
fprintf(stderr, "hal_debug: debuglevel not initialized!\n");
if (! ((1 << facility) & debuglevel))
return;
fprintf(stderr, "[LT:%08lx:%s] ", (long)func, lt_facility[facility]);
fprintf(stderr, "[HAL:%08lx:%s] ", (long)func, hal_facility[facility]);
va_list args;
va_start(args, fmt);
vfprintf(stderr, fmt, args);
va_end(args);
}
void lt_debug_init(void)
void hal_debug_init(void)
{
int i = 0;
char *tmp = getenv("HAL_DEBUG");
@@ -65,16 +65,16 @@ void lt_debug_init(void)
{
fprintf(stderr, "libstb-hal debug options can be set by exporting HAL_DEBUG.\n");
fprintf(stderr, "The following values (or bitwise OR combinations) are valid:\n");
while (lt_facility[i]) {
fprintf(stderr, "\tcomponent: %s 0x%02x\n", lt_facility[i], 1 << i);
while (hal_facility[i]) {
fprintf(stderr, "\tcomponent: %s 0x%02x\n", hal_facility[i], 1 << i);
i++;
}
fprintf(stderr, "\tall components: 0x%02x\n", (1 << i) - 1);
} else {
fprintf(stderr, "libstb-hal debug is active for the following components:\n");
while (lt_facility[i]) {
while (hal_facility[i]) {
if (debuglevel & (1 << i))
fprintf(stderr, "%s ", lt_facility[i]);
fprintf(stderr, "%s ", hal_facility[i]);
i++;
}
fprintf(stderr, "\n");

22
common/hal_debug.h Normal file
View File

@@ -0,0 +1,22 @@
#ifndef __HAL_DEBUG_H__
#define __HAL_DEBUG_H__
#define HAL_DEBUG_AUDIO 0
#define HAL_DEBUG_VIDEO 1
#define HAL_DEBUG_DEMUX 2
#define HAL_DEBUG_PLAYBACK 3
#define HAL_DEBUG_PWRMNGR 4
#define HAL_DEBUG_INIT 5
#define HAL_DEBUG_CA 6
#define HAL_DEBUG_RECORD 7
#define HAL_DEBUG_ALL ((1<<8)-1)
extern int debuglevel;
void _hal_debug(int facility, const void *, const char *fmt, ...) __attribute__ ((format (printf, 3, 4)));
void _hal_info(int facility, const void *, const char *fmt, ...) __attribute__ ((format (printf, 3, 4)));
void hal_debug_init(void);
void hal_set_threadname(const char *name);
#endif // __HAL_DEBUG_H__

View File

@@ -1,36 +0,0 @@
#ifndef __LT_DEBUG_H
#define __LT_DEBUG_H
#define TRIPLE_DEBUG_AUDIO 0
#define TRIPLE_DEBUG_VIDEO 1
#define TRIPLE_DEBUG_DEMUX 2
#define TRIPLE_DEBUG_PLAYBACK 3
#define TRIPLE_DEBUG_PWRMNGR 4
#define TRIPLE_DEBUG_INIT 5
#define TRIPLE_DEBUG_CA 6
#define TRIPLE_DEBUG_RECORD 7
#define TRIPLE_DEBUG_ALL ((1<<8)-1)
#define HAL_DEBUG_AUDIO 0
#define HAL_DEBUG_VIDEO 1
#define HAL_DEBUG_DEMUX 2
#define HAL_DEBUG_PLAYBACK 3
#define HAL_DEBUG_PWRMNGR 4
#define HAL_DEBUG_INIT 5
#define HAL_DEBUG_CA 6
#define HAL_DEBUG_RECORD 7
#define HAL_DEBUG_ALL ((1<<8)-1)
#ifdef __cplusplus
extern "C" {
#endif
extern int debuglevel;
void hal_set_threadname(const char *name);
void _lt_debug(int facility, const void *, const char *fmt, ...) __attribute__ ((format (printf, 3, 4)));
void _lt_info(int facility, const void *, const char *fmt, ...) __attribute__ ((format (printf, 3, 4)));
void lt_debug_init(void);
#ifdef __cplusplus
}
#endif
#endif

View File

@@ -17,9 +17,8 @@
#include <config.h>
#include "pwrmngr.h"
#include "lt_debug.h"
#include "hal_debug.h"
#if HAVE_TRIPLEDRAGON
#include <stdio.h>
#include <cstdlib>
@@ -29,51 +28,68 @@
#include <sys/stat.h>
#include <sys/types.h>
#if HAVE_TRIPLEDRAGON
#include <avs/avs_inf.h>
#include <tdpanel/lcdstuff.h>
#endif
#define lt_debug(args...) _lt_debug(TRIPLE_DEBUG_PWRMNGR, this, args)
#define lt_info(args...) _lt_info(TRIPLE_DEBUG_PWRMNGR, this, args)
#define hal_debug(args...) _hal_debug(HAL_DEBUG_PWRMNGR, this, args)
#define hal_info(args...) _hal_info(HAL_DEBUG_PWRMNGR, this, args)
/* cpufreqmanager */
void cCpuFreqManager::Up(void)
{
lt_debug("%s\n", __func__);
hal_debug("%s\n", __func__);
}
void cCpuFreqManager::Down(void)
{
lt_debug("%s\n", __func__);
hal_debug("%s\n", __func__);
}
void cCpuFreqManager::Reset(void)
{
lt_debug("%s\n", __func__);
hal_debug("%s\n", __func__);
}
/* those function dummies return true or "harmless" values */
bool cCpuFreqManager::SetDelta(unsigned long)
{
lt_debug("%s\n", __func__);
hal_debug("%s\n", __func__);
return true;
}
unsigned long cCpuFreqManager::GetDelta(void)
{
lt_debug("%s\n", __func__);
hal_debug("%s\n", __func__);
return 0;
}
unsigned long cCpuFreqManager::GetCpuFreq(void)
{
lt_debug("%s\n", __func__);
#if HAVE_SPARK_HARDWARE || HAVE_DUCKBOX_HARDWARE
unsigned long cCpuFreqManager::GetCpuFreq(void) {
int freq = 0;
if (FILE *pll0 = fopen("/proc/cpu_frequ/pll0_ndiv_mdiv", "r")) {
char buffer[120];
while(fgets(buffer, sizeof(buffer), pll0)) {
if (1 == sscanf(buffer, "SH4 = %d MHZ", &freq))
break;
}
fclose(pll0);
return 1000 * 1000 * (unsigned long) freq;
}
return 0;
}
#else
unsigned long cCpuFreqManager::GetCpuFreq(void)
{
hal_debug("%s\n", __func__);
return 0;
}
#endif
bool cCpuFreqManager::SetCpuFreq(unsigned long f)
{
lt_info("%s(%lu) => set standby = %s\n", __func__, f, f?"true":"false");
hal_info("%s(%lu) => set standby = %s\n", __func__, f, f?"true":"false");
#if HAVE_TRIPLEDRAGON
/* actually SetCpuFreq is used to determine if the system is in standby
this is an "elegant" hack, because:
@@ -97,11 +113,11 @@ bool cCpuFreqManager::SetCpuFreq(unsigned long f)
ioctl(fd, IOC_AVS_STANDBY_ENTER);
if (getenv("TRIPLE_LCDBACKLIGHT"))
{
lt_info("%s: TRIPLE_LCDBACKLIGHT is set: keeping LCD backlight on\n", __func__);
hal_info("%s: TRIPLE_LCDBACKLIGHT is set: keeping LCD backlight on\n", __func__);
close(fd);
fd = open("/dev/stb/tdlcd", O_RDONLY);
if (fd < 0)
lt_info("%s: open tdlcd error: %m\n", __func__);
hal_info("%s: open tdlcd error: %m\n", __func__);
else
ioctl(fd, IOC_LCD_BACKLIGHT_ON);
}
@@ -115,38 +131,49 @@ bool cCpuFreqManager::SetCpuFreq(unsigned long f)
}
close(fd);
#elif HAVE_SPARK_HARDWARE || HAVE_DUCKBOX_HARDWARE
if (f) {
FILE *pll0 = fopen ("/proc/cpu_frequ/pll0_ndiv_mdiv", "w");
if (pll0) {
f /= 1000000;
fprintf(pll0, "%lu\n", (f/10 << 8) | 3);
fclose (pll0);
return false;
}
}
#endif
return true;
}
cCpuFreqManager::cCpuFreqManager(void)
{
lt_debug("%s\n", __func__);
hal_debug("%s\n", __func__);
}
/* powermanager */
bool cPowerManager::Open(void)
{
lt_debug("%s\n", __func__);
hal_debug("%s\n", __func__);
return true;
}
void cPowerManager::Close(void)
{
lt_debug("%s\n", __func__);
hal_debug("%s\n", __func__);
}
bool cPowerManager::SetStandby(bool Active, bool Passive)
{
lt_debug("%s(%d, %d)\n", __func__, Active, Passive);
hal_debug("%s(%d, %d)\n", __func__, Active, Passive);
return true;
}
cPowerManager::cPowerManager(void)
{
lt_debug("%s\n", __func__);
hal_debug("%s\n", __func__);
}
cPowerManager::~cPowerManager()
{
lt_debug("%s\n", __func__);
hal_debug("%s\n", __func__);
}

View File

@@ -19,37 +19,33 @@
#include <version_hal.h>
std::string getPackageVersion()
void hal_get_lib_version(hal_libversion_t *ver)
{
return PACKAGE_VERSION;
}
if (!ver)
return;
int getPackageVersionMajor()
{
return PACKAGE_VERSION_MAJOR;
}
//init struct
*ver = {"",0,0,0,"","",""};
int getPackageVersionMinor()
{
return PACKAGE_VERSION_MINOR;
}
int getPackageVersionMicro()
{
return PACKAGE_VERSION_MICRO;
}
std::string getPackagenName()
{
return PACKAGE_NAME;
}
std::string getPackageString()
{
return PACKAGE_STRING;
}
std::string getPackageVersionGit()
{
return PACKAGE_VERSION_GIT;
#ifdef VERSION
ver->vVersion = VERSION;
#endif
#ifdef PACKAGE_VERSION_MAJOR
ver->vMajor = PACKAGE_VERSION_MAJOR;
#endif
#ifdef PACKAGE_VERSION_MAJOR
ver->vMinor = PACKAGE_VERSION_MINOR;
#endif
#ifdef PACKAGE_VERSION_MINOR
ver->vPatch = PACKAGE_VERSION_MICRO;
#endif
#ifdef PACKAGE_NAME
ver->vName = PACKAGE_NAME;
#endif
#ifdef PACKAGE_STRING
ver->vStr = PACKAGE_STRING;
#endif
#ifdef PACKAGE_VERSION_GIT
ver->vGitDescribe = PACKAGE_VERSION_GIT;
#endif
}

View File

@@ -1,7 +1,7 @@
# explicit defines for separate revision handling
define(ver_major, 0)
define(ver_minor, 2)
define(ver_micro, 1)
define(ver_major, 1)
define(ver_minor, 3)
define(ver_micro, 0)
# sync with current git
define(ver_git, m4_esyscmd([
@@ -12,10 +12,9 @@ define(ver_git, m4_esyscmd([
AC_PACKAGE_NAME, PACKAGE_NAME_LIBSTB_HAL
AC_INIT([Tuxbox-libstb-hal], [ver_major.ver_minor.ver_micro])
AM_INIT_AUTOMAKE
AC_CONFIG_HEADERS([include/libstb-hal-config.h])
AM_INIT_AUTOMAKE([foreign])
AC_CONFIG_HEADERS([libstb-hal-config.h:config.h.in])
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES])
AC_CONFIG_MACRO_DIR([m4])
AC_GNU_SOURCE
AC_DEFINE(PACKAGE_VERSION_MAJOR, ver_major, [Major version number])
@@ -24,7 +23,6 @@ AC_DEFINE(PACKAGE_VERSION_MICRO, ver_micro, [Micro version number])
AC_DEFINE(PACKAGE_VERSION_GIT, "ver_git", [internal vcs version info])
TUXBOX_APPS
TUXBOX_APPS_DIRECTORY
TUXBOX_BOXTYPE
AC_PROG_CC
@@ -37,7 +35,7 @@ PKG_PROG_PKG_CONFIG
AC_DISABLE_SHARED
AC_DISABLE_STATIC
AC_SYS_LARGEFILE
AC_PROG_LIBTOOL
LT_INIT
AC_ARG_ENABLE(clutter,
AS_HELP_STRING(--enable-clutter, use clutter instead of OpenGL),
@@ -55,51 +53,71 @@ if test x"$BOXTYPE" = x"tripledragon"; then
PKG_CHECK_MODULES([DIRECTFB], [directfb])
fi
if test x$BOXTYPE = xgeneric; then
AC_ARG_ENABLE(gstreamer_01,
AS_HELP_STRING(--enable-gstreamer_01, use gstreamer 0.10 playback),
,[enable_gstreamer_01=no])
AM_CONDITIONAL(ENABLE_GSTREAMER_01,test "$enable_gstreamer_01" = "yes")
if test "$enable_gstreamer_01" = "yes"; then
AC_DEFINE(ENABLE_GSTREAMER_01, 1, [use gstreamer 0.10 playback])
PKG_CHECK_MODULES([GSTREAMER], [gstreamer-0.10])
PKG_CHECK_MODULES([GSTREAMER_INTERFACES], [gstinterfaces-0.10])
fi
AC_ARG_ENABLE(gstreamer_10,
AS_HELP_STRING(--enable-gstreamer_10, use gstreamer 1.0 playback),
,[enable_gstreamer_10=no])
AM_CONDITIONAL(ENABLE_GSTREAMER_10, test "$enable_gstreamer_10" = "yes")
if test "$enable_gstreamer_10" = "yes"; then
AC_DEFINE(ENABLE_GSTREAMER_10, 1, [use gstreamer 1.0 playback])
PKG_CHECK_MODULES([GSTREAMER], [gstreamer-1.0])
PKG_CHECK_MODULES([GSTREAMER_AUDIO], [gstreamer-audio-1.0])
PKG_CHECK_MODULES([GSTREAMER_VIDEO], [gstreamer-video-1.0])
fi
if test x$BOXTYPE = xarmbox -a "$enable_gstreamer_10" = "yes"; then
PKG_CHECK_MODULES([GSTREAMER], [gstreamer-1.0])
PKG_CHECK_MODULES([GSTREAMER_AUDIO], [gstreamer-audio-1.0])
PKG_CHECK_MODULES([GSTREAMER_VIDEO], [gstreamer-video-1.0])
fi
if test x$BOXTYPE = xgeneric -a x$BOXMODEL != xraspi; then
if test x"$enable_clutter" = xyes; then
PKG_CHECK_MODULES([CLUTTER], [clutter-1.0])
fi
if test x$BOXMODEL != xraspi; then
PKG_CHECK_MODULES([AVFORMAT], [libavformat >= 53.21.1])
PKG_CHECK_MODULES([AVCODEC], [libavcodec >= 54.28.0])
# don't know which version is exactly needed here...
PKG_CHECK_MODULES([SWSCALE], [libswscale])
else
# openmaxil are the broadcom userspace libs
# my yocto (openembedded) layer has an openmaxil package built from userland git.
# Use that if available. If not, just fall back to /opt/vc/...
# can be overridden with OMX_CFLAGS= OMX_LIBS= variables...
#
PKG_CHECK_MODULES([OMX], [openmaxil], echo "OpenMAX/IL userspace package found. Good.",
[ echo "OpenMAX/IL package not found, assuming /opt/vc/..."
OMX_CFLAGS="-I/opt/vc/include -I/opt/vc/include/interface/vcos/pthreads/ -I/opt/vc/include/interface/vmcs_host/linux"
OMX_LIBS="-L/opt/vc/lib/ -lopenmaxil -lbcm_host -lvcos -lvchiq_arm -pthread"
])
# raspbian has no current versions and only libav instead of ffmpeg... :-(
PKG_CHECK_MODULES([AVFORMAT], [libavformat])
PKG_CHECK_MODULES([AVCODEC], [libavcodec])
fi
PKG_CHECK_MODULES([SWRESAMPLE], [libswresample])
# don't know which version is exactly needed here...
PKG_CHECK_MODULES([AVUTIL], [libavutil])
fi
if test x$BOXTYPE = xspark; then
# versions are probably not correct :-(
PKG_CHECK_MODULES([AVFORMAT], [libavformat >= 53.21.1])
PKG_CHECK_MODULES([AVCODEC], [libavcodec >= 54.28.0])
PKG_CHECK_MODULES([SWRESAMPLE], [libswresample])
# don't know which version is exactly needed here...
PKG_CHECK_MODULES([AVUTIL], [libavutil])
PKG_CHECK_MODULES([SWSCALE], [libswscale])
PKG_CHECK_MODULES([SWRESAMPLE], [libswresample])
fi
AC_OUTPUT([
AC_ARG_ENABLE(flv2mpeg4,
AS_HELP_STRING(--enable-flv2mpeg4, use flv2mpeg4 libeplayer3),
,[enable_flv2mpeg4=no])
AM_CONDITIONAL(ENABLE_FLV2MPEG4, test "$enable_flv2mpeg4" = "yes")
if test "$enable_flv2mpeg4" = "yes"; then
AC_DEFINE(ENABLE_FLV2MPEG4, 1, [use flv2mpeg4 libeplayer3])
fi
AC_CONFIG_FILES([
Makefile
common/Makefile
libmipsbox/Makefile
libarmbox/Makefile
libazbox/Makefile
libduckbox/Makefile
libdvbci/Makefile
libeplayer3/Makefile
azbox/Makefile
generic-pc/Makefile
libtriple/Makefile
libeplayer3-sh4/Makefile
libgeneric-pc/Makefile
libraspi/Makefile
libspark/Makefile
raspi/Makefile
libtriple/Makefile
tools/Makefile
])
AC_OUTPUT

View File

@@ -1,54 +0,0 @@
/*
* (C) 2010-2013 Stefan Seyfried
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* private stuff for the audio decoder, only used inside libstb-hal
*/
#include <OpenThreads/Thread>
extern "C" {
#include <libavformat/avformat.h>
#include <libavutil/opt.h>
#include <libavutil/samplefmt.h>
#include <libswresample/swresample.h>
#include <ao/ao.h>
}
class ADec : public OpenThreads::Thread
{
public:
ADec();
~ADec();
int Start();
int Stop();
int PrepareClipPlay(int ch, int srate, int bits, int le);
int WriteClip(unsigned char *buffer, int size);
void getAudioInfo(int &type, int &layer, int &freq, int &bitrate, int &mode);
int my_read(uint8_t *buf, int buf_size);
int64_t getPts() { return curr_pts; };
private:
bool thread_started;
int64_t curr_pts;
void run();
ao_device *adevice;
ao_sample_format sformat;
uint8_t *dmxbuf;
int bufpos;
AVCodecContext *c;
AVCodecParameters *p;
};

View File

@@ -1,109 +0,0 @@
/*
Copyright 2013 Stefan Seyfried <seife@tuxboxcvs.slipkontur.de>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
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 General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __vdec__
#include <OpenThreads/Thread>
#include <OpenThreads/Mutex>
#include "video_hal.h"
extern "C" {
#include <libavutil/rational.h>
}
#define VDEC_MAXBUFS 0x40
class VDec : public OpenThreads::Thread
{
friend class GLFbPC;
friend class cDemux;
friend class cVideo;
private:
/* called from GL thread */
class SWFramebuffer : public std::vector<unsigned char>
{
public:
SWFramebuffer() : mWidth(0), mHeight(0) {}
void width(int w) { mWidth = w; }
void height(int h) { mHeight = h; }
void pts(uint64_t p) { mPts = p; }
void AR(AVRational a) { mAR = a; }
int width() const { return mWidth; }
int height() const { return mHeight; }
int64_t pts() const { return mPts; }
AVRational AR() const { return mAR; }
private:
int mWidth;
int mHeight;
int64_t mPts;
AVRational mAR;
};
int buf_in, buf_out, buf_num;
public:
/* constructor & destructor */
VDec(void);
~VDec(void);
/* aspect ratio */
int getAspectRatio(void);
int setAspectRatio(int aspect, int mode);
void getPictureInfo(int &width, int &height, int &rate);
#if 0
/* cropping mode */
int setCroppingMode(int x = 0 /*vidDispMode_t x = VID_DISPMODE_NORM*/);
/* get play state */
int getPlayState(void);
/* blank on freeze */
int getBlank(void);
int setBlank(int enable);
#endif
int GetVideoSystem();
int SetVideoSystem(int system);
/* change video play state. Parameters are all unused. */
int Start();
int Stop(bool blank = true);
int SetStreamType(VIDEO_FORMAT type);
void ShowPicture(const char * fname);
void Pig(int x, int y, int w, int h);
bool GetScreenImage(unsigned char * &data, int &xres, int &yres, bool get_video = true, bool get_osd = false, bool scale_to_video = false);
SWFramebuffer *getDecBuf(void);
int64_t GetPTS(void);
private:
void run();
SWFramebuffer buffers[VDEC_MAXBUFS];
int dec_w, dec_h;
int dec_r;
bool w_h_changed;
bool thread_running;
VIDEO_FORMAT v_format;
OpenThreads::Mutex buf_m;
DISPLAY_AR display_aspect;
DISPLAY_AR_MODE display_crop;
int output_h;
VIDEO_STD v_std;
int pig_x;
int pig_y;
int pig_w;
int pig_h;
bool pig_changed;
OpenThreads::Mutex still_m;
bool stillpicture;
};
#endif

View File

@@ -1,99 +1,24 @@
/*
* (C) 2010-2013 Stefan Seyfried
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __audio_hal__
#define __audio_hal__
#include <stdint.h>
#include <cs_types.h>
typedef enum
{
AUDIO_SYNC_WITH_PTS,
AUDIO_NO_SYNC,
AUDIO_SYNC_AUDIO_MASTER
} AUDIO_SYNC_MODE;
typedef enum {
HDMI_ENCODED_OFF,
HDMI_ENCODED_AUTO,
HDMI_ENCODED_FORCED
} HDMI_ENCODED_MODE;
typedef enum
{
AUDIO_FMT_AUTO = 0,
AUDIO_FMT_MPEG,
AUDIO_FMT_MP3,
AUDIO_FMT_DOLBY_DIGITAL,
AUDIO_FMT_BASIC = AUDIO_FMT_DOLBY_DIGITAL,
AUDIO_FMT_AAC,
AUDIO_FMT_AAC_PLUS,
AUDIO_FMT_DD_PLUS,
AUDIO_FMT_DTS,
AUDIO_FMT_AVS,
AUDIO_FMT_MLP,
AUDIO_FMT_WMA,
AUDIO_FMT_MPG1, // TD only. For Movieplayer / cPlayback
AUDIO_FMT_ADVANCED = AUDIO_FMT_MLP
} AUDIO_FORMAT;
class cAudio
{
public:
/* construct & destruct */
cAudio(void *, void *, void *);
~cAudio(void);
void *GetHandle() { return NULL; };
/* shut up */
int mute(void);
int unmute(void);
int SetMute(bool enable);
/* volume, min = 0, max = 255 */
int setVolume(unsigned int left, unsigned int right);
int getVolume(void) { return volume;}
bool getMuteStatus(void) { return muted; };
/* start and stop audio */
int Start(void);
int Stop(void);
bool Pause(bool Pcm = true);
void SetStreamType(AUDIO_FORMAT type);
void SetSyncMode(AVSYNC_TYPE Mode);
/* select channels */
int setChannel(int channel);
int PrepareClipPlay(int uNoOfChannels, int uSampleRate, int uBitsPerSample, int bLittleEndian);
int WriteClip(unsigned char * buffer, int size);
int StopClip();
void getAudioInfo(int &type, int &layer, int& freq, int &bitrate, int &mode);
void SetSRS(int iq_enable, int nmgr_enable, int iq_mode, int iq_level);
bool IsHdmiDDSupported();
void SetHdmiDD(bool enable);
void SetSpdifDD(bool enable);
void ScheduleMute(bool On);
void EnableAnalogOut(bool enable);
private:
bool muted;
int volume;
void *pdata;
};
#include <config.h>
#if HAVE_TRIPLEDRAGON
#include "../libtriple/audio_td.h"
#elif HAVE_DUCKBOX_HARDWARE
#include "../libduckbox/audio_lib.h"
#include "../libduckbox/audio_mixer.h"
#elif HAVE_SPARK_HARDWARE
#include "../libspark/audio_lib.h"
#include "../libspark/audio_mixer.h"
#elif HAVE_ARM_HARDWARE
#include "../libarmbox/audio_lib.h"
#elif HAVE_MIPS_HARDWARE
#include "../libmipsbox/audio_lib.h"
#elif HAVE_AZBOX_HARDWARE
#include "../libazbox/audio_lib.h"
#elif HAVE_GENERIC_HARDWARE
#if BOXMODEL_RASPI
#include "../libraspi/audio_lib.h"
#else
#include "../libgeneric-pc/audio_lib.h"
#endif
#else
#error no valid hardware defined
#endif

View File

@@ -1,22 +1,16 @@
/*
* dummy functions to implement ca_cs.h interface
*/
#ifndef __CA_LIBTRIPLE_H_
#define __CA_LIBTRIPLE_H_
#ifndef __CA_H__
#define __CA_H__
#include <stdint.h>
#include "cs_types.h"
#include <vector>
#include <set>
typedef std::set<int> ca_map_t;
typedef ca_map_t::iterator ca_map_iterator_t;
typedef std::vector<u16> CaIdVector;
typedef std::vector<u16>::iterator CaIdVectorIterator;
typedef std::vector<u16>::const_iterator CaIdVectorConstIterator;
enum CA_INIT_MASK {
CA_INIT_SC = 1,
CA_INIT_SC = 1,
CA_INIT_CI,
CA_INIT_BOTH
};
@@ -24,7 +18,7 @@ enum CA_INIT_MASK {
enum CA_SLOT_TYPE {
CA_SLOT_TYPE_SMARTCARD,
CA_SLOT_TYPE_CI,
CA_SLOT_TYPE_ALL,
CA_SLOT_TYPE_ALL
};
enum CA_MESSAGE_FLAGS {
@@ -67,13 +61,18 @@ enum CA_MESSAGE_MSGID {
CA_MESSAGE_MSG_MMI_CLOSE,
CA_MESSAGE_MSG_INTERNAL,
CA_MESSAGE_MSG_PMT_ARRIVED,
CA_MESSAGE_MSG_CAPMT_ARRIVED,
CA_MESSAGE_MSG_CAT_ARRIVED,
CA_MESSAGE_MSG_ECM_ARRIVED,
CA_MESSAGE_MSG_EMM_ARRIVED,
CA_MESSAGE_MSG_CHANNEL_CHANGE,
CA_MESSAGE_MSG_EXIT,
CA_MESSAGE_MSG_GUI_READY,
CA_MESSAGE_MSG_EXIT
};
typedef std::set<int> ca_map_t;
typedef ca_map_t::iterator ca_map_iterator_t;
typedef struct CA_MESSAGE {
uint32_t MsgId;
enum CA_SLOT_TYPE SlotType;
@@ -95,9 +94,9 @@ public:
uint32_t GetNumberSmartCardSlots(void);
static cCA *GetInstance(void);
bool SendPMT(int Unit, unsigned char *Data, int Len, CA_SLOT_TYPE SlotType = CA_SLOT_TYPE_ALL);
bool SendCAPMT(u64 /*Source*/, u8 /*DemuxSource*/, u8 /*DemuxMask*/, const unsigned char * /*CAPMT*/, u32 /*CAPMTLen*/, const unsigned char * /*RawPMT*/, u32 /*RawPMTLen*/, enum CA_SLOT_TYPE SlotType = CA_SLOT_TYPE_ALL) { (void)SlotType; return true; };
bool SendCAPMT(u64 /*Source*/, u8 /*DemuxSource*/, u8 /*DemuxMask*/, const unsigned char * /*CAPMT*/, u32 /*CAPMTLen*/, const unsigned char * /*RawPMT*/, u32 /*RawPMTLen*/, enum CA_SLOT_TYPE SlotType = CA_SLOT_TYPE_ALL, unsigned char scrambled = 0, ca_map_t camap ={0}, int mode = 0, bool enable = false) { (void)SlotType;(void)scrambled;(void)camap;(void)mode;(void)enable; return true; };
// bool SendCAPMT(u64 /*Source*/, u8 /*DemuxSource*/, u8 /*DemuxMask*/, const unsigned char * /*CAPMT*/, u32 /*CAPMTLen*/, const unsigned char * /*RawPMT*/, u32 /*RawPMTLen*/) { return true; };
bool SendCAPMT(u64 /*Source*/, u8 /*DemuxSource*/, u8 /*DemuxMask*/, const unsigned char * /*CAPMT*/, u32 /*CAPMTLen*/, const unsigned char * /*RawPMT*/, u32 /*RawPMTLen*/, enum CA_SLOT_TYPE
/*SlotType*/, unsigned char /*scrambled = 0*/, ca_map_t /*camap = std::set<int>()*/, int /*mode = 0*/, bool /*enabled = false*/) { return true; };
bool SendMessage(const CA_MESSAGE *Msg);
void SetInitMask(enum CA_INIT_MASK InitMask);
int GetCAIDS(CaIdVector & /*Caids*/) { return 0; };
@@ -111,8 +110,10 @@ public:
void MenuAnswer(enum CA_SLOT_TYPE, uint32_t Slot, uint32_t choice);
void InputAnswer(enum CA_SLOT_TYPE, uint32_t Slot, uint8_t * Data, int Len);
void MenuClose(enum CA_SLOT_TYPE, uint32_t Slot);
void SetTSClock(u32 /*Speed*/) { return; };
void SetTSClock(u32 /*Speed*/, int /*slot*/) { return; };
bool checkChannelID(u64 /*chanID*/) { return false; };
void setCheckLiveSlot(int /*check*/) { return; };
virtual ~cCA();
};
#endif // __CA_LIBTRIPLE_H_
#endif // __CA_H__

383
include/ca_ci.h Normal file
View File

@@ -0,0 +1,383 @@
#ifndef __CA_CI_H__
#define __CA_CI_H__
#include <config.h>
#include <stdint.h>
#include <asm/types.h>
#include <pthread.h>
#include <list>
#include <queue>
#include <vector>
#include <set>
#include "mmi.h"
#include "cs_types.h"
#include "cs_api.h"
/* constants taken from dvb-apps */
#define T_SB 0x80 // sb primitive h<--m
#define T_RCV 0x81 // receive primitive h-->m
#define T_CREATE_T_C 0x82 // create transport connection primitive h-->m
#define T_C_T_C_REPLY 0x83 // ctc reply primitive h<--m
#define T_DELETE_T_C 0x84 // delete tc primitive h<->m
#define T_D_T_C_REPLY 0x85 // dtc reply primitive h<->m
#define T_REQUEST_T_C 0x86 // request transport connection primitive h<--m
#define T_NEW_T_C 0x87 // new tc / reply to t_request primitive h-->m
#define T_T_C_ERROR 0x77 // error creating tc primitive h-->m
#define T_DATA_LAST 0xA0 // convey data from higher constructed h<->m
#define T_DATA_MORE 0xA1 // convey data from higher constructed h<->m
/* max multi decrypt per ci-cam */
#define CI_MAX_MULTI 5
enum CA_INIT_MASK {
CA_INIT_SC = 1,
CA_INIT_CI,
CA_INIT_BOTH
};
enum CA_SLOT_TYPE {
CA_SLOT_TYPE_SMARTCARD,
CA_SLOT_TYPE_CI,
CA_SLOT_TYPE_ALL
};
enum CA_MESSAGE_FLAGS {
CA_MESSAGE_EMPTY = (1 << 0),
CA_MESSAGE_HAS_PARAM1_DATA = (1 << 1), /// Free after use!
CA_MESSAGE_HAS_PARAM1_INT = (1 << 2),
CA_MESSAGE_HAS_PARAM1_PTR = (1 << 3),
CA_MESSAGE_HAS_PARAM2_INT = (1 << 4),
CA_MESSAGE_HAS_PARAM2_PTR = (1 << 5),
CA_MESSAGE_HAS_PARAM2_DATA = (1 << 6),
CA_MESSAGE_HAS_PARAM3_DATA = (1 << 7), /// Free after use!
CA_MESSAGE_HAS_PARAM3_INT = (1 << 8),
CA_MESSAGE_HAS_PARAM3_PTR = (1 << 9),
CA_MESSAGE_HAS_PARAM4_INT = (1 << 10),
CA_MESSAGE_HAS_PARAM4_PTR = (1 << 11),
CA_MESSAGE_HAS_PARAM4_DATA = (1 << 12),
CA_MESSAGE_HAS_PARAM5_INT = (1 << 13),
CA_MESSAGE_HAS_PARAM5_PTR = (1 << 14),
CA_MESSAGE_HAS_PARAM5_DATA = (1 << 15),
CA_MESSAGE_HAS_PARAM6_INT = (1 << 16),
CA_MESSAGE_HAS_PARAM6_PTR = (1 << 17),
CA_MESSAGE_HAS_PARAM6_DATA = (1 << 18),
CA_MESSAGE_HAS_PARAM1_LONG = (1 << 19),
CA_MESSAGE_HAS_PARAM2_LONG = (1 << 20),
CA_MESSAGE_HAS_PARAM3_LONG = (1 << 21),
CA_MESSAGE_HAS_PARAM4_LONG = (1 << 22)
};
enum CA_MESSAGE_MSGID {
CA_MESSAGE_MSG_INSERTED,
CA_MESSAGE_MSG_REMOVED,
CA_MESSAGE_MSG_INIT_OK,
CA_MESSAGE_MSG_INIT_FAILED,
CA_MESSAGE_MSG_MMI_MENU,
CA_MESSAGE_MSG_MMI_MENU_ENTER,
CA_MESSAGE_MSG_MMI_MENU_ANSWER,
CA_MESSAGE_MSG_MMI_LIST,
CA_MESSAGE_MSG_MMI_TEXT,
CA_MESSAGE_MSG_MMI_REQ_INPUT,
CA_MESSAGE_MSG_MMI_CLOSE,
CA_MESSAGE_MSG_INTERNAL,
CA_MESSAGE_MSG_PMT_ARRIVED,
CA_MESSAGE_MSG_CAPMT_ARRIVED,
CA_MESSAGE_MSG_CAT_ARRIVED,
CA_MESSAGE_MSG_ECM_ARRIVED,
CA_MESSAGE_MSG_EMM_ARRIVED,
CA_MESSAGE_MSG_CHANNEL_CHANGE,
CA_MESSAGE_MSG_GUI_READY,
CA_MESSAGE_MSG_EXIT
};
typedef struct CA_MESSAGE {
uint32_t MsgId;
enum CA_SLOT_TYPE SlotType;
int Slot;
uint32_t Flags;
union {
uint8_t *Data[4];
uint32_t Param[4];
void *Ptr[4];
uint64_t ParamLong[4];
} Msg;
} CA_MESSAGE;
typedef std::set<int> ca_map_t;
typedef ca_map_t::iterator ca_map_iterator_t;
typedef std::vector<u16> bSIDVector;
typedef std::vector<u16> CaIdVector;
typedef std::vector<u16>::iterator CaIdVectorIterator;
typedef std::vector<u16>::const_iterator CaIdVectorConstIterator;
#define CA_MESSAGE_SIZE sizeof(CA_MESSAGE)
#define CA_MESSAGE_ENTRIES 256
#define CA_MESSAGE_ENTRIES_CI 128
#define CA_MESSAGE_ENTRIES_SC 64
#ifndef CS_CA_PDATA
#define CS_CA_PDATA void
#endif
typedef enum {
TUNER_A,
TUNER_B,
TUNER_C,
TUNER_D
#if BOXMODEL_VUSOLO4K || BOXMODEL_VUDUO4K || BOXMODEL_VUULTIMO4K || BOXMODEL_VUUNO4KSE || BOXMODEL_VUUNO4K
, TUNER_E
, TUNER_F
, TUNER_G
, TUNER_H
, TUNER_I
, TUNER_J
, TUNER_K
, TUNER_L
, TUNER_M
, TUNER_N
, TUNER_O
, TUNER_P
#if BOXMODEL_VUULTIMO4K
, TUNER_Q
, TUNER_R
, TUNER_S
, TUNER_T
, TUNER_U
, TUNER_V
, TUNER_W
, TUNER_X
#endif
#endif
} source_t;
typedef enum {
eDataTimeout,
eDataError,
eDataReady,
eDataWrite,
eDataStatusChanged
} eData;
typedef enum {
eStatusNone,
eStatusWait,
eStatusReset
} eStatus;
struct queueData
{
__u8 prio;
unsigned char *data;
unsigned int len;
queueData(unsigned char *_data, unsigned int _len, __u8 _prio = 0)
:prio(_prio), data(_data), len(_len)
{
}
bool operator < ( const struct queueData &a ) const
{
return prio < a.prio;
}
};
class eDVBCIMMISession;
class eDVBCIApplicationManagerSession;
class eDVBCICAManagerSession;
class eDVBCIContentControlManagerSession;
typedef struct
{
pthread_t slot_thread;
unsigned int slot;
int fd;
int connection_id;
eStatus status;
int receivedLen;
unsigned char* receivedData;
void* pClass;
bool pollConnection;
bool camIsReady;
eDVBCIMMISession* mmiSession;
eDVBCIApplicationManagerSession* appSession;
eDVBCICAManagerSession* camgrSession;
eDVBCIContentControlManagerSession* ccmgrSession;
bool hasAppManager;
bool hasMMIManager;
bool hasCAManager;
bool hasCCManager;
bool hasDateTime;
bool mmiOpened;
bool init;
bool ccmgr_ready;
char ci_dev[32];
char name[512];
bool newPids;
bool newCapmt;
bool multi;
bool recordUse[CI_MAX_MULTI];
bool liveUse[CI_MAX_MULTI];
u16 SID[CI_MAX_MULTI];
u64 TP;
int ci_use_count;
u32 pmtlen;
u8 source;
u8 camask;
unsigned char pmtdata[1024 * 4];
int counter;
CaIdVector cam_caids;
std::priority_queue<queueData> sendqueue;
std::vector<u16> pids;
bSIDVector bsids;
unsigned char lastKey[32];
unsigned char scrambled;
u8 lastParity;
bool DataLast;
bool DataRCV;
bool SidBlackListed;
/* private data */
void *private_data;
} eDVBCISlot;
eData sendData(eDVBCISlot *slot, unsigned char* data, int len);
typedef std::list<eDVBCISlot*>::iterator SlotIt;
/// CA module class
class cCA {
private:
/// Static instance of the CA module
// static cCA *inst;
/// Private constructor (singleton method)
cCA(void);
/// Private data for the CA module
CS_CA_PDATA *privateData;
/// set inputs with tuner letter in tsmux
void setInputs();
/// write ci info file to /tmp
void write_ci_info(int slot, CaIdVector caids);
/// delete ci info file
void del_ci_info(int slot);
/// extract audio / video pids from capmt
void extractPids(eDVBCISlot* slot);
/// ci module is detected
void ci_inserted(eDVBCISlot* slot);
/// ci module is removed
void ci_removed(eDVBCISlot* slot);
/// decode the tpdu tag
void process_tpdu(eDVBCISlot* slot, unsigned char tpdu_tag, __u8* data, int asn_data_length, int con_id);
/// set flag of running ci record to false
bool StopRecordCI( u64 TP, u16 SID, u8 source, u32 calen);
/// set flag of running ci live-tv to false
bool StopLiveCI( u64 TP, u16 SID, u8 source, u32 calen);
/// find an unused ci slot for use with service
SlotIt FindFreeSlot(u64 tpid, u8 source, u16 sid, ca_map_t camap, u8 scrambled);
/// get slot iterator by slot number
SlotIt GetSlot(unsigned int slot);
/// send buffered capmt to ci modul
bool SendCaPMT(eDVBCISlot* slot);
/// send a dummy capmt to ci for deactivating
bool SendNullPMT(eDVBCISlot* slot);
/// set ci source
void setSource(eDVBCISlot* slot);
/// set demux source
void setInputSource(eDVBCISlot* slot, bool ci);
/// check if data in queue
bool checkQueueSize(eDVBCISlot* slot);
enum CA_INIT_MASK initMask;
int num_slots;
bool init;
void SendPMT();
pthread_mutex_t ciMutex;
std::list<eDVBCISlot*> slot_data;
pthread_t slot_thread;
public:
/// sh4 unused
bool Init(void);
/// init ci and start the loop
cCA(int Slots);
/// Returns the number of CI slots
uint32_t GetNumberCISlots(void);
/// Returns the number of Smartcard slots
uint32_t GetNumberSmartCardSlots(void);
/// Singleton
static cCA *GetInstance(void);
/// Send PMT to a individual or to all available modules (DEPRECATED)
bool SendPMT(int Unit, unsigned char *Data, int Len, enum CA_SLOT_TYPE SlotType = CA_SLOT_TYPE_ALL);
/// Sends a message to the CA thread
bool SendMessage(const CA_MESSAGE *Msg);
/// Sets which modules to initialize. It is only
/// possible to change this once!
/// sh4 unused
void SetInitMask(enum CA_INIT_MASK InitMask);
/// Sets the frequency (in Hz) of the TS stream input (only valid for CI)
/// sh4 unused
void SetTSClock(u32 Speed, int slot = 0);
#if BOXMODEL_VUPLUS
/// dvb wait delay for ci response
void SetCIDelay(int Delay);
/// relevant pids routing
void SetCIRelevantPidsRouting(int RPR, int slot = 0);
#endif
/// Start the CA module
/// sh4 unused
bool Start(void);
/// Stops the CA module
/// sh4 unused
void Stop(void);
/// Notify that the GUI is ready to receive messages
/// (CA messages coming from a module)
/// sh4 unused
void Ready(bool Set);
/// Resets a module (if possible)
/// sh4 unused
void ModuleReset(enum CA_SLOT_TYPE, uint32_t Slot);
/// Checks if a module is present
bool ModulePresent(enum CA_SLOT_TYPE, uint32_t Slot);
/// Returns the module name in array Name
void ModuleName(enum CA_SLOT_TYPE, uint32_t Slot, char *Name);
/// Notify the module we want to enter menu
void MenuEnter(enum CA_SLOT_TYPE, uint32_t Slot);
/// Notify the module with our answer (choice nr)
void MenuAnswer(enum CA_SLOT_TYPE, uint32_t Slot, uint32_t choice);
/// Notify the module with our answer (binary)
void InputAnswer(enum CA_SLOT_TYPE, uint32_t Slot, uint8_t * Data, int Len);
/// Notify the module we closed the menu
void MenuClose(enum CA_SLOT_TYPE, uint32_t Slot);
/// Get the supported CAIDs
int GetCAIDS(CaIdVector &Caids);
/// Send a CA-PMT object and Raw unparsed PMT to the CA layer
bool SendCAPMT(u64 /*Source*/, u8 /*DemuxSource*/, u8 /*DemuxMask*/, const unsigned char * /*CAPMT*/, u32 /*CAPMTLen*/, const unsigned char * /*RawPMT*/, u32 /*RawPMTLen*/, enum CA_SLOT_TYPE SlotType = CA_SLOT_TYPE_ALL,
unsigned char scrambled = 0, ca_map_t camap = std::set<int>(), int mode = 0, bool enabled = false);
/// sh4 unused
bool SendDateTime(void);
/// the main loop
void slot_pollthread(void *c);
/// check if current channel uses any ci module
bool checkChannelID(u64 chanID);
/// set checking for live-tv use ci to true
void setCheckLiveSlot(int check);
/// as the name says
bool CheckCerts(void);
/// Virtual destructor
virtual ~cCA();
};
#endif // __CA_CI_H__

View File

@@ -1 +0,0 @@
#include "ca.h"

5
include/ca_hal.h Normal file
View File

@@ -0,0 +1,5 @@
#if HAVE_DUCKBOX_HARDWARE || (HAVE_ARM_HARDWARE && !BOXMODEL_HD60) || HAVE_MIPS_HARDWARE
#include "ca_ci.h"
#else
#include "ca.h"
#endif

View File

@@ -1,67 +1,38 @@
/* compatibility header for tripledragon. I'm lazy, so I just left it
as "cs_api.h" so that I don't need too many ifdefs in the code */
#ifndef __CS_API_H_
#define __CS_API_H_
#ifndef __CS_API_H__
#define __CS_API_H__
#include "init.h"
#include <config.h>
#include "init_td.h"
typedef void (*cs_messenger) (unsigned int msg, unsigned int data);
#if 0
enum CS_LOG_MODULE {
CS_LOG_CI = 0,
CS_LOG_HDMI_CEC,
CS_LOG_HDMI,
CS_LOG_VIDEO,
CS_LOG_VIDEO_DRM,
CS_LOG_AUDIO,
CS_LOG_DEMUX,
CS_LOG_DENC,
CS_LOG_PVR_RECORD,
CS_LOG_PVR_PLAY,
CS_LOG_POWER_CTRL,
CS_LOG_POWER_CLK,
CS_LOG_MEM,
CS_LOG_API,
};
#endif
inline void cs_api_init()
{
init_td_api();
hal_api_init();
};
inline void cs_api_exit()
{
shutdown_td_api();
hal_api_exit();
};
#define cs_malloc_uncached malloc
#define cs_free_uncached free
// Callback function helpers
#if HAVE_DUCKBOX_HARDWARE || (HAVE_ARM_HARDWARE && !BOXMODEL_HD60) || HAVE_MIPS_HARDWARE
void cs_register_messenger(cs_messenger messenger);
#else
static inline void cs_register_messenger(cs_messenger) { return; };
static inline void cs_deregister_messenger(void) { return; };
//cs_messenger cs_get_messenger(void);
#if 0
// Logging functions
void cs_log_enable(void);
void cs_log_disable(void);
void cs_log_message(const char *prefix, const char *fmt, ...);
void cs_log_module_enable(enum CS_LOG_MODULE module);
void cs_log_module_disable(enum CS_LOG_MODULE module);
void cs_log_module_message(enum CS_LOG_MODULE module, const char *fmt, ...);
// TS Routing
unsigned int cs_get_ts_output(void);
int cs_set_ts_output(unsigned int port);
// Serial nr and revision accessors
unsigned long long cs_get_serial(void);
#endif
static inline void cs_deregister_messenger(void) { return; };
/* compat... HD1 seems to be version 6. everything newer ist > 6... */
static inline unsigned int cs_get_revision(void) { return 1; };
static inline unsigned int cs_get_chip_type(void) { return 0; };
extern int cnxt_debug;
#endif //__CS_API_H_
#endif // __CS_API_H__

320
include/cs_frontpanel.h Normal file
View File

@@ -0,0 +1,320 @@
#ifndef __CS_FRONTPANEL_H__
#define __CS_FRONTPANEL_H__
#define VFDDISPLAYCHARS 0xc0425a00
#define VFDWRITECGRAM 0x40425a01
#define VFDBRIGHTNESS 0xc0425a03
#define VFDPWRLED 0xc0425a04
#define VFDDRIVERINIT 0xc0425a08
#define VFDICONDISPLAYONOFF 0xc0425a0a
#define VFDDISPLAYWRITEONOFF 0xc0425a05
#define VFDCLEARICONS 0xc0425af6
#define VFDSETRF 0xc0425af7
#define VFDSETFAN 0xc0425af8
#define VFDGETWAKEUPMODE 0xc0425af9
#define VFDGETTIME 0xc0425afa
#define VFDSETTIME 0xc0425afb
#define VFDSTANDBY 0xc0425afc
#define VFDREBOOT 0xc0425afd
#define VFDSETLED 0xc0425afe
#define VFDSETMODE 0xc0425aff
#define VFDGETWAKEUPTIME 0xc0425b00
#define VFDGETVERSION 0xc0425b01
#define VFDSETDISPLAYTIME 0xc0425b02
#define VFDSETTIMEMODE 0xc0425b03
#define VFDDISPLAYCLR 0xc0425b00
typedef enum {
#if defined(BOXMODEL_OCTAGON1008)
ICON_DOLBY = 0x10,
ICON_DTS,
ICON_VIDEO,
ICON_AUDIO,
ICON_LINK,
ICON_HDD,
ICON_DISC,
ICON_DVB,
ICON_DVD,
ICON_TIME,
ICON_TIMER,
ICON_CARD,
ICON_1,
ICON_2,
ICON_KEY,
ICON_16_9,
ICON_USB,
ICON_CRYPTED,
ICON_PLAY,
ICON_REWIND,
ICON_PAUSE,
ICON_FF,
ICON_REC,
ICON_ARROW,
ICON_COLON1,
ICON_COLON2,
ICON_COLON3,
ICON_MAX,
FP_ICON_USB = ICON_USB,
FP_ICON_HD = ICON_16_9,
FP_ICON_HDD = ICON_HDD,
FP_ICON_LOCK = ICON_CRYPTED,
FP_ICON_BT,
FP_ICON_MP3,
FP_ICON_MUSIC,
FP_ICON_DD = ICON_DOLBY,
FP_ICON_MAIL,
FP_ICON_MUTE = ICON_TIME,
FP_ICON_PLAY = ICON_PLAY,
FP_ICON_PAUSE = ICON_PAUSE,
FP_ICON_FF = ICON_FF,
FP_ICON_FR = ICON_REWIND,
FP_ICON_REC = ICON_REC,
FP_ICON_CLOCK = ICON_TIMER,
FP_ICON_RADIO = ICON_AUDIO,
FP_ICON_TV = ICON_VIDEO,
FP_ICON_DOWNLOAD = ICON_LINK,
FP_ICON_CAM1 = ICON_REC,
#elif defined(BOXMODEL_FORTIS_HDBOX)
ICON_USB = 0x10,
ICON_STANDBY,
ICON_SAT,
ICON_REC,
ICON_TIMESHIFT,
ICON_TIMER,
ICON_HD,
ICON_SCRAMBLED,
ICON_DOLBY,
ICON_MUTE,
ICON_TUNER1,
ICON_TUNER2,
ICON_MP3,
ICON_REPEAT,
ICON_Play,
ICON_TER,
ICON_FILE,
ICON_480i,
ICON_480p,
ICON_576i,
ICON_576p,
ICON_720p,
ICON_1080i,
ICON_1080p,
ICON_Circ0,
ICON_Circ1,
ICON_Circ2,
ICON_Circ3,
ICON_Circ4,
ICON_Circ5,
ICON_Circ6,
ICON_Circ7,
ICON_Circ8,
ICON_COLON1,
ICON_COLON2,
ICON_COLON3,
ICON_COLON4,
ICON_TV,
ICON_RADIO,
ICON_MAX,
FP_ICON_USB = ICON_USB,
FP_ICON_REC = ICON_REC,
FP_ICON_CAM1 = ICON_REC,
FP_ICON_TIMESHIFT = ICON_TIMESHIFT,
FP_ICON_CLOCK = ICON_TIMER,
FP_ICON_HD = ICON_HD,
FP_ICON_LOCK = ICON_SCRAMBLED,
FP_ICON_DD = ICON_DOLBY,
FP_ICON_MUTE = ICON_MUTE,
FP_ICON_BT = 0,
FP_ICON_MP3 = ICON_MP3,
FP_ICON_PLAY = ICON_Play,
FP_ICON_PAUSE = 0,
FP_ICON_HDD = 0,
FP_ICON_MAIL = 0,
FP_ICON_FF = 0,
FP_ICON_FR = 0,
FP_ICON_RADIO = ICON_RADIO,
FP_ICON_TV = ICON_TV,
FP_ICON_MUSIC = ICON_RADIO,
FP_ICON_MAX = ICON_MAX
#elif defined(BOXMODEL_UFS910) || defined(BOXMODEL_UFS922) || defined(BOXMODEL_UFS912) || defined(BOXMODEL_UFS913)
FP_ICON_USB = 0x10,
FP_ICON_HD,
FP_ICON_HDD,
FP_ICON_LOCK,
FP_ICON_BT,
FP_ICON_MP3,
FP_ICON_MUSIC,
FP_ICON_DD,
FP_ICON_MAIL,
FP_ICON_MUTE,
FP_ICON_PLAY,
FP_ICON_PAUSE,
FP_ICON_FF,
FP_ICON_FR,
FP_ICON_REC,
FP_ICON_CLOCK,
FP_ICON_MAX,
FP_ICON_CAM1 = FP_ICON_REC,
FP_ICON_TV = 0,
FP_ICON_RADIO = FP_ICON_MUSIC,
FP_ICON_RECORD = FP_ICON_REC,
FP_ICON_DOWNLOAD = 0,
FP_ICON_TIMESHIFT = 0
#elif defined(BOXMODEL_IPBOX9900) || defined(BOXMODEL_IPBOX99)
ICON_STANDBY,
ICON_SAT,
ICON_REC,
ICON_TIMESHIFT,
ICON_TIMER,
ICON_HD,
ICON_SCRAMBLED,
ICON_MUTE,
ICON_TUNER1,
ICON_TUNER2,
ICON_MP3,
ICON_REPEAT,
ICON_PLAY,
ICON_PAUSE,
ICON_TER,
ICON_FILE,
ICON_480I,
ICON_480P,
ICON_576I,
ICON_576P,
ICON_720P,
ICON_1080I,
ICON_1080P,
ICON_TV,
ICON_RADIO,
ICON_MAX,
FP_ICON_480P = ICON_480P,
FP_ICON_480I = ICON_480I,
FP_ICON_576P = ICON_576P,
FP_ICON_576I = ICON_576I,
FP_ICON_PLAY = ICON_PLAY,
FP_ICON_PAUSE = ICON_PAUSE,
FP_ICON_1080P = 0x0A,
FP_ICON_1080I = 0x09,
FP_ICON_720P = 0x08,
FP_ICON_POWER = 0x00,
FP_ICON_HD = 0x05,
FP_ICON_RADIO = 0x0D,
FP_ICON_MP3 = FP_ICON_RADIO,
FP_ICON_MUSIC = FP_ICON_RADIO,
FP_ICON_DD = 0x04,
FP_ICON_REC = 0x03,
FP_ICON_FF = 0,
FP_ICON_FR = 0,
FP_ICON_USB = 0,
FP_ICON_HDD = 0,
FP_ICON_MUTE = 0,
FP_ICON_CLOCK = 0,
FP_ICON_CAM1 = 0,
FP_ICON_LOCK = 0,
FP_ICON_DOWNLOAD = 0,
FP_ICON_TIMESHIFT = FP_ICON_REC,
FP_ICON_TV = 0,
FP_ICON_MAIL = 0,
FP_ICON_BT = 0,
#else
FP_ICON_USB = 0x10,
FP_ICON_HD,
FP_ICON_HDD,
FP_ICON_LOCK,
FP_ICON_BT,
FP_ICON_MP3,
FP_ICON_MUSIC,
FP_ICON_DD,
FP_ICON_MAIL,
FP_ICON_MUTE,
FP_ICON_PLAY,
FP_ICON_PAUSE,
FP_ICON_FF,
FP_ICON_FR,
FP_ICON_REC,
FP_ICON_CLOCK,
FP_ICON_CAM1 = FP_ICON_REC,
FP_ICON_TV = FP_ICON_MUSIC,
FP_ICON_RADIO = FP_ICON_MUSIC,
FP_ICON_RECORD = FP_ICON_REC,
FP_ICON_DOWNLOAD,
FP_ICON_TIMESHIFT,
#endif
#if !defined(BOXMODEL_UFS910) && !defined(BOXMODEL_UFS922) && !defined(BOXMODEL_UFS912) && !defined(BOXMODEL_UFS913) && !defined(BOXMODEL_FORTIS_HDBOX)
FP_ICON_MAX
#endif
} fp_icon;
typedef enum {
FP_FLAG_NONE = 0x00,
FP_FLAG_SCROLL_ON = 0x01, /* switch scrolling on */
FP_FLAG_SCROLL_LTR = 0x02, /* scroll from left to rightinstead of default right to left direction (i.e. for arabic text) */
FP_FLAG_SCROLL_SIO = 0x04, /* start/stop scrolling with empty screen (scroll in/out) */
FP_FLAG_SCROLL_DELAY = 0x08, /* delayed scroll start */
FP_FLAG_ALIGN_LEFT = 0x10, /* align the text in display from the left (default) */
FP_FLAG_ALIGN_RIGHT = 0x20, /* align the text in display from the right (arabic) */
FP_FLAG_UPDATE_SCROLL_POS = 0x40, /* update the current position for scrolling */
} fp_flag;
typedef struct {
unsigned char brightness;
unsigned char flags;
unsigned char current_hour;
unsigned char current_minute;
unsigned char timer_minutes_hi;
unsigned char timer_minutes_lo;
} fp_standby_data_t;
typedef enum {
FP_LED_1_ON = 0x81,
FP_LED_2_ON = 0x82,
FP_LED_3_ON = 0x83,
FP_LED_1_OFF = 0x01,
FP_LED_2_OFF = 0x02,
FP_LED_3_OFF = 0x03,
} fp_led_ctrl_t;
typedef struct {
unsigned char source;
unsigned char time_minutes_hi;
unsigned char time_minutes_lo;
} fp_wakeup_data_t;
typedef enum {
FP_WAKEUP_SOURCE_TIMER = 0x01,
FP_WAKEUP_SOURCE_BUTTON = 0x02,
FP_WAKEUP_SOURCE_REMOTE = 0x04,
FP_WAKEUP_SOURCE_PWLOST = 0x7F,
FP_WAKEUP_SOURCE_POWER = 0xFF
} fp_wakeup_source;
typedef struct {
unsigned short addr;
unsigned short cmd;
} fp_standby_cmd_data_t;
typedef enum {
FP_DISPLAY_TEXT_NONE = 0,
FP_DISPLAY_TEXT_LIMITED,
FP_DISPLAY_TEXT_ALL,
} fp_display_text_type_t;
typedef enum {
FP_DISPLAY_TYPE_NONE = 0,
FP_DISPLAY_TYPE_VFD,
FP_DISPLAY_TYPE_OLED,
FP_DISPLAY_TYPE_LED_SEGMENT
} fp_display_type_t;
typedef struct {
fp_display_type_t display_type;
unsigned short xres, yres;
unsigned int segment_count;
fp_display_text_type_t text_support;
bool number_support;
} fp_display_caps_t;
#endif // __CS_FRONTPANEL_H__

View File

@@ -1,8 +1,8 @@
/* pretty useless, but we don't need to work around this if
* we just copy it over... */
#ifndef __CS_TYPES_H_
#define __CS_TYPES_H_
#ifndef __CS_TYPES_H__
#define __CS_TYPES_H__
typedef enum
{
@@ -20,4 +20,4 @@ typedef signed int s32;
typedef signed short s16;
typedef signed char s8;
#endif // __CS_TYPES_H_
#endif // __CS_TYPES_H__

View File

@@ -1 +0,0 @@
#include "dmx_hal.h"

View File

@@ -15,9 +15,10 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __dmx_hal__
#define __dmx_hal__
#ifndef __DMX_HAL_H__
#define __DMX_HAL_H__
#include <config.h>
#include <cstdlib>
#include <vector>
#include <inttypes.h>
@@ -36,7 +37,38 @@ extern "C" {
#include <cs_types.h>
#if BOXMODEL_VUULTIMO4K
#define MAX_DMX_UNITS 24
#else
#if BOXMODEL_VUSOLO4K || BOXMODEL_VUDUO4K || BOXMODEL_VUUNO4KSE || BOXMODEL_VUUNO4K
#define MAX_DMX_UNITS 16
#else
#define MAX_DMX_UNITS 4
#endif
#endif
#ifndef DMX_SET_SOURCE
/**
* DMX_SET_SOURCE and dmx_source enum removed on 4.14 kernel
* From Github.com/OpenPLI/enigma2 commit 7996dbb
**/
enum dmx_source
{
DMX_SOURCE_FRONT0 = 0,
DMX_SOURCE_FRONT1,
DMX_SOURCE_FRONT2,
DMX_SOURCE_FRONT3,
#if BOXMODEL_VUPLUS_ARM
DMX_SOURCE_DVR0 = 32,
#else
DMX_SOURCE_DVR0 = 16,
#endif
DMX_SOURCE_DVR1,
DMX_SOURCE_DVR2,
DMX_SOURCE_DVR3
};
#define DMX_SET_SOURCE _IOW('o', 49, enum dmx_source)
#endif
typedef enum
{
@@ -60,38 +92,38 @@ class cRecord;
class cPlayback;
class cDemux
{
friend class cRecord;
friend class cPlayback;
public:
bool Open(DMX_CHANNEL_TYPE pes_type, void * x = NULL, int y = 0);
void Close(void);
bool Start(bool record = false);
bool Stop(void);
int Read(unsigned char *buff, int len, int Timeout = 0);
bool sectionFilter(unsigned short pid, const unsigned char * const filter, const unsigned char * const mask, int len, int Timeout = 0, const unsigned char * const negmask = NULL);
bool pesFilter(const unsigned short pid);
void SetSyncMode(AVSYNC_TYPE mode);
void * getBuffer();
void * getChannel();
DMX_CHANNEL_TYPE getChannelType(void) { return dmx_type; };
bool addPid(unsigned short pid);
void getSTC(int64_t * STC);
int getUnit(void);
static bool SetSource(int unit, int source);
static int GetSource(int unit);
cDemux(int num = 0);
~cDemux();
int getFD(void) { return fd; }; /* needed by cPlayback class */
private:
void removePid(unsigned short Pid); /* needed by cRecord class */
int num;
int fd;
int buffersize;
uint16_t pid;
uint8_t flt;
std::vector<pes_pids> pesfds;
DMX_CHANNEL_TYPE dmx_type;
void *pdata;
friend class cRecord;
friend class cPlayback;
public:
bool Open(DMX_CHANNEL_TYPE pes_type, void * x = NULL, int y = 0);
void Close(void);
bool Start(bool record = false);
bool Stop(void);
int Read(unsigned char *buff, int len, int Timeout = 0);
bool sectionFilter(unsigned short pid, const unsigned char * const filter, const unsigned char * const mask, int len, int Timeout = 0, const unsigned char * const negmask = NULL);
bool pesFilter(const unsigned short pid);
void SetSyncMode(AVSYNC_TYPE mode);
void * getBuffer();
void * getChannel();
DMX_CHANNEL_TYPE getChannelType(void) { return dmx_type; };
bool addPid(unsigned short pid);
void getSTC(int64_t * STC);
int getUnit(void);
static bool SetSource(int unit, int source);
static int GetSource(int unit);
int getFD(void) { return fd; }; /* needed by cPlayback class */
cDemux(int num = 0);
~cDemux();
private:
void removePid(unsigned short Pid); /* needed by cRecord class */
int num;
int fd;
int buffersize;
uint16_t pid;
uint8_t flt;
std::vector<pes_pids> pesfds;
DMX_CHANNEL_TYPE dmx_type;
void *pdata;
};
#endif //__dmx_hal__
#endif // __DMX_HAL_H__

View File

@@ -16,8 +16,9 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __glfb__
#define __glfb__
#ifndef __GLFB_H__
#define __GLFB_H__
#include <OpenThreads/Thread>
#include <vector>
#include <linux/fb.h> /* for screeninfo etc. */
@@ -39,4 +40,5 @@ private:
void blit_osd();
void *pdata; /* not yet used */
};
#endif
#endif // __GLFB_H__

View File

@@ -15,6 +15,7 @@ extern "C" {
typedef enum
{
HW_DISPLAY_NONE,
HW_DISPLAY_LED_ONLY,
HW_DISPLAY_LED_NUM, /* simple 7 segment LED display */
HW_DISPLAY_LINE_TEXT, /* 1 line text display */
HW_DISPLAY_GFX
@@ -36,13 +37,16 @@ typedef struct hw_caps
display_type_t display_type;
int display_xres; /* x resolution or chars per line */
int display_yres;
int display_can_deepstandby;
int display_can_set_brightness;
int display_can_deepstandby;
int display_has_statusline;
int has_button_timer;
int has_button_vformat;
char boxvendor[64];
char boxname[64];
char boxarch[64];
int boxtype;
int has_CI;
} hw_caps_t;
hw_caps_t *get_hwcaps(void);
@@ -50,4 +54,5 @@ hw_caps_t *get_hwcaps(void);
#ifdef __cplusplus
}
#endif
#endif
#endif // __HARDWARE_CAPS_H__

7
include/init.h Normal file
View File

@@ -0,0 +1,7 @@
#ifndef __INIT_H__
#define __INIT_H__
void hal_api_init();
void hal_api_exit();
#endif // __INIT_H__

View File

@@ -1,2 +0,0 @@
#warning using init_cs.h from libstb-hal
#include "init_td.h"

View File

@@ -1,5 +0,0 @@
#ifndef __INIT_TD_H
#define __INIT_TD_H
void init_td_api();
void shutdown_td_api();
#endif

View File

@@ -1,11 +1,34 @@
#ifndef __MMI_H_
#define __MMI_H_
#ifndef __MMI_H__
#define __MMI_H__
#define MAX_MMI_ITEMS 40
#define MAX_MMI_TEXT_LEN 255
#define MAX_MMI_CHOICE_TEXT_LEN 255
typedef enum {
MMI_TOP_MENU_SUBS = 1,
MMI_TOP_MENU_EVENTS,
MMI_TOP_MENU_TOKENS,
MMI_TOP_MENU_PIN,
MMI_TOP_MENU_MATURE,
MMI_TOP_MENU_ABOUT
} MMI_MENU_CURRENT;
typedef enum {
MMI_MENU_LEVEL_MAIN = 0,
MMI_MENU_LEVEL_MATURE,
MMI_MENU_LEVEL_ASK_PIN_MATURE
} MMI_MENU_LEVEL;
typedef enum {
MMI_PIN_LEVEL_ASK_OLD = 0,
MMI_PIN_LEVEL_CHECK_CURRENT,
MMI_PIN_LEVEL_ASK_REPEAT,
MMI_PIN_LEVEL_CHECK_AND_CHANGE
} MMI_PIN_LEVEL;
typedef struct {
int slot;
int choice_nb;
char title[MAX_MMI_TEXT_LEN];
char subtitle[MAX_MMI_TEXT_LEN];
@@ -14,14 +37,15 @@ typedef struct {
} MMI_MENU_LIST_INFO;
typedef struct {
int slot;
int blind;
int answerlen;
char enquiryText[MAX_MMI_TEXT_LEN];
} MMI_ENQUIRY_INFO;
/* compat */
#define enguiryText enquiryText
#define enguiryText enquiryText
#define MMI_ENGUIRY_INFO MMI_ENQUIRY_INFO
#endif // __MMI_H_
#endif // __MMI_H__

View File

@@ -1 +0,0 @@
#include "playback_hal.h"

View File

@@ -1,82 +1,34 @@
/*
* (C) 2010-2013 Stefan Seyfried
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __playback_hal__
#define __playback_hal__
#include <string>
#include <stdint.h>
#include <vector>
extern "C" {
#include <libavformat/avformat.h>
}
/*
* This is actually the max number that could be returned by
* FindAllPids() / FindAllSubs().
* not yet implemented, most archs return max. 10 PIDs.
*/
#define MAX_PLAYBACK_PIDS 40
typedef enum {
PLAYMODE_TS = 0,
PLAYMODE_FILE,
} playmode_t;
class PBPrivate;
class cPlayback
{
public:
bool Open(playmode_t PlayMode);
void Close(void);
bool Start(char *filename, unsigned short vpid, int vtype, unsigned short apid, int ac3, unsigned int duration);
bool Start(std::string filename, std::string headers = "");
bool Stop(void);
bool SetAPid(unsigned short pid, int audio_flag);
bool SetSpeed(int speed);
bool GetSpeed(int &speed) const;
bool GetPosition(int &position, int &duration);
bool SetPosition(int position, bool absolute = false);
void FindAllPids(uint16_t *pids, unsigned short *aud_flags, uint16_t *num, std::string *language);
void FindAllPids(int *apids, unsigned int *ac3flags, uint32_t *numpida, std::string *language){FindAllPids((uint16_t*)apids, (unsigned short*)ac3flags, (uint16_t*) numpida, language);}
void FindAllSubs(uint16_t *pids, unsigned short *supported, uint16_t *num, std::string *language);
bool SelectSubtitles(int pid, std::string charset = "");
void GetChapters(std::vector<int> &positions, std::vector<std::string> &titles);
void RequestAbort();
void GetTitles(std::vector<int> &playlists, std::vector<std::string> &titles, int &current);
void SetTitle(int title);
uint64_t GetReadCount(void);
void FindAllTeletextsubtitlePids(int *, unsigned int *numpids, std::string *, int *, int *){*numpids = 0;}
void FindAllSubtitlePids(int * /*pids*/, unsigned int *numpids, std::string * /*language*/){*numpids = 0;}
int GetSubtitlePid(void){return 0;}
bool SetTeletextPid(int /*pid*/){return true;}
int GetAPid(){return 0;}
void GetMetadata(std::vector<std::string> /*&keys*/, std::vector<std::string> /*&values*/){}
void GetPts(uint64_t &/*pts*/){}
bool SetSubtitlePid(int /*pid*/){return false;}
AVFormatContext *GetAVFormatContext(){return NULL;}
void ReleaseAVFormatContext(){}
//
cPlayback(int num = 0);
~cPlayback();
private:
PBPrivate *pd;
};
#include <config.h>
#if HAVE_TRIPLEDRAGON
#include "../libtriple/playback_td.h"
#elif HAVE_DUCKBOX_HARDWARE
#include "../libduckbox/playback_libeplayer3.h"
#elif HAVE_SPARK_HARDWARE
#include "../libspark/playback_libeplayer3.h"
#elif HAVE_ARM_HARDWARE
#if ENABLE_GSTREAMER_10
#include "../libarmbox/playback_gst.h"
#else
#if BOXMODEL_HD60
#include "../libarmbox/playback_hisilicon.h"
#else
#include "../libarmbox/playback_libeplayer3.h"
#endif
#endif
#elif HAVE_MIPS_HARDWARE
#include "../libmipsbox/playback_libeplayer3.h"
#elif HAVE_AZBOX_HARDWARE
#include "../libazbox/playback_lib.h"
#elif HAVE_GENERIC_HARDWARE
#if BOXMODEL_RASPI
#include "../libraspi/playback_lib.h"
#else
#if ENABLE_GSTREAMER
#include "../libgeneric-pc/playback_gst.h"
#else
#include "../libgeneric-pc/playback_lib.h"
#endif
#endif
#else
#error no valid hardware defined
#endif

View File

@@ -15,8 +15,8 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __pwrmngr_hal__
#define __pwrmngr_hal__
#ifndef __PWRMNGR_H__
#define __PWRMNGR_H__
class cCpuFreqManager
{
@@ -44,4 +44,4 @@ public:
bool SetStandby(bool Active, bool Passive);
};
#endif
#endif // __PWRMNGR_H__

View File

@@ -1,41 +1,22 @@
/*
* (C) 2010-2013 Stefan Seyfried
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __record_hal__
#define __record_hal__
#define REC_STATUS_OK 0
#define REC_STATUS_SLOW 1
#define REC_STATUS_OVERFLOW 2
class RecData;
class cRecord
{
public:
cRecord(int num = 0);
~cRecord();
bool Open();
bool Start(int fd, unsigned short vpid, unsigned short *apids, int numapids, uint64_t ch = 0);
bool Stop(void);
bool AddPid(unsigned short pid);
int GetStatus();
void ResetStatus();
bool ChangePids(unsigned short vpid, unsigned short *apids, int numapids);
private:
RecData *pd;
};
#include <config.h>
#if HAVE_TRIPLEDRAGON
#include "../libtriple/record_td.h"
#elif HAVE_DUCKBOX_HARDWARE
#include "../libduckbox/record_lib.h"
#elif HAVE_SPARK_HARDWARE
#include "../libspark/record_lib.h"
#elif HAVE_ARM_HARDWARE
#include "../libarmbox/record_lib.h"
#elif HAVE_MIPS_HARDWARE
#include "../libmipsbox/record_lib.h"
#elif HAVE_AZBOX_HARDWARE
#include "../libazbox/record_lib.h"
#elif HAVE_GENERIC_HARDWARE
#if BOXMODEL_RASPI
#include "../libraspi/record_lib.h"
#else
#include "../libgeneric-pc/record_lib.h"
#endif
#else
#error no valid hardware defined
#endif

View File

@@ -3,13 +3,19 @@
#include <string>
std::string getPackageVersion();
int getPackageVersionMajor();
int getPackageVersionMinor();
int getPackageVersionMicro();
std::string getPackagenName();
std::string getPackageString();
std::string getPackageVersionGit();
// library version functions
typedef struct hal_libversion_t
{
std::string vVersion;
int vMajor;
int vMinor;
int vPatch;;
std::string vName;
std::string vStr;
std::string vGitDescribe;
} hal_libversion_struct_t;
void hal_get_lib_version(hal_libversion_t *ver);
#endif //__VERSION_HAL_H__

View File

@@ -1 +0,0 @@
#include "video_hal.h"

View File

@@ -1,213 +1,28 @@
/*
Copyright 2010-2013 Stefan Seyfried <seife@tuxboxcvs.slipkontur.de>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
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 General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef _VIDEO_LIB_H
#define _VIDEO_LIB_H
#include <vector>
#include <cs_types.h>
typedef enum {
ANALOG_SD_RGB_CINCH = 0x00,
ANALOG_SD_YPRPB_CINCH,
ANALOG_HD_RGB_CINCH,
ANALOG_HD_YPRPB_CINCH,
ANALOG_SD_RGB_SCART = 0x10,
ANALOG_SD_YPRPB_SCART,
ANALOG_HD_RGB_SCART,
ANALOG_HD_YPRPB_SCART,
ANALOG_SCART_MASK = 0x10
} analog_mode_t;
typedef enum {
VIDEO_FORMAT_MPEG2 = 0,
VIDEO_FORMAT_MPEG4, /* H264 */
VIDEO_FORMAT_VC1,
VIDEO_FORMAT_JPEG,
VIDEO_FORMAT_GIF,
VIDEO_FORMAT_PNG,
VIDEO_FORMAT_DIVX,/* DIVX 3.11 */
VIDEO_FORMAT_MPEG4PART2,/* MPEG4 SVH, MPEG4 SP, MPEG4 ASP, DIVX4,5,6 */
VIDEO_FORMAT_REALVIDEO8,
VIDEO_FORMAT_REALVIDEO9,
VIDEO_FORMAT_ON2_VP6,
VIDEO_FORMAT_ON2_VP8,
VIDEO_FORMAT_SORENSON_SPARK,
VIDEO_FORMAT_H263,
VIDEO_FORMAT_H263_ENCODER,
VIDEO_FORMAT_H264_ENCODER,
VIDEO_FORMAT_MPEG4PART2_ENCODER,
VIDEO_FORMAT_AVS,
VIDEO_FORMAT_VIP656,
VIDEO_FORMAT_UNSUPPORTED
} VIDEO_FORMAT;
typedef enum {
VIDEO_SD = 0,
VIDEO_HD,
VIDEO_120x60i,
VIDEO_320x240i,
VIDEO_1440x800i,
VIDEO_360x288i
} VIDEO_DEFINITION;
typedef enum {
VIDEO_FRAME_RATE_23_976 = 0,
VIDEO_FRAME_RATE_24,
VIDEO_FRAME_RATE_25,
VIDEO_FRAME_RATE_29_97,
VIDEO_FRAME_RATE_30,
VIDEO_FRAME_RATE_50,
VIDEO_FRAME_RATE_59_94,
VIDEO_FRAME_RATE_60
} VIDEO_FRAME_RATE;
typedef enum {
DISPLAY_AR_1_1,
DISPLAY_AR_4_3,
DISPLAY_AR_14_9,
DISPLAY_AR_16_9,
DISPLAY_AR_20_9,
DISPLAY_AR_RAW,
} DISPLAY_AR;
typedef enum {
DISPLAY_AR_MODE_PANSCAN = 0,
DISPLAY_AR_MODE_LETTERBOX,
DISPLAY_AR_MODE_NONE,
DISPLAY_AR_MODE_PANSCAN2
} DISPLAY_AR_MODE;
typedef enum {
VIDEO_DB_DR_NEITHER = 0,
VIDEO_DB_ON,
VIDEO_DB_DR_BOTH
} VIDEO_DB_DR;
typedef enum {
VIDEO_PLAY_STILL = 0,
VIDEO_PLAY_CLIP,
VIDEO_PLAY_TRICK,
VIDEO_PLAY_MOTION,
VIDEO_PLAY_MOTION_NO_SYNC
} VIDEO_PLAY_MODE;
typedef enum {
VIDEO_STD_NTSC,
VIDEO_STD_SECAM,
VIDEO_STD_PAL,
VIDEO_STD_480P,
VIDEO_STD_576P,
VIDEO_STD_720P60,
VIDEO_STD_1080I60,
VIDEO_STD_720P50,
VIDEO_STD_1080I50,
VIDEO_STD_1080P30,
VIDEO_STD_1080P24,
VIDEO_STD_1080P25,
VIDEO_STD_1080P50,
VIDEO_STD_1080P60,
VIDEO_STD_AUTO,
VIDEO_STD_MAX
} VIDEO_STD;
/* not used, for dummy functions */
typedef enum {
VIDEO_HDMI_CEC_MODE_OFF = 0,
VIDEO_HDMI_CEC_MODE_TUNER,
VIDEO_HDMI_CEC_MODE_RECORDER
} VIDEO_HDMI_CEC_MODE;
typedef enum
{
VIDEO_CONTROL_BRIGHTNESS = 0,
VIDEO_CONTROL_CONTRAST,
VIDEO_CONTROL_SATURATION,
VIDEO_CONTROL_HUE,
VIDEO_CONTROL_SHARPNESS,
VIDEO_CONTROL_MAX = VIDEO_CONTROL_SHARPNESS
} VIDEO_CONTROL;
class cDemux;
class cPlayback;
class VDec;
class cVideo
{
friend class cPlayback;
friend class cDemux;
public:
/* constructor & destructor */
cVideo(int mode, void *, void *, unsigned int unit = 0);
~cVideo(void);
void * GetTVEnc() { return NULL; };
void * GetTVEncSD() { return NULL; };
/* aspect ratio */
int getAspectRatio(void);
void getPictureInfo(int &width, int &height, int &rate);
int setAspectRatio(int aspect, int mode);
/* cropping mode */
int setCroppingMode(void);
/* get play state */
int getPlayState(void);
/* blank on freeze */
int getBlank(void);
int setBlank(int enable);
/* change video play state. Parameters are all unused. */
int Start(void *PcrChannel = NULL, unsigned short PcrPid = 0, unsigned short VideoPid = 0, void *x = NULL);
int Stop(bool blank = true);
bool Pause(void);
int GetVideoSystem();
/* set video_system */
int SetVideoSystem(int video_system, bool remember = true);
int SetStreamType(VIDEO_FORMAT type);
void SetSyncMode(AVSYNC_TYPE mode);
bool SetCECMode(VIDEO_HDMI_CEC_MODE) { return true; };
void SetCECAutoView(bool) { return; };
void SetCECAutoStandby(bool) { return; };
void ShowPicture(const char * fname);
void StopPicture();
void Standby(unsigned int bOn);
void Pig(int x, int y, int w, int h, int osd_w = 1064, int osd_h = 600);
void SetControl(int, int) { return; };
void setContrast(int val);
void SetVideoMode(analog_mode_t mode);
void SetDBDR(int) { return; };
void SetAudioHandle(void *) { return; };
void SetAutoModes(int [VIDEO_STD_MAX]) { return; };
int OpenVBI(int) { return 0; };
int CloseVBI(void) { return 0; };
int StartVBI(unsigned short) { return 0; };
int StopVBI(void) { return 0; };
void SetDemux(cDemux *dmx);
bool GetScreenImage(unsigned char * &data, int &xres, int &yres, bool get_video = true, bool get_osd = false, bool scale_to_video = false);
private:
VDec *vdec;
void *pdata;
};
#include <config.h>
#if HAVE_TRIPLEDRAGON
#include "../libtriple/video_td.h"
#elif HAVE_DUCKBOX_HARDWARE
#include "../libduckbox/video_lib.h"
#elif HAVE_SPARK_HARDWARE
#include "../libspark/video_lib.h"
#elif HAVE_ARM_HARDWARE
#include "../libarmbox/video_lib.h"
#include "../libarmbox/hdmi_cec.h"
#elif HAVE_MIPS_HARDWARE
#include "../libmipsbox/video_lib.h"
#include "../libmipsbox/hdmi_cec.h"
#elif HAVE_AZBOX_HARDWARE
#include "../libazbox/video_lib.h"
#elif HAVE_GENERIC_HARDWARE
#if BOXMODEL_RASPI
#include "../libraspi/video_lib.h"
#else
#include "../libgeneric-pc/video_lib.h"
#endif
#else
#error no valid hardware defined
#endif
#if STB_HAL_VIDEO_HAS_GETSCREENIMAGE
#define SCREENSHOT 1
#endif

50
libarmbox/Makefile.am Normal file
View File

@@ -0,0 +1,50 @@
noinst_LTLIBRARIES = libarmbox.la
AM_CPPFLAGS = \
-I$(top_srcdir)/common \
-I$(top_srcdir)/include
AM_CXXFLAGS = -fno-rtti -fno-exceptions -fno-strict-aliasing
AM_LDFLAGS = \
-lOpenThreads \
@AVFORMAT_LIBS@ \
@AVUTIL_LIBS@ \
@AVCODEC_LIBS@ \
@SWRESAMPLE_LIBS@ \
-lpthread -lass -lrt
libarmbox_la_SOURCES = \
hardware_caps.c \
dmx.cpp \
video.cpp \
audio.cpp \
init.cpp \
record.cpp \
hdmi_cec.cpp
if ENABLE_GSTREAMER_10
libarmbox_la_SOURCES += \
playback_gst.cpp
AM_LDFLAGS += \
-lgstreamer-1.0 \
-lgsttag-1.0 \
-lgstmpegts-1.0
else
if BOXMODEL_HD60
libarmbox_la_SOURCES += \
playback_hisilicon.cpp
else
libarmbox_la_SOURCES += \
playback_libeplayer3.cpp
AM_CPPFLAGS += \
-I$(top_srcdir)/libeplayer3/include
endif
AM_LDFLAGS += \
-lass
endif
AM_CPPFLAGS += -D__STDC_FORMAT_MACROS -D__STDC_CONSTANT_MACROS

445
libarmbox/audio.cpp Normal file
View File

@@ -0,0 +1,445 @@
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <sys/fcntl.h>
#include <sys/ioctl.h>
#include <unistd.h>
#include <linux/dvb/audio.h>
#include <proc_tools.h>
#include "audio_lib.h"
#include "hal_debug.h"
#include <config.h>
#define AUDIO_DEVICE "/dev/dvb/adapter0/audio0"
#define hal_debug(args...) _hal_debug(HAL_DEBUG_AUDIO, this, args)
#define hal_info(args...) _hal_info(HAL_DEBUG_AUDIO, this, args)
#include <linux/soundcard.h>
cAudio * audioDecoder = NULL;
cAudio::cAudio(void *, void *, void *)
{
fd = -1;
clipfd = -1;
mixer_fd = -1;
openDevice();
Muted = false;
}
cAudio::~cAudio(void)
{
closeDevice();
}
void cAudio::openDevice(void)
{
if (fd < 0)
{
if ((fd = open(AUDIO_DEVICE, O_RDWR)) < 0)
hal_info("openDevice: open failed (%m)\n");
fcntl(fd, F_SETFD, FD_CLOEXEC);
//do_mute(true, false);
}
else
hal_info("openDevice: already open (fd = %d)\n", fd);
}
void cAudio::closeDevice(void)
{
if (fd > -1) {
close(fd);
fd = -1;
}
if (clipfd > -1) {
close(clipfd);
clipfd = -1;
}
if (mixer_fd > -1) {
close(mixer_fd);
mixer_fd = -1;
}
}
int cAudio::do_mute(bool enable, bool remember)
{
hal_debug("%s(%d, %d)\n", __FUNCTION__, enable, remember);
char str[4];
if (remember)
Muted = enable;
sprintf(str, "%d", Muted);
proc_put("/proc/stb/audio/j1_mute", str, strlen(str));
if (fd > 0)
{
if (ioctl(fd, AUDIO_SET_MUTE, enable) < 0)
perror("AUDIO_SET_MUTE");
}
return 0;
}
int map_volume(const int volume)
{
unsigned char vol = volume;
if (vol > 100)
vol = 100;
// convert to -1dB steps
vol = 63 - vol * 63 / 100;
// now range is 63..0, where 0 is loudest
#if BOXMODEL_VUPLUS4K
if (vol == 63)
vol = 255;
#endif
return vol;
}
int cAudio::setVolume(unsigned int left, unsigned int right)
{
hal_info("cAudio::%s(%d, %d)\n", __func__, left, right);
volume = (left + right) / 2;
int v = map_volume(volume);
left = map_volume(volume);
right = map_volume(volume);
audio_mixer_t mixer;
mixer.volume_left = left;
mixer.volume_right = right;
if (fd > 0)
{
if (ioctl(fd, AUDIO_SET_MIXER, &mixer) < 0)
perror("AUDIO_SET_MIXER");
}
char str[4];
sprintf(str, "%d", v);
proc_put("/proc/stb/avs/0/volume", str, strlen(str));
return 0;
}
int cAudio::Start(void)
{
int ret;
ret = ioctl(fd, AUDIO_PLAY);
return ret;
}
int cAudio::Stop(void)
{
return ioctl(fd, AUDIO_STOP);
}
bool cAudio::Pause(bool Pcm)
{
ioctl(fd, Pcm ? AUDIO_PAUSE : AUDIO_CONTINUE, 1);
return true;
}
void cAudio::SetSyncMode(AVSYNC_TYPE Mode)
{
hal_debug("%s %d\n", __func__, Mode);
ioctl(fd, AUDIO_SET_AV_SYNC, Mode);
}
#define AUDIO_STREAMTYPE_AC3 0
#define AUDIO_STREAMTYPE_MPEG 1
#define AUDIO_STREAMTYPE_DTS 2
#define AUDIO_STREAMTYPE_AAC 8
#define AUDIO_STREAMTYPE_AACHE 9
void cAudio::SetStreamType(AUDIO_FORMAT type)
{
int bypass = AUDIO_STREAMTYPE_MPEG;
hal_debug("%s %d\n", __FUNCTION__, type);
StreamType = type;
switch (type)
{
case AUDIO_FMT_DD_PLUS:
case AUDIO_FMT_DOLBY_DIGITAL:
bypass = AUDIO_STREAMTYPE_AC3;
break;
case AUDIO_FMT_AAC:
bypass = AUDIO_STREAMTYPE_AAC;
break;
case AUDIO_FMT_AAC_PLUS:
bypass = AUDIO_STREAMTYPE_AACHE;
break;
case AUDIO_FMT_DTS:
bypass = AUDIO_STREAMTYPE_DTS;
break;
default:
break;
}
// Normaly the encoding should be set using AUDIO_SET_ENCODING
// But as we implemented the behavior to bypass (cause of e2) this is correct here
if (ioctl(fd, AUDIO_SET_BYPASS_MODE, bypass) < 0)
hal_info("%s: AUDIO_SET_BYPASS_MODE failed (%m)\n", __func__);
}
int cAudio::setChannel(int channel)
{
hal_debug("%s %d\n", __FUNCTION__, channel);
return 0;
}
int cAudio::PrepareClipPlay(int ch, int srate, int bits, int little_endian)
{
int fmt;
unsigned int devmask, stereo, usable;
const char *dsp_dev = getenv("DSP_DEVICE");
const char *mix_dev = getenv("MIX_DEVICE");
hal_info("cAudio::%s ch %d srate %d bits %d le %d\n", __FUNCTION__, ch, srate, bits, little_endian);
if (clipfd > -1) {
hal_info("%s: clipfd already opened (%d)\n", __func__, clipfd);
return -1;
}
mixer_num = -1;
mixer_fd = -1;
/* a different DSP device can be given with DSP_DEVICE and MIX_DEVICE
* if this device cannot be opened, we fall back to the internal OSS device
* Example:
* modprobe snd-usb-audio
* export DSP_DEVICE=/dev/sound/dsp2
* export MIX_DEVICE=/dev/sound/mixer2
* neutrino
*/
if ((!dsp_dev) || (access(dsp_dev, W_OK))) {
if (dsp_dev)
hal_info("%s: DSP_DEVICE is set (%s) but cannot be opened,"
" fall back to /dev/dsp\n", __func__, dsp_dev);
dsp_dev = "/dev/dsp";
}
if ((!mix_dev) || (access(mix_dev, W_OK))) {
if (mix_dev)
hal_info("%s: MIX_DEVICE is set (%s) but cannot be opened,"
" fall back to /dev/mixer\n", __func__, dsp_dev);
mix_dev = "/dev/mixer";
}
hal_info("cAudio::%s: dsp_dev %s mix_dev %s\n", __func__, dsp_dev, mix_dev); /* NULL mix_dev is ok */
/* the tdoss dsp driver seems to work only on the second open(). really. */
clipfd = open(dsp_dev, O_WRONLY);
if (clipfd < 0) {
hal_info("%s open %s: %m\n", dsp_dev, __FUNCTION__);
return -1;
}
fcntl(clipfd, F_SETFD, FD_CLOEXEC);
/* no idea if we ever get little_endian == 0 */
if (little_endian)
fmt = AFMT_S16_BE;
else
fmt = AFMT_S16_LE;
if (ioctl(clipfd, SNDCTL_DSP_SETFMT, &fmt))
perror("SNDCTL_DSP_SETFMT");
if (ioctl(clipfd, SNDCTL_DSP_CHANNELS, &ch))
perror("SNDCTL_DSP_CHANNELS");
if (ioctl(clipfd, SNDCTL_DSP_SPEED, &srate))
perror("SNDCTL_DSP_SPEED");
#if !BOXMODEL_HD51 && !BOXMODEL_BRE2ZE4K && !BOXMODEL_H7
if (ioctl(clipfd, SNDCTL_DSP_RESET))
perror("SNDCTL_DSP_RESET");
#endif
if (!mix_dev)
return 0;
mixer_fd = open(mix_dev, O_RDWR);
if (mixer_fd < 0) {
hal_info("%s: open mixer %s failed (%m)\n", __func__, mix_dev);
/* not a real error */
return 0;
}
if (ioctl(mixer_fd, SOUND_MIXER_READ_DEVMASK, &devmask) == -1) {
hal_info("%s: SOUND_MIXER_READ_DEVMASK %m\n", __func__);
devmask = 0;
}
if (ioctl(mixer_fd, SOUND_MIXER_READ_STEREODEVS, &stereo) == -1) {
hal_info("%s: SOUND_MIXER_READ_STEREODEVS %m\n", __func__);
stereo = 0;
}
usable = devmask & stereo;
if (usable == 0) {
hal_info("%s: devmask: %08x stereo: %08x, no usable dev :-(\n",
__func__, devmask, stereo);
close(mixer_fd);
mixer_fd = -1;
return 0; /* TODO: should we treat this as error? */
}
/* __builtin_popcount needs GCC, it counts the set bits... */
if (__builtin_popcount (usable) != 1) {
/* TODO: this code is not yet tested as I have only single-mixer devices... */
hal_info("%s: more than one mixer control: devmask %08x stereo %08x\n"
"%s: querying MIX_NUMBER environment variable...\n",
__func__, devmask, stereo, __func__);
const char *tmp = getenv("MIX_NUMBER");
if (tmp)
mixer_num = atoi(tmp);
hal_info("%s: mixer_num is %d -> device %08x\n",
__func__, mixer_num, (mixer_num >= 0) ? (1 << mixer_num) : 0);
/* no error checking, you'd better know what you are doing... */
} else {
mixer_num = 0;
while (!(usable & 0x01)) {
mixer_num++;
usable >>= 1;
}
}
setVolume(volume, volume);
return 0;
}
int cAudio::WriteClip(unsigned char *buffer, int size)
{
int ret, __attribute__ ((unused)) count = 1;
// hal_debug("cAudio::%s\n", __FUNCTION__);
if (clipfd < 0) {
hal_info("%s: clipfd not yet opened\n", __FUNCTION__);
return -1;
}
#if BOXMODEL_HD51 || BOXMODEL_BRE2ZE4K || BOXMODEL_H7
again:
#endif
ret = write(clipfd, buffer, size);
if (ret < 0) {
hal_info("%s: write error (%m)\n", __FUNCTION__);
return ret;
}
#if BOXMODEL_HD51 || BOXMODEL_BRE2ZE4K || BOXMODEL_H7
if (ret != size) {
hal_info("cAudio::%s: difference > to write (%d) != written (%d) try (%d) > reset dsp and restart write\n", __FUNCTION__, size, ret, count);
if (ioctl(clipfd, SNDCTL_DSP_RESET))
perror("SNDCTL_DSP_RESET");
count++;
if (count < 3)
goto again;
}
#endif
return ret;
};
int cAudio::StopClip()
{
hal_info("cAudio::%s\n", __FUNCTION__);
if (clipfd < 0) {
hal_info("%s: clipfd not yet opened\n", __FUNCTION__);
return -1;
}
#if BOXMODEL_VUPLUS4K
ioctl(clipfd, SNDCTL_DSP_RESET);
#endif
close(clipfd);
clipfd = -1;
if (mixer_fd > -1) {
close(mixer_fd);
mixer_fd = -1;
}
setVolume(volume, volume);
return 0;
};
void cAudio::getAudioInfo(int &type, int &layer, int &freq, int &bitrate, int &mode)
{
hal_debug("%s\n", __FUNCTION__);
type = 0;
layer = 0;
freq = 0;
bitrate = 0;
mode = 0;
#if 0
unsigned int atype;
static const int freq_mpg[] = {44100, 48000, 32000, 0};
static const int freq_ac3[] = {48000, 44100, 32000, 0};
scratchl2 i;
if (ioctl(fd, MPEG_AUD_GET_DECTYP, &atype) < 0)
perror("cAudio::getAudioInfo MPEG_AUD_GET_DECTYP");
if (ioctl(fd, MPEG_AUD_GET_STATUS, &i) < 0)
perror("cAudio::getAudioInfo MPEG_AUD_GET_STATUS");
type = atype;
#if 0
/* this does not work, some of the values are negative?? */
AMPEGStatus A;
memcpy(&A, &i.word00, sizeof(i.word00));
layer = A.audio_mpeg_layer;
mode = A.audio_mpeg_mode;
bitrate = A.audio_mpeg_bitrate;
switch(A.audio_mpeg_frequency)
#endif
/* layer and bitrate are not used anyway... */
layer = 0; //(i.word00 >> 17) & 3;
bitrate = 0; //(i.word00 >> 12) & 3;
switch (type)
{
case 0: /* MPEG */
mode = (i.word00 >> 6) & 3;
freq = freq_mpg[(i.word00 >> 10) & 3];
break;
case 1: /* AC3 */
mode = (i.word00 >> 28) & 7;
freq = freq_ac3[(i.word00 >> 16) & 3];
break;
default:
mode = 0;
freq = 0;
}
//fprintf(stderr, "type: %d layer: %d freq: %d bitrate: %d mode: %d\n", type, layer, freq, bitrate, mode);
#endif
};
void cAudio::SetSRS(int /*iq_enable*/, int /*nmgr_enable*/, int /*iq_mode*/, int /*iq_level*/)
{
hal_debug("%s\n", __FUNCTION__);
};
void cAudio::SetHdmiDD(bool enable)
{
const char *opt[] = { "downmix", "passthrough" };
hal_debug("%s %d\n", __func__, enable);
proc_put("/proc/stb/audio/ac3", opt[enable], strlen(opt[enable]));
}
void cAudio::SetSpdifDD(bool enable)
{
//using this function for dts passthrough
const char *opt[] = { "downmix", "passthrough" };
hal_debug("%s %d\n", __func__, enable);
proc_put("/proc/stb/audio/dts", opt[enable], strlen(opt[enable]));
}
void cAudio::ScheduleMute(bool On)
{
hal_debug("%s %d\n", __FUNCTION__, On);
}
void cAudio::EnableAnalogOut(bool enable)
{
hal_debug("%s %d\n", __FUNCTION__, enable);
}
#define AUDIO_BYPASS_ON 0
#define AUDIO_BYPASS_OFF 1
void cAudio::setBypassMode(bool disable)
{
int mode = disable ? AUDIO_BYPASS_OFF : AUDIO_BYPASS_ON;
if (ioctl(fd, AUDIO_SET_BYPASS_MODE, mode) < 0)
hal_info("%s AUDIO_SET_BYPASS_MODE %d: %m\n", __func__, mode);
}

101
libarmbox/audio_lib.h Normal file
View File

@@ -0,0 +1,101 @@
/* public header file */
#ifndef __AUDIO_LIB_H__
#define __AUDIO_LIB_H__
#include "cs_types.h"
typedef enum
{
AUDIO_SYNC_WITH_PTS,
AUDIO_NO_SYNC,
AUDIO_SYNC_AUDIO_MASTER
} AUDIO_SYNC_MODE;
typedef enum {
HDMI_ENCODED_OFF,
HDMI_ENCODED_AUTO,
HDMI_ENCODED_FORCED
} HDMI_ENCODED_MODE;
typedef enum
{
AUDIO_FMT_AUTO = 0,
AUDIO_FMT_MPEG,
AUDIO_FMT_MP3,
AUDIO_FMT_DOLBY_DIGITAL,
AUDIO_FMT_BASIC = AUDIO_FMT_DOLBY_DIGITAL,
AUDIO_FMT_AAC,
AUDIO_FMT_AAC_PLUS,
AUDIO_FMT_DD_PLUS,
AUDIO_FMT_DTS,
AUDIO_FMT_AVS,
AUDIO_FMT_MLP,
AUDIO_FMT_WMA,
AUDIO_FMT_MPG1, // TD only. For Movieplayer / cPlayback
AUDIO_FMT_ADVANCED = AUDIO_FMT_MLP
} AUDIO_FORMAT;
class mixerVolume;
class cAudio
{
friend class cPlayback;
private:
int fd;
bool Muted;
int clipfd; /* for pcm playback */
int mixer_fd; /* if we are using the OSS mixer */
int mixer_num; /* oss mixer to use, if any */
AUDIO_FORMAT StreamType;
AUDIO_SYNC_MODE SyncMode;
bool started;
int volume;
int do_mute(bool enable, bool remember);
void setBypassMode(bool disable);
public:
/* construct & destruct */
cAudio(void *, void *, void *);
~cAudio(void);
void openDevice(void);
void closeDevice(void);
void *GetHandle() { return NULL; };
/* shut up */
int mute(bool remember = true) { return do_mute(true, remember); };
int unmute(bool remember = true) { return do_mute(false, remember); };
/* volume, min = 0, max = 255 */
int setVolume(unsigned int left, unsigned int right);
int getVolume(void) { return volume;}
bool getMuteStatus(void) { return Muted; };
/* start and stop audio */
int Start(void);
int Stop(void);
bool Pause(bool Pcm = true);
void SetStreamType(AUDIO_FORMAT type);
AUDIO_FORMAT GetStreamType(void) { return StreamType; }
void SetSyncMode(AVSYNC_TYPE Mode);
/* select channels */
int setChannel(int channel);
int PrepareClipPlay(int uNoOfChannels, int uSampleRate, int uBitsPerSample, int bLittleEndian);
int WriteClip(unsigned char * buffer, int size);
int StopClip();
void getAudioInfo(int &type, int &layer, int& freq, int &bitrate, int &mode);
void SetSRS(int iq_enable, int nmgr_enable, int iq_mode, int iq_level);
bool IsHdmiDDSupported() { return true; };
void SetHdmiDD(bool enable);
void SetSpdifDD(bool enable);
void ScheduleMute(bool On);
void EnableAnalogOut(bool enable);
};
#endif // __AUDIO_LIB_H__

646
libarmbox/dmx.cpp Normal file
View File

@@ -0,0 +1,646 @@
/*
* cDemux implementation for arm receivers (tested on mutant hd51
* hardware)
*
* derived from libtriple/dmx_td.cpp
*
* (C) 2010-2013 Stefan Seyfried
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <config.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <poll.h>
#include <errno.h>
#include <inttypes.h>
#include <unistd.h>
#include <cstring>
#include <cstdio>
#include <string>
#include <sys/ioctl.h>
#include <OpenThreads/Mutex>
#include <OpenThreads/ScopedLock>
#include "dmx_hal.h"
#include "hal_debug.h"
#include "video_lib.h"
/* needed for getSTC... */
extern cVideo *videoDecoder;
#define hal_debug(args...) _hal_debug(HAL_DEBUG_DEMUX, this, args)
#define hal_info(args...) _hal_info(HAL_DEBUG_DEMUX, this, args)
#define hal_debug_c(args...) _hal_debug(HAL_DEBUG_DEMUX, NULL, args)
#define hal_info_c(args...) _hal_info(HAL_DEBUG_DEMUX, NULL, args)
#define hal_info_z(args...) _hal_info(HAL_DEBUG_DEMUX, thiz, args)
#define hal_debug_z(args...) _hal_debug(HAL_DEBUG_DEMUX, thiz, args)
#define dmx_err(_errfmt, _errstr, _revents) do { \
hal_info("%s " _errfmt " fd:%d, ev:0x%x %s pid:0x%04hx flt:0x%02hx\n", \
__func__, _errstr, fd, _revents, DMX_T[dmx_type], pid, flt); \
} while(0);
cDemux *videoDemux = NULL;
cDemux *audioDemux = NULL;
//cDemux *pcrDemux = NULL;
static const char *DMX_T[] = {
"DMX_INVALID",
"DMX_VIDEO",
"DMX_AUDIO",
"DMX_PES",
"DMX_PSI",
"DMX_PIP",
"DMX_TP",
"DMX_PCR"
};
/* this is the number of different cDemux() units, not the number of
* /dev/dvb/.../demuxX devices! */
#if BOXMODEL_VUULTIMO4K
#define NUM_DEMUX 24
#else
#if BOXMODEL_VUSOLO4K || BOXMODEL_VUDUO4K || BOXMODEL_VUUNO4KSE || BOXMODEL_VUUNO4K
#define NUM_DEMUX 16
#else
#define NUM_DEMUX 4
#endif
#endif
/* the current source of each cDemux unit */
#if BOXMODEL_VUULTIMO4K
static int dmx_source[NUM_DEMUX] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
#else
#if BOXMODEL_VUSOLO4K || BOXMODEL_VUDUO4K || BOXMODEL_VUUNO4KSE || BOXMODEL_VUUNO4K
static int dmx_source[NUM_DEMUX] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
#else
static int dmx_source[NUM_DEMUX] = { 0, 0, 0, 0 };
#endif
#endif
/* map the device numbers. */
#if BOXMODEL_VUULTIMO4K
#define NUM_DEMUXDEV 24
#else
#if BOXMODEL_VUSOLO4K || BOXMODEL_VUDUO4K || BOXMODEL_VUUNO4KSE || BOXMODEL_VUUNO4K
#define NUM_DEMUXDEV 16
#else
#define NUM_DEMUXDEV 8
#endif
#endif
static const char *devname[NUM_DEMUXDEV] = {
"/dev/dvb/adapter0/demux0",
"/dev/dvb/adapter0/demux1",
"/dev/dvb/adapter0/demux2",
"/dev/dvb/adapter0/demux3",
"/dev/dvb/adapter0/demux4",
"/dev/dvb/adapter0/demux5",
"/dev/dvb/adapter0/demux6",
"/dev/dvb/adapter0/demux7"
#if BOXMODEL_VUSOLO4K || BOXMODEL_VUDUO4K || BOXMODEL_VUULTIMO4K || BOXMODEL_VUUNO4KSE || BOXMODEL_VUUNO4K
, "/dev/dvb/adapter0/demux8"
, "/dev/dvb/adapter0/demux9"
, "/dev/dvb/adapter0/demux10"
, "/dev/dvb/adapter0/demux11"
, "/dev/dvb/adapter0/demux12"
, "/dev/dvb/adapter0/demux13"
, "/dev/dvb/adapter0/demux14"
, "/dev/dvb/adapter0/demux15"
#if BOXMODEL_VUULTIMO4K
, "/dev/dvb/adapter0/demux16"
, "/dev/dvb/adapter0/demux17"
, "/dev/dvb/adapter0/demux18"
, "/dev/dvb/adapter0/demux19"
, "/dev/dvb/adapter0/demux20"
, "/dev/dvb/adapter0/demux21"
, "/dev/dvb/adapter0/demux22"
, "/dev/dvb/adapter0/demux23"
#endif
#endif
};
/* did we already DMX_SET_SOURCE on that demux device? */
#if BOXMODEL_VUULTIMO4K
static bool init[NUM_DEMUXDEV] = { false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false };
#else
#if BOXMODEL_VUSOLO4K || BOXMODEL_VUDUO4K || BOXMODEL_VUUNO4KSE || BOXMODEL_VUUNO4K
static bool init[NUM_DEMUXDEV] = { false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false };
#else
static bool init[NUM_DEMUXDEV] = { false, false, false, false, false, false, false, false };
#endif
#endif
typedef struct dmx_pdata {
int last_source;
OpenThreads::Mutex *mutex;
} dmx_pdata;
#define P ((dmx_pdata *)pdata)
cDemux::cDemux(int n)
{
if (n < 0 || n >= NUM_DEMUX)
{
hal_info("%s ERROR: n invalid (%d)\n", __FUNCTION__, n);
num = 0;
}
else
num = n;
fd = -1;
pdata = (void *)calloc(1, sizeof(dmx_pdata));
P->last_source = -1;
P->mutex = new OpenThreads::Mutex;
dmx_type = DMX_INVALID;
}
cDemux::~cDemux()
{
hal_debug("%s #%d fd: %d\n", __FUNCTION__, num, fd);
Close();
/* wait until Read() has released the mutex */
(*P->mutex).lock();
(*P->mutex).unlock();
free(P->mutex);
free(pdata);
pdata = NULL;
}
bool cDemux::Open(DMX_CHANNEL_TYPE pes_type, void * /*hVideoBuffer*/, int uBufferSize)
{
if (fd > -1)
hal_info("%s FD ALREADY OPENED? fd = %d\n", __FUNCTION__, fd);
dmx_type = pes_type;
buffersize = uBufferSize;
/* return code is unchecked anyway... */
return true;
}
static bool _open(cDemux *thiz, int num, int &fd, int &last_source, DMX_CHANNEL_TYPE dmx_type, int buffersize)
{
int flags = O_RDWR|O_CLOEXEC;
int devnum = dmx_source[num];
if (last_source == devnum) {
hal_debug_z("%s #%d: source (%d) did not change\n", __func__, num, last_source);
if (fd > -1)
return true;
}
if (fd > -1) {
/* we changed source -> close and reopen the fd */
hal_debug_z("%s #%d: FD ALREADY OPENED fd = %d lastsource %d devnum %d\n",
__func__, num, fd, last_source, devnum);
close(fd);
}
if (dmx_type != DMX_PSI_CHANNEL)
flags |= O_NONBLOCK;
fd = open(devname[devnum], flags);
if (fd < 0)
{
hal_info_z("%s %s: %m\n", __FUNCTION__, devname[devnum]);
return false;
}
hal_debug_z("%s #%d pes_type: %s(%d), uBufferSize: %d fd: %d\n", __func__,
num, DMX_T[dmx_type], dmx_type, buffersize, fd);
/* this would actually need locking, but the worst that weill happen is, that
* we'll DMX_SET_SOURCE twice per device, so don't bother... */
if (!init[devnum])
{
/* this should not change anything... */
int n = DMX_SOURCE_FRONT0 + devnum;
hal_info_z("%s: setting %s to source %d\n", __func__, devname[devnum], n);
if (ioctl(fd, DMX_SET_SOURCE, &n) < 0)
hal_info_z("%s DMX_SET_SOURCE failed!\n", __func__);
else
init[devnum] = true;
}
if (buffersize == 0)
buffersize = 0xffff; // may or may not be reasonable --martii
if (buffersize > 0)
{
/* probably uBufferSize == 0 means "use default size". TODO: find a reasonable default */
if (ioctl(fd, DMX_SET_BUFFER_SIZE, buffersize) < 0)
hal_info_z("%s DMX_SET_BUFFER_SIZE failed (%m)\n", __func__);
}
last_source = devnum;
return true;
}
void cDemux::Close(void)
{
hal_debug("%s #%d, fd = %d\n", __FUNCTION__, num, fd);
if (fd < 0)
{
hal_info("%s #%d: not open!\n", __FUNCTION__, num);
return;
}
pesfds.clear();
ioctl(fd, DMX_STOP);
close(fd);
fd = -1;
}
bool cDemux::Start(bool)
{
hal_debug("%s #%d fd: %d type: %s\n", __func__, num, fd, DMX_T[dmx_type]);
if (fd < 0)
{
hal_info("%s #%d: not open!\n", __FUNCTION__, num);
return false;
}
ioctl(fd, DMX_START);
return true;
}
bool cDemux::Stop(void)
{
hal_debug("%s #%d fd: %d type: %s\n", __func__, num, fd, DMX_T[dmx_type]);
if (fd < 0)
{
hal_info("%s #%d: not open!\n", __FUNCTION__, num);
return false;
}
ioctl(fd, DMX_STOP);
return true;
}
int cDemux::Read(unsigned char *buff, int len, int timeout)
{
#if 0
if (len != 4095 && timeout != 10)
fprintf(stderr, "cDemux::%s #%d fd: %d type: %s len: %d timeout: %d\n",
__FUNCTION__, num, fd, DMX_T[dmx_type], len, timeout);
#endif
if (fd < 0)
{
hal_info("%s #%d: not open!\n", __func__, num);
return -1;
}
/* avoid race in destructor: ~cDemux needs to wait until Read() returns */
OpenThreads::ScopedLock<OpenThreads::Mutex> m_lock(*P->mutex);
int rc;
int to = timeout;
struct pollfd ufds;
ufds.fd = fd;
ufds.events = POLLIN|POLLPRI|POLLERR;
ufds.revents = 0;
/* hack: if the frontend loses and regains lock, the demuxer often will not
* return from read(), so as a "emergency exit" for e.g. NIT scan, set a (long)
* timeout here */
if (dmx_type == DMX_PSI_CHANNEL && timeout <= 0)
to = 60 * 1000;
if (to > 0)
{
retry:
rc = ::poll(&ufds, 1, to);
if (ufds.fd != fd)
{
/* Close() will set fd to -1, this is normal. Everything else is not. */
hal_info("%s:1 ========== fd has changed, %d->%d ==========\n", __func__, ufds.fd, fd);
return -1;
}
if (!rc)
{
if (timeout == 0) /* we took the emergency exit */
{
dmx_err("timed out for timeout=0!, %s", "", 0);
return -1; /* this timeout is an error */
}
return 0; // timeout
}
else if (rc < 0)
{
dmx_err("poll: %s,", strerror(errno), 0)
//hal_info("%s poll: %m\n", __FUNCTION__);
/* happens, when running under gdb... */
if (errno == EINTR)
goto retry;
return -1;
}
#if 0
if (ufds.revents & POLLERR) /* POLLERR means buffer error, i.e. buffer overflow */
{
dmx_err("received %s,", "POLLERR", ufds.revents);
/* this seems to happen sometimes at recording start, without bad effects */
return 0;
}
#endif
if (ufds.revents & POLLHUP) /* we get POLLHUP if e.g. a too big DMX_BUFFER_SIZE was set */
{
dmx_err("received %s,", "POLLHUP", ufds.revents);
return -1;
}
if (!(ufds.revents & POLLIN)) /* we requested POLLIN but did not get it? */
{
dmx_err("received %s, please report!", "POLLIN", ufds.revents);
return 0;
}
}
if (ufds.fd != fd) /* does this ever happen? and if, is it harmful? */
{ /* read(-1,...) will just return EBADF anyway... */
hal_info("%s:2 ========== fd has changed, %d->%d ==========\n", __func__, ufds.fd, fd);
return -1;
}
rc = ::read(fd, buff, len);
//fprintf(stderr, "fd %d ret: %d\n", fd, rc);
if (rc < 0)
dmx_err("read: %s", strerror(errno), 0);
return rc;
}
bool cDemux::sectionFilter(unsigned short _pid, const unsigned char * const filter,
const unsigned char * const mask, int len, int timeout,
const unsigned char * const negmask)
{
struct dmx_sct_filter_params s_flt;
memset(&s_flt, 0, sizeof(s_flt));
pid = _pid;
_open(this, num, fd, P->last_source, dmx_type, buffersize);
if (len > DMX_FILTER_SIZE)
{
hal_info("%s #%d: len too long: %d, DMX_FILTER_SIZE %d\n", __func__, num, len, DMX_FILTER_SIZE);
len = DMX_FILTER_SIZE;
}
flt = filter[0];
s_flt.pid = pid;
s_flt.timeout = timeout;
memcpy(s_flt.filter.filter, filter, len);
memcpy(s_flt.filter.mask, mask, len);
if (negmask != NULL)
memcpy(s_flt.filter.mode, negmask, len);
s_flt.flags = DMX_IMMEDIATE_START|DMX_CHECK_CRC;
int to = 0;
switch (filter[0])
{
case 0x00: /* program_association_section */
to = 2000;
break;
case 0x01: /* conditional_access_section */
to = 6000;
break;
case 0x02: /* program_map_section */
to = 1500;
break;
case 0x03: /* transport_stream_description_section */
to = 10000;
break;
/* 0x04 - 0x3F: reserved */
case 0x40: /* network_information_section - actual_network */
to = 10000;
break;
case 0x41: /* network_information_section - other_network */
to = 15000;
break;
case 0x42: /* service_description_section - actual_transport_stream */
to = 10000;
break;
/* 0x43 - 0x45: reserved for future use */
case 0x46: /* service_description_section - other_transport_stream */
to = 10000;
break;
/* 0x47 - 0x49: reserved for future use */
case 0x4A: /* bouquet_association_section */
to = 11000;
break;
/* 0x4B - 0x4D: reserved for future use */
case 0x4E: /* event_information_section - actual_transport_stream, present/following */
to = 2000;
break;
case 0x4F: /* event_information_section - other_transport_stream, present/following */
to = 10000;
break;
/* 0x50 - 0x5F: event_information_section - actual_transport_stream, schedule */
/* 0x60 - 0x6F: event_information_section - other_transport_stream, schedule */
case 0x70: /* time_date_section */
s_flt.flags &= ~DMX_CHECK_CRC; /* section has no CRC */
s_flt.flags |= DMX_ONESHOT;
//s_flt.pid = 0x0014;
to = 30000;
break;
case 0x71: /* running_status_section */
s_flt.flags &= ~DMX_CHECK_CRC; /* section has no CRC */
to = 0;
break;
case 0x72: /* stuffing_section */
s_flt.flags &= ~DMX_CHECK_CRC; /* section has no CRC */
to = 0;
break;
case 0x73: /* time_offset_section */
s_flt.flags |= DMX_ONESHOT;
//s_flt.pid = 0x0014;
to = 30000;
break;
/* 0x74 - 0x7D: reserved for future use */
case 0x7E: /* discontinuity_information_section */
s_flt.flags &= ~DMX_CHECK_CRC; /* section has no CRC */
to = 0;
break;
case 0x7F: /* selection_information_section */
to = 0;
break;
/* 0x80 - 0x8F: ca_message_section */
/* 0x90 - 0xFE: user defined */
/* 0xFF: reserved */
default:
//return -1;
break;
}
/* the negmask == NULL is a hack: the users of negmask are PMT-update
* and sectionsd EIT-Version change. And they really want no timeout
* if timeout == 0 instead of "default timeout" */
if (timeout == 0 && negmask == NULL)
s_flt.timeout = to;
hal_debug("%s #%d pid:0x%04hx fd:%d type:%s len:%d to:%d flags:%x flt[0]:%02x\n", __func__, num,
pid, fd, DMX_T[dmx_type], len, s_flt.timeout, s_flt.flags, s_flt.filter.filter[0]);
#if 0
fprintf(stderr,"filt: "); for (int i = 0; i < len; i++) fprintf(stderr, "%02hhx ", s_flt.filter.filter[i]); fprintf(stderr, "\n");
fprintf(stderr,"mask: "); for (int i = 0; i < len; i++) fprintf(stderr, "%02hhx ", s_flt.filter.mask [i]); fprintf(stderr, "\n");
fprintf(stderr,"mode: "); for (int i = 0; i < len; i++) fprintf(stderr, "%02hhx ", s_flt.filter.mode [i]); fprintf(stderr, "\n");
#endif
ioctl (fd, DMX_STOP);
if (ioctl(fd, DMX_SET_FILTER, &s_flt) < 0)
return false;
return true;
}
bool cDemux::pesFilter(const unsigned short _pid)
{
struct dmx_pes_filter_params p_flt;
pid = _pid;
flt = 0;
/* allow PID 0 for web streaming e.g.
* this check originally is from tuxbox cvs but I'm not sure
* what it is good for...
if (pid <= 0x0001 && dmx_type != DMX_PCR_ONLY_CHANNEL)
return false;
*/
if ((pid >= 0x0002 && pid <= 0x000f) || pid >= 0x1fff)
return false;
hal_debug("%s #%d pid: 0x%04hx fd: %d type: %s\n", __FUNCTION__, num, pid, fd, DMX_T[dmx_type]);
_open(this, num, fd, P->last_source, dmx_type, buffersize);
memset(&p_flt, 0, sizeof(p_flt));
p_flt.pid = pid;
p_flt.output = DMX_OUT_DECODER;
p_flt.input = DMX_IN_FRONTEND;
p_flt.flags = 0;
switch (dmx_type)
{
case DMX_PCR_ONLY_CHANNEL:
p_flt.pes_type = DMX_PES_PCR;
break;
case DMX_AUDIO_CHANNEL:
p_flt.pes_type = DMX_PES_AUDIO;
break;
case DMX_VIDEO_CHANNEL:
p_flt.pes_type = DMX_PES_VIDEO;
break;
case DMX_PIP_CHANNEL: /* PIP is a special version of DMX_VIDEO_CHANNEL */
p_flt.pes_type = DMX_PES_VIDEO1;
break;
case DMX_PES_CHANNEL:
p_flt.pes_type = DMX_PES_OTHER;
p_flt.output = DMX_OUT_TAP;
break;
case DMX_TP_CHANNEL:
p_flt.pes_type = DMX_PES_OTHER;
p_flt.output = DMX_OUT_TSDEMUX_TAP;
break;
default:
hal_info("%s #%d invalid dmx_type %d!\n", __func__, num, dmx_type);
return false;
}
return (ioctl(fd, DMX_SET_PES_FILTER, &p_flt) >= 0);
}
void cDemux::SetSyncMode(AVSYNC_TYPE /*mode*/)
{
hal_debug("%s #%d\n", __FUNCTION__, num);
}
void *cDemux::getBuffer()
{
hal_debug("%s #%d\n", __FUNCTION__, num);
return NULL;
}
void *cDemux::getChannel()
{
hal_debug("%s #%d\n", __FUNCTION__, num);
return NULL;
}
bool cDemux::addPid(unsigned short Pid)
{
hal_debug("%s: pid 0x%04hx\n", __func__, Pid);
pes_pids pfd;
int ret;
if (dmx_type != DMX_TP_CHANNEL)
{
hal_info("%s pes_type %s not implemented yet! pid=%hx\n", __FUNCTION__, DMX_T[dmx_type], Pid);
return false;
}
_open(this, num, fd, P->last_source, dmx_type, buffersize);
if (fd == -1)
hal_info("%s bucketfd not yet opened? pid=%hx\n", __FUNCTION__, Pid);
pfd.fd = fd; /* dummy */
pfd.pid = Pid;
pesfds.push_back(pfd);
ret = (ioctl(fd, DMX_ADD_PID, &Pid));
if (ret < 0)
hal_info("%s: DMX_ADD_PID (%m) pid=%hx\n", __func__, Pid);
return (ret != -1);
}
void cDemux::removePid(unsigned short Pid)
{
if (dmx_type != DMX_TP_CHANNEL)
{
hal_info("%s pes_type %s not implemented yet! pid=%hx\n", __FUNCTION__, DMX_T[dmx_type], Pid);
return;
}
for (std::vector<pes_pids>::iterator i = pesfds.begin(); i != pesfds.end(); ++i)
{
if ((*i).pid == Pid) {
hal_debug("removePid: removing demux fd %d pid 0x%04x\n", fd, Pid);
if (ioctl(fd, DMX_REMOVE_PID, Pid) < 0)
hal_info("%s: (DMX_REMOVE_PID, 0x%04hx): %m\n", __func__, Pid);
pesfds.erase(i);
return; /* TODO: what if the same PID is there multiple times */
}
}
hal_info("%s pid 0x%04x not found\n", __FUNCTION__, Pid);
}
void cDemux::getSTC(int64_t * STC)
{
/* apparently I can only get the PTS of the video decoder,
* but that's good enough for dvbsub */
hal_debug("%s #%d\n", __func__, num);
int64_t pts = 0;
if (videoDecoder)
pts = videoDecoder->GetPTS();
*STC = pts;
}
int cDemux::getUnit(void)
{
hal_debug("%s #%d\n", __FUNCTION__, num);
/* just guessed that this is the right thing to do.
right now this is only used by the CA code which is stubbed out
anyway */
return num;
}
bool cDemux::SetSource(int unit, int source)
{
if (unit >= NUM_DEMUX || unit < 0) {
hal_info_c("%s: unit (%d) out of range, NUM_DEMUX %d\n", __func__, unit, NUM_DEMUX);
return false;
}
hal_debug_c("%s(%d, %d) => %d to %d\n", __func__, unit, source, dmx_source[unit], source);
if (source < 0 || source >= NUM_DEMUXDEV)
hal_info_c("%s(%d, %d) ERROR: source %d out of range!\n", __func__, unit, source, source);
else
dmx_source[unit] = source;
return true;
}
int cDemux::GetSource(int unit)
{
if (unit >= NUM_DEMUX || unit < 0) {
hal_info_c("%s: unit (%d) out of range, NUM_DEMUX %d\n", __func__, unit, NUM_DEMUX);
return -1;
}
hal_debug_c("%s(%d) => %d\n", __func__, unit, dmx_source[unit]);
return dmx_source[unit];
}

223
libarmbox/hardware_caps.c Normal file
View File

@@ -0,0 +1,223 @@
/*
* determine the capabilities of the hardware.
* part of libstb-hal
*
* (C) 2010-2012 Stefan Seyfried
*
* License: GPL v2 or later
*/
#include <config.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <stdio.h>
#include <string.h>
#include <unistd.h>
#include <sys/ioctl.h>
#include <hardware_caps.h>
#define FP_DEV "/dev/dbox/oled0"
static int initialized = 0;
static hw_caps_t caps;
hw_caps_t *get_hwcaps(void)
{
if (initialized)
return &caps;
memset(&caps, 0, sizeof(hw_caps_t));
#if BOXMODEL_VUSOLO4K
initialized = 1;
caps.has_CI = 1;
caps.can_cec = 1;
caps.can_shutdown = 1;
caps.display_xres = 480;
caps.display_yres = 320;
caps.display_type = HW_DISPLAY_GFX;
caps.display_can_deepstandby = 0; // 0 because we use graphlcd/lcd4linux
caps.display_can_set_brightness = 0; // 0 because we use graphlcd/lcd4linux
caps.display_has_statusline = 0; // 0 because we use graphlcd/lcd4linux
caps.has_button_timer = 1;
caps.has_button_vformat = 0;
caps.has_HDMI = 1;
strcpy(caps.boxvendor, "VU+");
strcpy(caps.boxname, "SOLO4K");
strcpy(caps.boxarch, "BCM7376");
#endif
#if BOXMODEL_VUDUO4K
initialized = 1;
caps.has_CI = 2;
caps.can_cec = 1;
caps.can_shutdown = 1;
caps.display_xres = 480;
caps.display_yres = 320;
caps.display_type = HW_DISPLAY_GFX;
caps.display_can_deepstandby = 0; // 0 because we use graphlcd/lcd4linux
caps.display_can_set_brightness = 0; // 0 because we use graphlcd/lcd4linux
caps.display_has_statusline = 0; // 0 because we use graphlcd/lcd4linux
caps.has_button_timer = 1;
caps.has_button_vformat = 0;
caps.has_HDMI = 2;
strcpy(caps.boxvendor, "VU+");
strcpy(caps.boxname, "DUO4K");
strcpy(caps.boxarch, "BCM7278");
#endif
#if BOXMODEL_VUULTIMO4K
initialized = 1;
caps.has_CI = 2;
caps.can_cec = 1;
caps.can_shutdown = 1;
caps.display_xres = 800;
caps.display_yres = 480;
caps.display_type = HW_DISPLAY_GFX;
caps.display_can_deepstandby = 0; // 0 because we use graphlcd/lcd4linux
caps.display_can_set_brightness = 0; // 0 because we use graphlcd/lcd4linux
caps.display_has_statusline = 0; // 0 because we use graphlcd/lcd4linux
caps.has_button_timer = 1;
caps.has_button_vformat = 0;
caps.has_HDMI = 2;
strcpy(caps.boxvendor, "VU+");
strcpy(caps.boxname, "ULTIMO4K");
strcpy(caps.boxarch, "BCM7444S");
#endif
#if BOXMODEL_VUZERO4K
initialized = 1;
caps.has_CI = 1;
caps.can_cec = 1;
caps.can_shutdown = 1;
caps.display_type = HW_DISPLAY_LED_ONLY;
caps.display_can_deepstandby = 0;
caps.display_can_set_brightness = 1;
caps.display_has_statusline = 0;
caps.has_button_timer = 1;
caps.has_button_vformat = 0;
caps.has_HDMI = 1;
strcpy(caps.boxvendor, "VU+");
strcpy(caps.boxname, "ZERO4K");
strcpy(caps.boxarch, "BCM72604");
#endif
#if BOXMODEL_VUUNO4KSE
initialized = 1;
caps.has_CI = 1;
caps.can_cec = 1;
caps.can_shutdown = 1;
caps.display_xres = 400;
caps.display_yres = 240;
caps.display_type = HW_DISPLAY_GFX;
caps.display_can_deepstandby = 0; // 0 because we use graphlcd/lcd4linux
caps.display_can_set_brightness = 0; // 0 because we use graphlcd/lcd4linux
caps.display_has_statusline = 0; // 0 because we use graphlcd/lcd4linux
caps.has_button_timer = 1;
caps.has_button_vformat = 0;
caps.has_HDMI = 2;
strcpy(caps.boxvendor, "VU+");
strcpy(caps.boxname, "UNO4KSE");
strcpy(caps.boxarch, "BCM7252S");
#endif
#if BOXMODEL_VUUNO4K
initialized = 1;
caps.has_CI = 1;
caps.can_cec = 1;
caps.can_shutdown = 1;
caps.display_type = HW_DISPLAY_LED_ONLY;
caps.display_can_deepstandby = 0;
caps.display_can_set_brightness = 1;
caps.display_has_statusline = 0;
caps.has_button_timer = 1;
caps.has_button_vformat = 0;
caps.has_HDMI = 1;
strcpy(caps.boxvendor, "VU+");
strcpy(caps.boxname, "UNO4K");
strcpy(caps.boxarch, "BCM7252S");
#endif
#if BOXMODEL_HD51
initialized = 1;
caps.has_CI = 1;
caps.can_cec = 1;
caps.can_shutdown = 1;
caps.display_xres = 16;
caps.display_type = HW_DISPLAY_LINE_TEXT;
caps.display_can_deepstandby = 0;
caps.display_can_set_brightness = 1;
caps.display_has_statusline = 0;
caps.has_button_timer = 1;
caps.has_button_vformat = 0;
caps.has_HDMI = 1;
strcpy(caps.boxvendor, "AX-Technologies");
strcpy(caps.boxname, "HD51");
strcpy(caps.boxarch, "BCM7251S");
#endif
#if BOXMODEL_HD60
initialized = 1;
caps.has_CI = 0;
caps.can_cec = 1;
caps.can_shutdown = 1;
caps.display_xres = 4;
caps.display_type = HW_DISPLAY_LED_NUM;
caps.display_can_deepstandby = 0;
caps.display_can_set_brightness = 1;
caps.display_has_statusline = 0;
caps.has_button_timer = 1;
caps.has_button_vformat = 0;
caps.has_HDMI = 1;
strcpy(caps.boxvendor, "AX-Technologies");
strcpy(caps.boxname, "HD60");
strcpy(caps.boxarch, "HI3798M");
#endif
#if BOXMODEL_BRE2ZE4K
initialized = 1;
caps.has_CI = 1;
caps.can_cec = 1;
caps.can_shutdown = 1;
caps.display_xres = 5;
caps.display_type = HW_DISPLAY_LINE_TEXT;
caps.display_can_deepstandby = 0;
caps.display_can_set_brightness = 1;
caps.display_has_statusline = 0;
caps.has_button_timer = 1;
caps.has_button_vformat = 1;
caps.has_HDMI = 1;
strcpy(caps.boxvendor, "WWIO");
strcpy(caps.boxname, "BRE2ZE4K");
strcpy(caps.boxarch, "BCM7251S");
#endif
#if BOXMODEL_H7
initialized = 1;
caps.has_CI = 1;
caps.can_cec = 1;
caps.can_shutdown = 1;
caps.display_xres = 5;
caps.display_type = HW_DISPLAY_LINE_TEXT;
caps.display_can_deepstandby = 0;
caps.display_can_set_brightness = 1;
caps.display_has_statusline = 0;
caps.has_button_timer = 1;
caps.has_button_vformat = 0;
caps.has_HDMI = 1;
strcpy(caps.boxvendor, "AirDigital");
strcpy(caps.boxname, "Zgemma H7C/S");
strcpy(caps.boxarch, "BCM7251S");
#endif
#if BOXMODEL_OSMIOPLUS4K
initialized = 1;
caps.has_CI = 0;
caps.can_cec = 1;
caps.can_shutdown = 1;
caps.display_xres = 5;
caps.display_type = HW_DISPLAY_LINE_TEXT;
caps.display_can_deepstandby = 1;
caps.display_can_set_brightness = 1;
caps.display_has_statusline = 1;
caps.has_button_timer = 1;
caps.has_button_vformat = 0;
caps.has_HDMI = 1;
strcpy(caps.boxvendor, "Edision");
strcpy(caps.boxname, "OS Mio+ 4K");
strcpy(caps.boxarch, "BCM72604");
#endif
return &caps;
}

733
libarmbox/hdmi_cec.cpp Normal file
View File

@@ -0,0 +1,733 @@
/*
Copyright (C) 2018 TangoCash
License: GPLv2
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation;
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 General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include <fcntl.h>
#include <sys/ioctl.h>
#include <sys/mman.h>
#include <sys/poll.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include <utime.h>
#include <errno.h>
#include <ctype.h>
#include <cstring>
#include <cstdio>
#include <cstdlib>
#include <linux/input.h>
#include "linux-uapi-cec.h"
#include "hdmi_cec.h"
#include "hdmi_cec_types.h"
#include "hal_debug.h"
#define RED "\x1B[31m"
#define NORMAL "\x1B[0m"
#define hal_debug(args...) _hal_debug(HAL_DEBUG_INIT, this, args)
#define hal_info(args...) _hal_info(HAL_DEBUG_INIT, this, args)
#define hal_debug_c(args...) _hal_debug(HAL_DEBUG_INIT, NULL, args)
#define hal_info_c(args...) _hal_info(HAL_DEBUG_INIT, NULL, args)
#define fop(cmd, args...) ({ \
int _r; \
if (fd >= 0) { \
if ((_r = ::cmd(fd, args)) < 0) \
hal_info(#cmd"(fd, "#args")\n"); \
else \
hal_debug(#cmd"(fd, "#args")\n");\
} \
else { _r = fd; } \
_r; \
})
#define CEC_DEVICE "/dev/cec0"
#define CEC_HDMIDEV "/dev/hdmi_cec"
#define RC_DEVICE "/dev/input/event1"
hdmi_cec * hdmi_cec::hdmi_cec_instance = NULL;
//hack to get an instance before first call
hdmi_cec * CEC = hdmi_cec::getInstance();
hdmi_cec::hdmi_cec()
{
standby_cec_activ = autoview_cec_activ = standby = muted = false;
hdmiFd = -1;
volume = 0;
fallback = false;
}
hdmi_cec::~hdmi_cec()
{
if (hdmiFd >= 0)
{
close(hdmiFd);
hdmiFd = -1;
}
}
hdmi_cec* hdmi_cec::getInstance()
{
if (hdmi_cec_instance == NULL)
{
hdmi_cec_instance = new hdmi_cec();
hal_debug_c("[CEC] new instance created \n");
}
return hdmi_cec_instance;
}
bool hdmi_cec::SetCECMode(VIDEO_HDMI_CEC_MODE _deviceType)
{
physicalAddress[0] = 0x10;
physicalAddress[1] = 0x00;
logicalAddress = 1;
if (_deviceType == VIDEO_HDMI_CEC_MODE_OFF)
{
Stop();
hal_debug("[CEC] switch off %s\n", __func__);
return false;
}
else
deviceType = _deviceType;
hal_debug("[CEC] switch on %s\n", __func__);
if (hdmiFd == -1)
{
hdmiFd = open(CEC_DEVICE, O_RDWR | O_CLOEXEC);
if (hdmiFd >= 0)
{
__u32 monitor = CEC_MODE_INITIATOR | CEC_MODE_FOLLOWER;
struct cec_caps caps = {};
if (ioctl(hdmiFd, CEC_ADAP_G_CAPS, &caps) < 0)
hal_debug("[CEC] %s: get caps failed (%m)\n", __func__);
if (caps.capabilities & CEC_CAP_LOG_ADDRS)
{
struct cec_log_addrs laddrs = {};
if (ioctl(hdmiFd, CEC_ADAP_S_LOG_ADDRS, &laddrs) < 0)
hal_debug("[CEC] %s: reset log addr failed (%m)\n", __func__);
memset(&laddrs, 0, sizeof(laddrs));
/*
* NOTE: cec_version, osd_name and deviceType should be made configurable,
* CEC_ADAP_S_LOG_ADDRS delayed till the desired values are available
* (saves us some startup speed as well, polling for a free logical address
* takes some time)
*/
laddrs.cec_version = CEC_OP_CEC_VERSION_2_0;
strcpy(laddrs.osd_name, "neutrino");
laddrs.vendor_id = CEC_VENDOR_ID_NONE;
switch (deviceType)
{
case CEC_LOG_ADDR_TV:
laddrs.log_addr_type[laddrs.num_log_addrs] = CEC_LOG_ADDR_TYPE_TV;
laddrs.all_device_types[laddrs.num_log_addrs] = CEC_OP_ALL_DEVTYPE_TV;
laddrs.primary_device_type[laddrs.num_log_addrs] = CEC_OP_PRIM_DEVTYPE_TV;
break;
case CEC_LOG_ADDR_RECORD_1:
laddrs.log_addr_type[laddrs.num_log_addrs] = CEC_LOG_ADDR_TYPE_RECORD;
laddrs.all_device_types[laddrs.num_log_addrs] = CEC_OP_ALL_DEVTYPE_RECORD;
laddrs.primary_device_type[laddrs.num_log_addrs] = CEC_OP_PRIM_DEVTYPE_RECORD;
break;
case CEC_LOG_ADDR_TUNER_1:
laddrs.log_addr_type[laddrs.num_log_addrs] = CEC_LOG_ADDR_TYPE_TUNER;
laddrs.all_device_types[laddrs.num_log_addrs] = CEC_OP_ALL_DEVTYPE_TUNER;
laddrs.primary_device_type[laddrs.num_log_addrs] = CEC_OP_PRIM_DEVTYPE_TUNER;
break;
case CEC_LOG_ADDR_PLAYBACK_1:
laddrs.log_addr_type[laddrs.num_log_addrs] = CEC_LOG_ADDR_TYPE_PLAYBACK;
laddrs.all_device_types[laddrs.num_log_addrs] = CEC_OP_ALL_DEVTYPE_PLAYBACK;
laddrs.primary_device_type[laddrs.num_log_addrs] = CEC_OP_PRIM_DEVTYPE_PLAYBACK;
break;
case CEC_LOG_ADDR_AUDIOSYSTEM:
laddrs.log_addr_type[laddrs.num_log_addrs] = CEC_LOG_ADDR_TYPE_AUDIOSYSTEM;
laddrs.all_device_types[laddrs.num_log_addrs] = CEC_OP_ALL_DEVTYPE_AUDIOSYSTEM;
laddrs.primary_device_type[laddrs.num_log_addrs] = CEC_OP_PRIM_DEVTYPE_AUDIOSYSTEM;
break;
default:
laddrs.log_addr_type[laddrs.num_log_addrs] = CEC_LOG_ADDR_TYPE_UNREGISTERED;
laddrs.all_device_types[laddrs.num_log_addrs] = CEC_OP_ALL_DEVTYPE_SWITCH;
laddrs.primary_device_type[laddrs.num_log_addrs] = CEC_OP_PRIM_DEVTYPE_SWITCH;
break;
}
laddrs.num_log_addrs++;
if (ioctl(hdmiFd, CEC_ADAP_S_LOG_ADDRS, &laddrs) < 0)
hal_debug("[CEC] %s: et log addr failed (%m)\n", __func__);
}
if (ioctl(hdmiFd, CEC_S_MODE, &monitor) < 0)
hal_debug("[CEC] %s: monitor failed (%m)\n", __func__);
}
}
if (hdmiFd == -1)
{
hdmiFd = ::open(CEC_HDMIDEV, O_RDWR | O_NONBLOCK | O_CLOEXEC);
if (hdmiFd >= 0)
{
::ioctl(hdmiFd, 0); /* flush old messages */
fallback = true;
}
}
if (hdmiFd >= 0)
{
GetCECAddressInfo();
if(autoview_cec_activ)
SetCECState(false);
Start();
return true;
}
return false;
}
void hdmi_cec::GetCECAddressInfo()
{
if (hdmiFd >= 0)
{
bool hasdata = false;
struct addressinfo addressinfo;
if (fallback)
{
if (::ioctl(hdmiFd, 1, &addressinfo) >= 0)
{
hasdata = true;
}
}
else
{
__u16 phys_addr;
struct cec_log_addrs laddrs = {};
::ioctl(hdmiFd, CEC_ADAP_G_PHYS_ADDR, &phys_addr);
addressinfo.physical[0] = (phys_addr >> 8) & 0xff;
addressinfo.physical[1] = phys_addr & 0xff;
::ioctl(hdmiFd, CEC_ADAP_G_LOG_ADDRS, &laddrs);
addressinfo.logical = laddrs.log_addr[0];
switch (laddrs.log_addr_type[0])
{
case CEC_LOG_ADDR_TYPE_TV:
addressinfo.type = CEC_LOG_ADDR_TV;
break;
case CEC_LOG_ADDR_TYPE_RECORD:
addressinfo.type = CEC_LOG_ADDR_RECORD_1;
break;
case CEC_LOG_ADDR_TYPE_TUNER:
addressinfo.type = CEC_LOG_ADDR_TUNER_1;
break;
case CEC_LOG_ADDR_TYPE_PLAYBACK:
addressinfo.type = CEC_LOG_ADDR_PLAYBACK_1;
break;
case CEC_LOG_ADDR_TYPE_AUDIOSYSTEM:
addressinfo.type = CEC_LOG_ADDR_AUDIOSYSTEM;
break;
case CEC_LOG_ADDR_TYPE_UNREGISTERED:
default:
addressinfo.type = CEC_LOG_ADDR_UNREGISTERED;
break;
}
hasdata = true;
}
if (hasdata)
{
deviceType = addressinfo.type;
logicalAddress = addressinfo.logical;
if (memcmp(physicalAddress, addressinfo.physical, sizeof(physicalAddress)))
{
hal_info("[CEC] %s: detected physical address change: %02X%02X --> %02X%02X\n", __func__, physicalAddress[0], physicalAddress[1], addressinfo.physical[0], addressinfo.physical[1]);
memcpy(physicalAddress, addressinfo.physical, sizeof(physicalAddress));
ReportPhysicalAddress();
}
}
}
}
void hdmi_cec::ReportPhysicalAddress()
{
struct cec_message txmessage;
txmessage.initiator = logicalAddress;
txmessage.destination = CEC_LOG_ADDR_BROADCAST;
txmessage.data[0] = CEC_MSG_REPORT_PHYSICAL_ADDR;
txmessage.data[1] = physicalAddress[0];
txmessage.data[2] = physicalAddress[1];
txmessage.data[3] = deviceType;
txmessage.length = 4;
SendCECMessage(txmessage);
}
void hdmi_cec::SendCECMessage(struct cec_message &txmessage)
{
if (hdmiFd >= 0)
{
char str[txmessage.length*6];
for (int i = 0; i < txmessage.length; i++)
{
sprintf(str+(i*6),"[0x%02X]", txmessage.data[i]);
}
hal_info("[CEC] send message %s to %s (0x%02X>>0x%02X) '%s' (%s)\n",ToString((cec_logical_address)txmessage.initiator), txmessage.destination == 0xf ? "all" : ToString((cec_logical_address)txmessage.destination), txmessage.initiator, txmessage.destination, ToString((cec_opcode)txmessage.data[0]), str);
if (fallback)
{
struct cec_message_fb message;
message.address = txmessage.destination;
message.length = txmessage.length;
memcpy(&message.data, txmessage.data, txmessage.length);
::write(hdmiFd, &message, 2 + message.length);
}
else
{
struct cec_msg msg;
cec_msg_init(&msg, txmessage.initiator, txmessage.destination);
memcpy(&msg.msg[1], txmessage.data, txmessage.length);
msg.len = txmessage.length + 1;
ioctl(hdmiFd, CEC_TRANSMIT, &msg);
}
}
}
void hdmi_cec::SetCECAutoStandby(bool state)
{
standby_cec_activ = state;
}
void hdmi_cec::SetCECAutoView(bool state)
{
autoview_cec_activ = state;
}
void hdmi_cec::SetCECState(bool state)
{
struct cec_message message;
standby = state;
if ((standby_cec_activ) && state)
{
message.initiator = logicalAddress;
message.destination = CEC_OP_PRIM_DEVTYPE_TV;
message.data[0] = CEC_MSG_STANDBY;
message.length = 1;
SendCECMessage(message);
}
if ((autoview_cec_activ) && !state)
{
message.initiator = logicalAddress;
message.destination = CEC_OP_PRIM_DEVTYPE_AUDIOSYSTEM;
message.data[0] = CEC_MSG_GIVE_SYSTEM_AUDIO_MODE_STATUS;
message.length = 1;
SendCECMessage(message);
usleep(10000);
message.initiator = logicalAddress;
message.destination = CEC_OP_PRIM_DEVTYPE_TV;
message.data[0] = CEC_MSG_IMAGE_VIEW_ON;
message.length = 1;
SendCECMessage(message);
usleep(10000);
message.initiator = logicalAddress;
message.destination = CEC_LOG_ADDR_BROADCAST;
message.data[0] = CEC_MSG_ACTIVE_SOURCE;
message.data[1] = physicalAddress[0];
message.data[2] = physicalAddress[1];
message.length = 3;
SendCECMessage(message);
usleep(10000);
request_audio_status();
}
}
long hdmi_cec::translateKey(unsigned char code)
{
long key = 0;
switch (code)
{
case CEC_USER_CONTROL_CODE_PREVIOUS_CHANNEL:
key = KEY_MENU;
break;
case CEC_USER_CONTROL_CODE_NUMBER0:
key = KEY_0;
break;
case CEC_USER_CONTROL_CODE_NUMBER1:
key = KEY_1;
break;
case CEC_USER_CONTROL_CODE_NUMBER2:
key = KEY_2;
break;
case CEC_USER_CONTROL_CODE_NUMBER3:
key = KEY_3;
break;
case CEC_USER_CONTROL_CODE_NUMBER4:
key = KEY_4;
break;
case CEC_USER_CONTROL_CODE_NUMBER5:
key = KEY_5;
break;
case CEC_USER_CONTROL_CODE_NUMBER6:
key = KEY_6;
break;
case CEC_USER_CONTROL_CODE_NUMBER7:
key = KEY_7;
break;
case CEC_USER_CONTROL_CODE_NUMBER8:
key = KEY_8;
break;
case CEC_USER_CONTROL_CODE_NUMBER9:
key = KEY_9;
break;
case CEC_USER_CONTROL_CODE_CHANNEL_UP:
key = KEY_CHANNELUP;
break;
case CEC_USER_CONTROL_CODE_CHANNEL_DOWN:
key = KEY_CHANNELDOWN;
break;
case CEC_USER_CONTROL_CODE_PLAY:
key = KEY_PLAY;
break;
case CEC_USER_CONTROL_CODE_STOP:
key = KEY_STOP;
break;
case CEC_USER_CONTROL_CODE_PAUSE:
key = KEY_PAUSE;
break;
case CEC_USER_CONTROL_CODE_RECORD:
key = KEY_RECORD;
break;
case CEC_USER_CONTROL_CODE_REWIND:
key = KEY_REWIND;
break;
case CEC_USER_CONTROL_CODE_FAST_FORWARD:
key = KEY_FASTFORWARD;
break;
case CEC_USER_CONTROL_CODE_ELECTRONIC_PROGRAM_GUIDE:
key = KEY_INFO;
break;
case CEC_USER_CONTROL_CODE_TIMER_PROGRAMMING:
key = KEY_PROGRAM;
break;
case CEC_USER_CONTROL_CODE_PLAY_FUNCTION:
key = KEY_PLAY;
break;
case CEC_USER_CONTROL_CODE_PAUSE_PLAY_FUNCTION:
key = KEY_PLAYPAUSE;
break;
case CEC_USER_CONTROL_CODE_RECORD_FUNCTION:
key = KEY_RECORD;
break;
case CEC_USER_CONTROL_CODE_STOP_FUNCTION:
key = KEY_STOP;
break;
case CEC_USER_CONTROL_CODE_SELECT:
key = KEY_OK;
break;
case CEC_USER_CONTROL_CODE_LEFT:
key = KEY_LEFT;
break;
case CEC_USER_CONTROL_CODE_RIGHT:
key = KEY_RIGHT;
break;
case CEC_USER_CONTROL_CODE_UP:
key = KEY_UP;
break;
case CEC_USER_CONTROL_CODE_DOWN:
key = KEY_DOWN;
break;
case CEC_USER_CONTROL_CODE_EXIT:
key = KEY_EXIT;
break;
case CEC_USER_CONTROL_CODE_F2_RED:
key = KEY_RED;
break;
case CEC_USER_CONTROL_CODE_F3_GREEN:
key = KEY_GREEN;
break;
case CEC_USER_CONTROL_CODE_F4_YELLOW:
key = KEY_YELLOW;
break;
case CEC_USER_CONTROL_CODE_F1_BLUE:
key = KEY_BLUE;
break;
default:
key = KEY_MENU;
break;
}
return key;
}
bool hdmi_cec::Start()
{
if (running)
return false;
if (hdmiFd == -1)
return false;
running = true;
return (OpenThreads::Thread::start() == 0);
}
bool hdmi_cec::Stop()
{
if (!running)
return false;
running = false;
OpenThreads::Thread::cancel();
if (hdmiFd >= 0)
{
close(hdmiFd);
hdmiFd = -1;
}
return (OpenThreads::Thread::join() == 0);
}
void hdmi_cec::run()
{
OpenThreads::Thread::setCancelModeAsynchronous();
struct pollfd pfd;
pfd.fd = hdmiFd;
pfd.events = (POLLIN | POLLPRI);
while (running)
{
if (poll(&pfd, 1, 0) > 0)
Receive();
}
}
void hdmi_cec::Receive()
{
bool hasdata = false;
struct cec_message rxmessage;
struct cec_message txmessage;
if (fallback)
{
struct cec_message_fb rx_message;
if (::read(hdmiFd, &rx_message, 2) == 2)
{
if (::read(hdmiFd, &rx_message.data, rx_message.length) == rx_message.length)
{
rxmessage.length = rx_message.length;
rxmessage.initiator = rx_message.address;
rxmessage.destination = logicalAddress;
rxmessage.opcode = rx_message.data[0];
memcpy(&rxmessage.data, rx_message.data, rx_message.length);
hasdata = true;
}
}
}
else
{
struct cec_msg msg;
if (::ioctl(hdmiFd, CEC_RECEIVE, &msg) >= 0)
{
rxmessage.length = msg.len - 1;
rxmessage.initiator = cec_msg_initiator(&msg);
rxmessage.destination = cec_msg_destination(&msg);
rxmessage.opcode = cec_msg_opcode(&msg);
memcpy(&rxmessage.data, &msg.msg[1], rxmessage.length);
hasdata = true;
}
}
if (hasdata)
{
bool keypressed = false;
static unsigned char pressedkey = 0;
char str[rxmessage.length*6];
for (int i = 0; i < rxmessage.length; i++)
{
sprintf(str+(i*6),"[0x%02X]", rxmessage.data[i]);
}
hal_info("[CEC] received message %s to %s (0x%02X>>0x%02X) '%s' (%s)\n",ToString((cec_logical_address)rxmessage.initiator), rxmessage.destination == 0xf ? "all" : ToString((cec_logical_address)rxmessage.destination), rxmessage.initiator, rxmessage.destination, ToString((cec_opcode)rxmessage.opcode), str);
switch (rxmessage.opcode)
{
case CEC_OPCODE_REPORT_AUDIO_STATUS:
{
muted = ((rxmessage.data[1] & 0x80) == 0x80);
volume = ((rxmessage.data[1] & 0x7F) / 127.0) * 100.0;
if (muted)
hal_debug("[CEC] %s volume muted\n", ToString((cec_logical_address)rxmessage.initiator));
else
hal_debug("[CEC] %s volume %d \n", ToString((cec_logical_address)rxmessage.initiator), volume);
break;
}
case CEC_OPCODE_DEVICE_VENDOR_ID:
case CEC_OPCODE_VENDOR_COMMAND_WITH_ID:
{
uint64_t iVendorId = ((uint64_t)rxmessage.data[1] << 16) +
((uint64_t)rxmessage.data[2] << 8) +
(uint64_t)rxmessage.data[3];
hal_debug("[CEC] decoded message '%s' (%s)\n", ToString((cec_opcode)rxmessage.opcode), ToString((cec_vendor_id)iVendorId));
break;
}
case CEC_OPCODE_GIVE_DEVICE_POWER_STATUS:
{
txmessage.destination = rxmessage.initiator;
txmessage.initiator = rxmessage.destination;
txmessage.data[0] = GetResponseOpcode((cec_opcode)rxmessage.opcode);
txmessage.data[1] = standby ? CEC_POWER_STATUS_STANDBY : CEC_POWER_STATUS_ON;
txmessage.length = 2;
SendCECMessage(txmessage);
break;
}
case CEC_OPCODE_USER_CONTROL_PRESSED: /* key pressed */
{
keypressed = true;
pressedkey = rxmessage.data[1];
} // fall through
case CEC_OPCODE_USER_CONTROL_RELEASE: /* key released */
{
long code = translateKey(pressedkey);
hal_debug("[CEC] decoded key %s (%ld)\n",ToString((cec_user_control_code)pressedkey), code);
handleCode(code,keypressed);
break;
}
}
}
}
void hdmi_cec::handleCode(long code, bool keypressed)
{
int evd = open(RC_DEVICE, O_RDWR);
if (evd < 0)
{
hal_debug("[CEC] opening " RC_DEVICE " failed");
return;
}
if (keypressed)
{
if (rc_send(evd, code, CEC_KEY_PRESSED) < 0)
{
hal_debug("[CEC] writing 'KEY_PRESSED' event failed");
close(evd);
return;
}
rc_sync(evd);
}
else
{
if (rc_send(evd, code, CEC_KEY_RELEASED) < 0)
{
hal_debug("[CEC] writing 'KEY_RELEASED' event failed");
close(evd);
return;
}
rc_sync(evd);
}
close(evd);
}
int hdmi_cec::rc_send(int fd, unsigned int code, unsigned int value)
{
struct input_event ev;
ev.type = EV_KEY;
ev.code = code;
ev.value = value;
return write(fd, &ev, sizeof(ev));
}
void hdmi_cec::rc_sync(int fd)
{
struct input_event ev;
gettimeofday(&ev.time, NULL);
ev.type = EV_SYN;
ev.code = SYN_REPORT;
ev.value = 0;
write(fd, &ev, sizeof(ev));
}
void hdmi_cec::send_key(unsigned char key, unsigned char destination)
{
struct cec_message txmessage;
txmessage.destination = destination;
txmessage.initiator = logicalAddress;
txmessage.data[0] = CEC_OPCODE_USER_CONTROL_PRESSED;
txmessage.data[1] = key;
txmessage.length = 2;
SendCECMessage(txmessage);
usleep(10000);
txmessage.destination = destination;
txmessage.initiator = logicalAddress;
txmessage.data[0] = CEC_OPCODE_USER_CONTROL_RELEASE;
txmessage.length = 1;
SendCECMessage(txmessage);
}
void hdmi_cec::request_audio_status()
{
struct cec_message txmessage;
txmessage.destination = CEC_OP_PRIM_DEVTYPE_AUDIOSYSTEM;
txmessage.initiator = logicalAddress;
txmessage.data[0] = CEC_OPCODE_GIVE_AUDIO_STATUS;
txmessage.length = 1;
SendCECMessage(txmessage);
}
void hdmi_cec::vol_up()
{
send_key(CEC_USER_CONTROL_CODE_VOLUME_UP, CEC_OP_PRIM_DEVTYPE_AUDIOSYSTEM);
usleep(50000);
request_audio_status();
}
void hdmi_cec::vol_down()
{
send_key(CEC_USER_CONTROL_CODE_VOLUME_DOWN, CEC_OP_PRIM_DEVTYPE_AUDIOSYSTEM);
usleep(50000);
request_audio_status();
}
void hdmi_cec::toggle_mute()
{
send_key(CEC_USER_CONTROL_CODE_MUTE, CEC_OP_PRIM_DEVTYPE_AUDIOSYSTEM);
usleep(50000);
request_audio_status();
}

107
libarmbox/hdmi_cec.h Normal file
View File

@@ -0,0 +1,107 @@
#ifndef __HDMI_CEC_H__
#define __HDMI_CEC_H__
/*
Copyright (C) 2018 TangoCash
License: GPLv2
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation;
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 General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include <OpenThreads/Thread>
#include <OpenThreads/Condition>
#include "video_lib.h"
struct cec_message
{
unsigned char initiator;
unsigned char destination;
unsigned char opcode;
unsigned char data[256];
unsigned char length;
} __attribute__((packed));
struct cec_message_fb
{
unsigned char address;
unsigned char length;
unsigned char data[256];
}__attribute__((packed));
struct addressinfo
{
unsigned char logical;
unsigned char physical[2];
unsigned char type;
};
enum
{
CEC_KEY_RELEASED = 0,
CEC_KEY_PRESSED,
CEC_KEY_AUTOREPEAT
};
class hdmi_cec : public OpenThreads::Thread
{
private:
hdmi_cec();
static hdmi_cec *hdmi_cec_instance;
void run();
bool Start();
bool Stop();
void Receive();
unsigned char physicalAddress[2];
bool autoview_cec_activ;
unsigned char deviceType, logicalAddress;
int hdmiFd;
long translateKey(unsigned char code);
void handleCode(long code, bool keypressed);
int rc_send(int fd, unsigned int code, unsigned int value);
void rc_sync(int fd);
bool standby;
void send_key(unsigned char key, unsigned char destination);
void request_audio_status();
bool muted;
int volume;
bool fallback;
protected:
bool running;
public:
~hdmi_cec();
static hdmi_cec* getInstance();
bool SetCECMode(VIDEO_HDMI_CEC_MODE);
void SetCECAutoView(bool);
void SetCECAutoStandby(bool);
void GetCECAddressInfo();
void SendCECMessage(struct cec_message &message);
void SetCECState(bool state);
void ReportPhysicalAddress();
bool standby_cec_activ;
void vol_up();
void vol_down();
void toggle_mute();
int GetVolume()
{
return volume;
};
bool isMuted()
{
return muted;
};
};
#endif // __HDMI_CEC_H__

713
libarmbox/hdmi_cec_types.h Normal file
View File

@@ -0,0 +1,713 @@
#ifndef __HDMI_CEC_TYPES_H__
#define __HDMI_CEC_TYPES_H__
typedef enum cec_vendor_id
{
CEC_VENDOR_TOSHIBA = 0x000039,
CEC_VENDOR_SAMSUNG = 0x0000F0,
CEC_VENDOR_DENON = 0x0005CD,
CEC_VENDOR_MARANTZ = 0x000678,
CEC_VENDOR_LOEWE = 0x000982,
CEC_VENDOR_ONKYO = 0x0009B0,
CEC_VENDOR_MEDION = 0x000CB8,
CEC_VENDOR_TOSHIBA2 = 0x000CE7,
CEC_VENDOR_PULSE_EIGHT = 0x001582,
CEC_VENDOR_HARMAN_KARDON2 = 0x001950,
CEC_VENDOR_GOOGLE = 0x001A11,
CEC_VENDOR_AKAI = 0x0020C7,
CEC_VENDOR_AOC = 0x002467,
CEC_VENDOR_PANASONIC = 0x008045,
CEC_VENDOR_PHILIPS = 0x00903E,
CEC_VENDOR_DAEWOO = 0x009053,
CEC_VENDOR_YAMAHA = 0x00A0DE,
CEC_VENDOR_GRUNDIG = 0x00D0D5,
CEC_VENDOR_PIONEER = 0x00E036,
CEC_VENDOR_LG = 0x00E091,
CEC_VENDOR_SHARP = 0x08001F,
CEC_VENDOR_SONY = 0x080046,
CEC_VENDOR_BROADCOM = 0x18C086,
CEC_VENDOR_SHARP2 = 0x534850,
CEC_VENDOR_VIZIO = 0x6B746D,
CEC_VENDOR_BENQ = 0x8065E9,
CEC_VENDOR_HARMAN_KARDON = 0x9C645E,
CEC_VENDOR_UNKNOWN = 0
} cec_vendor_id;
typedef enum cec_user_control_code
{
CEC_USER_CONTROL_CODE_SELECT = 0x00,
CEC_USER_CONTROL_CODE_UP = 0x01,
CEC_USER_CONTROL_CODE_DOWN = 0x02,
CEC_USER_CONTROL_CODE_LEFT = 0x03,
CEC_USER_CONTROL_CODE_RIGHT = 0x04,
CEC_USER_CONTROL_CODE_RIGHT_UP = 0x05,
CEC_USER_CONTROL_CODE_RIGHT_DOWN = 0x06,
CEC_USER_CONTROL_CODE_LEFT_UP = 0x07,
CEC_USER_CONTROL_CODE_LEFT_DOWN = 0x08,
CEC_USER_CONTROL_CODE_ROOT_MENU = 0x09,
CEC_USER_CONTROL_CODE_SETUP_MENU = 0x0A,
CEC_USER_CONTROL_CODE_CONTENTS_MENU = 0x0B,
CEC_USER_CONTROL_CODE_FAVORITE_MENU = 0x0C,
CEC_USER_CONTROL_CODE_EXIT = 0x0D,
// reserved: 0x0E, 0x0F
CEC_USER_CONTROL_CODE_TOP_MENU = 0x10,
CEC_USER_CONTROL_CODE_DVD_MENU = 0x11,
// reserved: 0x12 ... 0x1C
CEC_USER_CONTROL_CODE_NUMBER_ENTRY_MODE = 0x1D,
CEC_USER_CONTROL_CODE_NUMBER11 = 0x1E,
CEC_USER_CONTROL_CODE_NUMBER12 = 0x1F,
CEC_USER_CONTROL_CODE_NUMBER0 = 0x20,
CEC_USER_CONTROL_CODE_NUMBER1 = 0x21,
CEC_USER_CONTROL_CODE_NUMBER2 = 0x22,
CEC_USER_CONTROL_CODE_NUMBER3 = 0x23,
CEC_USER_CONTROL_CODE_NUMBER4 = 0x24,
CEC_USER_CONTROL_CODE_NUMBER5 = 0x25,
CEC_USER_CONTROL_CODE_NUMBER6 = 0x26,
CEC_USER_CONTROL_CODE_NUMBER7 = 0x27,
CEC_USER_CONTROL_CODE_NUMBER8 = 0x28,
CEC_USER_CONTROL_CODE_NUMBER9 = 0x29,
CEC_USER_CONTROL_CODE_DOT = 0x2A,
CEC_USER_CONTROL_CODE_ENTER = 0x2B,
CEC_USER_CONTROL_CODE_CLEAR = 0x2C,
CEC_USER_CONTROL_CODE_NEXT_FAVORITE = 0x2F,
CEC_USER_CONTROL_CODE_CHANNEL_UP = 0x30,
CEC_USER_CONTROL_CODE_CHANNEL_DOWN = 0x31,
CEC_USER_CONTROL_CODE_PREVIOUS_CHANNEL = 0x32,
CEC_USER_CONTROL_CODE_SOUND_SELECT = 0x33,
CEC_USER_CONTROL_CODE_INPUT_SELECT = 0x34,
CEC_USER_CONTROL_CODE_DISPLAY_INFORMATION = 0x35,
CEC_USER_CONTROL_CODE_HELP = 0x36,
CEC_USER_CONTROL_CODE_PAGE_UP = 0x37,
CEC_USER_CONTROL_CODE_PAGE_DOWN = 0x38,
// reserved: 0x39 ... 0x3F
CEC_USER_CONTROL_CODE_POWER = 0x40,
CEC_USER_CONTROL_CODE_VOLUME_UP = 0x41,
CEC_USER_CONTROL_CODE_VOLUME_DOWN = 0x42,
CEC_USER_CONTROL_CODE_MUTE = 0x43,
CEC_USER_CONTROL_CODE_PLAY = 0x44,
CEC_USER_CONTROL_CODE_STOP = 0x45,
CEC_USER_CONTROL_CODE_PAUSE = 0x46,
CEC_USER_CONTROL_CODE_RECORD = 0x47,
CEC_USER_CONTROL_CODE_REWIND = 0x48,
CEC_USER_CONTROL_CODE_FAST_FORWARD = 0x49,
CEC_USER_CONTROL_CODE_EJECT = 0x4A,
CEC_USER_CONTROL_CODE_FORWARD = 0x4B,
CEC_USER_CONTROL_CODE_BACKWARD = 0x4C,
CEC_USER_CONTROL_CODE_STOP_RECORD = 0x4D,
CEC_USER_CONTROL_CODE_PAUSE_RECORD = 0x4E,
// reserved: 0x4F
CEC_USER_CONTROL_CODE_ANGLE = 0x50,
CEC_USER_CONTROL_CODE_SUB_PICTURE = 0x51,
CEC_USER_CONTROL_CODE_VIDEO_ON_DEMAND = 0x52,
CEC_USER_CONTROL_CODE_ELECTRONIC_PROGRAM_GUIDE = 0x53,
CEC_USER_CONTROL_CODE_TIMER_PROGRAMMING = 0x54,
CEC_USER_CONTROL_CODE_INITIAL_CONFIGURATION = 0x55,
CEC_USER_CONTROL_CODE_SELECT_BROADCAST_TYPE = 0x56,
CEC_USER_CONTROL_CODE_SELECT_SOUND_PRESENTATION = 0x57,
// reserved: 0x58 ... 0x5F
CEC_USER_CONTROL_CODE_PLAY_FUNCTION = 0x60,
CEC_USER_CONTROL_CODE_PAUSE_PLAY_FUNCTION = 0x61,
CEC_USER_CONTROL_CODE_RECORD_FUNCTION = 0x62,
CEC_USER_CONTROL_CODE_PAUSE_RECORD_FUNCTION = 0x63,
CEC_USER_CONTROL_CODE_STOP_FUNCTION = 0x64,
CEC_USER_CONTROL_CODE_MUTE_FUNCTION = 0x65,
CEC_USER_CONTROL_CODE_RESTORE_VOLUME_FUNCTION = 0x66,
CEC_USER_CONTROL_CODE_TUNE_FUNCTION = 0x67,
CEC_USER_CONTROL_CODE_SELECT_MEDIA_FUNCTION = 0x68,
CEC_USER_CONTROL_CODE_SELECT_AV_INPUT_FUNCTION = 0x69,
CEC_USER_CONTROL_CODE_SELECT_AUDIO_INPUT_FUNCTION = 0x6A,
CEC_USER_CONTROL_CODE_POWER_TOGGLE_FUNCTION = 0x6B,
CEC_USER_CONTROL_CODE_POWER_OFF_FUNCTION = 0x6C,
CEC_USER_CONTROL_CODE_POWER_ON_FUNCTION = 0x6D,
// reserved: 0x6E ... 0x70
CEC_USER_CONTROL_CODE_F1_BLUE = 0x71,
CEC_USER_CONTROL_CODE_F2_RED = 0X72,
CEC_USER_CONTROL_CODE_F3_GREEN = 0x73,
CEC_USER_CONTROL_CODE_F4_YELLOW = 0x74,
CEC_USER_CONTROL_CODE_F5 = 0x75,
CEC_USER_CONTROL_CODE_DATA = 0x76,
// reserved: 0x77 ... 0xFF
CEC_USER_CONTROL_CODE_AN_RETURN = 0x91, // return (Samsung)
CEC_USER_CONTROL_CODE_AN_CHANNELS_LIST = 0x96, // channels list (Samsung)
CEC_USER_CONTROL_CODE_MAX = 0x96,
CEC_USER_CONTROL_CODE_UNKNOWN = 0xFF
} cec_user_control_code;
typedef enum cec_opcode
{
CEC_OPCODE_ACTIVE_SOURCE = 0x82,
CEC_OPCODE_IMAGE_VIEW_ON = 0x04,
CEC_OPCODE_TEXT_VIEW_ON = 0x0D,
CEC_OPCODE_INACTIVE_SOURCE = 0x9D,
CEC_OPCODE_REQUEST_ACTIVE_SOURCE = 0x85,
CEC_OPCODE_ROUTING_CHANGE = 0x80,
CEC_OPCODE_ROUTING_INFORMATION = 0x81,
CEC_OPCODE_SET_STREAM_PATH = 0x86,
CEC_OPCODE_STANDBY = 0x36,
CEC_OPCODE_RECORD_OFF = 0x0B,
CEC_OPCODE_RECORD_ON = 0x09,
CEC_OPCODE_RECORD_STATUS = 0x0A,
CEC_OPCODE_RECORD_TV_SCREEN = 0x0F,
CEC_OPCODE_CLEAR_ANALOGUE_TIMER = 0x33,
CEC_OPCODE_CLEAR_DIGITAL_TIMER = 0x99,
CEC_OPCODE_CLEAR_EXTERNAL_TIMER = 0xA1,
CEC_OPCODE_SET_ANALOGUE_TIMER = 0x34,
CEC_OPCODE_SET_DIGITAL_TIMER = 0x97,
CEC_OPCODE_SET_EXTERNAL_TIMER = 0xA2,
CEC_OPCODE_SET_TIMER_PROGRAM_TITLE = 0x67,
CEC_OPCODE_TIMER_CLEARED_STATUS = 0x43,
CEC_OPCODE_TIMER_STATUS = 0x35,
CEC_OPCODE_CEC_VERSION = 0x9E,
CEC_OPCODE_GET_CEC_VERSION = 0x9F,
CEC_OPCODE_GIVE_PHYSICAL_ADDRESS = 0x83,
CEC_OPCODE_GET_MENU_LANGUAGE = 0x91,
CEC_OPCODE_REPORT_PHYSICAL_ADDRESS = 0x84,
CEC_OPCODE_SET_MENU_LANGUAGE = 0x32,
CEC_OPCODE_DECK_CONTROL = 0x42,
CEC_OPCODE_DECK_STATUS = 0x1B,
CEC_OPCODE_GIVE_DECK_STATUS = 0x1A,
CEC_OPCODE_PLAY = 0x41,
CEC_OPCODE_GIVE_TUNER_DEVICE_STATUS = 0x08,
CEC_OPCODE_SELECT_ANALOGUE_SERVICE = 0x92,
CEC_OPCODE_SELECT_DIGITAL_SERVICE = 0x93,
CEC_OPCODE_TUNER_DEVICE_STATUS = 0x07,
CEC_OPCODE_TUNER_STEP_DECREMENT = 0x06,
CEC_OPCODE_TUNER_STEP_INCREMENT = 0x05,
CEC_OPCODE_DEVICE_VENDOR_ID = 0x87,
CEC_OPCODE_GIVE_DEVICE_VENDOR_ID = 0x8C,
CEC_OPCODE_VENDOR_COMMAND = 0x89,
CEC_OPCODE_VENDOR_COMMAND_WITH_ID = 0xA0,
CEC_OPCODE_VENDOR_REMOTE_BUTTON_DOWN = 0x8A,
CEC_OPCODE_VENDOR_REMOTE_BUTTON_UP = 0x8B,
CEC_OPCODE_SET_OSD_STRING = 0x64,
CEC_OPCODE_GIVE_OSD_NAME = 0x46,
CEC_OPCODE_SET_OSD_NAME = 0x47,
CEC_OPCODE_MENU_REQUEST = 0x8D,
CEC_OPCODE_MENU_STATUS = 0x8E,
CEC_OPCODE_USER_CONTROL_PRESSED = 0x44,
CEC_OPCODE_USER_CONTROL_RELEASE = 0x45,
CEC_OPCODE_GIVE_DEVICE_POWER_STATUS = 0x8F,
CEC_OPCODE_REPORT_POWER_STATUS = 0x90,
CEC_OPCODE_FEATURE_ABORT = 0x00,
CEC_OPCODE_ABORT = 0xFF,
CEC_OPCODE_GIVE_AUDIO_STATUS = 0x71,
CEC_OPCODE_GIVE_SYSTEM_AUDIO_MODE_STATUS = 0x7D,
CEC_OPCODE_REPORT_AUDIO_STATUS = 0x7A,
CEC_OPCODE_SET_SYSTEM_AUDIO_MODE = 0x72,
CEC_OPCODE_SYSTEM_AUDIO_MODE_REQUEST = 0x70,
CEC_OPCODE_SYSTEM_AUDIO_MODE_STATUS = 0x7E,
CEC_OPCODE_SET_AUDIO_RATE = 0x9A,
/* CEC 1.4 */
CEC_OPCODE_START_ARC = 0xC0,
CEC_OPCODE_REPORT_ARC_STARTED = 0xC1,
CEC_OPCODE_REPORT_ARC_ENDED = 0xC2,
CEC_OPCODE_REQUEST_ARC_START = 0xC3,
CEC_OPCODE_REQUEST_ARC_END = 0xC4,
CEC_OPCODE_END_ARC = 0xC5,
CEC_OPCODE_CDC = 0xF8,
/* when this opcode is set, no opcode will be sent to the device. this is one of the reserved numbers */
CEC_OPCODE_NONE = 0xFD
} cec_opcode;
typedef enum cec_logical_address
{
CECDEVICE_UNKNOWN = -1, //not a valid logical address
CECDEVICE_TV = 0,
CECDEVICE_RECORDINGDEVICE1 = 1,
CECDEVICE_RECORDINGDEVICE2 = 2,
CECDEVICE_TUNER1 = 3,
CECDEVICE_PLAYBACKDEVICE1 = 4,
CECDEVICE_AUDIOSYSTEM = 5,
CECDEVICE_TUNER2 = 6,
CECDEVICE_TUNER3 = 7,
CECDEVICE_PLAYBACKDEVICE2 = 8,
CECDEVICE_RECORDINGDEVICE3 = 9,
CECDEVICE_TUNER4 = 10,
CECDEVICE_PLAYBACKDEVICE3 = 11,
CECDEVICE_RESERVED1 = 12,
CECDEVICE_RESERVED2 = 13,
CECDEVICE_FREEUSE = 14,
CECDEVICE_UNREGISTERED = 15,
CECDEVICE_BROADCAST = 15
} cec_logical_address;
typedef enum cec_power_status
{
CEC_POWER_STATUS_ON = 0x00,
CEC_POWER_STATUS_STANDBY = 0x01,
CEC_POWER_STATUS_IN_TRANSITION_STANDBY_TO_ON = 0x02,
CEC_POWER_STATUS_IN_TRANSITION_ON_TO_STANDBY = 0x03,
CEC_POWER_STATUS_UNKNOWN = 0x99
} cec_power_status;
static const char *ToString(const cec_opcode opcode)
{
switch (opcode)
{
case CEC_OPCODE_ACTIVE_SOURCE:
return "active source";
case CEC_OPCODE_IMAGE_VIEW_ON:
return "image view on";
case CEC_OPCODE_TEXT_VIEW_ON:
return "text view on";
case CEC_OPCODE_INACTIVE_SOURCE:
return "inactive source";
case CEC_OPCODE_REQUEST_ACTIVE_SOURCE:
return "request active source";
case CEC_OPCODE_ROUTING_CHANGE:
return "routing change";
case CEC_OPCODE_ROUTING_INFORMATION:
return "routing information";
case CEC_OPCODE_SET_STREAM_PATH:
return "set stream path";
case CEC_OPCODE_STANDBY:
return "standby";
case CEC_OPCODE_RECORD_OFF:
return "record off";
case CEC_OPCODE_RECORD_ON:
return "record on";
case CEC_OPCODE_RECORD_STATUS:
return "record status";
case CEC_OPCODE_RECORD_TV_SCREEN:
return "record tv screen";
case CEC_OPCODE_CLEAR_ANALOGUE_TIMER:
return "clear analogue timer";
case CEC_OPCODE_CLEAR_DIGITAL_TIMER:
return "clear digital timer";
case CEC_OPCODE_CLEAR_EXTERNAL_TIMER:
return "clear external timer";
case CEC_OPCODE_SET_ANALOGUE_TIMER:
return "set analogue timer";
case CEC_OPCODE_SET_DIGITAL_TIMER:
return "set digital timer";
case CEC_OPCODE_SET_EXTERNAL_TIMER:
return "set external timer";
case CEC_OPCODE_SET_TIMER_PROGRAM_TITLE:
return "set timer program title";
case CEC_OPCODE_TIMER_CLEARED_STATUS:
return "timer cleared status";
case CEC_OPCODE_TIMER_STATUS:
return "timer status";
case CEC_OPCODE_CEC_VERSION:
return "cec version";
case CEC_OPCODE_GET_CEC_VERSION:
return "get cec version";
case CEC_OPCODE_GIVE_PHYSICAL_ADDRESS:
return "give physical address";
case CEC_OPCODE_GET_MENU_LANGUAGE:
return "get menu language";
case CEC_OPCODE_REPORT_PHYSICAL_ADDRESS:
return "report physical address";
case CEC_OPCODE_SET_MENU_LANGUAGE:
return "set menu language";
case CEC_OPCODE_DECK_CONTROL:
return "deck control";
case CEC_OPCODE_DECK_STATUS:
return "deck status";
case CEC_OPCODE_GIVE_DECK_STATUS:
return "give deck status";
case CEC_OPCODE_PLAY:
return "play";
case CEC_OPCODE_GIVE_TUNER_DEVICE_STATUS:
return "give tuner status";
case CEC_OPCODE_SELECT_ANALOGUE_SERVICE:
return "select analogue service";
case CEC_OPCODE_SELECT_DIGITAL_SERVICE:
return "set digital service";
case CEC_OPCODE_TUNER_DEVICE_STATUS:
return "tuner device status";
case CEC_OPCODE_TUNER_STEP_DECREMENT:
return "tuner step decrement";
case CEC_OPCODE_TUNER_STEP_INCREMENT:
return "tuner step increment";
case CEC_OPCODE_DEVICE_VENDOR_ID:
return "device vendor id";
case CEC_OPCODE_GIVE_DEVICE_VENDOR_ID:
return "give device vendor id";
case CEC_OPCODE_VENDOR_COMMAND:
return "vendor command";
case CEC_OPCODE_VENDOR_COMMAND_WITH_ID:
return "vendor command with id";
case CEC_OPCODE_VENDOR_REMOTE_BUTTON_DOWN:
return "vendor remote button down";
case CEC_OPCODE_VENDOR_REMOTE_BUTTON_UP:
return "vendor remote button up";
case CEC_OPCODE_SET_OSD_STRING:
return "set osd string";
case CEC_OPCODE_GIVE_OSD_NAME:
return "give osd name";
case CEC_OPCODE_SET_OSD_NAME:
return "set osd name";
case CEC_OPCODE_MENU_REQUEST:
return "menu request";
case CEC_OPCODE_MENU_STATUS:
return "menu status";
case CEC_OPCODE_USER_CONTROL_PRESSED:
return "user control pressed";
case CEC_OPCODE_USER_CONTROL_RELEASE:
return "user control release";
case CEC_OPCODE_GIVE_DEVICE_POWER_STATUS:
return "give device power status";
case CEC_OPCODE_REPORT_POWER_STATUS:
return "report power status";
case CEC_OPCODE_FEATURE_ABORT:
return "feature abort";
case CEC_OPCODE_ABORT:
return "abort";
case CEC_OPCODE_GIVE_AUDIO_STATUS:
return "give audio status";
case CEC_OPCODE_GIVE_SYSTEM_AUDIO_MODE_STATUS:
return "give audio mode status";
case CEC_OPCODE_REPORT_AUDIO_STATUS:
return "report audio status";
case CEC_OPCODE_SET_SYSTEM_AUDIO_MODE:
return "set system audio mode";
case CEC_OPCODE_SYSTEM_AUDIO_MODE_REQUEST:
return "system audio mode request";
case CEC_OPCODE_SYSTEM_AUDIO_MODE_STATUS:
return "system audio mode status";
case CEC_OPCODE_SET_AUDIO_RATE:
return "set audio rate";
case CEC_OPCODE_START_ARC:
return "start ARC";
case CEC_OPCODE_REPORT_ARC_STARTED:
return "report ARC started";
case CEC_OPCODE_REPORT_ARC_ENDED:
return "report ARC ended";
case CEC_OPCODE_REQUEST_ARC_START:
return "request ARC start";
case CEC_OPCODE_REQUEST_ARC_END:
return "request ARC end";
case CEC_OPCODE_END_ARC:
return "end ARC";
case CEC_OPCODE_CDC:
return "CDC";
case CEC_OPCODE_NONE:
return "poll";
default:
return "UNKNOWN";
}
}
static const char *ToString(const cec_vendor_id vendor)
{
switch (vendor)
{
case CEC_VENDOR_SAMSUNG:
return "Samsung";
case CEC_VENDOR_LG:
return "LG";
case CEC_VENDOR_PANASONIC:
return "Panasonic";
case CEC_VENDOR_PIONEER:
return "Pioneer";
case CEC_VENDOR_ONKYO:
return "Onkyo";
case CEC_VENDOR_YAMAHA:
return "Yamaha";
case CEC_VENDOR_PHILIPS:
return "Philips";
case CEC_VENDOR_SONY:
return "Sony";
case CEC_VENDOR_TOSHIBA:
case CEC_VENDOR_TOSHIBA2:
return "Toshiba";
case CEC_VENDOR_AKAI:
return "Akai";
case CEC_VENDOR_AOC:
return "AOC";
case CEC_VENDOR_BENQ:
return "Benq";
case CEC_VENDOR_DAEWOO:
return "Daewoo";
case CEC_VENDOR_GRUNDIG:
return "Grundig";
case CEC_VENDOR_MEDION:
return "Medion";
case CEC_VENDOR_SHARP:
case CEC_VENDOR_SHARP2:
return "Sharp";
case CEC_VENDOR_VIZIO:
return "Vizio";
case CEC_VENDOR_BROADCOM:
return "Broadcom";
case CEC_VENDOR_LOEWE:
return "Loewe";
case CEC_VENDOR_DENON:
return "Denon";
case CEC_VENDOR_MARANTZ:
return "Marantz";
case CEC_VENDOR_HARMAN_KARDON:
case CEC_VENDOR_HARMAN_KARDON2:
return "Harman/Kardon";
case CEC_VENDOR_PULSE_EIGHT:
return "Pulse Eight";
case CEC_VENDOR_GOOGLE:
return "Google";
default:
return "Unknown";
}
}
static const char *ToString(const cec_user_control_code key)
{
switch (key)
{
case CEC_USER_CONTROL_CODE_SELECT:
return "select";
case CEC_USER_CONTROL_CODE_UP:
return "up";
case CEC_USER_CONTROL_CODE_DOWN:
return "down";
case CEC_USER_CONTROL_CODE_LEFT:
return "left";
case CEC_USER_CONTROL_CODE_RIGHT:
return "right";
case CEC_USER_CONTROL_CODE_RIGHT_UP:
return "right+up";
case CEC_USER_CONTROL_CODE_RIGHT_DOWN:
return "right+down";
case CEC_USER_CONTROL_CODE_LEFT_UP:
return "left+up";
case CEC_USER_CONTROL_CODE_LEFT_DOWN:
return "left+down";
case CEC_USER_CONTROL_CODE_ROOT_MENU:
return "root menu";
case CEC_USER_CONTROL_CODE_SETUP_MENU:
return "setup menu";
case CEC_USER_CONTROL_CODE_CONTENTS_MENU:
return "contents menu";
case CEC_USER_CONTROL_CODE_FAVORITE_MENU:
return "favourite menu";
case CEC_USER_CONTROL_CODE_EXIT:
return "exit";
case CEC_USER_CONTROL_CODE_TOP_MENU:
return "top menu";
case CEC_USER_CONTROL_CODE_DVD_MENU:
return "dvd menu";
case CEC_USER_CONTROL_CODE_NUMBER_ENTRY_MODE:
return "number entry mode";
case CEC_USER_CONTROL_CODE_NUMBER11:
return "11";
case CEC_USER_CONTROL_CODE_NUMBER12:
return "12";
case CEC_USER_CONTROL_CODE_NUMBER0:
return "0";
case CEC_USER_CONTROL_CODE_NUMBER1:
return "1";
case CEC_USER_CONTROL_CODE_NUMBER2:
return "2";
case CEC_USER_CONTROL_CODE_NUMBER3:
return "3";
case CEC_USER_CONTROL_CODE_NUMBER4:
return "4";
case CEC_USER_CONTROL_CODE_NUMBER5:
return "5";
case CEC_USER_CONTROL_CODE_NUMBER6:
return "6";
case CEC_USER_CONTROL_CODE_NUMBER7:
return "7";
case CEC_USER_CONTROL_CODE_NUMBER8:
return "8";
case CEC_USER_CONTROL_CODE_NUMBER9:
return "9";
case CEC_USER_CONTROL_CODE_DOT:
return ".";
case CEC_USER_CONTROL_CODE_ENTER:
return "enter";
case CEC_USER_CONTROL_CODE_CLEAR:
return "clear";
case CEC_USER_CONTROL_CODE_NEXT_FAVORITE:
return "next favourite";
case CEC_USER_CONTROL_CODE_CHANNEL_UP:
return "channel up";
case CEC_USER_CONTROL_CODE_CHANNEL_DOWN:
return "channel down";
case CEC_USER_CONTROL_CODE_PREVIOUS_CHANNEL:
return "previous channel";
case CEC_USER_CONTROL_CODE_SOUND_SELECT:
return "sound select";
case CEC_USER_CONTROL_CODE_INPUT_SELECT:
return "input select";
case CEC_USER_CONTROL_CODE_DISPLAY_INFORMATION:
return "display information";
case CEC_USER_CONTROL_CODE_HELP:
return "help";
case CEC_USER_CONTROL_CODE_PAGE_UP:
return "page up";
case CEC_USER_CONTROL_CODE_PAGE_DOWN:
return "page down";
case CEC_USER_CONTROL_CODE_POWER:
return "power";
case CEC_USER_CONTROL_CODE_VOLUME_UP:
return "volume up";
case CEC_USER_CONTROL_CODE_VOLUME_DOWN:
return "volume down";
case CEC_USER_CONTROL_CODE_MUTE:
return "mute";
case CEC_USER_CONTROL_CODE_PLAY:
return "play";
case CEC_USER_CONTROL_CODE_STOP:
return "stop";
case CEC_USER_CONTROL_CODE_PAUSE:
return "pause";
case CEC_USER_CONTROL_CODE_RECORD:
return "record";
case CEC_USER_CONTROL_CODE_REWIND:
return "rewind";
case CEC_USER_CONTROL_CODE_FAST_FORWARD:
return "Fast forward";
case CEC_USER_CONTROL_CODE_EJECT:
return "eject";
case CEC_USER_CONTROL_CODE_FORWARD:
return "forward";
case CEC_USER_CONTROL_CODE_BACKWARD:
return "backward";
case CEC_USER_CONTROL_CODE_STOP_RECORD:
return "stop record";
case CEC_USER_CONTROL_CODE_PAUSE_RECORD:
return "pause record";
case CEC_USER_CONTROL_CODE_ANGLE:
return "angle";
case CEC_USER_CONTROL_CODE_SUB_PICTURE:
return "sub picture";
case CEC_USER_CONTROL_CODE_VIDEO_ON_DEMAND:
return "video on demand";
case CEC_USER_CONTROL_CODE_ELECTRONIC_PROGRAM_GUIDE:
return "electronic program guide";
case CEC_USER_CONTROL_CODE_TIMER_PROGRAMMING:
return "timer programming";
case CEC_USER_CONTROL_CODE_INITIAL_CONFIGURATION:
return "initial configuration";
case CEC_USER_CONTROL_CODE_SELECT_BROADCAST_TYPE:
return "select broadcast type";
case CEC_USER_CONTROL_CODE_SELECT_SOUND_PRESENTATION:
return "select sound presentation";
case CEC_USER_CONTROL_CODE_PLAY_FUNCTION:
return "play (function)";
case CEC_USER_CONTROL_CODE_PAUSE_PLAY_FUNCTION:
return "pause play (function)";
case CEC_USER_CONTROL_CODE_RECORD_FUNCTION:
return "record (function)";
case CEC_USER_CONTROL_CODE_PAUSE_RECORD_FUNCTION:
return "pause record (function)";
case CEC_USER_CONTROL_CODE_STOP_FUNCTION:
return "stop (function)";
case CEC_USER_CONTROL_CODE_MUTE_FUNCTION:
return "mute (function)";
case CEC_USER_CONTROL_CODE_RESTORE_VOLUME_FUNCTION:
return "restore volume";
case CEC_USER_CONTROL_CODE_TUNE_FUNCTION:
return "tune";
case CEC_USER_CONTROL_CODE_SELECT_MEDIA_FUNCTION:
return "select media";
case CEC_USER_CONTROL_CODE_SELECT_AV_INPUT_FUNCTION:
return "select AV input";
case CEC_USER_CONTROL_CODE_SELECT_AUDIO_INPUT_FUNCTION:
return "select audio input";
case CEC_USER_CONTROL_CODE_POWER_TOGGLE_FUNCTION:
return "power toggle";
case CEC_USER_CONTROL_CODE_POWER_OFF_FUNCTION:
return "power off";
case CEC_USER_CONTROL_CODE_POWER_ON_FUNCTION:
return "power on";
case CEC_USER_CONTROL_CODE_F1_BLUE:
return "F1 (blue)";
case CEC_USER_CONTROL_CODE_F2_RED:
return "F2 (red)";
case CEC_USER_CONTROL_CODE_F3_GREEN:
return "F3 (green)";
case CEC_USER_CONTROL_CODE_F4_YELLOW:
return "F4 (yellow)";
case CEC_USER_CONTROL_CODE_F5:
return "F5";
case CEC_USER_CONTROL_CODE_DATA:
return "data";
case CEC_USER_CONTROL_CODE_AN_RETURN:
return "return (Samsung)";
case CEC_USER_CONTROL_CODE_AN_CHANNELS_LIST:
return "channels list (Samsung)";
default:
return "unknown";
}
}
static const char *ToString(cec_logical_address la)
{
switch (la & 0xf)
{
case CECDEVICE_TV:
return "TV";
case CECDEVICE_RECORDINGDEVICE1:
return "Recording Device 1";
case CECDEVICE_RECORDINGDEVICE2:
return "Recording Device 2";
case CECDEVICE_TUNER1:
return "Tuner 1";
case CECDEVICE_PLAYBACKDEVICE1:
return "Playback Device 1";
case CECDEVICE_AUDIOSYSTEM:
return "Audio System";
case CECDEVICE_TUNER2:
return "Tuner 2";
case CECDEVICE_TUNER3:
return "Tuner 3";
case CECDEVICE_PLAYBACKDEVICE2:
return "Playback Device 2";
case CECDEVICE_RECORDINGDEVICE3:
return "Recording Device 3";
case CECDEVICE_TUNER4:
return "Tuner 4";
case CECDEVICE_PLAYBACKDEVICE3:
return "Playback Device 3";
case CECDEVICE_RESERVED1:
return "Reserved 1";
case CECDEVICE_RESERVED2:
return "Reserved 2";
case CECDEVICE_FREEUSE:
return "Free use";
case CECDEVICE_UNREGISTERED:
default:
return "Unregistered";
}
}
static cec_opcode GetResponseOpcode(cec_opcode opcode)
{
switch (opcode)
{
case CEC_OPCODE_REQUEST_ACTIVE_SOURCE:
return CEC_OPCODE_ACTIVE_SOURCE;
case CEC_OPCODE_GET_CEC_VERSION:
return CEC_OPCODE_CEC_VERSION;
case CEC_OPCODE_GIVE_PHYSICAL_ADDRESS:
return CEC_OPCODE_REPORT_PHYSICAL_ADDRESS;
case CEC_OPCODE_GET_MENU_LANGUAGE:
return CEC_OPCODE_SET_MENU_LANGUAGE;
case CEC_OPCODE_GIVE_DECK_STATUS:
return CEC_OPCODE_DECK_STATUS;
case CEC_OPCODE_GIVE_TUNER_DEVICE_STATUS:
return CEC_OPCODE_TUNER_DEVICE_STATUS;
case CEC_OPCODE_GIVE_DEVICE_VENDOR_ID:
return CEC_OPCODE_DEVICE_VENDOR_ID;
case CEC_OPCODE_GIVE_OSD_NAME:
return CEC_OPCODE_SET_OSD_NAME;
case CEC_OPCODE_MENU_REQUEST:
return CEC_OPCODE_MENU_STATUS;
case CEC_OPCODE_GIVE_DEVICE_POWER_STATUS:
return CEC_OPCODE_REPORT_POWER_STATUS;
case CEC_OPCODE_GIVE_AUDIO_STATUS:
return CEC_OPCODE_REPORT_AUDIO_STATUS;
case CEC_OPCODE_GIVE_SYSTEM_AUDIO_MODE_STATUS:
return CEC_OPCODE_SYSTEM_AUDIO_MODE_STATUS;
case CEC_OPCODE_SYSTEM_AUDIO_MODE_REQUEST:
return CEC_OPCODE_SET_SYSTEM_AUDIO_MODE;
default:
break;
}
return CEC_OPCODE_NONE;
}
#endif // __HDMI_CEC_TYPES_H__

287
libarmbox/hisilicon.h Normal file
View File

@@ -0,0 +1,287 @@
#ifndef _hisilicon_h
#define _hisilicon_h
#define HI_FORMAT_MAX_URL_LEN (2048)
#define HI_FORMAT_MAX_FILE_NAME_LEN (512)
#define HI_FORMAT_TITLE_MAX_LEN (512)
#define HI_FORMAT_LANG_LEN (64)
#define HI_FORMAT_MAX_LANGUAGE_NUM (4)
#define HI_FORMAT_SERVICE_DESCRIPT_LEN (64)
typedef uint8_t HI_U8;
typedef uint16_t HI_U16;
typedef uint32_t HI_U32;
typedef int8_t HI_S8;
typedef int16_t HI_S16;
typedef int32_t HI_S32;
typedef uint64_t HI_U64;
typedef int64_t HI_S64;
typedef void HI_VOID;
typedef char HI_CHAR;
typedef enum
{
HI_FALSE = 0,
HI_TRUE = 1,
} HI_BOOL;
typedef enum hiFORMAT_SUBTITLE_TYPE_E
{
HI_FORMAT_SUBTITLE_ASS = 0x0, /**< ASS subtitle */
HI_FORMAT_SUBTITLE_LRC, /**< LRC subtitle */
HI_FORMAT_SUBTITLE_SRT, /**< SRT subtitle */
HI_FORMAT_SUBTITLE_SMI, /**< SMI subtitle */
HI_FORMAT_SUBTITLE_SUB, /**< SUB subtitle */
HI_FORMAT_SUBTITLE_TXT, /**< RAW UTF8 subtitle */
HI_FORMAT_SUBTITLE_HDMV_PGS, /**< pgs subtitle */
HI_FORMAT_SUBTITLE_DVB_SUB, /**< DVB subtitle */
HI_FORMAT_SUBTITLE_DVD_SUB, /**< DVD subtitle */
HI_FORMAT_SUBTITLE_TTML, /**< TTML subtitle */
HI_FORMAT_SUBTITLE_WEBVTT,
HI_FORMAT_SUBTITLE_BUTT
} HI_FORMAT_SUBTITLE_TYPE_E;
typedef enum hiFORMAT_AUDIO_TYPE_E
{
HI_FORMAT_AUDIO_MP2 = 0x000, /**< MPEG audio layer 1, 2.*/
HI_FORMAT_AUDIO_MP3, /**< MPEG audio layer 1, 2, 3.*/
HI_FORMAT_AUDIO_AAC,
HI_FORMAT_AUDIO_AC3,
HI_FORMAT_AUDIO_DTS,
HI_FORMAT_AUDIO_VORBIS,
HI_FORMAT_AUDIO_DVAUDIO,
HI_FORMAT_AUDIO_WMAV1,
HI_FORMAT_AUDIO_WMAV2,
HI_FORMAT_AUDIO_MACE3,
HI_FORMAT_AUDIO_MACE6,
HI_FORMAT_AUDIO_VMDAUDIO,
HI_FORMAT_AUDIO_SONIC,
HI_FORMAT_AUDIO_SONIC_LS,
HI_FORMAT_AUDIO_FLAC,
HI_FORMAT_AUDIO_MP3ADU,
HI_FORMAT_AUDIO_MP3ON4,
HI_FORMAT_AUDIO_SHORTEN,
HI_FORMAT_AUDIO_ALAC,
HI_FORMAT_AUDIO_WESTWOOD_SND1,
HI_FORMAT_AUDIO_GSM,
HI_FORMAT_AUDIO_QDM2,
HI_FORMAT_AUDIO_COOK,
HI_FORMAT_AUDIO_TRUESPEECH,
HI_FORMAT_AUDIO_TTA,
HI_FORMAT_AUDIO_SMACKAUDIO,
HI_FORMAT_AUDIO_QCELP,
HI_FORMAT_AUDIO_WAVPACK,
HI_FORMAT_AUDIO_DSICINAUDIO,
HI_FORMAT_AUDIO_IMC,
HI_FORMAT_AUDIO_MUSEPACK7,
HI_FORMAT_AUDIO_MLP,
HI_FORMAT_AUDIO_GSM_MS, /**< as found in WAV.*/
HI_FORMAT_AUDIO_ATRAC3,
HI_FORMAT_AUDIO_VOXWARE,
HI_FORMAT_AUDIO_APE,
HI_FORMAT_AUDIO_NELLYMOSER,
HI_FORMAT_AUDIO_MUSEPACK8,
HI_FORMAT_AUDIO_SPEEX,
HI_FORMAT_AUDIO_WMAVOICE,
HI_FORMAT_AUDIO_WMAPRO,
HI_FORMAT_AUDIO_WMALOSSLESS,
HI_FORMAT_AUDIO_ATRAC3P,
HI_FORMAT_AUDIO_EAC3,
HI_FORMAT_AUDIO_SIPR,
HI_FORMAT_AUDIO_MP1,
HI_FORMAT_AUDIO_TWINVQ,
HI_FORMAT_AUDIO_TRUEHD,
HI_FORMAT_AUDIO_MP4ALS,
HI_FORMAT_AUDIO_ATRAC1,
HI_FORMAT_AUDIO_BINKAUDIO_RDFT,
HI_FORMAT_AUDIO_BINKAUDIO_DCT,
HI_FORMAT_AUDIO_DRA,
HI_FORMAT_AUDIO_DTS_EXPRESS,
HI_FORMAT_AUDIO_PCM = 0x100, /**< various PCM codecs. */
HI_FORMAT_AUDIO_PCM_BLURAY = 0x121,
HI_FORMAT_AUDIO_ADPCM = 0x130, /**< various ADPCM codecs. */
HI_FORMAT_AUDIO_AMR_NB = 0x160,/**< various AMR codecs. */
HI_FORMAT_AUDIO_AMR_WB,
HI_FORMAT_AUDIO_AMR_AWB,
HI_FORMAT_AUDIO_RA_144 = 0x170, /**< RealAudio codecs. */
HI_FORMAT_AUDIO_RA_288,
HI_FORMAT_AUDIO_DPCM = 0x180, /**< various DPCM codecs. */
HI_FORMAT_AUDIO_G711 = 0x190, /**< various G.7xx codecs. */
HI_FORMAT_AUDIO_G722,
HI_FORMAT_AUDIO_G7231,
HI_FORMAT_AUDIO_G726,
HI_FORMAT_AUDIO_G728,
HI_FORMAT_AUDIO_G729AB,
HI_FORMAT_AUDIO_MULTI = 0x1f0, /**< support multi codecs. */
HI_FORMAT_AUDIO_BUTT = 0x1ff,
} HI_FORMAT_AUDIO_TYPE_E;
typedef enum hiFORMAT_VIDEO_TYPE_E
{
HI_FORMAT_VIDEO_MPEG2 = 0x0, /**< MPEG2*/
HI_FORMAT_VIDEO_MPEG4, /**< MPEG4 DIVX4 DIVX5*/
HI_FORMAT_VIDEO_AVS, /**< AVS*/
HI_FORMAT_VIDEO_H263, /**< H263*/
HI_FORMAT_VIDEO_H264, /**< H264*/
HI_FORMAT_VIDEO_REAL8, /**< REAL*/
HI_FORMAT_VIDEO_REAL9, /**< REAL*/
HI_FORMAT_VIDEO_VC1, /**< VC-1*/
HI_FORMAT_VIDEO_VP6, /**< VP6*/
HI_FORMAT_VIDEO_VP6F, /**< VP6F*/
HI_FORMAT_VIDEO_VP6A, /**< VP6A*/
HI_FORMAT_VIDEO_MJPEG, /**< MJPEG*/
HI_FORMAT_VIDEO_SORENSON, /**< SORENSON SPARK*/
HI_FORMAT_VIDEO_DIVX3, /**< DIVX3, not supported*/
HI_FORMAT_VIDEO_RAW, /**< RAW*/
HI_FORMAT_VIDEO_JPEG, /**< JPEG added for VENC*/
HI_FORMAT_VIDEO_VP8, /**<VP8*/
HI_FORMAT_VIDEO_MSMPEG4V1, /**< MS private MPEG4 */
HI_FORMAT_VIDEO_MSMPEG4V2,
HI_FORMAT_VIDEO_MSVIDEO1, /**< MS video */
HI_FORMAT_VIDEO_WMV1,
HI_FORMAT_VIDEO_WMV2,
HI_FORMAT_VIDEO_RV10,
HI_FORMAT_VIDEO_RV20,
HI_FORMAT_VIDEO_SVQ1, /**< Apple video */
HI_FORMAT_VIDEO_SVQ3, /**< Apple video */
HI_FORMAT_VIDEO_H261,
HI_FORMAT_VIDEO_VP3,
HI_FORMAT_VIDEO_VP5,
HI_FORMAT_VIDEO_CINEPAK,
HI_FORMAT_VIDEO_INDEO2,
HI_FORMAT_VIDEO_INDEO3,
HI_FORMAT_VIDEO_INDEO4,
HI_FORMAT_VIDEO_INDEO5,
HI_FORMAT_VIDEO_MJPEGB,
HI_FORMAT_VIDEO_MVC,
HI_FORMAT_VIDEO_HEVC, /**< HEVC(H265)*/
HI_FORMAT_VIDEO_DV,
HI_FORMAT_VIDEO_HUFFYUV,
HI_FORMAT_VIDEO_DIVX, /**< DIVX,not supported*/
HI_FORMAT_VIDEO_REALMAGICMPEG4, /**< REALMAGIC MPEG4,not supported*/
HI_FORMAT_VIDEO_VP9, /**<VP9*/
HI_FORMAT_VIDEO_WMV3,
HI_FORMAT_VIDEO_AVS2,
HI_FORMAT_VIDEO_BUTT
} HI_FORMAT_VIDEO_TYPE_E;
typedef enum hiFORMAT_SOURCE_TYPE_E
{
HI_FORMAT_SOURCE_LOCAL = 0x0, /**< Local file */
HI_FORMAT_SOURCE_NET_VOD, /**< Net VOD file */
HI_FORMAT_SOURCE_NET_LIVE, /**< Net Live stream */
HI_FORMAT_SOURCE_BUTT
} HI_FORMAT_SOURCE_TYPE_E;
typedef enum hiFORMAT_STREAM_TYPE_E
{
HI_FORMAT_STREAM_ES = 0x0, /**< Element stream (ES) file */
HI_FORMAT_STREAM_TS, /**< TS file */
HI_FORMAT_STREAM_BUTT
} HI_FORMAT_STREAM_TYPE_E;
typedef struct hiFORMAT_AUD_INFO_S
{
HI_S32 s32StreamIndex; /**< Stream index. The invalid value is ::HI_FORMAT_INVALID_STREAM_ID. */
HI_U32 u32Format; /**< Audio encoding format. For details about the value definition, see ::HI_FORMAT_AUDIO_TYPE_E. */
HI_U32 u32Profile; /**< Audio encoding version, such as 0x160(WMAV1) and 0x161 (WMAV2). It is valid only for WMA encoding. */
HI_U32 u32SampleRate; /**< 8000,11025,441000,... */
HI_U16 u16BitPerSample; /**< Number of bits occupied by each audio sampling point such as 8 bits or 16 bits. */
HI_U16 u16Channels; /**< Number of channels, 1 or 2. *//**< CNcomment:ÉùµÀÊý, 1 or 2 */
HI_S32 s32SubStreamID; /**< Sub audio stream ID */
HI_U32 u32BlockAlign; /**< Number of bytes contained in a packet */
HI_U32 u32Bitrate; /**< Audio bit rate, in the unit of bit/s. */
HI_BOOL bBigEndian; /**< Big endian or little endian. It is valid only for the PCM format */
HI_CHAR aszLanguage[HI_FORMAT_LANG_LEN]; /**< Audio stream language */
HI_U32 u32ExtradataSize; /**< Length of the extended data */
HI_U8* pu8Extradata; /**< Extended data */
HI_VOID* pCodecContext; /**< Audio decode context */
HI_U32 u32Role; /**< Role descriptor value of mpeg dash. the most 8 bits is scheme value(refer to HI_FORMAT_ROLE_SCHEME_E), the left 24 bits is descriptor value, the descriptor value may be the bitwise '|' result of value define in HI_FORMAT_ROLE_VALUE_E*/
HI_U32 u32Accessibility; /**< Accessbilitydescriptor value of mpeg dash. the most 8 bits is scheme value(refer to HI_FORMAT_ROLE_SCHEME_E), the left 24 bits is descriptor value, the descriptor value type is number*/
HI_S64 s64Duration; /**< Duration of audio stream, in the unit of ms. */
HI_U32 u32CodecTag; /**< Codec tag of audio stream format, fourcc (LSB first, so "ABCD" -> ('D'<<24) + ('C'<<16) + ('B'<<8) + 'A'). */
} HI_FORMAT_AUD_INFO_S;
typedef struct hiFORMAT_VID_INFO_S
{
HI_S32 s32StreamIndex; /**< Stream index. The invalid value is ::HI_FORMAT_INVALID_STREAM_ID. */
HI_U32 u32Format; /**< Video encoding format. For details about the value definition, see ::HI_FORMAT_VIDEO_TYPE_E. */
HI_U16 u16RefFrameNum; /**< Number of reference frames. */
HI_U16 u16Profile; /**< Profile level. */
HI_U16 u16Width; /**< Width, in the unit of pixel. */
HI_U16 u16Height; /**< Height, in the unit of pixel. */
HI_U16 u16FpsInteger; /**< Integer part of the frame rate */
HI_U16 u16FpsDecimal; /**< Decimal part of the frame rate */
HI_U32 u32Bitrate; /**< Video bit rate, in the unit of bit/s. */
HI_U32 u32CodecVersion; /**< Version of codec. */
HI_U32 u32Rotate; /**< Video rotation angle, value is 90/180/270, default value is 0 */
HI_U32 u32Reversed;
HI_BOOL bEnableTVP;
HI_U32 u32ExtradataSize; /**< Length of the extended data */
HI_U8* pu8Extradata; /**< Extended data */
HI_VOID* pCodecContext; /**< video decode context */
HI_U32 u32Role; /**< Role descriptor value of mpeg dash. the most 8 bits is scheme value(refer to HI_FORMAT_ROLE_SCHEME_E), the left 24 bits is descriptor value, the descriptor value may be the bitwise '|' result of value define in HI_FORMAT_ROLE_VALUE_E*/
HI_U32 u32Accessibility; /**< Accessbilitydescriptor value of mpeg dash. the most 8 bits is scheme value(refer to HI_FORMAT_ROLE_SCHEME_E), the left 24 bits is descriptor value, the descriptor value type is number*/
HI_S64 s64Duration; /**< Duration of video stream, in the unit of ms. */
HI_BOOL bNoPts; /**<this stream has no pts info or pts is invalid> */
} HI_FORMAT_VID_INFO_S;
typedef struct hiFORMAT_SUB_INFO_S
{
HI_S32 s32StreamIndex; /**< Stream index. The invalid value is ::HI_FORMAT_INVALID_STREAM_ID. */
HI_U32 u32Format; /**< Subtitle format, For details about the value definition, see::HI_FORMAT_SUBTITLE_TYPE_E */
HI_U32 u32CharSet; /**< Encoding type of the subtitle, the value range is as follows:
1. The default value is 0.
2. The value of the u32CharSet is the identified byte encoding value if the IdentStream byte encoding function (for details about the definition, see hi_charset_common.h) is set.
3. If the ConvStream function (for details about the definition, see hi_charset_common.h) is set and the invoke interface is called to set the encoding type to be converted by implementing HI_FORMAT_INVOKE_SET_SOURCE_CODETYPE, the value of the u32CharSet is the configured encoding type */
HI_BOOL bExtSub; /**< Whether subtitles are external subtitles. When bExtSub is HI_TRUE, the subtitles are external. When bExtSub is HI_FALSE, the subtitles are internal. */
HI_U32 u32StreamNum; /**< contains stream number */
HI_CHAR paszLanguage[HI_FORMAT_MAX_LANGUAGE_NUM][HI_FORMAT_LANG_LEN]; /**< Subtitle language */
HI_U16 u16OriginalFrameWidth; /**< Width of the original image */
HI_U16 u16OriginalFrameHeight; /**< Height of the original image */
HI_U32 u32ExtradataSize; /**< Length of the extended data */
HI_U8* pu8Extradata; /**< Extended data */
HI_VOID* pCodecContext; /**< Audio decode context */
HI_U32 u32Role; /**< Role descriptor value of mpeg dash. the most 8 bits is scheme value(refer to HI_FORMAT_ROLE_SCHEME_E), the left 24 bits is descriptor value, the descriptor value may be the bitwise '|' result of value define in HI_FORMAT_ROLE_VALUE_E*/
HI_U32 u32Accessibility; /**< Accessibility descriptor value of mpeg dash. the most 8 bits is scheme value(refer to HI_FORMAT_ROLE_SCHEME_E), the left 24 bits is descriptor value, value type is number*/
HI_CHAR paszFileName[HI_FORMAT_MAX_URL_LEN]; /**< File name of external subtitle. */
} HI_FORMAT_SUB_INFO_S;
typedef struct hiFORMAT_PROGRAM_INFO_S
{
HI_U32 u32VidStreamNum; /**< Number of video streams */
HI_FORMAT_VID_INFO_S* pastVidStream; /**< Video stream information */
HI_U32 u32AudStreamNum; /**< Number of audio streams */
HI_FORMAT_AUD_INFO_S* pastAudStream; /**< Audio stream information */
HI_U32 u32SubStreamNum; /**< Number of subtitles */
HI_FORMAT_SUB_INFO_S* pastSubStream; /**< Subtitle information */
HI_CHAR aszServiceName[HI_FORMAT_SERVICE_DESCRIPT_LEN]; /**< Program service name info */
HI_CHAR aszServiceProvider[HI_FORMAT_SERVICE_DESCRIPT_LEN]; /**< Program service provider info */
HI_S64 s64ProgramDuration;
HI_S64 s64ProgramStartTime;
} HI_FORMAT_PROGRAM_INFO_S;
typedef struct hiFORMAT_FILE_INFO_S
{
HI_FORMAT_SOURCE_TYPE_E eSourceType; /**< File source type */
HI_FORMAT_STREAM_TYPE_E eStreamType; /**< File stream type */
HI_S64 s64FileSize; /**< File size, in the unit of byte. */
HI_S64 s64StartTime; /**< Start time of playing a file, in the unit is ms. */
HI_S64 s64Duration; /**< Total duration of a file, in the unit of ms. */
HI_U32 u32Bitrate; /**< File bit rate, in the unit of bit/s. */
HI_CHAR aszFileFormat[HI_FORMAT_TITLE_MAX_LEN]; /**< File demuxer info .Not used now*/
HI_U32 u32ProgramNum; /**< Actual number of programs */
HI_FORMAT_PROGRAM_INFO_S* pastProgramInfo; /**< Program information */
HI_BOOL bIsDivx; /**< If the stream is DIVX restricted stream,HI_TRUE yes,HI_FALSE no */
HI_BOOL bIsDrmFile;
} HI_FORMAT_FILE_INFO_S;
#endif

54
libarmbox/init.cpp Normal file
View File

@@ -0,0 +1,54 @@
#include <config.h>
#include <stdio.h>
#include <fcntl.h>
#include <sys/ioctl.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include "init.h"
#include "pwrmngr.h"
#include <proc_tools.h>
#include "hal_debug.h"
#define hal_debug(args...) _hal_debug(HAL_DEBUG_INIT, NULL, args)
#define hal_info(args...) _hal_info(HAL_DEBUG_INIT, NULL, args)
static bool initialized = false;
void hal_api_init()
{
if (!initialized)
hal_debug_init();
hal_info("%s begin, initialized=%d, debug=0x%02x\n", __FUNCTION__, (int)initialized, debuglevel);
if (!initialized)
{
cCpuFreqManager f;
f.SetCpuFreq(0); /* CPUFREQ == 0 is the trigger for leaving standby */
char buffer[64];
sprintf(buffer, "%x", 0);
proc_put("/proc/stb/fb/dst_top", buffer, strlen(buffer));
proc_put("/proc/stb/fb/dst_left", buffer, strlen(buffer));
sprintf(buffer, "%x", 576);
proc_put("/proc/stb/fb/dst_height", buffer, strlen(buffer));
sprintf(buffer, "%x", 720);
proc_put("/proc/stb/fb/dst_width", buffer, strlen(buffer));
sprintf(buffer, "%x", 1);
proc_put("/proc/stb/fb/dst_apply", buffer, strlen(buffer));
#if BOXMODEL_VUSOLO4K || BOXMODEL_VUDUO4K || BOXMODEL_VUULTIMO4K || BOXMODEL_VUUNO4KSE || BOXMODEL_VUUNO4K
sprintf(buffer, "%s", "enable");
proc_put("/proc/stb/frontend/fbc/fcc", buffer, strlen(buffer));
#endif
}
initialized = true;
hal_info("%s end\n", __FUNCTION__);
}
void hal_api_exit()
{
hal_info("%s, initialized = %d\n", __FUNCTION__, (int)initialized);
initialized = false;
}

1014
libarmbox/linux-uapi-cec.h Normal file

File diff suppressed because it is too large Load Diff

1191
libarmbox/playback_gst.cpp Normal file

File diff suppressed because it is too large Load Diff

107
libarmbox/playback_gst.h Normal file
View File

@@ -0,0 +1,107 @@
/*
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
*/
#ifndef __PLAYBACK_GST_H__
#define __PLAYBACK_GST_H__
#include <string>
#include <stdint.h>
#include <vector>
#include <config.h>
typedef enum
{
STATE_STOP,
STATE_PLAY,
STATE_PAUSE,
STATE_FF,
STATE_REW,
STATE_SLOW
} playstate_t;
typedef enum
{
PLAYMODE_TS = 0,
PLAYMODE_FILE,
} playmode_t;
struct AVFormatContext;
class cPlayback
{
private:
bool playing, first;
bool decoders_closed;
int mSpeed;
int mAudioStream;
int init_jump;
public:
playstate_t playstate;
cPlayback(int);
bool Open(playmode_t PlayMode);
void Close(void);
bool Start(char *filename, int vpid, int vtype, int apid, int ac3, int duration, std::string headers = "");
bool Start(std::string filename, std::string headers = "");
bool Play(void);
bool SyncAV(void);
bool Stop(void);
bool SetAPid(int pid, bool ac3);
bool SetSubtitlePid(int pid);
bool SetTeletextPid(int pid);
void trickSeek(int ratio);
bool SetSpeed(int speed);
bool SetSlow(int slow);
bool GetSpeed(int &speed) const;
bool GetPosition(int &position, int &duration);
void GetPts(uint64_t &pts);
int GetAPid(void);
int GetVPid(void);
int GetSubtitlePid(void);
bool SetPosition(int position, bool absolute = false);
void FindAllPids(int *apids, unsigned int *ac3flags, unsigned int *numpida, std::string *language);
void FindAllPids(uint16_t *apids, unsigned short *ac3flags, uint16_t *numpida, std::string *language) { FindAllPids((int*) apids, (unsigned int*) ac3flags, (unsigned int*) numpida, language); };
void FindAllSubs(int *pids, unsigned int *supported, unsigned int *numpida, std::string *language);
void FindAllSubs(uint16_t *pids, unsigned short *supported, uint16_t *numpida, std::string *language) { FindAllSubs((int*) pids, (unsigned int*) supported, (unsigned int*) numpida, language); };
bool SelectSubtitles(int pid, std::string charset = "");
void FindAllSubtitlePids(int *pids, unsigned int *numpids, std::string *language);
void FindAllTeletextsubtitlePids(int *pids, unsigned int *numpidt, std::string *tlanguage, int *mags, int *pages);
void RequestAbort(void);
uint64_t GetReadCount(void);
void GetChapters(std::vector<int> &positions, std::vector<std::string> &titles);
void GetMetadata(std::vector<std::string> &keys, std::vector<std::string> &values);
AVFormatContext *GetAVFormatContext();
void ReleaseAVFormatContext();
std::string extra_headers;
std::string user_agent;
void GetTitles(std::vector<int> &playlists, std::vector<std::string> &titles, int &current);
void SetTitle(int title);
//
~cPlayback();
void getMeta();
};
#endif // __PLAYBACK_GST_H__

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,180 @@
/*
Copyright (C) 2018 TangoCash
License: GPLv2
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation;
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 General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#ifndef __HAL_PLAYBACK_H
#define __HAL_PLAYBACK_H
#include <string>
#include <vector>
#include <OpenThreads/Thread>
#include <OpenThreads/Condition>
#include "hisilicon.h"
typedef enum
{
PLAYMODE_TS = 0,
PLAYMODE_FILE
} playmode_t;
struct AVFormatContext;
struct errorInfo
{
std::string error_message;
std::string missing_codec;
};
class cPlayback
{
friend class CStreamInfo2;
friend class netlink_event;
private:
int m_video_fd;
int m_audio_fd;
bool enabled;
bool playing, first;
bool no_probe;
bool got_vpts_ts;
int nPlaybackSpeed;
int mAudioStream;
int mSubtitleStream;
int mTeletextStream;
int64_t vpts_ts;
bool Stop(void);
bool decoders_closed;
playmode_t pm;
std::string fn_ts;
std::string fn_xml;
off64_t last_size;
int init_jump;
const char *getVidFormatStr(uint32_t format);
const char *getAudFormatStr(uint32_t format);
const char *getSubFormatStr(uint32_t format);
public:
cPlayback(int num = 0);
~cPlayback();
bool Open(playmode_t PlayMode);
void Close(void);
bool Start(char *filename, int vpid, int vtype, int apid, int ac3, int duration, std::string headers = "");
bool Start(std::string filename, std::string headers = "");
bool SetAPid(int pid, bool ac3 = false);
bool SetVPid(int /*pid*/);
bool SetSubtitlePid(int pid);
bool SetTeletextPid(int pid);
int GetAPid(void)
{
return mAudioStream;
}
int GetVPid(void)
{
return 0;
}
int GetSubtitlePid(void)
{
return mSubtitleStream;
}
int GetTeletextPid(void);
bool SetSpeed(int speed);
bool GetSpeed(int &speed) const;
bool GetPosition(int &position, int &duration);
void GetPts(uint64_t &pts);
bool SetPosition(int position, bool absolute = false);
void FindAllPids(int *apids, unsigned int *ac3flags, unsigned int *numpida, std::string *language);
void FindAllSubtitlePids(int *pids, unsigned int *numpids, std::string *language);
void FindAllTeletextsubtitlePids(int */*pids*/, unsigned int *numpidt, std::string */*tlanguage*/, int */*mags*/, int */*pages*/);
void RequestAbort(void);
bool IsPlaying(void);
uint64_t GetReadCount(void);
void GetChapters(std::vector<int> &positions, std::vector<std::string> &titles);
void GetMetadata(std::vector<std::string> &keys, std::vector<std::string> &values);
AVFormatContext *GetAVFormatContext();
void ReleaseAVFormatContext();
};
class netlink_event : public OpenThreads::Thread
{
friend class cPlayback;
protected:
bool running;
private:
netlink_event();
~netlink_event();
static netlink_event *netlink_event_instance;
cPlayback *player;
int m_player_state;
enum
{
stIdle, stRunning, stStopped,
};
struct streamid
{
uint16_t programid;
uint16_t videostreamid;
uint16_t audiostreamid;
uint16_t subtitlestreamid;
} streamid;
int m_state;
bool m_paused;
bool m_buffering;
HI_FORMAT_FILE_INFO_S fileinfo;
struct nlmsghdr *nlh;
int m_bufferpercentage;
uint32_t m_seekable;
uint32_t m_download_progress;
int netlink_socket;
int receive_netlink_message();
errorInfo m_errorInfo;
void run();
void Receive();
public:
static netlink_event* getInstance();
uint64_t getDuration()
{
return fileinfo.s64Duration;
};
bool Start(cPlayback *player);
bool Stop();
};
#if 0 // for later use, maybe
class video_event : public OpenThreads::Thread
{
friend class cPlayback;
protected:
bool running;
private:
int m_video_fd;
void run();
void Receive();
public:
bool Start(int video_fd);
bool Stop();
};
#endif
#endif

View File

@@ -0,0 +1,859 @@
#define __USE_FILE_OFFSET64 1
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/stat.h>
#include <unistd.h>
#include <sstream>
#include <audio_lib.h>
#include <video_lib.h>
#include <common.h>
extern OutputHandler_t OutputHandler;
extern PlaybackHandler_t PlaybackHandler;
extern ContainerHandler_t ContainerHandler;
extern ManagerHandler_t ManagerHandler;
#include "playback_libeplayer3.h"
#include "hal_debug.h"
#define hal_debug(args...) _hal_debug(HAL_DEBUG_PLAYBACK, this, args)
#define hal_info(args...) _hal_info(HAL_DEBUG_PLAYBACK, this, args)
static Context_t *player = NULL;
extern cAudio *audioDecoder;
extern cVideo *videoDecoder;
OpenThreads::Mutex cPlayback::mutex;
//Used by Fileplay
bool cPlayback::Open(playmode_t PlayMode)
{
const char *aPLAYMODE[] =
{
"PLAYMODE_TS",
"PLAYMODE_FILE"
};
if (PlayMode != PLAYMODE_TS)
{
audioDecoder->closeDevice();
videoDecoder->closeDevice();
decoders_closed = true;
}
pm = PlayMode;
got_vpts_ts = false;
vpts_ts = 0;
fn_ts = "";
fn_xml = "";
last_size = 0;
nPlaybackSpeed = 0;
init_jump = -1;
if (!player)
{
player = (Context_t *) malloc(sizeof(Context_t));
}
if (player)
{
player->playback = &PlaybackHandler;
player->output = &OutputHandler;
player->container = &ContainerHandler;
player->manager = &ManagerHandler;
hal_info("%s - player output name: %s PlayMode: %s\n", __func__, player->output->Name, aPLAYMODE[PlayMode]);
}
//Registration of output devices
if (player && player->output)
{
player->output->Command(player, OUTPUT_ADD, (void *)"audio");
player->output->Command(player, OUTPUT_ADD, (void *)"video");
player->output->Command(player, OUTPUT_ADD, (void *)"subtitle");
}
return 0;
}
void cPlayback::Close(void)
{
hal_info("%s\n", __func__);
//Dagobert: movieplayer does not call stop, it calls close ;)
mutex.lock();
if(playing)
Stop();
mutex.unlock();
if (decoders_closed)
{
audioDecoder->openDevice();
videoDecoder->openDevice();
decoders_closed = false;
}
}
bool cPlayback::Start(std::string filename, std::string headers, std::string filename2)
{
return Start((char *) filename.c_str(), 0, 0, 0, 0, 0, headers,filename2);
}
bool cPlayback::Start(char *filename, int vpid, int vtype, int apid, int ac3, int, std::string headers __attribute__((unused)),std::string filename2)
{
bool ret = false;
bool isHTTP = false;
no_probe = false;
hal_info("%s - filename=%s vpid=%u vtype=%d apid=%u ac3=%d\n", __func__, filename, vpid, vtype, apid, ac3);
init_jump = -1;
//create playback path
mAudioStream = 0;
mSubtitleStream = -1;
mTeletextStream = -1;
unlink("/tmp/.id3coverart");
std::string file;
if (*filename == '/')
file = "file://";
file += filename;
if ((file.find(":31339/id=") != std::string::npos) || (file.find(":10000") != std::string::npos) || (file.find(":8001/") != std::string::npos)) // for LocalTV and Entertain-TV streaming
no_probe = true;
if (file.substr(0, 7) == "file://")
{
if (file.substr(file.length() - 3) == ".ts")
{
fn_ts = file.substr(7);
fn_xml = file.substr(7, file.length() - 9);
fn_xml += "xml";
no_probe = true;
}
}
else
isHTTP = true;
std::string szSecondFile;
char *file2 = NULL;
if(!filename2.empty()){
szSecondFile = filename2;
file2 = (char *) szSecondFile.c_str();
}
PlayFiles_t playbackFiles = { (char *) file.c_str(), file2, NULL, NULL, 0, 0, 0, 0};
if (player->playback->Command(player, PLAYBACK_OPEN, &playbackFiles) == 0)
{
if (pm == PLAYMODE_TS)
{
struct stat64 s;
if (!stat64(file.c_str(), &s))
last_size = s.st_size;
ret = true;
videoDecoder->Stop(false);
audioDecoder->Stop();
}
else
{
//AUDIO
if (player && player->manager && player->manager->audio)
{
char ** TrackList = NULL;
player->manager->audio->Command(player, MANAGER_LIST, &TrackList);
if (TrackList != NULL)
{
printf("AudioTrack List\n");
int i = 0;
for (i = 0; TrackList[i] != NULL; i += 2)
{
printf("\t%s - %s\n", TrackList[i], TrackList[i + 1]);
free(TrackList[i]);
free(TrackList[i + 1]);
}
free(TrackList);
}
}
//SUB
if (player && player->manager && player->manager->subtitle)
{
char ** TrackList = NULL;
player->manager->subtitle->Command(player, MANAGER_LIST, &TrackList);
if (TrackList != NULL)
{
printf("SubtitleTrack List\n");
int i = 0;
for (i = 0; TrackList[i] != NULL; i+=2)
{
printf("\t%s - %s\n", TrackList[i], TrackList[i + 1]);
free(TrackList[i]);
free(TrackList[i + 1]);
}
free(TrackList);
}
}
/*
//Teletext
if (player && player->manager && player->manager->teletext)
{
char ** TrackList = NULL;
player->manager->teletext->Command(player, MANAGER_LIST, &TrackList);
if (TrackList != NULL)
{
printf("TeletextTrack List\n");
int i = 0;
for (i = 0; TrackList[i] != NULL; i += 2)
{
printf("\t%s - %s\n", TrackList[i], TrackList[i + 1]);
free(TrackList[i]);
free(TrackList[i + 1]);
}
free(TrackList);
}
}
*/
//Chapters
if (player && player->manager && player->manager->chapter)
{
char ** TrackList = NULL;
player->manager->chapter->Command(player, MANAGER_LIST, &TrackList);
if (TrackList != NULL)
{
printf("Chapter List\n");
int i = 0;
for (i = 0; TrackList[i] != NULL; i += 2)
{
printf("\t%s - %s\n", TrackList[i], TrackList[i + 1]);
free(TrackList[i]);
free(TrackList[i + 1]);
}
free(TrackList);
}
}
playing = true;
first = true;
player->output->Command(player, OUTPUT_OPEN, NULL);
ret = (player->playback->Command(player, PLAYBACK_PLAY, NULL) == 0);
if (ret && !isHTTP)
playing = ret = (player->playback->Command(player, PLAYBACK_PAUSE, NULL) == 0);
}
}
return ret;
}
bool cPlayback::Stop(void)
{
hal_info("%s playing %d\n", __func__, playing);
if (player && player->playback)
player->playback->Command(player, PLAYBACK_STOP, NULL);
if (player && player->output)
player->output->Command(player, OUTPUT_CLOSE, NULL);
if (player && player->output)
{
player->output->Command(player, OUTPUT_DEL, (void *)"audio");
player->output->Command(player, OUTPUT_DEL, (void *)"video");
player->output->Command(player, OUTPUT_DEL, (void *)"subtitle");
}
if (player && player->playback)
player->playback->Command(player, PLAYBACK_CLOSE, NULL);
playing = false;
return true;
}
bool cPlayback::SetAPid(int pid, bool /* ac3 */)
{
hal_info("%s\n", __func__);
int i = pid;
if (pid != mAudioStream)
{
if (player && player->playback)
player->playback->Command(player, PLAYBACK_SWITCH_AUDIO, (void *)&i);
mAudioStream = pid;
}
return true;
}
bool cPlayback::SetVPid(int /*pid*/)
{
hal_info("%s\n", __func__);
return true;
}
bool cPlayback::SetSubtitlePid(int pid)
{
hal_info("%s\n", __func__);
int i = pid;
if (pid != mSubtitleStream)
{
if (player && player->playback)
player->playback->Command(player, PLAYBACK_SWITCH_SUBTITLE, (void *)&i);
mSubtitleStream = pid;
}
return true;
}
bool cPlayback::SetTeletextPid(int pid)
{
hal_info("%s\n", __func__);
//int i = pid;
if (pid != mTeletextStream)
{
//if (player && player->playback)
// player->playback->Command(player, PLAYBACK_SWITCH_TELETEXT, (void*)&i);
mTeletextStream = pid;
}
return true;
}
bool cPlayback::SetSpeed(int speed)
{
hal_info("%s playing %d speed %d\n", __func__, playing, speed);
if (!decoders_closed)
{
audioDecoder->closeDevice();
videoDecoder->closeDevice();
decoders_closed = true;
usleep(500000);
if (player && player->output && player->playback)
{
player->output->Command(player, OUTPUT_OPEN, NULL);
if (player->playback->Command(player, PLAYBACK_PLAY, NULL) == 0)
playing = true;
}
}
if (!playing)
return false;
if (player && player->playback)
{
int result = 0;
nPlaybackSpeed = speed;
if (speed > 1)
{
/* direction switch ? */
if (player->playback->BackWard)
{
int r = 0;
result = player->playback->Command(player, PLAYBACK_FASTBACKWARD, (void *)&r);
printf("result = %d\n", result);
}
result = player->playback->Command(player, PLAYBACK_FASTFORWARD, (void *)&speed);
}
else if (speed < 0)
{
/* direction switch ? */
if (player->playback->isForwarding)
{
result = player->playback->Command(player, PLAYBACK_CONTINUE, NULL);
printf("result = %d\n", result);
}
result = player->playback->Command(player, PLAYBACK_FASTBACKWARD, (void *)&speed);
}
else if (speed == 0)
{
/* konfetti: hmmm accessing the member isn't very proper */
if ((player->playback->isForwarding) || (!player->playback->BackWard))
player->playback->Command(player, PLAYBACK_PAUSE, NULL);
else
{
int _speed = 0; /* means end of reverse playback */
player->playback->Command(player, PLAYBACK_FASTBACKWARD, (void *)&_speed);
}
}
else
{
result = player->playback->Command(player, PLAYBACK_CONTINUE, NULL);
}
if (init_jump > -1)
{
SetPosition(init_jump);
init_jump = -1;
}
if (result != 0)
{
printf("returning false\n");
return false;
}
}
return true;
}
bool cPlayback::GetSpeed(int &speed) const
{
hal_debug("%s\n", __func__);
speed = nPlaybackSpeed;
return true;
}
void cPlayback::GetPts(uint64_t &pts)
{
if (player && player->playback)
player->playback->Command(player, PLAYBACK_PTS, (void *)&pts);
}
// in milliseconds
bool cPlayback::GetPosition(int &position, int &duration)
{
bool got_duration = false;
hal_debug("%s %d %d\n", __func__, position, duration);
/* hack: if the file is growing (timeshift), then determine its length
* by comparing the mtime with the mtime of the xml file */
if (pm == PLAYMODE_TS)
{
struct stat64 s;
if (!stat64(fn_ts.c_str(), &s))
{
if (!playing || last_size != s.st_size)
{
last_size = s.st_size;
time_t curr_time = s.st_mtime;
if (!stat64(fn_xml.c_str(), &s))
{
duration = (curr_time - s.st_mtime) * 1000;
if (!playing)
return true;
got_duration = true;
}
}
}
}
if (!playing)
return false;
if (player && player->playback && !player->playback->isPlaying)
{
hal_info("%s !!!!EOF!!!! < -1\n", __func__);
position = duration + 1000;
return false;
}
int64_t vpts = 0;
if (player && player->playback)
player->playback->Command(player, PLAYBACK_PTS, &vpts);
if (vpts <= 0)
{
//printf("ERROR: vpts==0");
}
else
{
/* workaround for crazy vpts value during timeshift */
if (!got_vpts_ts && pm == PLAYMODE_TS)
{
vpts_ts = vpts;
got_vpts_ts = true;
}
if (got_vpts_ts)
vpts -= vpts_ts;
/* end workaround */
/* len is in nanoseconds. we have 90 000 pts per second. */
position = vpts / 90;
}
if (got_duration)
return true;
int64_t length = 0;
if (player && player->playback)
player->playback->Command(player, PLAYBACK_LENGTH, &length);
if (length <= 0)
{
duration = duration + 1000;
}
else
{
duration = length * 1000;
}
return true;
}
bool cPlayback::SetPosition(int position, bool absolute)
{
hal_info("%s %d\n", __func__, position);
if (playing && first)
{
/* the calling sequence is:
* Start() - paused
* SetPosition() - which fails if not running
* SetSpeed() - to start playing
* so let's remember the initial jump position and later jump to it
*/
init_jump = position;
first = false;
return false;
}
int64_t pos = (position / 1000.0);
if (player && player->playback)
player->playback->Command(player, absolute ? PLAYBACK_SEEK_ABS : PLAYBACK_SEEK, (void *)&pos);
return true;
}
void cPlayback::FindAllPids(uint16_t *apids, unsigned short *ac3flags, uint16_t *numpida, std::string *language)
{
hal_info("%s\n", __func__);
const int max_numpida = 40;//MAX_PLAYBACK_PIDS defined in neutrino movieplayer.h
*numpida = 0;
if (player && player->manager && player->manager->audio)
{
char **TrackList = NULL;
player->manager->audio->Command(player, MANAGER_LIST, &TrackList);
if (TrackList != NULL)
{
printf("AudioTrack List\n");
int i = 0, j = 0;
for (i = 0, j = 0; TrackList[i] != NULL; i += 2, j++)
{
printf("\t%s - %s\n", TrackList[i], TrackList[i + 1]);
if (j < max_numpida)
{
int _pid = 0;
std::string _lang ;
std::istringstream iss(TrackList[i]) ;
iss >> _pid;
iss >> _lang;
if (_pid && !_lang.empty())
{
apids[j] = _pid;
// atUnknown, atMPEG, atMP3, atAC3, atDTS, atAAC, atPCM, atOGG, atFLAC
if (!strncmp("A_MPEG/L3", TrackList[i + 1], 9))
ac3flags[j] = 3;
if (!strncmp("A_MP3", TrackList[i + 1], 5))
ac3flags[j] = 4;
else if (!strncmp("A_AC3", TrackList[i + 1], 5))
ac3flags[j] = 1;
else if (!strncmp("A_EAC3", TrackList[i + 1], 6))
ac3flags[j] = 7;
else if (!strncmp("A_DTS", TrackList[i + 1], 5))
ac3flags[j] = 6;
else if (!strncmp("A_AAC", TrackList[i + 1], 5))
ac3flags[j] = 5;
else if (!strncmp("A_PCM", TrackList[i + 1], 5))
ac3flags[j] = 0; //todo
else if (!strncmp("A_VORBIS", TrackList[i + 1], 8))
ac3flags[j] = 0; //todo
else if (!strncmp("A_FLAC", TrackList[i + 1], 6))
ac3flags[j] = 0; //todo
else
ac3flags[j] = 0; //todo
std::string _language = "";
_language += _lang;
_language += " - ";
_language += "(";
_language += TrackList[i + 1];
_language += ")";
language[j] = _language;
}
}
free(TrackList[i]);
free(TrackList[i + 1]);
}
free(TrackList);
*numpida = j;
}
}
}
void cPlayback::FindAllSubtitlePids(int *pids, unsigned int *numpids, std::string *language)
{
hal_info("%s\n", __func__);
int max_numpids = *numpids;
*numpids = 0;
if (player && player->manager && player->manager->subtitle)
{
char **TrackList = NULL;
player->manager->subtitle->Command(player, MANAGER_LIST, &TrackList);
if (TrackList != NULL)
{
printf("SubtitleTrack List\n");
int i = 0, j = 0;
for (i = 0, j = 0; TrackList[i] != NULL; i += 2, j++)
{
printf("\t%s - %s\n", TrackList[i], TrackList[i + 1]);
if (j < max_numpids)
{
int _pid = 0;
std::string _lang ;
std::istringstream iss(TrackList[i]) ;
iss >> _pid;
iss >> _lang;
if (_pid && !_lang.empty())
{
pids[j] = _pid;
language[j] = _lang;
}
}
free(TrackList[i]);
free(TrackList[i + 1]);
}
free(TrackList);
*numpids = j;
}
}
}
void cPlayback::FindAllTeletextsubtitlePids(int */*pids*/, unsigned int *numpids, std::string */*language*/, int */*mags*/, int */*pages*/)
{
hal_info("%s\n", __func__);
//int max_numpids = *numpids;
*numpids = 0;
/* if (player && player->manager && player->manager->teletext)
{
char **TrackList = NULL;
player->manager->teletext->Command(player, MANAGER_LIST, &TrackList);
if (TrackList != NULL)
{
printf("Teletext List\n");
int i = 0, j = 0;
for (i = 0, j = 0; TrackList[i] != NULL; i += 2)
{
int type = 0;
printf("\t%s - %s\n", TrackList[i], TrackList[i + 1]);
if (j < max_numpids)
{
int _pid;
if (2 != sscanf(TrackList[i], "%d %*s %d %*d %*d", &_pid, &type))
continue;
if (type != 2 && type != 5) // return subtitles only
continue;
pids[j] = _pid;
language[j] = std::string(TrackList[i]);
j++;
}
free(TrackList[i]);
free(TrackList[i + 1]);
}
free(TrackList);
*numpids = j;
}
} */
}
int cPlayback::GetTeletextPid(void)
{
hal_info("%s\n", __func__);
int pid = -1;
/* if (player && player->manager && player->manager->teletext)
{
char **TrackList = NULL;
player->manager->teletext->Command(player, MANAGER_LIST, &TrackList);
if (TrackList != NULL)
{
printf("Teletext List\n");
int i = 0;
for (i = 0; TrackList[i] != NULL; i += 2)
{
int type = 0;
printf("\t%s - %s\n", TrackList[i], TrackList[i+1]);
if (pid < 0)
{
if (2 != sscanf(TrackList[i], "%*d %d %*s %d %*d %*d", &pid, &type))
continue;
if (type != 1)
pid = -1;
}
free(TrackList[i]);
free(TrackList[i + 1]);
}
free(TrackList);
}
} */
printf("teletext pid id %d (0x%x)\n", pid, pid);
return pid;
}
/* dummy functions for subtitles */
void cPlayback::FindAllSubs(int * /*pids*/, unsigned int * /*supp*/, unsigned int *num, std::string * /*lang*/)
{
*num = 0;
}
bool cPlayback::SelectSubtitles(int /*pid*/, std::string /*charset*/)
{
return false;
}
void cPlayback::GetChapters(std::vector<int> &positions, std::vector<std::string> &titles)
{
positions.clear();
titles.clear();
if (player && player->manager && player->manager->chapter)
{
char **TrackList = NULL;
player->manager->chapter->Command(player, MANAGER_LIST, &TrackList);
if (TrackList != NULL)
{
printf("%s: Chapter List\n", __func__);
int i = 0;
for (i = 0; TrackList[i] != NULL; i += 2)
{
printf("\t%s - %s\n", TrackList[i], TrackList[i + 1]);
int pos = atoi(TrackList[i]);
std::string title(TrackList[i + 1]);
positions.push_back(pos);
titles.push_back(title);
free(TrackList[i]);
free(TrackList[i + 1]);
}
free(TrackList);
}
}
}
void cPlayback::GetTitles(std::vector<int> &playlists, std::vector<std::string> &titles, int &current)
{
playlists.clear();
titles.clear();
current = 0;
}
void cPlayback::SetTitle(int /*title*/)
{
}
void cPlayback::GetMetadata(std::vector<std::string> &keys, std::vector<std::string> &values)
{
keys.clear();
values.clear();
char **metadata = NULL;
if (player && player->playback)
{
player->playback->Command(player, PLAYBACK_METADATA, &metadata);
if (metadata)
{
for (char **m = metadata; *m;)
{
keys.push_back(*m);
free(*m++);
values.push_back(*m);
free(*m++);
}
free(metadata);
}
}
}
cPlayback::cPlayback(int num __attribute__((unused)))
{
hal_info("%s\n", __func__);
playing = false;
decoders_closed = false;
first = false;
player = NULL;
}
cPlayback::~cPlayback()
{
hal_info("%s\n", __func__);
RequestAbort();
mutex.lock();
if (player)
{
free(player);
player = NULL;
}
mutex.unlock();
}
void cPlayback::RequestAbort()
{
if (player && player->playback)
{
hal_info("%s\n", __func__);
mutex.lock();
if (player && player->playback && player->playback->isPlaying)
{
Stop();
player->playback->abortRequested = 1;
}
else if(player->playback->isHttp && !player->playback->isPlaying &&!player->playback->abortRequested)
{
player->playback->abortRequested = 1;
}
mutex.unlock();
}
}
bool cPlayback::IsPlaying()
{
if (player && player->playback)
return player->playback->isPlaying;
return false;
}
uint64_t cPlayback::GetReadCount()
{
if (player && player->playback)
{
return player->playback->readCount;
}
return 0;
}
AVFormatContext *cPlayback::GetAVFormatContext()
{
return NULL;
}
void cPlayback::ReleaseAVFormatContext()
{
}
#if 0
bool cPlayback::IsPlaying(void) const
{
hal_info("%s\n", __func__);
/* konfetti: there is no event/callback mechanism in libeplayer2
* so in case of ending playback we have no information on a
* terminated stream currently (or did I oversee it?).
* So let's ask the player the state.
*/
if (playing)
{
return player->playback->isPlaying;
}
return playing;
}
#endif

View File

@@ -0,0 +1,91 @@
#ifndef __PLAYBACK_LIBEPLAYER3_H__
#define __PLAYBACK_LIBEPLAYER3_H__
#include <string>
#include <vector>
#include <OpenThreads/Mutex>
typedef enum
{
PLAYMODE_TS = 0,
PLAYMODE_FILE
} playmode_t;
struct AVFormatContext;
class cPlayback
{
friend class CStreamInfo2;
private:
static OpenThreads::Mutex mutex;
bool enabled;
bool playing, first;
bool no_probe;
bool got_vpts_ts;
int nPlaybackSpeed;
int mAudioStream;
int mSubtitleStream;
int mTeletextStream;
int64_t vpts_ts;
bool Stop(void);
bool decoders_closed;
playmode_t pm;
std::string fn_ts;
std::string fn_xml;
off64_t last_size;
int init_jump;
public:
cPlayback(int num = 0);
~cPlayback();
bool Open(playmode_t PlayMode);
void Close(void);
bool Start(char *filename, int vpid, int vtype, int apid, int ac3, int duration, std::string headers = "", std::string filename2 = "");
bool Start(std::string filename, std::string headers = "", std::string filename2 = "");
bool SetAPid(int pid, bool ac3 = false);
bool SetVPid(int /*pid*/);
bool SetSubtitlePid(int pid);
bool SetTeletextPid(int pid);
int GetAPid(void) { return mAudioStream; }
int GetVPid(void) { return 0; }
int GetSubtitlePid(void) { return mSubtitleStream; }
int GetTeletextPid(void);
bool SetSpeed(int speed);
bool GetSpeed(int &speed) const;
bool GetPosition(int &position, int &duration);
void GetPts(uint64_t &pts);
bool SetPosition(int position, bool absolute = false);
void FindAllPids(uint16_t *apids, unsigned short *ac3flags, uint16_t *numpida, std::string *language);
void FindAllSubs(int *pids, unsigned int *supported, unsigned int *numpida, std::string *language);
void FindAllSubs(uint16_t *pids, unsigned short *supported, uint16_t *numpida, std::string *language) { FindAllSubs((int*) pids, (unsigned int*) supported, (unsigned int*) numpida, language); };
bool SelectSubtitles(int pid, std::string charset = "");
void FindAllSubtitlePids(int *pids, unsigned int *numpids, std::string *language);
void FindAllTeletextsubtitlePids(int */*pids*/, unsigned int *numpidt, std::string */*tlanguage*/, int */*mags*/, int */*pages*/);
void RequestAbort(void);
bool IsPlaying(void);
uint64_t GetReadCount(void);
void GetChapters(std::vector<int> &positions, std::vector<std::string> &titles);
void GetMetadata(std::vector<std::string> &keys, std::vector<std::string> &values);
AVFormatContext *GetAVFormatContext();
void ReleaseAVFormatContext();
void GetTitles(std::vector<int> &playlists, std::vector<std::string> &titles, int &current);
void SetTitle(int title);
#if 0
// Functions that are not used by movieplayer.cpp:
bool GetOffset(off64_t &offset);
bool IsPlaying(void) const;
bool IsEnabled(void) const;
void *GetHandle(void);
void *GetDmHandle(void);
int GetCurrPlaybackSpeed(void) const;
void PlaybackNotify(int Event, void *pData, void *pTag);
void DMNotify(int Event, void *pTsBuf, void *Tag);
#endif
};
#endif // __PLAYBACK_LIBEPLAYER3_H__

403
libarmbox/record.cpp Normal file
View File

@@ -0,0 +1,403 @@
/*
* (C)
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <errno.h>
#include <fcntl.h>
#include <malloc.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/prctl.h>
#include <inttypes.h>
#include <cstdio>
#include <cstring>
#include <pthread.h>
#include <aio.h>
#include "record_lib.h"
#include "hal_debug.h"
#define hal_debug(args...) _hal_debug(HAL_DEBUG_RECORD, this, args)
#define hal_info(args...) _hal_info(HAL_DEBUG_RECORD, this, args)
/* helper function to call the cpp thread loop */
void *execute_record_thread(void *c)
{
cRecord *obj = (cRecord *)c;
obj->RecordThread();
return NULL;
}
void *execute_writer_thread(void *c)
{
cRecord *obj = (cRecord *)c;
obj->WriterThread();
return NULL;
}
cRecord::cRecord(int num, int bs_dmx, int bs)
{
hal_info("%s %d\n", __func__, num);
dmx = NULL;
record_thread_running = false;
file_fd = -1;
exit_flag = RECORD_STOPPED;
dmx_num = num;
bufsize = bs;
bufsize_dmx = bs_dmx;
failureCallback = NULL;
failureData = NULL;
}
cRecord::~cRecord()
{
hal_info("%s: calling ::Stop()\n", __func__);
Stop();
hal_info("%s: end\n", __func__);
}
bool cRecord::Open(void)
{
hal_info("%s\n", __func__);
exit_flag = RECORD_STOPPED;
return true;
}
#if 0
// unused
void cRecord::Close(void)
{
hal_info("%s: \n", __func__);
}
#endif
bool cRecord::Start(int fd, unsigned short vpid, unsigned short *apids, int numpids, uint64_t)
{
hal_info("%s: fd %d, vpid 0x%03x\n", __func__, fd, vpid);
int i;
if (!dmx)
dmx = new cDemux(dmx_num);
dmx->Open(DMX_TP_CHANNEL, NULL, bufsize_dmx);
dmx->pesFilter(vpid);
for (i = 0; i < numpids; i++)
dmx->addPid(apids[i]);
file_fd = fd;
exit_flag = RECORD_RUNNING;
if (posix_fadvise(file_fd, 0, 0, POSIX_FADV_DONTNEED))
perror("posix_fadvise");
i = pthread_create(&record_thread, 0, execute_record_thread, this);
if (i != 0)
{
exit_flag = RECORD_FAILED_READ;
errno = i;
hal_info("%s: error creating thread! (%m)\n", __func__);
delete dmx;
dmx = NULL;
return false;
}
record_thread_running = true;
return true;
}
bool cRecord::Stop(void)
{
hal_info("%s\n", __func__);
if (exit_flag != RECORD_RUNNING)
hal_info("%s: status not RUNNING? (%d)\n", __func__, exit_flag);
exit_flag = RECORD_STOPPED;
if (record_thread_running)
pthread_join(record_thread, NULL);
record_thread_running = false;
/* We should probably do that from the destructor... */
if (!dmx)
hal_info("%s: dmx == NULL?\n", __func__);
else
delete dmx;
dmx = NULL;
if (file_fd != -1)
close(file_fd);
else
hal_info("%s: file_fd not open??\n", __func__);
file_fd = -1;
return true;
}
bool cRecord::ChangePids(unsigned short /*vpid*/, unsigned short *apids, int numapids)
{
std::vector<pes_pids> pids;
int j;
bool found;
unsigned short pid;
hal_info("%s\n", __func__);
if (!dmx) {
hal_info("%s: DMX = NULL\n", __func__);
return false;
}
pids = dmx->pesfds;
/* the first PID is the video pid, so start with the second PID... */
for (std::vector<pes_pids>::const_iterator i = pids.begin() + 1; i != pids.end(); ++i) {
found = false;
pid = (*i).pid;
for (j = 0; j < numapids; j++) {
if (pid == apids[j]) {
found = true;
break;
}
}
if (!found)
dmx->removePid(pid);
}
for (j = 0; j < numapids; j++) {
found = false;
for (std::vector<pes_pids>::const_iterator i = pids.begin() + 1; i != pids.end(); ++i) {
if ((*i).pid == apids[j]) {
found = true;
break;
}
}
if (!found)
dmx->addPid(apids[j]);
}
return true;
}
bool cRecord::AddPid(unsigned short pid)
{
std::vector<pes_pids> pids;
hal_info("%s: \n", __func__);
if (!dmx) {
hal_info("%s: DMX = NULL\n", __func__);
return false;
}
pids = dmx->pesfds;
for (std::vector<pes_pids>::const_iterator i = pids.begin(); i != pids.end(); ++i) {
if ((*i).pid == pid)
return true; /* or is it an error to try to add the same PID twice? */
}
return dmx->addPid(pid);
}
void cRecord::WriterThread()
{
char threadname[17];
strncpy(threadname, "WriterThread", sizeof(threadname));
threadname[16] = 0;
prctl (PR_SET_NAME, (unsigned long)&threadname);
unsigned int chunk = 0;
while (!sem_wait(&sem)) {
if (!io_len[chunk]) // empty, assume end of recording
return;
unsigned char *p_buf = io_buf[chunk];
size_t p_len = io_len[chunk];
while (p_len) {
ssize_t written = write(file_fd, p_buf, p_len);
if (written < 0)
break;
p_len -= written;
p_buf += written;
}
if (posix_fadvise(file_fd, 0, 0, POSIX_FADV_DONTNEED))
perror("posix_fadvise");
chunk++;
chunk %= RECORD_WRITER_CHUNKS;
}
}
void cRecord::RecordThread()
{
hal_info("%s: begin\n", __func__);
char threadname[17];
strncpy(threadname, "RecordThread", sizeof(threadname));
threadname[16] = 0;
prctl (PR_SET_NAME, (unsigned long)&threadname);
int readsize = bufsize / 16;
int buf_pos = 0;
int count = 0;
int queued = 0;
uint8_t *buf;
struct aiocb a;
buf = (uint8_t *)malloc(bufsize);
hal_info("BUFSIZE=0x%x READSIZE=0x%x\n", bufsize, readsize);
if (!buf)
{
exit_flag = RECORD_FAILED_MEMORY;
hal_info("%s: unable to allocate buffer! (out of memory)\n", __func__);
if (failureCallback)
failureCallback(failureData);
hal_info("%s: end\n", __func__);
pthread_exit(NULL);
}
int val = fcntl(file_fd, F_GETFL);
if (fcntl(file_fd, F_SETFL, val|O_APPEND))
hal_info("%s: O_APPEND? (%m)\n", __func__);
memset(&a, 0, sizeof(a));
a.aio_fildes = file_fd;
a.aio_sigevent.sigev_notify = SIGEV_NONE;
dmx->Start();
int overflow_count = 0;
bool overflow = false;
int r = 0;
while (exit_flag == RECORD_RUNNING)
{
if (buf_pos < bufsize)
{
if (overflow_count) {
hal_info("%s: Overflow cleared after %d iterations\n", __func__, overflow_count);
overflow_count = 0;
}
int toread = bufsize - buf_pos;
if (toread > readsize)
toread = readsize;
ssize_t s = dmx->Read(buf + buf_pos, toread, 50);
hal_debug("%s: buf_pos %6d s %6d / %6d\n", __func__,
buf_pos, (int)s, bufsize - buf_pos);
if (s < 0)
{
if (errno != EAGAIN && (errno != EOVERFLOW || !overflow))
{
hal_info("%s: read failed: %m\n", __func__);
exit_flag = RECORD_FAILED_READ;
state = REC_STATUS_OVERFLOW;
break;
}
}
else
{
overflow = false;
buf_pos += s;
if (count > 100)
{
if (buf_pos < bufsize / 2)
continue;
}
else
{
count += 1;
}
}
}
else
{
if (!overflow)
overflow_count = 0;
overflow = true;
if (!(overflow_count % 10))
hal_info("%s: buffer full! Overflow? (%d)\n", __func__, ++overflow_count);
state = REC_STATUS_SLOW;
}
r = aio_error(&a);
if (r == EINPROGRESS)
{
hal_debug("%s: aio in progress, free: %d\n", __func__, bufsize - buf_pos);
continue;
}
// not calling aio_return causes a memory leak --martii
r = aio_return(&a);
if (r < 0)
{
exit_flag = RECORD_FAILED_FILE;
hal_debug("%s: aio_return = %d (%m)\n", __func__, r);
break;
}
else
hal_debug("%s: aio_return = %d, free: %d\n", __func__, r, bufsize - buf_pos);
if (posix_fadvise(file_fd, 0, 0, POSIX_FADV_DONTNEED))
perror("posix_fadvise");
if (queued)
{
memmove(buf, buf + queued, buf_pos - queued);
buf_pos -= queued;
}
queued = buf_pos;
a.aio_buf = buf;
a.aio_nbytes = queued;
r = aio_write(&a);
if (r)
{
hal_info("%s: aio_write %d (%m)\n", __func__, r);
exit_flag = RECORD_FAILED_FILE;
break;
}
}
dmx->Stop();
while (true) /* write out the unwritten buffer content */
{
hal_debug("%s: run-out write, buf_pos %d\n", __func__, buf_pos);
r = aio_error(&a);
if (r == EINPROGRESS)
{
usleep(50000);
continue;
}
r = aio_return(&a);
if (r < 0)
{
exit_flag = RECORD_FAILED_FILE;
hal_info("%s: aio_result: %d (%m)\n", __func__, r);
break;
}
if (!queued)
break;
memmove(buf, buf + queued, buf_pos - queued);
buf_pos -= queued;
queued = buf_pos;
a.aio_buf = buf;
a.aio_nbytes = queued;
r = aio_write(&a);
}
free(buf);
#if 0
// TODO: do we need to notify neutrino about failing recording?
CEventServer eventServer;
eventServer.registerEvent2(NeutrinoMessages::EVT_RECORDING_ENDED, CEventServer::INITID_NEUTRINO, "/tmp/neutrino.sock");
stream2file_status2_t s;
s.status = exit_flag;
strncpy(s.filename,basename(myfilename),512);
s.filename[511] = '\0';
strncpy(s.dir,dirname(myfilename),100);
s.dir[99] = '\0';
eventServer.sendEvent(NeutrinoMessages::EVT_RECORDING_ENDED, CEventServer::INITID_NEUTRINO, &s, sizeof(s));
printf("[stream2file]: pthreads exit code: %i, dir: '%s', filename: '%s' myfilename: '%s'\n", exit_flag, s.dir, s.filename, myfilename);
#endif
if ((exit_flag != RECORD_STOPPED) && failureCallback)
failureCallback(failureData);
hal_info("%s: end\n", __func__);
pthread_exit(NULL);
}
int cRecord::GetStatus()
{
return (exit_flag == RECORD_STOPPED) ? REC_STATUS_STOPPED : REC_STATUS_OK;
}
void cRecord::ResetStatus()
{
return;
}

57
libarmbox/record_lib.h Normal file
View File

@@ -0,0 +1,57 @@
#ifndef __RECORD_LIB_H__
#define __RECORD_LIB_H__
#include <semaphore.h>
#include "dmx_hal.h"
#define REC_STATUS_OK 0
#define REC_STATUS_SLOW 1
#define REC_STATUS_OVERFLOW 2
#define REC_STATUS_STOPPED 4
typedef enum {
RECORD_RUNNING,
RECORD_STOPPED,
RECORD_FAILED_READ, /* failed to read from DMX */
RECORD_FAILED_OVERFLOW, /* cannot write fast enough */
RECORD_FAILED_FILE, /* cannot write to file */
RECORD_FAILED_MEMORY /* out of memory */
} record_state_t;
class cRecord
{
private:
int file_fd;
int dmx_num;
cDemux *dmx;
pthread_t record_thread;
bool record_thread_running;
record_state_t exit_flag;
int state;
int bufsize;
int bufsize_dmx;
void (*failureCallback)(void *);
void *failureData;
sem_t sem;
#define RECORD_WRITER_CHUNKS 16
unsigned char *io_buf[RECORD_WRITER_CHUNKS];
size_t io_len[RECORD_WRITER_CHUNKS];
public:
cRecord(int num = 0, int bs_dmx = 2048 * 1024, int bs = 4096 * 1024);
void setFailureCallback(void (*f)(void *), void *d) { failureCallback = f; failureData = d; }
~cRecord();
bool Open();
bool Start(int fd, unsigned short vpid, unsigned short *apids, int numapids, uint64_t ch = 0);
bool Stop(void);
bool AddPid(unsigned short pid);
int GetStatus();
void ResetStatus();
bool ChangePids(unsigned short vpid, unsigned short *apids, int numapids);
void RecordThread();
void WriterThread();
};
#endif // __RECORD_LIB_H__

1281
libarmbox/video.cpp Normal file

File diff suppressed because it is too large Load Diff

259
libarmbox/video_lib.h Normal file
View File

@@ -0,0 +1,259 @@
#ifndef __VIDEO_LIB_H__
#define __VIDEO_LIB_H__
#include <linux/dvb/video.h>
#include "cs_types.h"
#include "dmx_hal.h"
typedef struct cs_vs_format_t
{
char format[16];
} cs_vs_format_struct_t;
typedef enum {
ANALOG_SD_RGB_CINCH = 0x00,
ANALOG_SD_YPRPB_CINCH,
ANALOG_HD_RGB_CINCH,
ANALOG_HD_YPRPB_CINCH,
ANALOG_SD_RGB_SCART = 0x10,
ANALOG_SD_YPRPB_SCART,
ANALOG_HD_RGB_SCART,
ANALOG_HD_YPRPB_SCART,
ANALOG_SCART_MASK = 0x10
} analog_mode_t;
typedef enum {
COLORFORMAT_RGB = 0x10, // keep compatible with analog_mode_t
COLORFORMAT_YUV,
COLORFORMAT_CVBS,
COLORFORMAT_SVIDEO,
COLORFORMAT_HDMI_AUTO,
COLORFORMAT_HDMI_RGB,
COLORFORMAT_HDMI_YCBCR444,
COLORFORMAT_HDMI_YCBCR422,
COLORFORMAT_HDMI_YCBCR420
} COLOR_FORMAT;
typedef enum {
VIDEO_FORMAT_MPEG2 = 0,
VIDEO_FORMAT_MPEG4_H264,
VIDEO_FORMAT_VC1,
VIDEO_FORMAT_JPEG,
VIDEO_FORMAT_GIF,
VIDEO_FORMAT_PNG,
VIDEO_FORMAT_MPEG4_H265,
VIDEO_FORMAT_AVS = 16
} VIDEO_FORMAT;
typedef enum {
VIDEO_SD = 0,
VIDEO_HD,
VIDEO_120x60i,
VIDEO_320x240i,
VIDEO_1440x800i,
VIDEO_360x288i
} VIDEO_DEFINITION;
typedef enum {
VIDEO_FRAME_RATE_23_976 = 0,
VIDEO_FRAME_RATE_24,
VIDEO_FRAME_RATE_25,
VIDEO_FRAME_RATE_29_97,
VIDEO_FRAME_RATE_30,
VIDEO_FRAME_RATE_50,
VIDEO_FRAME_RATE_59_94,
VIDEO_FRAME_RATE_60
} VIDEO_FRAME_RATE;
typedef enum {
DISPLAY_AR_1_1,
DISPLAY_AR_4_3,
DISPLAY_AR_14_9,
DISPLAY_AR_16_9,
DISPLAY_AR_20_9,
DISPLAY_AR_RAW
} DISPLAY_AR;
typedef enum {
/* FIX for HD51 mix-up of letterbox / panscan
Standard is 1. PANSCAN 2. LETTERBOX
If next drivers are correct please revert
this and pzapit.cpp */
DISPLAY_AR_MODE_LETTERBOX = 0,
DISPLAY_AR_MODE_PANSCAN,
DISPLAY_AR_MODE_NONE,
DISPLAY_AR_MODE_PANSCAN2
} DISPLAY_AR_MODE;
typedef enum {
VIDEO_DB_DR_NEITHER = 0,
VIDEO_DB_ON,
VIDEO_DB_DR_BOTH
} VIDEO_DB_DR;
typedef enum {
VIDEO_PLAY_STILL = 0,
VIDEO_PLAY_CLIP,
VIDEO_PLAY_TRICK,
VIDEO_PLAY_MOTION,
VIDEO_PLAY_MOTION_NO_SYNC
} VIDEO_PLAY_MODE;
typedef enum {
VIDEO_STD_NTSC,
VIDEO_STD_SECAM,
VIDEO_STD_PAL,
VIDEO_STD_480P,
VIDEO_STD_576P,
VIDEO_STD_720P60,
VIDEO_STD_1080I60,
VIDEO_STD_720P50,
VIDEO_STD_1080I50,
VIDEO_STD_1080P30,
VIDEO_STD_1080P24,
VIDEO_STD_1080P25,
VIDEO_STD_1080P50,
VIDEO_STD_1080P60,
VIDEO_STD_1080P2397,
VIDEO_STD_1080P2997,
VIDEO_STD_2160P24,
VIDEO_STD_2160P25,
VIDEO_STD_2160P30,
VIDEO_STD_2160P50,
VIDEO_STD_AUTO,
VIDEO_STD_MAX = VIDEO_STD_AUTO
} VIDEO_STD;
typedef enum {
VIDEO_HDMI_CEC_MODE_OFF = 0,
VIDEO_HDMI_CEC_MODE_TUNER = 3,
VIDEO_HDMI_CEC_MODE_RECORDER = 1
} VIDEO_HDMI_CEC_MODE;
typedef enum
{
VIDEO_CONTROL_BRIGHTNESS = 0,
VIDEO_CONTROL_CONTRAST,
VIDEO_CONTROL_SATURATION,
VIDEO_CONTROL_HUE,
VIDEO_CONTROL_SHARPNESS,
VIDEO_CONTROL_BLOCK_NOISE_REDUCTION,
VIDEO_CONTROL_MOSQUITO_NOISE_REDUCTION,
VIDEO_CONTROL_DIGITAL_CONTOUR_REMOVAL,
VIDEO_CONTROL_AUTO_FLESH,
VIDEO_CONTROL_GREEN_BOOST,
VIDEO_CONTROL_BLUE_BOOST,
VIDEO_CONTROL_DYNAMIC_CONTRAST,
VIDEO_CONTROL_SCALER_SHARPNESS,
VIDEO_CONTROL_ZAPPING_MODE,
VIDEO_CONTROL_MAX = VIDEO_CONTROL_SHARPNESS
} VIDEO_CONTROL;
class cDemux;
class cPlayback;
class cVideo
{
friend class cPlayback;
friend class cDemux;
private:
/* video device */
int fd;
unsigned int devnum;
/* apparently we cannot query the driver's state
=> remember it */
video_play_state_t playstate;
int /*vidDispMode_t*/ croppingMode;
int /*vidOutFmt_t*/ outputformat;
VIDEO_FORMAT StreamType;
VIDEO_DEFINITION VideoDefinition;
DISPLAY_AR DisplayAR;
VIDEO_PLAY_MODE SyncMode;
DISPLAY_AR_MODE ARMode;
VIDEO_DB_DR eDbDr;
DISPLAY_AR PictureAR;
VIDEO_FRAME_RATE FrameRate;
int video_standby;
int brightness;
int contrast;
int saturation;
int hue;
int sharpness;
int block_noise_reduction;
int mosquito_noise_reduction;
int digital_contour_removal;
int auto_flesh;
int green_boost;
int blue_boost;
int dynamic_contrast;
int scaler_sharpness;
int zapping_mode;
/* used internally by dmx */
int64_t GetPTS(void);
public:
/* constructor & destructor */
cVideo(int mode, void *, void *, unsigned int unit = 0);
~cVideo(void);
/* used internally by playback */
void openDevice(void);
void closeDevice(void);
void * GetTVEnc() { return NULL; };
void * GetTVEncSD() { return NULL; };
/* aspect ratio */
int getAspectRatio(void);
void getPictureInfo(int &width, int &height, int &rate);
int setAspectRatio(int aspect, int mode);
/* cropping mode */
int setCroppingMode(int x = 0 /*vidDispMode_t x = VID_DISPMODE_NORM*/);
/* get play state */
int getPlayState(void);
/* blank on freeze */
int getBlank(void);
int setBlank(int enable);
/* change video play state. Parameters are all unused. */
int Start(void *PcrChannel = NULL, unsigned short PcrPid = 0, unsigned short VideoPid = 0, void *x = NULL);
int Stop(bool blank = true);
bool Pause(void);
/* get video system infos */
int GetVideoSystem(void);
/* when system = -1 then use current video system */
void GetVideoSystemFormatName(cs_vs_format_t* format, int system);
/* set video_system */
int SetVideoSystem(int video_system, bool remember = true);
int SetStreamType(VIDEO_FORMAT type);
void SetSyncMode(AVSYNC_TYPE mode);
bool SetCECMode(VIDEO_HDMI_CEC_MODE);
void SetCECAutoView(bool);
void SetCECAutoStandby(bool);
bool ShowPicture(const char * fname);
void StopPicture();
void Standby(unsigned int bOn);
void Pig(int x, int y, int w, int h, int osd_w = 1064, int osd_h = 600, int startx = 0, int starty = 0, int endx = 1279, int endy = 719);
void SetControl(int, int);
void setContrast(int val);
void SetVideoMode(analog_mode_t mode);
void SetDBDR(int) { return; };
void SetAudioHandle(void *) { return; };
void SetAutoModes(int [VIDEO_STD_MAX]) { return; };
int OpenVBI(int) { return 0; };
int CloseVBI(void) { return 0; };
int StartVBI(unsigned short) { return 0; };
int StopVBI(void) { return 0; };
void SetDemux(cDemux *dmx);
void SetColorFormat(COLOR_FORMAT color_format);
bool GetScreenImage(unsigned char * &data, int &xres, int &yres, bool get_video = true, bool get_osd = false, bool scale_to_video = false);
};
#endif // __VIDEO_LIB_H__

View File

@@ -9,70 +9,69 @@
#include <proc_tools.h>
#include "audio_hal.h"
#include "lt_debug.h"
#include "audio_lib.h"
#include "hal_debug.h"
#define AUDIO_DEVICE "/dev/dvb/adapter0/audio0"
#define lt_debug(args...) _lt_debug(TRIPLE_DEBUG_AUDIO, this, args)
#define lt_info(args...) _lt_info(TRIPLE_DEBUG_AUDIO, this, args)
#define hal_debug(args...) _hal_debug(HAL_DEBUG_AUDIO, this, args)
#define hal_info(args...) _hal_info(HAL_DEBUG_AUDIO, this, args)
#include <linux/soundcard.h>
cAudio * audioDecoder = NULL;
typedef struct audio_pdata
{
int fd;
int clipfd;
int mixer_fd;
int mixer_num;
} audio_pdata;
#define P ((audio_pdata *)pdata)
cAudio::cAudio(void *, void *, void *)
{
pdata = calloc(1, sizeof(audio_pdata));
P->clipfd = -1;
P->mixer_fd = -1;
P->fd = open(AUDIO_DEVICE, O_RDONLY|O_CLOEXEC);
if (P->fd < 0)
lt_info("%s: open failed (%m)\n", __func__);
muted = false;
fd = -1;
clipfd = -1;
mixer_fd = -1;
openDevice();
Muted = false;
}
cAudio::~cAudio(void)
{
if (P->fd >= 0) {
ioctl(P->fd, AUDIO_CONTINUE); /* enigma2 also does CONTINUE before close... */
close(P->fd);
P->fd = -1;
closeDevice();
}
void cAudio::openDevice(void)
{
hal_debug("%s\n", __func__);
if (fd < 0)
{
if ((fd = open(AUDIO_DEVICE, O_RDONLY|O_CLOEXEC)) < 0)
hal_info("openDevice: open failed (%m)\n");
do_mute(true, false);
}
if (P->clipfd >= 0)
close(P->clipfd);
if (P->mixer_fd >= 0)
close(P->mixer_fd);
free(pdata);
else
hal_info("openDevice: already open (fd = %d)\n", fd);
}
int cAudio::mute(void)
void cAudio::closeDevice(void)
{
return SetMute(true);
hal_debug("%s\n", __func__);
ioctl(fd, AUDIO_CONTINUE); /* enigma2 also does CONTINUE before close... */
if (fd >= 0)
close(fd);
fd = -1;
if (clipfd >= 0)
close(clipfd);
clipfd = -1;
if (mixer_fd >= 0)
close(mixer_fd);
mixer_fd = -1;
}
int cAudio::unmute(void)
int cAudio::do_mute(bool enable, bool remember)
{
return SetMute(false);
}
hal_debug("%s(%d, %d)\n", __func__, enable, remember);
int cAudio::SetMute(bool enable)
{
lt_debug("%s(%d)\n", __func__, enable);
muted = enable;
if (remember)
Muted = enable;
#if 0
/* does not work? */
if (ioctl(fd, AUDIO_SET_MUTE, enable) < 0 )
lt_info("%s: AUDIO_SET_MUTE failed (%m)\n", __func__);
hal_info("%s: AUDIO_SET_MUTE failed (%m)\n", __func__);
#else
char s[2] = { 0, 0 };
s[0] = '0' + (int)enable;
@@ -94,17 +93,17 @@ int map_volume(const int volume)
int cAudio::setVolume(unsigned int left, unsigned int right)
{
lt_debug("%s(%d, %d)\n", __func__, left, right);
hal_debug("%s(%d, %d)\n", __func__, left, right);
volume = (left + right) / 2;
if (P->clipfd != -1 && P->mixer_fd != -1) {
if (clipfd != -1 && mixer_fd != -1) {
int tmp = 0;
/* not sure if left / right is correct here, but it is always the same anyways ;-) */
if (! muted)
if (! Muted)
tmp = left << 8 | right;
int ret = ioctl(P->mixer_fd, MIXER_WRITE(P->mixer_num), &tmp);
int ret = ioctl(mixer_fd, MIXER_WRITE(mixer_num), &tmp);
if (ret == -1)
lt_info("%s: MIXER_WRITE(%d),%04x: %m\n", __func__, P->mixer_num, tmp);
hal_info("%s: MIXER_WRITE(%d),%04x: %m\n", __func__, mixer_num, tmp);
return ret;
}
@@ -112,26 +111,26 @@ int cAudio::setVolume(unsigned int left, unsigned int right)
mixer.volume_left = map_volume(left);
mixer.volume_right = map_volume(right);
if (ioctl(P->fd, AUDIO_SET_MIXER, &mixer) < 0)
lt_info("%s: AUDIO_SET_MIXER failed (%m)\n", __func__);
if (ioctl(fd, AUDIO_SET_MIXER, &mixer) < 0)
hal_info("%s: AUDIO_SET_MIXER failed (%m)\n", __func__);
return 0;
}
int cAudio::Start(void)
{
lt_debug("%s\n", __func__);
hal_debug("%s\n", __func__);
int ret;
ioctl(P->fd, AUDIO_CONTINUE);
ret = ioctl(P->fd, AUDIO_PLAY);
ioctl(fd, AUDIO_CONTINUE);
ret = ioctl(fd, AUDIO_PLAY);
return ret;
}
int cAudio::Stop(void)
{
lt_debug("%s\n", __func__);
ioctl(P->fd, AUDIO_STOP);
ioctl(P->fd, AUDIO_CONTINUE); /* no idea why we have to stop and then continue => enigma2 does it, too */
hal_debug("%s\n", __func__);
ioctl(fd, AUDIO_STOP);
ioctl(fd, AUDIO_CONTINUE); /* no idea why we have to stop and then continue => enigma2 does it, too */
return 0;
}
@@ -142,8 +141,8 @@ bool cAudio::Pause(bool /*Pcm*/)
void cAudio::SetSyncMode(AVSYNC_TYPE Mode)
{
lt_debug("%s %d\n", __func__, Mode);
ioctl(P->fd, AUDIO_SET_AV_SYNC, Mode);
hal_debug("%s %d\n", __func__, Mode);
ioctl(fd, AUDIO_SET_AV_SYNC, Mode);
};
//AUDIO_ENCODING_AC3
@@ -158,7 +157,8 @@ void cAudio::SetSyncMode(AVSYNC_TYPE Mode)
void cAudio::SetStreamType(AUDIO_FORMAT type)
{
int bypass = AUDIO_STREAMTYPE_MPEG;
lt_debug("%s %d\n", __func__, type);
hal_debug("%s %d\n", __func__, type);
StreamType = type;
switch (type)
{
@@ -175,8 +175,8 @@ void cAudio::SetStreamType(AUDIO_FORMAT type)
// Normaly the encoding should be set using AUDIO_SET_ENCODING
// But as we implemented the behavior to bypass (cause of e2) this is correct here
if (ioctl(P->fd, AUDIO_SET_BYPASS_MODE, bypass) < 0)
lt_info("%s: AUDIO_SET_BYPASS_MODE failed (%m)\n", __func__);
if (ioctl(fd, AUDIO_SET_BYPASS_MODE, bypass) < 0)
hal_info("%s: AUDIO_SET_BYPASS_MODE failed (%m)\n", __func__);
};
int cAudio::setChannel(int channel)
@@ -190,13 +190,13 @@ int cAudio::PrepareClipPlay(int ch, int srate, int bits, int little_endian)
unsigned int devmask, stereo, usable;
const char *dsp_dev = getenv("DSP_DEVICE");
const char *mix_dev = getenv("MIX_DEVICE");
lt_debug("%s ch %d srate %d bits %d le %d\n", __FUNCTION__, ch, srate, bits, little_endian);
if (P->clipfd >= 0) {
lt_info("%s: clipfd already opened (%d)\n", __func__, P->clipfd);
hal_debug("%s ch %d srate %d bits %d le %d\n", __FUNCTION__, ch, srate, bits, little_endian);
if (clipfd >= 0) {
hal_info("%s: clipfd already opened (%d)\n", __FUNCTION__, clipfd);
return -1;
}
P->mixer_num = -1;
P->mixer_fd = -1;
mixer_num = -1;
mixer_fd = -1;
/* a different DSP device can be given with DSP_DEVICE and MIX_DEVICE
* if this device cannot be opened, we fall back to the internal OSS device
* Example:
@@ -207,15 +207,15 @@ int cAudio::PrepareClipPlay(int ch, int srate, int bits, int little_endian)
*/
if ((!dsp_dev) || (access(dsp_dev, W_OK))) {
if (dsp_dev)
lt_info("%s: DSP_DEVICE is set (%s) but cannot be opened,"
hal_info("%s: DSP_DEVICE is set (%s) but cannot be opened,"
" fall back to /dev/dsp1\n", __func__, dsp_dev);
dsp_dev = "/dev/dsp1";
}
lt_info("%s: dsp_dev %s mix_dev %s\n", __func__, dsp_dev, mix_dev); /* NULL mix_dev is ok */
hal_info("%s: dsp_dev %s mix_dev %s\n", __func__, dsp_dev, mix_dev); /* NULL mix_dev is ok */
/* the tdoss dsp driver seems to work only on the second open(). really. */
P->clipfd = open(dsp_dev, O_WRONLY|O_CLOEXEC);
if (P->clipfd < 0) {
lt_info("%s open %s: %m\n", dsp_dev, __FUNCTION__);
clipfd = open(dsp_dev, O_WRONLY|O_CLOEXEC);
if (clipfd < 0) {
hal_info("%s open %s: %m\n", dsp_dev, __FUNCTION__);
return -1;
}
/* no idea if we ever get little_endian == 0 */
@@ -223,56 +223,56 @@ int cAudio::PrepareClipPlay(int ch, int srate, int bits, int little_endian)
fmt = AFMT_S16_BE;
else
fmt = AFMT_S16_LE;
if (ioctl(P->clipfd, SNDCTL_DSP_SETFMT, &fmt))
if (ioctl(clipfd, SNDCTL_DSP_SETFMT, &fmt))
perror("SNDCTL_DSP_SETFMT");
if (ioctl(P->clipfd, SNDCTL_DSP_CHANNELS, &ch))
if (ioctl(clipfd, SNDCTL_DSP_CHANNELS, &ch))
perror("SNDCTL_DSP_CHANNELS");
if (ioctl(P->clipfd, SNDCTL_DSP_SPEED, &srate))
if (ioctl(clipfd, SNDCTL_DSP_SPEED, &srate))
perror("SNDCTL_DSP_SPEED");
if (ioctl(P->clipfd, SNDCTL_DSP_RESET))
if (ioctl(clipfd, SNDCTL_DSP_RESET))
perror("SNDCTL_DSP_RESET");
if (!mix_dev)
return 0;
P->mixer_fd = open(mix_dev, O_RDWR|O_CLOEXEC);
if (P->mixer_fd < 0) {
lt_info("%s: open mixer %s failed (%m)\n", __func__, mix_dev);
mixer_fd = open(mix_dev, O_RDWR|O_CLOEXEC);
if (mixer_fd < 0) {
hal_info("%s: open mixer %s failed (%m)\n", __func__, mix_dev);
/* not a real error */
return 0;
}
if (ioctl(P->mixer_fd, SOUND_MIXER_READ_DEVMASK, &devmask) == -1) {
lt_info("%s: SOUND_MIXER_READ_DEVMASK %m\n", __func__);
if (ioctl(mixer_fd, SOUND_MIXER_READ_DEVMASK, &devmask) == -1) {
hal_info("%s: SOUND_MIXER_READ_DEVMASK %m\n", __func__);
devmask = 0;
}
if (ioctl(P->mixer_fd, SOUND_MIXER_READ_STEREODEVS, &stereo) == -1) {
lt_info("%s: SOUND_MIXER_READ_STEREODEVS %m\n", __func__);
if (ioctl(mixer_fd, SOUND_MIXER_READ_STEREODEVS, &stereo) == -1) {
hal_info("%s: SOUND_MIXER_READ_STEREODEVS %m\n", __func__);
stereo = 0;
}
usable = devmask & stereo;
if (usable == 0) {
lt_info("%s: devmask: %08x stereo: %08x, no usable dev :-(\n",
hal_info("%s: devmask: %08x stereo: %08x, no usable dev :-(\n",
__func__, devmask, stereo);
close(P->mixer_fd);
P->mixer_fd = -1;
close(mixer_fd);
mixer_fd = -1;
return 0; /* TODO: should we treat this as error? */
}
/* __builtin_popcount needs GCC, it counts the set bits... */
if (__builtin_popcount (usable) != 1) {
/* TODO: this code is not yet tested as I have only single-mixer devices... */
lt_info("%s: more than one mixer control: devmask %08x stereo %08x\n"
hal_info("%s: more than one mixer control: devmask %08x stereo %08x\n"
"%s: querying MIX_NUMBER environment variable...\n",
__func__, devmask, stereo, __func__);
const char *tmp = getenv("MIX_NUMBER");
if (tmp)
P->mixer_num = atoi(tmp);
lt_info("%s: mixer_num is %d -> device %08x\n",
__func__, P->mixer_num, (P->mixer_num >= 0) ? (1 << P->mixer_num) : 0);
mixer_num = atoi(tmp);
hal_info("%s: mixer_num is %d -> device %08x\n",
__func__, mixer_num, (mixer_num >= 0) ? (1 << mixer_num) : 0);
/* no error checking, you'd better know what you are doing... */
} else {
P->mixer_num = 0;
mixer_num = 0;
while (!(usable & 0x01)) {
P->mixer_num++;
mixer_num++;
usable >>= 1;
}
}
@@ -284,36 +284,36 @@ int cAudio::PrepareClipPlay(int ch, int srate, int bits, int little_endian)
int cAudio::WriteClip(unsigned char *buffer, int size)
{
int ret;
// lt_debug("cAudio::%s\n", __FUNCTION__);
if (P->clipfd <= 0) {
lt_info("%s: clipfd not yet opened\n", __FUNCTION__);
// hal_debug("cAudio::%s\n", __FUNCTION__);
if (clipfd <= 0) {
hal_info("%s: clipfd not yet opened\n", __FUNCTION__);
return -1;
}
ret = write(P->clipfd, buffer, size);
ret = write(clipfd, buffer, size);
if (ret < 0)
lt_info("%s: write error (%m)\n", __FUNCTION__);
hal_info("%s: write error (%m)\n", __FUNCTION__);
return ret;
};
int cAudio::StopClip()
{
lt_debug("%s\n", __FUNCTION__);
if (P->clipfd <= 0) {
lt_info("%s: clipfd not yet opened\n", __FUNCTION__);
hal_debug("%s\n", __FUNCTION__);
if (clipfd <= 0) {
hal_info("%s: clipfd not yet opened\n", __FUNCTION__);
return -1;
}
close(P->clipfd);
P->clipfd = -1;
if (P->mixer_fd >= 0)
close(P->mixer_fd);
P->mixer_fd = -1;
close(clipfd);
clipfd = -1;
if (mixer_fd >= 0)
close(mixer_fd);
mixer_fd = -1;
setVolume(volume, volume);
return 0;
};
void cAudio::getAudioInfo(int &type, int &layer, int &freq, int &bitrate, int &mode)
{
lt_debug("%s\n", __FUNCTION__);
hal_debug("%s\n", __FUNCTION__);
type = 0;
layer = 0;
freq = 0;
@@ -362,42 +362,37 @@ void cAudio::getAudioInfo(int &type, int &layer, int &freq, int &bitrate, int &m
void cAudio::SetSRS(int /*iq_enable*/, int /*nmgr_enable*/, int /*iq_mode*/, int /*iq_level*/)
{
lt_debug("%s\n", __FUNCTION__);
hal_debug("%s\n", __FUNCTION__);
};
void cAudio::SetHdmiDD(bool enable)
{
lt_debug("%s %d\n", __func__, enable);
hal_debug("%s %d\n", __func__, enable);
};
#define AUDIO_BYPASS_ON 0
#define AUDIO_BYPASS_OFF 1
void cAudio::SetSpdifDD(bool enable)
{
lt_debug("%s %d\n", __func__, enable);
//setBypassMode(!enable);
int mode = enable ? AUDIO_BYPASS_ON : AUDIO_BYPASS_OFF;
if (ioctl(P->fd, AUDIO_SET_BYPASS_MODE, mode) < 0)
lt_info("%s AUDIO_SET_BYPASS_MODE %d: %m\n", __func__, mode);
hal_debug("%s %d\n", __func__, enable);
setBypassMode(!enable);
};
void cAudio::ScheduleMute(bool On)
{
lt_debug("%s %d\n", __FUNCTION__, On);
hal_debug("%s %d\n", __FUNCTION__, On);
};
void cAudio::EnableAnalogOut(bool enable)
{
lt_debug("%s %d\n", __FUNCTION__, enable);
hal_debug("%s %d\n", __FUNCTION__, enable);
};
#if 0
#define AUDIO_BYPASS_ON 0
#define AUDIO_BYPASS_OFF 1
void cAudio::setBypassMode(bool disable)
{
lt_debug("%s %d\n", __func__, disable);
hal_debug("%s %d\n", __func__, disable);
int mode = disable ? AUDIO_BYPASS_OFF : AUDIO_BYPASS_ON;
if (ioctl(fd, AUDIO_SET_BYPASS_MODE, mode) < 0)
lt_info("%s AUDIO_SET_BYPASS_MODE %d: %m\n", __func__, mode);
hal_info("%s AUDIO_SET_BYPASS_MODE %d: %m\n", __func__, mode);
return;
}
#endif

97
libazbox/audio_lib.h Normal file
View File

@@ -0,0 +1,97 @@
/* public header file */
#ifndef __AUDIO_LIB_H__
#define __AUDIO_LIB_H__
#include "../common/cs_types.h"
typedef enum
{
AUDIO_SYNC_WITH_PTS,
AUDIO_NO_SYNC,
AUDIO_SYNC_AUDIO_MASTER
} AUDIO_SYNC_MODE;
typedef enum {
HDMI_ENCODED_OFF,
HDMI_ENCODED_AUTO,
HDMI_ENCODED_FORCED
} HDMI_ENCODED_MODE;
typedef enum
{
AUDIO_FMT_AUTO = 0,
AUDIO_FMT_MPEG,
AUDIO_FMT_MP3,
AUDIO_FMT_DOLBY_DIGITAL,
AUDIO_FMT_BASIC = AUDIO_FMT_DOLBY_DIGITAL,
AUDIO_FMT_AAC,
AUDIO_FMT_AAC_PLUS,
AUDIO_FMT_DD_PLUS,
AUDIO_FMT_DTS,
AUDIO_FMT_AVS,
AUDIO_FMT_MLP,
AUDIO_FMT_WMA,
AUDIO_FMT_MPG1, // TD only. For Movieplayer / cPlayback
AUDIO_FMT_ADVANCED = AUDIO_FMT_MLP
} AUDIO_FORMAT;
class cAudio
{
friend class cPlayback;
private:
int fd;
bool Muted;
int clipfd; /* for pcm playback */
int mixer_fd; /* if we are using the OSS mixer */
int mixer_num; /* oss mixer to use, if any */
AUDIO_FORMAT StreamType;
AUDIO_SYNC_MODE SyncMode;
bool started;
int volume;
void openDevice(void);
void closeDevice(void);
int do_mute(bool enable, bool remember);
void setBypassMode(bool disable);
public:
/* construct & destruct */
cAudio(void *, void *, void *);
~cAudio(void);
void *GetHandle() { return NULL; };
/* shut up */
int mute(bool remember = true) { return do_mute(true, remember); };
int unmute(bool remember = true) { return do_mute(false, remember); };
/* volume, min = 0, max = 255 */
int setVolume(unsigned int left, unsigned int right);
int getVolume(void) { return volume;}
bool getMuteStatus(void) { return Muted; };
/* start and stop audio */
int Start(void);
int Stop(void);
bool Pause(bool Pcm = true);
void SetStreamType(AUDIO_FORMAT type);
void SetSyncMode(AVSYNC_TYPE Mode);
/* select channels */
int setChannel(int channel);
int PrepareClipPlay(int uNoOfChannels, int uSampleRate, int uBitsPerSample, int bLittleEndian);
int WriteClip(unsigned char * buffer, int size);
int StopClip();
void getAudioInfo(int &type, int &layer, int& freq, int &bitrate, int &mode);
void SetSRS(int iq_enable, int nmgr_enable, int iq_mode, int iq_level);
bool IsHdmiDDSupported();
void SetHdmiDD(bool enable);
void SetSpdifDD(bool enable);
void ScheduleMute(bool On);
void EnableAnalogOut(bool enable);
};
#endif // __AUDIO_LIB_H__

View File

@@ -32,19 +32,18 @@
#include <string>
#include <sys/ioctl.h>
#include "dmx_hal.h"
#include "lt_debug.h"
#include "hal_debug.h"
/* Ugh... see comment in destructor for details... */
#include "video_hal.h"
#include "video_priv.h"
#include "video_lib.h"
/* needed for getSTC... */
extern cVideo *videoDecoder;
#define lt_debug(args...) _lt_debug(TRIPLE_DEBUG_DEMUX, this, args)
#define lt_info(args...) _lt_info(TRIPLE_DEBUG_DEMUX, this, args)
#define lt_info_c(args...) _lt_info(TRIPLE_DEBUG_DEMUX, NULL, args)
#define hal_debug(args...) _hal_debug(HAL_DEBUG_DEMUX, this, args)
#define hal_info(args...) _hal_info(HAL_DEBUG_DEMUX, this, args)
#define hal_info_c(args...) _hal_info(HAL_DEBUG_DEMUX, NULL, args)
#define dmx_err(_errfmt, _errstr, _revents) do { \
lt_info("%s " _errfmt " fd:%d, ev:0x%x %s pid:0x%04hx flt:0x%02hx\n", \
hal_info("%s " _errfmt " fd:%d, ev:0x%x %s pid:0x%04hx flt:0x%02hx\n", \
__func__, _errstr, fd, _revents, DMX_T[dmx_type], pid, flt); \
} while(0);
@@ -78,7 +77,7 @@ cDemux::cDemux(int n)
{
if (n < 0 || n > 2)
{
lt_info("%s ERROR: n invalid (%d)\n", __FUNCTION__, n);
hal_info("%s ERROR: n invalid (%d)\n", __FUNCTION__, n);
num = 0;
}
else
@@ -88,7 +87,7 @@ cDemux::cDemux(int n)
cDemux::~cDemux()
{
lt_debug("%s #%d fd: %d\n", __FUNCTION__, num, fd);
hal_debug("%s #%d fd: %d\n", __FUNCTION__, num, fd);
Close();
/* in zapit.cpp, videoDemux is deleted after videoDecoder
* in the video watchdog, we access videoDecoder
@@ -109,7 +108,7 @@ bool cDemux::Open(DMX_CHANNEL_TYPE pes_type, void * /*hVideoBuffer*/, int uBuffe
int devnum = num;
int flags = O_RDWR|O_CLOEXEC;
if (fd > -1)
lt_info("%s FD ALREADY OPENED? fd = %d\n", __FUNCTION__, fd);
hal_info("%s FD ALREADY OPENED? fd = %d\n", __FUNCTION__, fd);
if (pes_type != DMX_PSI_CHANNEL)
flags |= O_NONBLOCK;
@@ -117,28 +116,28 @@ bool cDemux::Open(DMX_CHANNEL_TYPE pes_type, void * /*hVideoBuffer*/, int uBuffe
fd = open(devname[devnum], flags);
if (fd < 0)
{
lt_info("%s %s: %m\n", __FUNCTION__, devname[devnum]);
hal_info("%s %s: %m\n", __FUNCTION__, devname[devnum]);
return false;
}
lt_debug("%s #%d pes_type: %s(%d), uBufferSize: %d fd: %d\n", __func__,
hal_debug("%s #%d pes_type: %s(%d), uBufferSize: %d fd: %d\n", __func__,
num, DMX_T[pes_type], pes_type, uBufferSize, fd);
dmx_type = pes_type;
#if 0
if (!pesfds.empty())
{
lt_info("%s ERROR! pesfds not empty!\n", __FUNCTION__); /* TODO: error handling */
hal_info("%s ERROR! pesfds not empty!\n", __FUNCTION__); /* TODO: error handling */
return false;
}
int n = DMX_SOURCE_FRONT0;
if (ioctl(fd, DMX_SET_SOURCE, &n) < 0)
lt_info("%s DMX_SET_SOURCE failed!\n", __func__);
hal_info("%s DMX_SET_SOURCE failed!\n", __func__);
#endif
if (uBufferSize > 0)
{
/* probably uBufferSize == 0 means "use default size". TODO: find a reasonable default */
if (ioctl(fd, DMX_SET_BUFFER_SIZE, uBufferSize) < 0)
lt_info("%s DMX_SET_BUFFER_SIZE failed (%m)\n", __func__);
hal_info("%s DMX_SET_BUFFER_SIZE failed (%m)\n", __func__);
}
buffersize = uBufferSize;
@@ -147,10 +146,10 @@ bool cDemux::Open(DMX_CHANNEL_TYPE pes_type, void * /*hVideoBuffer*/, int uBuffe
void cDemux::Close(void)
{
lt_debug("%s #%d, fd = %d\n", __FUNCTION__, num, fd);
hal_debug("%s #%d, fd = %d\n", __FUNCTION__, num, fd);
if (fd < 0)
{
lt_info("%s #%d: not open!\n", __FUNCTION__, num);
hal_info("%s #%d: not open!\n", __FUNCTION__, num);
return;
}
@@ -163,7 +162,7 @@ void cDemux::Close(void)
dmx_tp_count--;
if (dmx_tp_count < 0)
{
lt_info("%s dmx_tp_count < 0!!\n", __func__);
hal_info("%s dmx_tp_count < 0!!\n", __func__);
dmx_tp_count = 0;
}
}
@@ -171,10 +170,10 @@ void cDemux::Close(void)
bool cDemux::Start(bool)
{
lt_debug("%s #%d fd: %d type: %s\n", __func__, num, fd, DMX_T[dmx_type]);
hal_debug("%s #%d fd: %d type: %s\n", __func__, num, fd, DMX_T[dmx_type]);
if (fd < 0)
{
lt_info("%s #%d: not open!\n", __FUNCTION__, num);
hal_info("%s #%d: not open!\n", __FUNCTION__, num);
return false;
}
ioctl(fd, DMX_START);
@@ -183,10 +182,10 @@ bool cDemux::Start(bool)
bool cDemux::Stop(void)
{
lt_debug("%s #%d fd: %d type: %s\n", __func__, num, fd, DMX_T[dmx_type]);
hal_debug("%s #%d fd: %d type: %s\n", __func__, num, fd, DMX_T[dmx_type]);
if (fd < 0)
{
lt_info("%s #%d: not open!\n", __FUNCTION__, num);
hal_info("%s #%d: not open!\n", __FUNCTION__, num);
return false;
}
ioctl(fd, DMX_STOP);
@@ -230,7 +229,7 @@ int cDemux::Read(unsigned char *buff, int len, int timeout)
else if (rc < 0)
{
dmx_err("poll: %s,", strerror(errno), 0)
//lt_info("%s poll: %m\n", __FUNCTION__);
//hal_info("%s poll: %m\n", __FUNCTION__);
/* happens, when running under gdb... */
if (errno == EINTR)
goto retry;
@@ -274,7 +273,7 @@ bool cDemux::sectionFilter(unsigned short _pid, const unsigned char * const filt
if (len > DMX_FILTER_SIZE)
{
lt_info("%s #%d: len too long: %d, DMX_FILTER_SIZE %d\n", __func__, num, len, DMX_FILTER_SIZE);
hal_info("%s #%d: len too long: %d, DMX_FILTER_SIZE %d\n", __func__, num, len, DMX_FILTER_SIZE);
len = DMX_FILTER_SIZE;
}
s_flt.pid = pid;
@@ -368,7 +367,7 @@ bool cDemux::sectionFilter(unsigned short _pid, const unsigned char * const filt
if (timeout == 0 && negmask == NULL)
s_flt.timeout = to;
lt_debug("%s #%d pid:0x%04hx fd:%d type:%s len:%d to:%d flags:%x flt[0]:%02x\n", __func__, num,
hal_debug("%s #%d pid:0x%04hx fd:%d type:%s len:%d to:%d flags:%x flt[0]:%02x\n", __func__, num,
pid, fd, DMX_T[dmx_type], len, s_flt.timeout,s_flt.flags, s_flt.filter.filter[0]);
#if 0
fprintf(stderr,"filt: ");for(int i=0;i<DMX_FILTER_SIZE;i++)fprintf(stderr,"%02hhx ",s_flt.filter.filter[i]);fprintf(stderr,"\n");
@@ -397,7 +396,7 @@ bool cDemux::pesFilter(const unsigned short _pid)
if ((pid >= 0x0002 && pid <= 0x000f) || pid >= 0x1fff)
return false;
lt_debug("%s #%d pid: 0x%04hx fd: %d type: %s\n", __FUNCTION__, num, pid, fd, DMX_T[dmx_type]);
hal_debug("%s #%d pid: 0x%04hx fd: %d type: %s\n", __FUNCTION__, num, pid, fd, DMX_T[dmx_type]);
memset(&p_flt, 0, sizeof(p_flt));
p_flt.pid = pid;
@@ -423,7 +422,7 @@ bool cDemux::pesFilter(const unsigned short _pid)
p_flt.output = DMX_OUT_TSDEMUX_TAP;
break;
default:
lt_info("%s #%d invalid dmx_type %d!\n", __func__, num, dmx_type);
hal_info("%s #%d invalid dmx_type %d!\n", __func__, num, dmx_type);
return false;
}
return (ioctl(fd, DMX_SET_PES_FILTER, &p_flt) >= 0);
@@ -431,39 +430,39 @@ bool cDemux::pesFilter(const unsigned short _pid)
void cDemux::SetSyncMode(AVSYNC_TYPE /*mode*/)
{
lt_debug("%s #%d\n", __FUNCTION__, num);
hal_debug("%s #%d\n", __FUNCTION__, num);
}
void *cDemux::getBuffer()
{
lt_debug("%s #%d\n", __FUNCTION__, num);
hal_debug("%s #%d\n", __FUNCTION__, num);
return NULL;
}
void *cDemux::getChannel()
{
lt_debug("%s #%d\n", __FUNCTION__, num);
hal_debug("%s #%d\n", __FUNCTION__, num);
return NULL;
}
bool cDemux::addPid(unsigned short Pid)
{
lt_debug("%s: pid 0x%04hx\n", __func__, Pid);
hal_debug("%s: pid 0x%04hx\n", __func__, Pid);
pes_pids pfd;
int ret;
if (dmx_type != DMX_TP_CHANNEL)
{
lt_info("%s pes_type %s not implemented yet! pid=%hx\n", __FUNCTION__, DMX_T[dmx_type], Pid);
hal_info("%s pes_type %s not implemented yet! pid=%hx\n", __FUNCTION__, DMX_T[dmx_type], Pid);
return false;
}
if (fd == -1)
lt_info("%s bucketfd not yet opened? pid=%hx\n", __FUNCTION__, Pid);
hal_info("%s bucketfd not yet opened? pid=%hx\n", __FUNCTION__, Pid);
pfd.fd = fd; /* dummy */
pfd.pid = Pid;
pesfds.push_back(pfd);
ret = (ioctl(fd, DMX_ADD_PID, &Pid));
if (ret < 0)
lt_info("%s: DMX_ADD_PID (%m)\n", __func__);
hal_info("%s: DMX_ADD_PID (%m)\n", __func__);
return (ret != -1);
}
@@ -471,36 +470,36 @@ void cDemux::removePid(unsigned short Pid)
{
if (dmx_type != DMX_TP_CHANNEL)
{
lt_info("%s pes_type %s not implemented yet! pid=%hx\n", __FUNCTION__, DMX_T[dmx_type], Pid);
hal_info("%s pes_type %s not implemented yet! pid=%hx\n", __FUNCTION__, DMX_T[dmx_type], Pid);
return;
}
for (std::vector<pes_pids>::iterator i = pesfds.begin(); i != pesfds.end(); ++i)
{
if ((*i).pid == Pid) {
lt_debug("removePid: removing demux fd %d pid 0x%04x\n", fd, Pid);
hal_debug("removePid: removing demux fd %d pid 0x%04x\n", fd, Pid);
if (ioctl(fd, DMX_REMOVE_PID, Pid) < 0)
lt_info("%s: (DMX_REMOVE_PID, 0x%04hx): %m\n", __func__, Pid);
hal_info("%s: (DMX_REMOVE_PID, 0x%04hx): %m\n", __func__, Pid);
pesfds.erase(i);
return; /* TODO: what if the same PID is there multiple times */
}
}
lt_info("%s pid 0x%04x not found\n", __FUNCTION__, Pid);
hal_info("%s pid 0x%04x not found\n", __FUNCTION__, Pid);
}
void cDemux::getSTC(int64_t * STC)
{
/* apparently I can only get the PTS of the video decoder,
* but that's good enough for dvbsub */
lt_debug("%s #%d\n", __func__, num);
hal_debug("%s #%d\n", __func__, num);
int64_t pts = 0;
if (videoDecoder)
pts = videoDecoder->vdec->GetPTS();
pts = videoDecoder->GetPTS();
*STC = pts;
}
int cDemux::getUnit(void)
{
lt_debug("%s #%d\n", __FUNCTION__, num);
hal_debug("%s #%d\n", __FUNCTION__, num);
/* just guessed that this is the right thing to do.
right now this is only used by the CA code which is stubbed out
anyway */
@@ -509,12 +508,12 @@ int cDemux::getUnit(void)
bool cDemux::SetSource(int unit, int source)
{
lt_info_c("%s(%d, %d): not implemented yet\n", __func__, unit, source);
hal_info_c("%s(%d, %d): not implemented yet\n", __func__, unit, source);
return true;
}
int cDemux::GetSource(int unit)
{
lt_info_c("%s(%d): not implemented yet\n", __func__, unit);
hal_info_c("%s(%d): not implemented yet\n", __func__, unit);
return 0;
}

View File

@@ -2,7 +2,7 @@
* determine the capabilities of the hardware.
* part of libstb-hal
*
* (C) 2010-2012,2016 Stefan Seyfried
* (C) 2010-2012 Stefan Seyfried
*
* License: GPL v2 or later
*/
@@ -30,9 +30,8 @@ hw_caps_t *get_hwcaps(void)
caps.display_type = HW_DISPLAY_LINE_TEXT;
caps.has_HDMI = 1;
caps.display_xres = 8;
caps.display_has_statusline = 0;
caps.display_can_deepstandby = 0;
caps.display_can_set_brightness = 0;
caps.display_has_statusline = 0;
strcpy(caps.boxvendor, "AZBox");
const char *tmp;
char buf[64];
@@ -48,7 +47,6 @@ hw_caps_t *get_hwcaps(void)
}
else
strcpy(caps.boxname, "(unknown model)");
strcpy(caps.boxarch, "mipsel");
return &caps;
}

23
libazbox/init.cpp Normal file
View File

@@ -0,0 +1,23 @@
#include <unistd.h>
#include "init.h"
#include "hal_debug.h"
#define hal_debug(args...) _hal_debug(HAL_DEBUG_INIT, NULL, args)
#define hal_info(args...) _hal_info(HAL_DEBUG_INIT, NULL, args)
static bool initialized = false;
void hal_api_init()
{
if (!initialized)
hal_debug_init();
hal_info("%s begin, initialized=%d, debug=0x%02x\n", __func__, (int)initialized, debuglevel);
initialized = true;
}
void hal_api_exit()
{
hal_info("%s, initialized = %d\n", __func__, (int)initialized);
initialized = false;
}

View File

@@ -38,10 +38,10 @@
#include <sys/types.h>
#include <sys/wait.h>
#include "lt_debug.h"
#define lt_debug(args...) _lt_debug(TRIPLE_DEBUG_PLAYBACK, this, args)
#define lt_info(args...) _lt_info(TRIPLE_DEBUG_PLAYBACK, this, args)
#define lt_info_c(args...) _lt_info(TRIPLE_DEBUG_PLAYBACK, NULL, args)
#include "hal_debug.h"
#define hal_debug(args...) _hal_debug(HAL_DEBUG_PLAYBACK, this, args)
#define hal_info(args...) _hal_info(HAL_DEBUG_PLAYBACK, this, args)
#define hal_info_c(args...) _hal_info(HAL_DEBUG_PLAYBACK, NULL, args)
#include <proc_tools.h>
@@ -50,7 +50,7 @@
#define IN_FILE "/tmp/rmfp.in2"
#define OUT_FILE "/tmp/rmfp.out2"
#include "playback_hal.h"
#include "playback_lib.h"
extern "C"{
#include "e2mruainclude.h"
@@ -73,40 +73,10 @@ static time_t monotonic_ms(void)
}
#endif
class PBPrivate
{
public:
bool rmfp_command(int cmd, int param, bool has_param, char *buf, int buflen);
void run_rmfp(void);
PBPrivate(void) {
playing = 0;
thread_started = false;
eof = false;
open_success = false;
pthread_mutex_init(&rmfp_cmd_mutex, NULL);
};
~PBPrivate(void) {
pthread_mutex_destroy(&rmfp_cmd_mutex);
};
int duration;
int playing;
int speed;
playmode_t pmode;
uint16_t apid;
uint16_t subpid;
bool eof;
bool open_success;
bool thread_started;
pthread_t thread;
pthread_mutex_t rmfp_cmd_mutex;
char *fname;
};
/* the mutex makes sure that commands are not interspersed */
bool PBPrivate::rmfp_command(int cmd, int param, bool has_param, char *buf, int buflen)
bool cPlayback::rmfp_command(int cmd, int param, bool has_param, char *buf, int buflen)
{
lt_info("%s: %d %d %d %d\n", __func__, cmd, param, has_param, buflen);
hal_info("%s: %d %d %d %d\n", __func__, cmd, param, has_param, buflen);
bool ret = true;
int fd;
if (cmd == 222)
@@ -131,7 +101,7 @@ bool PBPrivate::rmfp_command(int cmd, int param, bool has_param, char *buf, int
{
while ((fd = open(OUT_FILE, O_RDONLY)) == -1) {
if (++m > 500) { /* don't wait more than 5 seconds */
lt_info("%s: timed out waiting for %s (cmd %d par %d buflen %d\n",
hal_info("%s: timed out waiting for %s (cmd %d par %d buflen %d\n",
__func__, OUT_FILE, cmd, param, buflen);
ret = false;
goto out;
@@ -161,7 +131,7 @@ bool PBPrivate::rmfp_command(int cmd, int param, bool has_param, char *buf, int
out:
pthread_mutex_unlock(&rmfp_cmd_mutex);
if (cmd != 222) /* called tooo often :-) */
lt_info("%s: reply: '%s' ret: %d m:%d\n", __func__, buf?buf:"(none)", ret, m);
hal_info("%s: reply: '%s' ret: %d m:%d\n", __func__, buf?buf:"(none)", ret, m);
return ret;
}
@@ -171,21 +141,21 @@ bool PBPrivate::rmfp_command(int cmd, int param, bool has_param, char *buf, int
* the output will be buffered after starting up and we will only
* see "Playback has started..." after the player exits
*/
void PBPrivate::run_rmfp()
void cPlayback::run_rmfp()
{
lt_debug("%s: starting\n", __func__);
hal_debug("%s: starting\n", __func__);
thread_started = true;
//Watch for the space at the end
std::string base = "rmfp_player -dram 1 -ve 1 -waitexit ";
std::string filename(fname);
std::string filename(mfilename);
std::string file = '"' + filename + '"';
std::string final = base + file;
if (pmode == PLAYMODE_TS && duration != 0)
if (playMode == PLAYMODE_TS && mduration != 0)
{
std::stringstream du;
du << (duration /** 60000LL*/);
final = base + "-duration " + du.str() + " " + file;
std::stringstream duration;
duration << (mduration /** 60000LL*/);
final = base + "-duration " + duration.str() + " " + file;
}
pid_t pid = 0;
@@ -193,7 +163,7 @@ void PBPrivate::run_rmfp()
pid = forkpty(&master, NULL, NULL, NULL);
if (! pid) {
execl("/bin/sh", "sh", "-c", final.c_str(), (char *)0);
lt_info("%s: execl returned: %m\n", __func__);
hal_info("%s: execl returned: %m\n", __func__);
exit(0);
}
@@ -211,17 +181,17 @@ void PBPrivate::run_rmfp()
break;
output[len] = '\0';
}
lt_info("%s out: '%s'\n", __func__, output);
hal_info("%s out: '%s'\n", __func__, output);
if (strstr(output, "Playback has started..."))
{
playing = 1;
lt_info("%s: ===================> playing = true\n", __func__);
hal_info("%s: ===================> playing = true\n", __func__);
}
else if (strstr(output, "End of file..."))
{
playing = 1; /* this can happen without "Playback has started..." */
eof = true;
lt_info("%s: ===================> eof_reached = true\n", __func__);
eof_reached = true;
hal_info("%s: ===================> eof_reached = true\n", __func__);
}
}
fclose(f);
@@ -231,20 +201,20 @@ void PBPrivate::run_rmfp()
free(output);
}
lt_info("%s: terminating\n", __func__);
hal_info("%s: terminating\n", __func__);
if (playing == 0) /* playback did not start */
playing = 2;
else
playing = 0;
eof = true;
eof_reached = true;
pthread_exit(NULL);
}
/* helper function to call the cpp thread loop */
void *execute_rua_thread(void *c)
{
PBPrivate *obj = (PBPrivate *)c;
lt_info_c("%s\n", __func__);
cPlayback *obj = (cPlayback *)c;
hal_info_c("%s\n", __func__);
obj->run_rmfp();
/* free(obj); // this is most likely wrong */
@@ -258,14 +228,14 @@ bool cPlayback::Open(playmode_t PlayMode)
"PLAYMODE_TS",
"PLAYMODE_FILE"
};
pd->pmode = PlayMode;
if (pd->pmode > 1)
playMode = PlayMode;
if (playMode > 1)
{
lt_info("%s: PlayMode %d out of range!\n", __func__, PlayMode);
pd->pmode = PLAYMODE_FILE;
hal_info("%s: PlayMode %d out of range!\n", __func__, PlayMode);
playMode = PLAYMODE_FILE;
}
lt_info("%s: mode %d (%s)\n", __func__, PlayMode, aPLAYMODE[PlayMode]);
hal_info("%s: mode %d (%s)\n", __func__, PlayMode, aPLAYMODE[PlayMode]);
#if 0
while (access("/tmp/continue", R_OK))
sleep(1);
@@ -282,121 +252,116 @@ bool cPlayback::Open(playmode_t PlayMode)
i++;
if (i > 10)
{
lt_info("%s: ERROR - player is not idle after 10 seconds!\n", __func__);
pd->open_success = false;
hal_info("%s: ERROR - player is not idle after 10 seconds!\n", __func__);
open_success = false;
return false;
}
sleep(1);
}
proc_put("/proc/player", "2", 2);
lt_info("%s: /proc/player switched to '2'\n", __func__);
hal_info("%s: /proc/player switched to '2'\n", __func__);
unlink(CMD_FILE);
unlink(IN_FILE);
unlink(OUT_FILE);
pd->open_success = true;
open_success = true;
return 0;
}
bool cPlayback::Start(std::string /*filename*/, std::string /*headers*/)
{
return false;
}
//Used by Fileplay
bool cPlayback::Start(char *filename, unsigned short vpid, int vtype, unsigned short _apid,
int ac3, unsigned int duration)
{
bool ret = true;
lt_info("%s: filename=%s\n", __func__, filename);
lt_info("%s: vpid=%u vtype=%d apid=%u ac3=%d duration=%i open_success=%d\n",
__func__, vpid, vtype, _apid, ac3, duration, pd->open_success);
hal_info("%s: filename=%s\n", __func__, filename);
hal_info("%s: vpid=%u vtype=%d apid=%u ac3=%d duration=%i open_success=%d\n",
__func__, vpid, vtype, _apid, ac3, duration, open_success);
if (!pd->open_success)
if (!open_success)
return false;
pd->eof = false;
eof_reached = false;
//create playback path
pd->apid = 0;
pd->subpid = 0;
pd->fname = filename;
pd->duration = duration;
if (pthread_create(&pd->thread, 0, execute_rua_thread, pd) != 0)
apid = 0;
subpid = 0;
mfilename = filename;
mduration = duration;
if (pthread_create(&thread, 0, execute_rua_thread, this) != 0)
{
lt_info("%s: error creating rmfp_player thread! (out of memory?)\n", __func__);
hal_info("%s: error creating rmfp_player thread! (out of memory?)\n", __func__);
ret = false;
}
while (! pd->playing)
while (! playing)
sleep(1);
if (pd->playing == 2)
pd->playing = 0;
if (playing == 2)
playing = 0;
return ret;
}
void cPlayback::Close(void)
{
lt_info("%s: playing %d thread_started %d\n", __func__, pd->playing, pd->thread_started);
hal_info("%s: playing %d thread_started %d\n", __func__, playing, thread_started);
if (pd->thread_started)
if (thread_started)
{
pd->rmfp_command(KEY_COMMAND_QUIT_ALL, 0, false, NULL, 0);
rmfp_command(KEY_COMMAND_QUIT_ALL, 0, false, NULL, 0);
if (pthread_join(pd->thread, NULL))
lt_info("%s: error joining rmfp thread (%m)\n", __func__);
pd->playing = 0;
pd->thread_started = false;
if (pthread_join(thread, NULL))
hal_info("%s: error joining rmfp thread (%m)\n", __func__);
playing = 0;
thread_started = false;
}
else
lt_info("%s: Warning: thread_started == false!\n", __func__);
hal_info("%s: Warning: thread_started == false!\n", __func__);
if (pd->open_success)
if (open_success)
{
proc_put("/proc/player", "1", 2);
pd->open_success = false;
lt_info("%s: /proc/player switched to '1'\n", __func__);
open_success = false;
hal_info("%s: /proc/player switched to '1'\n", __func__);
usleep(1000000);
}
}
bool cPlayback::SetAPid(unsigned short pid, int /*ac3*/)
{
lt_info("%s: pid %i\n", __func__, pid);
if (pid != pd->apid) {
pd->rmfp_command(KEY_COMMAND_SWITCH_AUDIO, pid, true, NULL, 0);
pd->apid = pid;
hal_info("%s: pid %i\n", __func__, pid);
if (pid != apid) {
rmfp_command(KEY_COMMAND_SWITCH_AUDIO, pid, true, NULL, 0);
apid = pid;
}
return true;
}
bool cPlayback::SelectSubtitles(int pid, std::string /*charset*/)
bool cPlayback::SelectSubtitles(int pid)
{
lt_info("%s: pid %i\n", __func__, pid);
if (pid != pd->subpid)
hal_info("%s: pid %i\n", __func__, pid);
if (pid != subpid)
{
pd->rmfp_command(KEY_COMMAND_SWITCH_SUBS, pid, true, NULL, 0);
pd->subpid = pid;
rmfp_command(KEY_COMMAND_SWITCH_SUBS, pid, true, NULL, 0);
subpid = pid;
}
return true;
}
bool cPlayback::SetSpeed(int speed)
{
lt_info("%s: playing %d speed %d\n", __func__, pd->playing, speed);
hal_info("%s: playing %d speed %d\n", __func__, playing, speed);
if (!pd->playing)
if (!playing)
return false;
pd->speed = speed;
playback_speed = speed;
if (speed > 1 || speed < 0)
pd->rmfp_command(CUSTOM_COMMAND_TRICK_SEEK, speed, true, NULL, 0);
rmfp_command(CUSTOM_COMMAND_TRICK_SEEK, speed, true, NULL, 0);
else if (speed == 0)
pd->rmfp_command(KEY_COMMAND_PAUSE, 0, false, NULL, 0);
rmfp_command(KEY_COMMAND_PAUSE, 0, false, NULL, 0);
else
pd->rmfp_command(KEY_COMMAND_PLAY, 0, false, NULL, 0);
rmfp_command(KEY_COMMAND_PLAY, 0, false, NULL, 0);
return true;
}
@@ -404,7 +369,7 @@ bool cPlayback::SetSpeed(int speed)
bool cPlayback::GetSpeed(int &/*speed*/) const
{
#if 0
lt_info("%s:\n", __func__);
hal_info("%s:\n", __func__);
speed = playback_speed;
#endif
return true;
@@ -413,22 +378,22 @@ bool cPlayback::GetSpeed(int &/*speed*/) const
// in milliseconds
bool cPlayback::GetPosition(int &position, int &duration)
{
lt_debug("%s: playing %d\n", __func__, pd->playing);
hal_debug("%s: playing %d\n", __func__, playing);
if (pd->eof)
if (eof_reached)
{
position = pd->duration;
duration = pd->duration;
position = mduration;
duration = mduration;
return true;
}
if (!pd->playing)
if (!playing)
return false;
char buf[32];
/* custom command 222 returns "12345\n1234\n",
* first line is duration, second line is position */
if (! pd->rmfp_command(222, 0, false, buf, 32))
if (! rmfp_command(222, 0, false, buf, 32))
return false;
duration = atoi(buf);
char *p = strchr(buf, '\n');
@@ -439,11 +404,11 @@ bool cPlayback::GetPosition(int &position, int &duration)
if (duration == 0)
duration = position + 1000;
if (pd->pmode == PLAYMODE_TS)
if (playMode == PLAYMODE_TS)
{
if (position > pd->duration)
pd->duration = position + 1000;
duration = pd->duration;
if (position > mduration)
mduration = position + 1000;
duration = mduration;
return true;
}
return true;
@@ -451,31 +416,31 @@ bool cPlayback::GetPosition(int &position, int &duration)
bool cPlayback::SetPosition(int position, bool absolute)
{
lt_info("%s: pos %d abs %d playing %d\n", __func__, position, absolute, pd->playing);
hal_info("%s: pos %d abs %d playing %d\n", __func__, position, absolute, playing);
if (!pd->playing)
if (!playing)
return false;
int seconds = position / 1000;;
if (absolute)
{
pd->rmfp_command(KEY_COMMAND_SEEK_TO_TIME, seconds, true, NULL, 0);
rmfp_command(KEY_COMMAND_SEEK_TO_TIME, seconds, true, NULL, 0);
return true;
}
if (position > 0)
pd->rmfp_command(CUSTOM_COMMAND_SEEK_RELATIVE_FWD, seconds, true, NULL, 0);
rmfp_command(CUSTOM_COMMAND_SEEK_RELATIVE_FWD, seconds, true, NULL, 0);
else if (position < 0)
pd->rmfp_command(CUSTOM_COMMAND_SEEK_RELATIVE_BWD, seconds, true, NULL, 0);
rmfp_command(CUSTOM_COMMAND_SEEK_RELATIVE_BWD, seconds, true, NULL, 0);
return true;
}
void cPlayback::FindAllPids(uint16_t *apids, unsigned short *ac3flags, uint16_t *numpida, std::string *language)
{
lt_info("%s\n", __func__);
hal_info("%s\n", __func__);
char buf[32];
pd->rmfp_command(CUSTOM_COMMAND_AUDIO_COUNT, 0, false, buf, 3);
rmfp_command(CUSTOM_COMMAND_AUDIO_COUNT, 0, false, buf, 3);
unsigned int audio_count = atoi(buf);
*numpida = audio_count;
@@ -486,7 +451,7 @@ void cPlayback::FindAllPids(uint16_t *apids, unsigned short *ac3flags, uint16_t
char streamidstring[11];
char audio_lang[21];
memset(buf, 0, sizeof(buf));
pd->rmfp_command(CUSTOM_COMMAND_GET_AUDIO_BY_ID, aid, true, buf, 32);
rmfp_command(CUSTOM_COMMAND_GET_AUDIO_BY_ID, aid, true, buf, 32);
memcpy(streamidstring, buf, 10);
streamidstring[10] = '\0';
memcpy(audio_lang, buf + 10, 20);
@@ -494,17 +459,17 @@ void cPlayback::FindAllPids(uint16_t *apids, unsigned short *ac3flags, uint16_t
apids[aid] = atoi(streamidstring);
ac3flags[aid] = 0;
language[aid] = audio_lang;
lt_info("%s: #%d apid:%d lang: %s\n", __func__, aid, apids[aid], audio_lang);
hal_info("%s: #%d apid:%d lang: %s\n", __func__, aid, apids[aid], audio_lang);
}
}
}
void cPlayback::FindAllSubs(uint16_t *spids, unsigned short *supported, uint16_t *numpids, std::string *language)
{
lt_info("%s\n", __func__);
hal_info("%s\n", __func__);
char buf[32];
pd->rmfp_command(CUSTOM_COMMAND_SUBS_COUNT, 0, false, buf, 3);
rmfp_command(CUSTOM_COMMAND_SUBS_COUNT, 0, false, buf, 3);
unsigned int spu_count = atoi(buf);
*numpids = spu_count;
@@ -515,7 +480,7 @@ void cPlayback::FindAllSubs(uint16_t *spids, unsigned short *supported, uint16_t
char streamidstring[11];
char spu_lang[21];
memset(buf, 0, sizeof(buf));
pd->rmfp_command(CUSTOM_COMMAND_GET_SUB_BY_ID, sid, true, buf, 32);
rmfp_command(CUSTOM_COMMAND_GET_SUB_BY_ID, sid, true, buf, 32);
memcpy(streamidstring, buf, 10);
streamidstring[10] = '\0';
memcpy(spu_lang, buf + 10, 20);
@@ -523,7 +488,7 @@ void cPlayback::FindAllSubs(uint16_t *spids, unsigned short *supported, uint16_t
spids[sid] = atoi(streamidstring);
language[sid] = spu_lang;
supported[sid] = 1;
lt_info("%s: #%d apid:%d lang: %s\n", __func__, sid, spids[sid], spu_lang);
hal_info("%s: #%d apid:%d lang: %s\n", __func__, sid, spids[sid], spu_lang);
}
}
//Add streamid -1 to be able to disable subtitles
@@ -539,36 +504,18 @@ void cPlayback::GetChapters(std::vector<int> &positions, std::vector<std::string
titles.clear();
}
void cPlayback::GetTitles(std::vector<int> &playlists, std::vector<std::string> &titles, int &current)
{
playlists.clear();
titles.clear();
current = 0;
}
void cPlayback::SetTitle(int /*title*/)
{
}
void cPlayback::RequestAbort(void)
{
}
uint64_t cPlayback::GetReadCount(void)
{
return 0;
}
cPlayback::cPlayback(int /*num*/)
{
lt_info("%s: constructor\n", __func__);
pd = new PBPrivate();
hal_info("%s: constructor\n", __func__);
playing = 0;
thread_started = false;
eof_reached = false;
open_success = false;
pthread_mutex_init(&rmfp_cmd_mutex, NULL);
}
cPlayback::~cPlayback()
{
lt_info("%s\n", __func__);
delete pd;
pd = NULL;
hal_info("%s\n", __func__);
pthread_mutex_destroy(&rmfp_cmd_mutex);
}

62
libazbox/playback_lib.h Normal file
View File

@@ -0,0 +1,62 @@
#ifndef __PLAYBACK_LIB_H__
#define __PLAYBACK_LIB_H__
#include <string>
#include <stdint.h>
#include <vector>
typedef enum {
PLAYMODE_TS = 0,
PLAYMODE_FILE,
} playmode_t;
class cPlayback
{
private:
pthread_mutex_t rmfp_cmd_mutex;
int playing;
bool eof_reached;
int playback_speed;
playmode_t playMode;
bool open_success;
uint16_t apid;
uint16_t subpid;
char *mfilename;
int mduration;
pthread_t thread;
bool thread_started;
/* private functions */
bool rmfp_command(int cmd, int param, bool has_param, char *buf, int buflen);
public:
cPlayback(int num = 0);
~cPlayback();
void run_rmfp();
bool Open(playmode_t PlayMode);
void Close(void);
bool Start(char *filename, unsigned short vpid, int vtype, unsigned short apid,
int ac3, unsigned int duration);
bool SetAPid(unsigned short pid, int ac3);
bool SetSpeed(int speed);
bool GetSpeed(int &speed) const;
bool GetPosition(int &position, int &duration); /* pos: current time in ms, dur: file length in ms */
bool SetPosition(int position, bool absolute = false); /* position: jump in ms */
void FindAllPids(uint16_t *apids, unsigned short *ac3flags, uint16_t *numpida, std::string *language);
void FindAllSubs(uint16_t *pids, unsigned short *supported, uint16_t *numpida, std::string *language);
bool SelectSubtitles(int pid);
void GetChapters(std::vector<int> &positions, std::vector<std::string> &titles);
#if 0
// Functions that are not used by movieplayer.cpp:
bool Stop(void);
bool GetOffset(off64_t &offset);
bool IsPlaying(void) const { return playing; }
bool IsEnabled(void) const { return enabled; }
void * GetHandle(void);
void * GetDmHandle(void);
int GetCurrPlaybackSpeed(void) const { return nPlaybackSpeed; }
void PlaybackNotify (int Event, void *pData, void *pTag);
void DMNotify(int Event, void *pTsBuf, void *Tag);
#endif
};
#endif // __PLAYBACK_LIB_H__

1
libazbox/record_lib.h Symbolic link
View File

@@ -0,0 +1 @@
../libspark/record_lib.h

View File

@@ -37,23 +37,21 @@
#include <proc_tools.h>
#include "video_hal.h"
#include "video_priv.h"
#include "video_lib.h"
#define VIDEO_DEVICE "/dev/dvb/adapter0/video0"
#include "lt_debug.h"
#define lt_debug(args...) _lt_debug(TRIPLE_DEBUG_VIDEO, this, args)
#define lt_info(args...) _lt_info(TRIPLE_DEBUG_VIDEO, this, args)
#define lt_debug_c(args...) _lt_debug(TRIPLE_DEBUG_VIDEO, NULL, args)
#define lt_info_c(args...) _lt_info(TRIPLE_DEBUG_VIDEO, NULL, args)
#include "hal_debug.h"
#define hal_debug(args...) _hal_debug(HAL_DEBUG_VIDEO, this, args)
#define hal_info(args...) _hal_info(HAL_DEBUG_VIDEO, this, args)
#define hal_debug_c(args...) _hal_debug(HAL_DEBUG_VIDEO, NULL, args)
#define hal_info_c(args...) _hal_info(HAL_DEBUG_VIDEO, NULL, args)
#define fop(cmd, args...) ({ \
int _r; \
if (fd >= 0) { \
if ((_r = ::cmd(fd, args)) < 0) \
lt_info(#cmd"(fd, "#args")\n"); \
hal_info(#cmd"(fd, "#args")\n"); \
else \
lt_debug(#cmd"(fd, "#args")\n");\
hal_debug(#cmd"(fd, "#args")\n");\
} \
else { _r = fd; } \
_r; \
@@ -78,21 +76,11 @@ static void show_iframe(int fd, unsigned char *iframe, size_t st_size);
cVideo::cVideo(int, void *, void *, unsigned int)
{
vdec = new VDec();
}
cVideo::~cVideo(void)
{
delete vdec;
vdec = NULL;
}
VDec::VDec(void)
{
lt_debug("%s\n", __FUNCTION__);
hal_debug("%s\n", __FUNCTION__);
//croppingMode = VID_DISPMODE_NORM;
//outputformat = VID_OUTFMT_RGBC_SVIDEO;
scartvoltage = -1;
video_standby = 0;
fd = -1;
@@ -104,7 +92,7 @@ VDec::VDec(void)
blank_size = 0;
blankfd = open(blankname, O_RDONLY|O_CLOEXEC);
if (blankfd < 0)
lt_info("%s cannot open %s: %m", __func__, blankname);
hal_info("%s cannot open %s: %m", __func__, blankname);
else
{
if (fstat(blankfd, &st) != -1 && st.st_size > 0)
@@ -112,10 +100,10 @@ VDec::VDec(void)
blank_size = st.st_size;
blank_data = (unsigned char *)malloc(blank_size);
if (! blank_data)
lt_info("%s malloc failed (%m)\n", __func__);
hal_info("%s malloc failed (%m)\n", __func__);
else if (read(blankfd, blank_data, blank_size) != blank_size)
{
lt_info("%s short read (%m)\n", __func__);
hal_info("%s short read (%m)\n", __func__);
free(blank_data); /* don't leak... */
blank_data = NULL;
}
@@ -123,20 +111,20 @@ VDec::VDec(void)
close(blankfd);
}
openDevice();
Pig(-1, -1, -1, -1, 1, 1);
Pig(-1, -1, -1, -1);
}
VDec::~VDec(void)
cVideo::~cVideo(void)
{
closeDevice();
if (blank_data)
free(blank_data);
}
void VDec::openDevice(void)
void cVideo::openDevice(void)
{
int n = 0;
lt_debug("%s\n", __func__);
hal_debug("%s\n", __func__);
/* todo: this fd checking is racy, should be protected by a lock */
if (fd != -1) /* already open */
return;
@@ -150,14 +138,14 @@ retry:
if (++n < 10)
goto retry;
}
lt_info("%s cannot open %s: %m, retries %d\n", __func__, VIDEO_DEVICE, n);
hal_info("%s cannot open %s: %m, retries %d\n", __func__, VIDEO_DEVICE, n);
}
playstate = VIDEO_STOPPED;
}
void VDec::closeDevice(void)
void cVideo::closeDevice(void)
{
lt_debug("%s\n", __func__);
hal_debug("%s\n", __func__);
if (fd >= 0)
close(fd);
fd = -1;
@@ -170,34 +158,31 @@ int cVideo::setAspectRatio(int aspect, int mode)
/* { "panscan", "letterbox", "fullscreen", "14:9", "(unset)" } */
static const char *m[] = { "1", "2", "0", "1", "(unset)" };
int n;
lt_debug("%s: a:%d m:%d %s\n", __func__, aspect, mode, m[(mode < 0||mode > 3) ? 4 : mode]);
int mo = (mode < 0||mode > 3) ? 4 : mode;
hal_debug("%s: a:%d m:%d %s\n", __func__, aspect, mode, m[(mo)]);
if (aspect > 3 || aspect == 0)
lt_info("%s: invalid aspect: %d\n", __func__, aspect);
hal_info("%s: invalid aspect: %d\n", __func__, aspect);
else if (aspect > 0) /* -1 == don't set */
{
lt_debug("%s: /proc/stb/video/aspect -> %s\n", __func__, a[aspect]);
hal_debug("%s: /proc/stb/video/aspect -> %s\n", __func__, a[aspect]);
n = proc_put("/proc/stb/video/aspect", a[aspect], strlen(a[aspect]));
if (n < 0)
lt_info("%s: proc_put /proc/stb/video/aspect (%m)\n", __func__);
hal_info("%s: proc_put /proc/stb/video/aspect (%m)\n", __func__);
}
if (mode == -1)
return 0;
lt_debug("%s: /proc/scalingmode -> %s\n", __func__, m[mode]);
n = proc_put("/proc/scalingmode", m[mode], strlen(m[mode]));
hal_debug("%s: /proc/scalingmode -> %s\n", __func__, m[mo]);
n = proc_put("/proc/scalingmode", m[mo], strlen(m[mo]));
if (n < 0)
return 1;
return 0;
}
int cVideo::getAspectRatio(void)
{
return vdec->getAspectRatio();
}
int VDec::getAspectRatio(void)
{
video_size_t s;
if (fd == -1)
@@ -208,14 +193,14 @@ int VDec::getAspectRatio(void)
}
if (fop(ioctl, VIDEO_GET_SIZE, &s) < 0)
{
lt_info("%s: VIDEO_GET_SIZE %m\n", __func__);
hal_info("%s: VIDEO_GET_SIZE %m\n", __func__);
return -1;
}
lt_debug("%s: %d\n", __func__, s.aspect_ratio);
hal_debug("%s: %d\n", __func__, s.aspect_ratio);
return s.aspect_ratio * 2 + 1;
}
int cVideo::setCroppingMode(void)
int cVideo::setCroppingMode(int /*vidDispMode_t format*/)
{
return 0;
#if 0
@@ -226,24 +211,14 @@ int cVideo::setCroppingMode(void)
f = format_string[format];
else
f = "ILLEGAL format!";
lt_debug("%s(%d) => %s\n", __FUNCTION__, format, f);
hal_debug("%s(%d) => %s\n", __FUNCTION__, format, f);
return fop(ioctl, MPEG_VID_SET_DISPMODE, format);
#endif
}
int cVideo::Start(void * /*PcrChannel*/, unsigned short /*PcrPid*/, unsigned short /*VideoPid*/, void * /*hChannel*/)
{
return vdec->Start();
}
int cVideo::Stop(bool blank)
{
return vdec->Stop(blank);
}
int VDec::Start(void)
{
lt_debug("%s playstate=%d\n", __FUNCTION__, playstate);
hal_debug("%s playstate=%d\n", __FUNCTION__, playstate);
#if 0
if (playstate == VIDEO_PLAYING)
return 0;
@@ -254,12 +229,12 @@ int VDec::Start(void)
return fop(ioctl, VIDEO_PLAY);
}
int VDec::Stop(bool blank)
int cVideo::Stop(bool blank)
{
lt_debug("%s(%d)\n", __FUNCTION__, blank);
hal_debug("%s(%d)\n", __FUNCTION__, blank);
if (stillpicture)
{
lt_debug("%s: stillpicture == true\n", __func__);
hal_debug("%s: stillpicture == true\n", __func__);
return -1;
}
/* blank parameter seems to not work on VIDEO_STOP */
@@ -269,12 +244,7 @@ int VDec::Stop(bool blank)
return fop(ioctl, VIDEO_STOP, blank ? 1 : 0);
}
int cVideo::setBlank(int b)
{
return vdec->setBlank(b);
}
int VDec::setBlank(int)
int cVideo::setBlank(int)
{
pthread_mutex_lock(&stillp_mutex);
if (blank_data)
@@ -285,7 +255,7 @@ int VDec::setBlank(int)
int cVideo::SetVideoSystem(int video_system, bool remember)
{
lt_debug("%s(%d, %d)\n", __func__, video_system, remember);
hal_debug("%s(%d, %d)\n", __func__, video_system, remember);
char current[32];
static const char *modes[] = {
"480i", // VIDEO_STD_NTSC
@@ -306,16 +276,16 @@ int cVideo::SetVideoSystem(int video_system, bool remember)
if (video_system > VIDEO_STD_MAX)
{
lt_info("%s: video_system (%d) > VIDEO_STD_MAX (%d)\n", __func__, video_system, VIDEO_STD_MAX);
hal_info("%s: video_system (%d) > VIDEO_STD_MAX (%d)\n", __func__, video_system, VIDEO_STD_MAX);
return -1;
}
int ret = proc_get("/proc/stb/video/videomode", current, 32);
if (strcmp(current, modes[video_system]) == 0)
{
lt_info("%s: video_system %d (%s) already set, skipping\n", __func__, video_system, current);
hal_info("%s: video_system %d (%s) already set, skipping\n", __func__, video_system, current);
return 0;
}
lt_info("%s: old: '%s' new: '%s'\n", __func__, current, modes[video_system]);
hal_info("%s: old: '%s' new: '%s'\n", __func__, current, modes[video_system]);
ret = proc_put("/proc/stb/video/videomode", modes[video_system],strlen(modes[video_system]));
return ret;
@@ -323,15 +293,15 @@ int cVideo::SetVideoSystem(int video_system, bool remember)
int cVideo::getPlayState(void)
{
return vdec->playstate;
return playstate;
}
void cVideo::SetVideoMode(analog_mode_t mode)
{
lt_debug("%s(%d)\n", __func__, mode);
hal_debug("%s(%d)\n", __func__, mode);
if (!(mode & ANALOG_SCART_MASK))
{
lt_debug("%s: non-SCART mode ignored\n", __func__);
hal_debug("%s: non-SCART mode ignored\n", __func__);
return;
}
const char *m;
@@ -344,21 +314,17 @@ void cVideo::SetVideoMode(analog_mode_t mode)
m = "rgb";
break;
default:
lt_info("%s unknown mode %d\n", __func__, mode);
hal_info("%s unknown mode %d\n", __func__, mode);
m = "rgb";
break; /* default to rgb */
}
proc_put("/proc/stb/avs/0/colorformat", m, strlen(m));
}
void cVideo::ShowPicture(const char * fname)
bool cVideo::ShowPicture(const char * fname)
{
vdec->ShowPicture(fname);
}
void VDec::ShowPicture(const char * fname)
{
lt_debug("%s(%s)\n", __func__, fname);
bool ret = false;
hal_debug("%s(%s)\n", __func__, fname);
char destname[512];
char cmd[512];
char *p;
@@ -368,19 +334,19 @@ void VDec::ShowPicture(const char * fname)
if (video_standby)
{
/* does not work and the driver does not seem to like it */
lt_info("%s: video_standby == true\n", __func__);
return;
hal_info("%s: video_standby == true\n", __func__);
return ret;
}
if (fd < 0)
if (fd == -1)
{
lt_info("%s: decoder not opened?\n", __func__);
return;
hal_info("%s: decoder not opened\n", __func__);
return ret;
}
strcpy(destname, "/var/cache");
if (stat(fname, &st2))
{
lt_info("%s: could not stat %s (%m)\n", __func__, fname);
return;
hal_info("%s: could not stat %s (%m)\n", __func__, fname);
return ret;
}
mkdir(destname, 0755);
/* the cache filename is (example for /share/tuxbox/neutrino/icons/radiomode.jpg):
@@ -414,7 +380,7 @@ void VDec::ShowPicture(const char * fname)
mfd = open(destname, O_RDONLY|O_CLOEXEC);
if (mfd < 0)
{
lt_info("%s cannot open %s: %m", __func__, destname);
hal_info("%s cannot open %s: %m", __func__, destname);
goto out;
}
fstat(mfd, &st);
@@ -424,32 +390,28 @@ void VDec::ShowPicture(const char * fname)
iframe = (unsigned char *)malloc(st.st_size);
if (! iframe)
{
lt_info("%s: malloc failed (%m)\n", __func__);
hal_info("%s: malloc failed (%m)\n", __func__);
goto out;
}
read(mfd, iframe, st.st_size);
show_iframe(fd, iframe, st.st_size);
free(iframe);
ret = true;
out:
close(mfd);
pthread_mutex_unlock(&stillp_mutex);
return;
return ret;
}
void cVideo::StopPicture()
{
lt_debug("%s\n", __func__);
vdec->stillpicture = false;
hal_debug("%s\n", __func__);
stillpicture = false;
}
void cVideo::Standby(unsigned int bOn)
{
vdec->Standby(bOn);
}
void VDec::Standby(unsigned int bOn)
{
lt_debug("%s(%d)\n", __func__, bOn);
hal_debug("%s(%d)\n", __func__, bOn);
if (bOn)
{
closeDevice();
@@ -466,16 +428,30 @@ void VDec::Standby(unsigned int bOn)
int cVideo::getBlank(void)
{
int ret = proc_get_hex("/proc/stb/vmpeg/0/xres");
lt_debug("%s => %d\n", __func__, !ret);
hal_debug("%s => %d\n", __func__, !ret);
return !ret;
}
void cVideo::Pig(int x, int y, int w, int h, int osd_w, int osd_h)
/* this function is regularly called, checks if video parameters
changed and triggers appropriate actions */
void cVideo::VideoParamWatchdog(void)
{
vdec->Pig(x, y, w, h, osd_w, osd_h);
#if 0
static unsigned int _v_info = (unsigned int) -1;
unsigned int v_info;
if (fd == -1)
return;
ioctl(fd, MPEG_VID_GET_V_INFO_RAW, &v_info);
if (_v_info != v_info)
{
hal_debug("%s params changed. old: %08x new: %08x\n", __FUNCTION__, _v_info, v_info);
setAspectRatio(-1, -1);
}
_v_info = v_info;
#endif
}
void VDec::Pig(int x, int y, int w, int h, int osd_w, int osd_h)
void cVideo::Pig(int x, int y, int w, int h, int osd_w, int osd_h)
{
char buffer[64];
int _x, _y, _w, _h;
@@ -483,7 +459,7 @@ void VDec::Pig(int x, int y, int w, int h, int osd_w, int osd_h)
* TODO: check this in the driver sources */
int xres = 720; /* proc_get_hex("/proc/stb/vmpeg/0/xres") */
int yres = 576; /* proc_get_hex("/proc/stb/vmpeg/0/yres") */
lt_debug("%s: x:%d y:%d w:%d h:%d ow:%d oh:%d\n", __func__, x, y, w, h, osd_w, osd_h);
hal_debug("%s: x:%d y:%d w:%d h:%d ow:%d oh:%d\n", __func__, x, y, w, h, osd_w, osd_h);
if (x == -1 && y == -1 && w == -1 && h == -1)
{
_w = xres;
@@ -498,7 +474,7 @@ void VDec::Pig(int x, int y, int w, int h, int osd_w, int osd_h)
_y = y * yres / osd_h;
_h = h * yres / osd_h;
}
lt_debug("%s: x:%d y:%d w:%d h:%d xr:%d yr:%d\n", __func__, _x, _y, _w, _h, xres, yres);
hal_debug("%s: x:%d y:%d w:%d h:%d xr:%d yr:%d\n", __func__, _x, _y, _w, _h, xres, yres);
sprintf(buffer, "%x", _x);
proc_put("/proc/stb/vmpeg/0/dst_left", buffer, strlen(buffer));
sprintf(buffer, "%x", _y);
@@ -520,13 +496,13 @@ static inline int rate2csapi(int rate)
return 1;
case 25:
return 2;
case 29976:
case 29970:
return 3;
case 30:
return 4;
case 50:
return 5;
case 50940:
case 59940:
return 6;
case 60:
return 7;
@@ -537,11 +513,6 @@ static inline int rate2csapi(int rate)
}
void cVideo::getPictureInfo(int &width, int &height, int &rate)
{
vdec->getPictureInfo(width, height, rate);
}
void VDec::getPictureInfo(int &width, int &height, int &rate)
{
video_size_t s;
int r;
@@ -559,12 +530,12 @@ void VDec::getPictureInfo(int &width, int &height, int &rate)
rate = rate2csapi(r);
height = s.h;
width = s.w;
lt_debug("%s: rate: %d, width: %d height: %d\n", __func__, rate, width, height);
hal_debug("%s: rate: %d, width: %d height: %d\n", __func__, rate, width, height);
}
void cVideo::SetSyncMode(AVSYNC_TYPE mode)
{
lt_debug("%s %d\n", __func__, mode);
hal_debug("%s %d\n", __func__, mode);
/*
* { 0, LOCALE_OPTIONS_OFF },
* { 1, LOCALE_OPTIONS_ON },
@@ -587,11 +558,6 @@ void cVideo::SetSyncMode(AVSYNC_TYPE mode)
};
int cVideo::SetStreamType(VIDEO_FORMAT type)
{
return vdec->SetStreamType(type);
}
int VDec::SetStreamType(VIDEO_FORMAT type)
{
static const char *VF[] = {
"VIDEO_FORMAT_MPEG2",
@@ -602,7 +568,7 @@ int VDec::SetStreamType(VIDEO_FORMAT type)
"VIDEO_FORMAT_PNG"
};
int t;
lt_debug("%s type=%s\n", __FUNCTION__, VF[type]);
hal_debug("%s type=%s\n", __FUNCTION__, VF[type]);
switch (type)
{
@@ -619,15 +585,15 @@ int VDec::SetStreamType(VIDEO_FORMAT type)
}
if (ioctl(fd, VIDEO_SET_STREAMTYPE, t) < 0)
lt_info("%s VIDEO_SET_STREAMTYPE(%d) failed: %m\n", __func__, t);
hal_info("%s VIDEO_SET_STREAMTYPE(%d) failed: %m\n", __func__, t);
return 0;
}
int64_t VDec::GetPTS(void)
int64_t cVideo::GetPTS(void)
{
int64_t pts = 0;
if (ioctl(fd, VIDEO_GET_PTS, &pts) < 0)
lt_info("%s: GET_PTS failed (%m)\n", __func__);
hal_info("%s: GET_PTS failed (%m)\n", __func__);
return pts;
}
@@ -640,7 +606,7 @@ static void show_iframe(int fd, unsigned char *iframe, size_t st_size)
size_t pos = 0;
int count = 7;
if (ioctl(fd, VIDEO_SET_FORMAT, VIDEO_FORMAT_16_9) < 0)
lt_info_c("%s: VIDEO_SET_FORMAT failed (%m)\n", __func__);
hal_info_c("%s: VIDEO_SET_FORMAT failed (%m)\n", __func__);
ioctl(fd, VIDEO_SET_STREAMTYPE, VIDEO_FORMAT_MPEG2);
ioctl(fd, VIDEO_SELECT_SOURCE, VIDEO_SOURCE_MEMORY);
ioctl(fd, VIDEO_PLAY);
@@ -669,5 +635,5 @@ static void show_iframe(int fd, unsigned char *iframe, size_t st_size)
void cVideo::SetDemux(cDemux *)
{
lt_debug("%s: not implemented yet\n", __func__);
hal_debug("%s: not implemented yet\n", __func__);
}

196
libazbox/video_lib.h Normal file
View File

@@ -0,0 +1,196 @@
#ifndef __VIDEO_LIB_H__
#define __VIDEO_LIB_H__
#include <linux/dvb/video.h>
#include "cs_types.h"
#include "dmx_hal.h"
typedef enum {
ANALOG_SD_RGB_CINCH = 0x00,
ANALOG_SD_YPRPB_CINCH,
ANALOG_HD_RGB_CINCH,
ANALOG_HD_YPRPB_CINCH,
ANALOG_SD_RGB_SCART = 0x10,
ANALOG_SD_YPRPB_SCART,
ANALOG_HD_RGB_SCART,
ANALOG_HD_YPRPB_SCART,
ANALOG_SCART_MASK = 0x10
} analog_mode_t;
typedef enum {
VIDEO_FORMAT_MPEG2 = 0,
VIDEO_FORMAT_MPEG4,
VIDEO_FORMAT_VC1,
VIDEO_FORMAT_JPEG,
VIDEO_FORMAT_GIF,
VIDEO_FORMAT_PNG
} VIDEO_FORMAT;
typedef enum {
VIDEO_SD = 0,
VIDEO_HD,
VIDEO_120x60i,
VIDEO_320x240i,
VIDEO_1440x800i,
VIDEO_360x288i
} VIDEO_DEFINITION;
typedef enum {
VIDEO_FRAME_RATE_23_976 = 0,
VIDEO_FRAME_RATE_24,
VIDEO_FRAME_RATE_25,
VIDEO_FRAME_RATE_29_97,
VIDEO_FRAME_RATE_30,
VIDEO_FRAME_RATE_50,
VIDEO_FRAME_RATE_59_94,
VIDEO_FRAME_RATE_60
} VIDEO_FRAME_RATE;
typedef enum {
DISPLAY_AR_1_1,
DISPLAY_AR_4_3,
DISPLAY_AR_14_9,
DISPLAY_AR_16_9,
DISPLAY_AR_20_9,
DISPLAY_AR_RAW,
} DISPLAY_AR;
typedef enum {
DISPLAY_AR_MODE_PANSCAN = 0,
DISPLAY_AR_MODE_LETTERBOX,
DISPLAY_AR_MODE_NONE,
DISPLAY_AR_MODE_PANSCAN2
} DISPLAY_AR_MODE;
typedef enum {
VIDEO_DB_DR_NEITHER = 0,
VIDEO_DB_ON,
VIDEO_DB_DR_BOTH
} VIDEO_DB_DR;
typedef enum {
VIDEO_PLAY_STILL = 0,
VIDEO_PLAY_CLIP,
VIDEO_PLAY_TRICK,
VIDEO_PLAY_MOTION,
VIDEO_PLAY_MOTION_NO_SYNC
} VIDEO_PLAY_MODE;
typedef enum {
VIDEO_STD_NTSC,
VIDEO_STD_SECAM,
VIDEO_STD_PAL,
VIDEO_STD_480P,
VIDEO_STD_576P,
VIDEO_STD_720P60,
VIDEO_STD_1080I60,
VIDEO_STD_720P50,
VIDEO_STD_1080I50,
VIDEO_STD_1080P30,
VIDEO_STD_1080P24,
VIDEO_STD_1080P25,
VIDEO_STD_AUTO,
VIDEO_STD_1080P50, /* SPARK only */
VIDEO_STD_MAX
} VIDEO_STD;
/* not used, for dummy functions */
typedef enum {
VIDEO_HDMI_CEC_MODE_OFF = 0,
VIDEO_HDMI_CEC_MODE_TUNER,
VIDEO_HDMI_CEC_MODE_RECORDER
} VIDEO_HDMI_CEC_MODE;
typedef enum
{
VIDEO_CONTROL_BRIGHTNESS = 0,
VIDEO_CONTROL_CONTRAST,
VIDEO_CONTROL_SATURATION,
VIDEO_CONTROL_HUE,
VIDEO_CONTROL_SHARPNESS,
VIDEO_CONTROL_MAX = VIDEO_CONTROL_SHARPNESS
} VIDEO_CONTROL;
class cVideo
{
friend class cDemux;
friend class cPlayback;
private:
/* video device */
int fd;
/* apparently we cannot query the driver's state
=> remember it */
video_play_state_t playstate;
int /*vidDispMode_t*/ croppingMode;
int /*vidOutFmt_t*/ outputformat;
int scartvoltage;
VIDEO_FORMAT StreamType;
VIDEO_DEFINITION VideoDefinition;
DISPLAY_AR DisplayAR;
VIDEO_PLAY_MODE SyncMode;
DISPLAY_AR_MODE ARMode;
VIDEO_DB_DR eDbDr;
DISPLAY_AR PictureAR;
VIDEO_FRAME_RATE FrameRate;
int video_standby;
int64_t GetPTS(void);
void openDevice(void);
void closeDevice(void);
public:
/* constructor & destructor */
cVideo(int mode, void *, void *, unsigned int unit = 0);
~cVideo(void);
void * GetTVEnc() { return NULL; };
void * GetTVEncSD() { return NULL; };
/* aspect ratio */
int getAspectRatio(void);
void getPictureInfo(int &width, int &height, int &rate);
int setAspectRatio(int aspect, int mode);
/* cropping mode */
int setCroppingMode(int x = 0 /*vidDispMode_t x = VID_DISPMODE_NORM*/);
/* get play state */
int getPlayState(void);
/* blank on freeze */
int getBlank(void);
int setBlank(int enable);
/* change video play state. Parameters are all unused. */
int Start(void *PcrChannel = NULL, unsigned short PcrPid = 0, unsigned short VideoPid = 0, void *x = NULL);
int Stop(bool blank = true);
bool Pause(void);
/* set video_system */
int SetVideoSystem(int video_system, bool remember = true);
int SetStreamType(VIDEO_FORMAT type);
void SetSyncMode(AVSYNC_TYPE mode);
bool SetCECMode(VIDEO_HDMI_CEC_MODE) { return true; };
void SetCECAutoView(bool) { return; };
void SetCECAutoStandby(bool) { return; };
bool ShowPicture(const char * fname);
void StopPicture();
void Standby(unsigned int bOn);
void Pig(int x, int y, int w, int h, int osd_w = 1064, int osd_h = 600);
void SetControl(int, int) { return; };
void VideoParamWatchdog(void);
void setContrast(int val);
void SetVideoMode(analog_mode_t mode);
void SetDBDR(int) { return; };
void SetAudioHandle(void *) { return; };
void SetAutoModes(int [VIDEO_STD_MAX]) { return; };
int OpenVBI(int) { return 0; };
int CloseVBI(void) { return 0; };
int StartVBI(unsigned short) { return 0; };
int StopVBI(void) { return 0; };
void SetDemux(cDemux *dmx);
};
#endif // __VIDEO_LIB_H__

27
libduckbox/Makefile.am Normal file
View File

@@ -0,0 +1,27 @@
noinst_LTLIBRARIES = libduckbox.la
AM_CPPFLAGS = \
-I$(top_srcdir)/common \
-I$(top_srcdir)/include \
-I$(top_srcdir)/libeplayer3-sh4/include
AM_CXXFLAGS = -fno-rtti -fno-exceptions -fno-strict-aliasing
AM_LDFLAGS = \
@AVFORMAT_LIBS@ \
@AVUTIL_LIBS@ \
@AVCODEC_LIBS@ \
@SWRESAMPLE_LIBS@ \
-lpthread -lasound -lass -lrt
libduckbox_la_SOURCES = \
hardware_caps.c \
dmx.cpp \
video.cpp \
audio.cpp \
audio_mixer.cpp \
init.cpp \
playback_libeplayer3.cpp \
record.cpp
AM_CPPFLAGS += -D__STDC_FORMAT_MACROS -D__STDC_CONSTANT_MACROS

1
libduckbox/audio.cpp Symbolic link
View File

@@ -0,0 +1 @@
../libspark/audio.cpp

1
libduckbox/audio_lib.h Symbolic link
View File

@@ -0,0 +1 @@
../libspark/audio_lib.h

1
libduckbox/audio_mixer.cpp Symbolic link
View File

@@ -0,0 +1 @@
../libspark/audio_mixer.cpp

1
libduckbox/audio_mixer.h Symbolic link
View File

@@ -0,0 +1 @@
../libspark/audio_mixer.h

1
libduckbox/dmx.cpp Symbolic link
View File

@@ -0,0 +1 @@
../libspark/dmx.cpp

352
libduckbox/hardware_caps.c Normal file
View File

@@ -0,0 +1,352 @@
/*
* determine the capabilities of the hardware.
* part of libstb-hal
*
* (C) 2010-2012 Stefan Seyfried
*
* License: GPL v2 or later
*/
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <stdio.h>
#include <string.h>
#include <unistd.h>
#include <hardware_caps.h>
static int initialized = 0;
static hw_caps_t caps;
hw_caps_t *get_hwcaps(void)
{
if (initialized)
return &caps;
memset(&caps, 0, sizeof(hw_caps_t));
initialized = 1;
char buf[64];
int len = -1;
int fd = open("/proc/stb/info/model", O_RDONLY);
caps.display_can_set_brightness = 0;
caps.display_can_deepstandby = 0;
caps.display_has_statusline = 0;
if (fd != -1) {
len = read(fd, buf, sizeof(buf) - 1);
close(fd);
}
if (len > 0) {
buf[len] = 0;
if (!strncmp(buf, "atevio7500", 10)) {
strcpy(caps.boxvendor, "DUCKBOX");
strcpy(caps.boxname, buf);
caps.can_shutdown = 1;
caps.has_HDMI = 1;
caps.has_SCART = 1;
caps.can_cec = 1;
caps.has_fan = 0;
caps.has_CI = 2;
caps.display_can_set_brightness = 1;
caps.display_type = HW_DISPLAY_LINE_TEXT;
caps.display_xres = 12;
}
else if (!strncmp(buf, "ufs912", 6)) {
strcpy(caps.boxvendor, "DUCKBOX");
strcpy(caps.boxname, buf);
caps.can_shutdown = 1;
caps.has_HDMI = 1;
caps.has_SCART = 1;
caps.can_cec = 1;
caps.has_fan = 0;
caps.has_CI = 2;
caps.display_can_set_brightness = 1;
caps.display_type = HW_DISPLAY_LINE_TEXT;
caps.display_xres = 16;
}
else if (!strncmp(buf, "ufs913", 6)) {
strcpy(caps.boxvendor, "DUCKBOX");
strcpy(caps.boxname, buf);
caps.can_shutdown = 1;
caps.has_HDMI = 1;
caps.has_SCART = 1;
caps.can_cec = 1;
caps.has_fan = 0;
caps.has_CI = 2;
caps.display_can_set_brightness = 1;
caps.display_type = HW_DISPLAY_LINE_TEXT;
caps.display_xres = 16;
}
else if (!strncmp(buf, "ufs922", 6)) {
strcpy(caps.boxvendor, "DUCKBOX");
strcpy(caps.boxname, buf);
caps.can_shutdown = 1;
caps.has_HDMI = 1;
caps.has_SCART = 1;
caps.can_cec = 0;
caps.has_fan = 1;
caps.has_CI = 2;
caps.display_can_set_brightness = 1;
caps.display_type = HW_DISPLAY_LINE_TEXT;
caps.display_xres = 16;
}
else if (!strncmp(buf, "ufs910", 6)) {
strcpy(caps.boxvendor, "DUCKBOX");
strcpy(caps.boxname, buf);
caps.can_shutdown = 1;
caps.has_HDMI = 1;
caps.has_SCART = 1;
caps.can_cec = 0;
caps.has_fan = 0;
caps.has_CI = 2;
caps.display_can_set_brightness = 1;
caps.display_type = HW_DISPLAY_LINE_TEXT;
caps.display_xres = 16;
}
else if (!strncmp(buf, "hdbox", 5)) {
strcpy(caps.boxvendor, "DUCKBOX");
strcpy(caps.boxname, buf);
caps.can_shutdown = 1;
caps.has_HDMI = 1;
caps.has_SCART = 1;
caps.can_cec = 0;
caps.has_fan = 0;
caps.has_CI = 2;
caps.display_can_set_brightness = 1;
caps.display_type = HW_DISPLAY_LINE_TEXT;
caps.display_xres = 12;
}
else if (!strncmp(buf, "octagon1008", 11)) {
strcpy(caps.boxvendor, "DUCKBOX");
strcpy(caps.boxname, buf);
caps.can_shutdown = 1;
caps.has_HDMI = 1;
caps.has_SCART = 1;
caps.can_cec = 0;
caps.has_fan = 0;
caps.has_CI = 2;
caps.display_can_set_brightness = 1;
caps.display_type = HW_DISPLAY_LINE_TEXT;
caps.display_xres = 8;
}
else if (!strncmp(buf, "hs7110", 6)) {
strcpy(caps.boxvendor, "DUCKBOX");
strcpy(caps.boxname, buf);
caps.can_shutdown = 1;
caps.has_HDMI = 1;
caps.has_SCART = 1;
caps.can_cec = 1;
caps.has_fan = 0;
}
else if (!strncmp(buf, "hs7810a", 7)) {
strcpy(caps.boxvendor, "DUCKBOX");
strcpy(caps.boxname, buf);
caps.can_shutdown = 1;
caps.has_HDMI = 1;
caps.has_SCART = 1;
caps.can_cec = 1;
caps.has_fan = 0;
}
else if (!strncmp(buf, "hs7119", 6)) {
strcpy(caps.boxvendor, "DUCKBOX");
strcpy(caps.boxname, buf);
caps.can_shutdown = 1;
caps.has_HDMI = 1;
caps.has_SCART = 1;
caps.can_cec = 1;
caps.has_fan = 0;
}
else if (!strncmp(buf, "hs7819", 6)) {
strcpy(caps.boxvendor, "DUCKBOX");
strcpy(caps.boxname, buf);
caps.can_shutdown = 1;
caps.has_HDMI = 1;
caps.has_SCART = 1;
caps.can_cec = 1;
caps.has_fan = 0;
}
else if (!strncmp(buf, "dp7000", 6)) {
strcpy(caps.boxvendor, "DUCKBOX");
strcpy(caps.boxname, buf);
caps.can_shutdown = 1;
caps.has_HDMI = 1;
caps.has_SCART = 1;
caps.can_cec = 1;
caps.has_fan = 0;
}
else if (!strncmp(buf, "cuberevo-mini", 14)) {
strcpy(caps.boxvendor, "DUCKBOX");
strcpy(caps.boxname, buf);
caps.can_shutdown = 1;
caps.has_HDMI = 1;
caps.has_SCART = 1;
caps.can_cec = 0;
caps.has_fan = 0;
caps.has_CI = 2;
}
else if (!strncmp(buf, "cuberevo-mini2", 14)) {
strcpy(caps.boxvendor, "DUCKBOX");
strcpy(caps.boxname, buf);
caps.can_shutdown = 1;
caps.has_HDMI = 1;
caps.has_SCART = 1;
caps.can_cec = 0;
caps.has_fan = 1;
caps.has_CI = 2;
caps.display_can_set_brightness = 1;
caps.display_type = HW_DISPLAY_LINE_TEXT;
caps.display_xres = 14;
}
else if (!strncmp(buf, "cuberevo-250hd", 4)) {
strcpy(caps.boxvendor, "DUCKBOX");
strcpy(caps.boxname, buf);
caps.can_shutdown = 1;
caps.has_HDMI = 1;
caps.has_SCART = 1;
caps.can_cec = 0;
caps.has_fan = 1;
caps.has_CI = 0;
}
else if (!strncmp(buf, "cuberevo-2000hd", 15)) {
strcpy(caps.boxvendor, "DUCKBOX");
strcpy(caps.boxname, buf);
caps.can_shutdown = 1;
caps.has_HDMI = 1;
caps.has_SCART = 1;
caps.can_cec = 0;
caps.has_fan = 0;
caps.has_CI = 0;
}
else if (!strncmp(buf, "cuberevo", 8)) {
strcpy(caps.boxvendor, "DUCKBOX");
strcpy(caps.boxname, buf);
caps.can_shutdown = 1;
caps.has_HDMI = 1;
caps.has_SCART = 1;
caps.can_cec = 0;
caps.has_fan = 1;
caps.has_CI = 2;
}
else if (!strncmp(buf, "cuberevo-3000hd", 14)) {
strcpy(caps.boxvendor, "DUCKBOX");
strcpy(caps.boxname, buf);
caps.can_shutdown = 1;
caps.has_HDMI = 1;
caps.has_SCART = 1;
caps.can_cec = 0;
caps.has_fan = 1;
caps.has_CI = 2;
}
else if (!strncmp(buf, "ipbox9900", 9)) {
strcpy(caps.boxvendor, "DUCKBOX");
strcpy(caps.boxname, buf);
caps.can_shutdown = 1;
caps.has_HDMI = 1;
caps.has_SCART = 2;
caps.can_cec = 0;
caps.has_fan = 1;
caps.has_CI = 2;
}
else if (!strncmp(buf, "ipbox99", 7)) {
strcpy(caps.boxvendor, "DUCKBOX");
strcpy(caps.boxname, buf);
caps.can_shutdown = 1;
caps.has_HDMI = 1;
caps.has_SCART = 1;
caps.can_cec = 0;
caps.has_fan = 1;
caps.has_CI = 0;
}
else if (!strncmp(buf, "ipbox55", 7)) {
strcpy(caps.boxvendor, "DUCKBOX");
strcpy(caps.boxname, buf);
caps.can_shutdown = 1;
caps.has_HDMI = 1;
caps.has_SCART = 1;
caps.can_cec = 0;
caps.has_fan = 0;
caps.has_CI = 0;
}
else if (!strncmp(buf, "tf7700", 6)) {
strcpy(caps.boxvendor, "DUCKBOX");
strcpy(caps.boxname, buf);
caps.can_shutdown = 1;
caps.has_HDMI = 1;
caps.has_SCART = 1;
caps.can_cec = 0;
caps.has_fan = 0;
caps.has_CI = 2;
}
else if (!strncmp(buf, "hl101", 5)) {
strcpy(caps.boxvendor, "DUCKBOX");
strcpy(caps.boxname, buf);
caps.can_shutdown = 1;
caps.has_HDMI = 1;
caps.has_SCART = 1;
caps.has_SCART_input = 1;
caps.can_cec = 1;
caps.has_fan = 0;
caps.has_CI = 2;
caps.display_can_set_brightness = 1;
caps.display_type = HW_DISPLAY_LINE_TEXT;
caps.display_xres = 8;
}
else if (!strncmp(buf, "arivalink200", 12)) {
strcpy(caps.boxvendor, "DUCKBOX");
strcpy(caps.boxname, buf);
caps.can_shutdown = 0;
caps.has_HDMI = 1;
caps.has_SCART = 1;
caps.can_cec = 1;
caps.has_fan = 0;
caps.has_CI = 2;
caps.display_can_set_brightness = 0;
}
else if ((!strncasecmp(buf, "nbox", 4)) ||
(!strncasecmp(buf, "adb_box", 7))) {
strcpy(caps.boxvendor, "DUCKBOX");
strcpy(caps.boxname, buf);
caps.can_shutdown = 0;
caps.has_HDMI = 1;
caps.has_SCART = 1;
caps.can_cec = 1;
caps.has_fan = 1;
caps.has_CI = 2;
caps.display_can_set_brightness = 1;
}
else if ((!strncasecmp(buf, "sagemcom88", 10)) ||
(!strncasecmp(buf, "esi_88", 6)) ||
(!strncasecmp(buf, "esi88", 5)) ||
(!strncasecmp(buf, "dsi87", 5))) {
strcpy(caps.boxvendor, "DUCKBOX");
strcpy(caps.boxname, buf);
caps.can_shutdown = 0;
caps.has_HDMI = 1;
caps.has_SCART = 1;
caps.can_cec = 1;
caps.has_fan = 1;
caps.has_CI = 0;
caps.display_can_set_brightness = 1;
}
else if (!strncasecmp(buf, "dsi87", 5)) {
strcpy(caps.boxvendor, "DUCKBOX");
strcpy(caps.boxname, buf);
caps.can_shutdown = 0;
caps.has_HDMI = 1;
caps.has_SCART = 0;
caps.can_cec = 1;
caps.has_fan = 0;
caps.has_CI = 0;
caps.display_can_set_brightness = 0;
}
else {
strcpy(caps.boxvendor, "unknown");
strcpy(caps.boxname, buf);
}
}
else
strcpy(caps.boxname, "(unknown model)");
strcpy(caps.boxarch,caps.boxname);
return &caps;
}

55
libduckbox/init.cpp Normal file
View File

@@ -0,0 +1,55 @@
#include <stdio.h>
#include <fcntl.h>
#include <sys/ioctl.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <linux/dvb/dmx.h>
#include "init.h"
#include "pwrmngr.h"
#include "hal_debug.h"
#define hal_debug(args...) _hal_debug(HAL_DEBUG_INIT, NULL, args)
#define hal_info(args...) _hal_info(HAL_DEBUG_INIT, NULL, args)
static bool initialized = false;
void hal_api_init()
{
if (!initialized)
hal_debug_init();
hal_info("%s begin, initialized=%d, debug=0x%02x\n", __FUNCTION__, (int)initialized, debuglevel);
if (!initialized)
{
/* this is a strange hack: the drivers seem to only work correctly after
* demux0 has been used once. After that, we can use demux1,2,... */
struct dmx_pes_filter_params p;
int dmx = open("/dev/dvb/adapter0/demux0", O_RDWR|O_CLOEXEC);
if (dmx < 0)
hal_info("%s: ERROR open /dev/dvb/adapter0/demux0 (%m)\n", __func__);
else
{
memset(&p, 0, sizeof(p));
p.output = DMX_OUT_DECODER;
p.input = DMX_IN_FRONTEND;
p.flags = DMX_IMMEDIATE_START;
p.pes_type = DMX_PES_VIDEO;
ioctl(dmx, DMX_SET_PES_FILTER, &p);
ioctl(dmx, DMX_STOP);
close(dmx);
}
}
initialized = true;
hal_info("%s end\n", __FUNCTION__);
}
void hal_api_exit()
{
hal_info("%s, initialized = %d\n", __FUNCTION__, (int)initialized);
initialized = false;
}

View File

@@ -0,0 +1 @@
../libspark/playback_libeplayer3.cpp

View File

@@ -0,0 +1 @@
../libspark/playback_libeplayer3.h

1
libduckbox/record_lib.h Symbolic link
View File

@@ -0,0 +1 @@
../libspark/record_lib.h

1
libduckbox/video.cpp Symbolic link
View File

@@ -0,0 +1 @@
../libspark/video.cpp

1
libduckbox/video_lib.h Symbolic link
View File

@@ -0,0 +1 @@
../libspark/video_lib.h

22
libdvbci/Makefile.am Normal file
View File

@@ -0,0 +1,22 @@
noinst_LTLIBRARIES = libdvbci.la
AM_CPPFLAGS = \
-I$(top_srcdir)/common \
-I$(top_srcdir)/include
AM_CXXFLAGS = -fno-rtti -fno-exceptions -fno-strict-aliasing
AM_LDFLAGS = -lpthread -lcrypto -lssl
libdvbci_la_SOURCES = \
dvbci_session.cpp \
dvbci_mmi.cpp \
dvbci_camgr.cpp \
misc.cpp \
descrambler.cpp \
dh_rsa_misc.cpp \
aes_xcbc_mac.cpp \
dvbci_ccmgr.cpp \
dvbci_appmgr.cpp \
dvbci_datetimemgr.cpp \
dvbci_resmgr.cpp

39
libdvbci/_dh_params.h Normal file
View File

@@ -0,0 +1,39 @@
/* DH */
unsigned char dh_p[256] = { /* prime */
0xd6, 0x27, 0x14, 0x7a, 0x7c, 0x0c, 0x26, 0x63, 0x9d, 0x82, 0xeb, 0x1f, 0x4a, 0x18, 0xff, 0x6c,
0x34, 0xad, 0xea, 0xa6, 0xc0, 0x23, 0xe6, 0x65, 0xfc, 0x8e, 0x32, 0xc3, 0x33, 0xf4, 0x91, 0xa7,
0xcc, 0x88, 0x58, 0xd7, 0xf3, 0xb3, 0x17, 0x5e, 0xb0, 0xa8, 0xeb, 0x5c, 0xd4, 0xd8, 0x3a, 0xae,
0x8e, 0x75, 0xa1, 0x50, 0x5f, 0x5d, 0x67, 0xc5, 0x40, 0xf4, 0xb3, 0x68, 0x35, 0xd1, 0x3a, 0x4c,
0x93, 0x7f, 0xca, 0xce, 0xdd, 0x83, 0x29, 0x01, 0xc8, 0x4b, 0x76, 0x81, 0x56, 0x34, 0x83, 0x31,
0x92, 0x72, 0x65, 0x7b, 0xac, 0xd9, 0xda, 0xa9, 0xd1, 0xd3, 0xe5, 0x77, 0x58, 0x6f, 0x5b, 0x44,
0x3e, 0xaf, 0x7f, 0x6d, 0xf5, 0xcf, 0x0a, 0x80, 0x0d, 0xa5, 0x56, 0x4f, 0x4b, 0x85, 0x41, 0x0f,
0x13, 0x41, 0x06, 0x1f, 0xf3, 0xd9, 0x65, 0x36, 0xae, 0x47, 0x41, 0x1f, 0x1f, 0xe0, 0xde, 0x69,
0xe5, 0x86, 0x2a, 0xa1, 0xf2, 0x48, 0x02, 0x92, 0x68, 0xa6, 0x37, 0x9f, 0x76, 0x4f, 0x7d, 0x94,
0x5d, 0x10, 0xe5, 0xab, 0x5d, 0xb2, 0xf3, 0x12, 0x8c, 0x79, 0x03, 0x92, 0xa6, 0x7f, 0x8a, 0x78,
0xb0, 0xba, 0xc5, 0xb5, 0x31, 0xc5, 0xc8, 0x22, 0x6e, 0x29, 0x02, 0x40, 0xab, 0xe7, 0x5c, 0x23,
0x33, 0x7f, 0xcb, 0x86, 0xc7, 0xb4, 0xfd, 0xaa, 0x44, 0xcd, 0x9c, 0x9f, 0xba, 0xac, 0x3a, 0xcf,
0x7e, 0x31, 0x5f, 0xa8, 0x47, 0xce, 0xca, 0x1c, 0xb4, 0x77, 0xa0, 0xec, 0x9a, 0x46, 0xd4, 0x79,
0x7b, 0x64, 0xbb, 0x6c, 0x91, 0xb2, 0x38, 0x01, 0x65, 0x11, 0x45, 0x9f, 0x62, 0x08, 0x6f, 0x31,
0xcf, 0xc4, 0xba, 0xdc, 0xd0, 0x03, 0x91, 0xf1, 0x18, 0x1f, 0xcb, 0x4d, 0xfc, 0x73, 0x5a, 0xa2,
0x15, 0xb8, 0x3c, 0x8d, 0x80, 0x92, 0x1c, 0xa1, 0x03, 0xd0, 0x83, 0x2f, 0x5f, 0xe3, 0x07, 0x69
};
unsigned char dh_g[256] = { /* generator */
0x95, 0x7d, 0xd1, 0x49, 0x68, 0xc1, 0xa5, 0xf1, 0x48, 0xe6, 0x50, 0x4f, 0xa1, 0x10, 0x72, 0xc4,
0xef, 0x12, 0xec, 0x2d, 0x94, 0xbe, 0xc7, 0x20, 0x2c, 0x94, 0xf9, 0x68, 0x67, 0x0e, 0x22, 0x17,
0xb5, 0x5c, 0x0b, 0xca, 0xac, 0x9f, 0x25, 0x9c, 0xd2, 0xa6, 0x1a, 0x20, 0x10, 0x16, 0x6a, 0x42,
0x27, 0x83, 0x47, 0x42, 0xa0, 0x07, 0x52, 0x09, 0x33, 0x97, 0x4e, 0x30, 0x57, 0xd8, 0xb7, 0x1e,
0x46, 0xa6, 0xba, 0x4e, 0x40, 0x6a, 0xe9, 0x1a, 0x5a, 0xa0, 0x74, 0x56, 0x92, 0x55, 0xc2, 0xbd,
0x44, 0xcd, 0xb3, 0x33, 0xf7, 0x35, 0x46, 0x25, 0xdf, 0x84, 0x19, 0xf3, 0xe2, 0x7a, 0xac, 0x4e,
0xee, 0x1a, 0x86, 0x3b, 0xb3, 0x87, 0xa6, 0x66, 0xc1, 0x70, 0x21, 0x41, 0xd3, 0x58, 0x36, 0xb5,
0x3b, 0x6e, 0xa1, 0x55, 0x60, 0x9a, 0x59, 0xd3, 0x85, 0xd8, 0xdc, 0x6a, 0xff, 0x41, 0xb6, 0xbf,
0x42, 0xde, 0x64, 0x00, 0xd0, 0xee, 0x3a, 0xa1, 0x8a, 0xed, 0x12, 0xf9, 0xba, 0x54, 0x5c, 0xdb,
0x06, 0x24, 0x49, 0xe8, 0x47, 0xcf, 0x5b, 0xe4, 0xbb, 0xc0, 0xaa, 0x8a, 0x8c, 0xbe, 0x73, 0xd9,
0x02, 0xea, 0xee, 0x8d, 0x87, 0x5b, 0xbf, 0x78, 0x04, 0x41, 0x9e, 0xa8, 0x5c, 0x3c, 0x49, 0xde,
0x88, 0x6d, 0x62, 0x21, 0x7f, 0xf0, 0x5e, 0x2d, 0x1d, 0xfc, 0x47, 0x0d, 0x1b, 0xaa, 0x4e, 0x0d,
0x78, 0x20, 0xfe, 0x57, 0x0f, 0xca, 0xdf, 0xeb, 0x3c, 0x84, 0xa7, 0xe1, 0x61, 0xb2, 0x95, 0x98,
0x07, 0x73, 0x8e, 0x51, 0xc6, 0x87, 0xe4, 0xcf, 0xf1, 0x5f, 0x86, 0x99, 0xec, 0x8d, 0x44, 0x92,
0x2c, 0x99, 0xf6, 0xc0, 0xf4, 0x39, 0xe8, 0x05, 0xbf, 0xc1, 0x56, 0xde, 0xfe, 0x93, 0x75, 0x06,
0x69, 0x87, 0x83, 0x06, 0x51, 0x80, 0xa5, 0x6e, 0xa6, 0x19, 0x7d, 0x3b, 0xef, 0xfb, 0xe0, 0x4a
};

62
libdvbci/aes_xcbc_mac.cpp Normal file
View File

@@ -0,0 +1,62 @@
#include <stdint.h>
#include <string.h>
#include <openssl/aes.h>
#include "aes_xcbc_mac.h"
int aes_xcbc_mac_init(struct aes_xcbc_mac_ctx *ctx, const uint8_t *key)
{
AES_KEY aes_key;
int y, x;
AES_set_encrypt_key(key, 128, &aes_key);
for (y = 0; y < 3; y++) {
for (x = 0; x < 16; x++)
ctx->K[y][x] = y + 1;
AES_ecb_encrypt(ctx->K[y], ctx->K[y], &aes_key, 1);
}
/* setup K1 */
AES_set_encrypt_key(ctx->K[0], 128, &ctx->key);
memset(ctx->IV, 0, 16);
ctx->buflen = 0;
return 0;
}
int aes_xcbc_mac_process(struct aes_xcbc_mac_ctx *ctx, const uint8_t *in, unsigned int len)
{
while (len) {
if (ctx->buflen == 16) {
AES_ecb_encrypt(ctx->IV, ctx->IV, &ctx->key, 1);
ctx->buflen = 0;
}
ctx->IV[ctx->buflen++] ^= *in++;
--len;
}
return 0;
}
int aes_xcbc_mac_done(struct aes_xcbc_mac_ctx *ctx, uint8_t *out)
{
int i;
if (ctx->buflen == 16) {
/* K2 */
for (i = 0; i < 16; i++)
ctx->IV[i] ^= ctx->K[1][i];
} else {
ctx->IV[ctx->buflen] ^= 0x80;
/* K3 */
for (i = 0; i < 16; i++)
ctx->IV[i] ^= ctx->K[2][i];
}
AES_ecb_encrypt(ctx->IV, ctx->IV, &ctx->key, 1);
memcpy(out, ctx->IV, 16);
return 0;
}

15
libdvbci/aes_xcbc_mac.h Normal file
View File

@@ -0,0 +1,15 @@
#ifndef __AES_XCBC_H_
#define __AES_XCBC_H_
struct aes_xcbc_mac_ctx {
uint8_t K[3][16];
uint8_t IV[16];
AES_KEY key;
int buflen;
};
int aes_xcbc_mac_init(struct aes_xcbc_mac_ctx *ctx, const uint8_t *key);
int aes_xcbc_mac_process(struct aes_xcbc_mac_ctx *ctx, const uint8_t *in, unsigned int len);
int aes_xcbc_mac_done(struct aes_xcbc_mac_ctx *ctx, uint8_t *out);
#endif

203
libdvbci/descrambler.cpp Normal file
View File

@@ -0,0 +1,203 @@
#include <stdio.h>
#include <unistd.h>
#include <fcntl.h>
#include <sys/ioctl.h>
#include <stdint.h>
#include <errno.h>
#include <string.h>
#include <linux/dvb/ca.h>
#include "misc.h"
#include "descrambler.h"
#include <config.h>
static const char * FILENAME = "[descrambler]";
static int desc_fd = -1;
static int desc_user_count = 0;
#ifndef CA_SET_PID
typedef struct ca_pid {
unsigned int pid;
int index; /* -1 == disable*/
} ca_pid_t;
#define CA_SET_PID _IOW('o', 135, ca_pid_t)
#endif
#ifndef CA_SET_DESCR_DATA
enum ca_descr_data_type {
CA_DATA_IV,
CA_DATA_KEY,
};
enum ca_descr_parity {
CA_PARITY_EVEN,
CA_PARITY_ODD,
};
struct ca_descr_data {
unsigned int index;
enum ca_descr_parity parity;
enum ca_descr_data_type data_type;
unsigned int length;
unsigned char *data;
};
#define CA_SET_DESCR_DATA _IOW('o', 137, struct ca_descr_data)
#endif
#if HAVE_ARM_HARDWARE || HAVE_MIPS_HARDWARE
static const char *descrambler_filename = "/dev/ciplus_ca0";
int descrambler_set_key(int index, int parity, unsigned char *data)
{
struct ca_descr_data d;
int ret;
printf("%s -> %s\n", FILENAME, __FUNCTION__);
if (descrambler_open())
{
//printf("Complete Data-> Index: (%d) Parity: (%d) -> ", index, parity);
//hexdump(data, 32);
d.index = index;
d.parity = (ca_descr_parity)parity;
d.data_type = CA_DATA_KEY;
d.length = 16;
d.data = data;
printf("AES Index: (%d) Parity: (%d) -> ", d.index, d.parity);
hexdump(d.data, 16);
ret = ioctl(desc_fd, CA_SET_DESCR_DATA, &d);
if (ret)
{
printf("CA_SET_DESCR_DATA (AES) index=%d parity=%d (errno=%d %s)\n", index, parity, errno, strerror(errno));
}
d.index = index;
d.parity = (ca_descr_parity)parity;
d.data_type = CA_DATA_IV;
d.length = 16;
d.data = data + 16;
printf("IV Index: (%d) Parity: (%d) -> ", d.index, d.parity);
hexdump(d.data, 16);
ret = ioctl(desc_fd, CA_SET_DESCR_DATA, &d);
if (ret)
{
printf("CA_SET_DESCR_DATA (IV) index=%d parity=%d (errno=%d %s)\n", index, parity, errno, strerror(errno));
}
}
return 0;
}
#else
static const char *descrambler_filename = "/dev/dvb/adapter0/ca3";
/* Byte 0 to 15 are AES Key, Byte 16 to 31 are IV */
int descrambler_set_key(int index, int parity, unsigned char *data)
{
struct ca_descr_data d;
printf("%s -> %s\n", FILENAME, __FUNCTION__);
index |= 0x100;
if (descrambler_open())
{
d.index = index;
d.parity = (ca_descr_parity)parity;
d.data_type = CA_DATA_KEY;
d.length = 32;
d.data = data;
#if 0
printf("Index: %d Parity: (%d) -> ", d.index, d.parity);
hexdump(d.data, 32);
#endif
if (ioctl(desc_fd, CA_SET_DESCR_DATA, &d))
{
printf("CA_SET_DESCR_DATA index=%d parity=%d (errno=%d %s)\n", index, parity, errno, strerror(errno));
}
printf("Index: %d Parity: (%d) -> ", d.index, d.parity);
hexdump(d.data, 32);
}
return 0;
}
#endif
/* we don't use this for sh4 ci cam ! */
int descrambler_set_pid(int index, int enable, int pid)
{
struct ca_pid p;
#if HAVE_ARM_HARDWARE || HAVE_MIPS_HARDWARE
unsigned int flags = 0x80;
if (index)
flags |= 0x40;
if (enable)
flags |= 0x20;
p.index = flags;
p.pid = pid;
#else
p.index = index;
if (enable)
p.pid = pid;
else
p.pid = -1;
#endif
printf("CA_SET_PID pid=0x%04x index=0x%04x\n", p.pid, p.index);
if (ioctl(desc_fd, CA_SET_PID, &p) == -1)
printf("CA_SET_PID pid=0x%04x index=0x%04x (errno=%d %s)\n", p.pid, p.index, errno, strerror(errno));
return 0;
}
bool descrambler_open(void)
{
if (desc_fd > 0)
return true;
desc_fd = open(descrambler_filename, O_RDWR | O_NONBLOCK );
if (desc_fd <= 0) {
printf("cannot open %s\n", descrambler_filename);
return false;
}
return true;
}
int descrambler_init(void)
{
desc_user_count++;
descrambler_open();
printf("%s -> %s %d\n", FILENAME, __FUNCTION__, desc_user_count);
return 0;
}
void descrambler_close(void)
{
close(desc_fd);
desc_fd = -1;
}
void descrambler_deinit(void)
{
desc_user_count--;
if (desc_user_count <= 0 && desc_fd > 0)
descrambler_close();
}

12
libdvbci/descrambler.h Normal file
View File

@@ -0,0 +1,12 @@
#ifndef __DESCR_H_
#define __DESCR_H_
int descrambler_init(void);
void descrambler_deinit(void);
bool descrambler_open(void);
void descrambler_close(void);
int descrambler_set_key(int index, int parity, unsigned char *data);
/* we don't use this for sh4 ci cam ! */
int descrambler_set_pid(int index, int enable, int pid);
#endif

262
libdvbci/dh_rsa_misc.cpp Normal file
View File

@@ -0,0 +1,262 @@
#include <stdint.h>
#include <string.h>
#include <openssl/dh.h>
#include <openssl/rsa.h>
#include <openssl/sha.h>
#include <openssl/opensslv.h>
#include "misc.h"
/* stolen from libtomcrypt */
static int pkcs_1_mgf1(const uint8_t *seed, unsigned long seedlen, uint8_t *mask, unsigned long masklen)
{
unsigned long hLen, x;
uint32_t counter;
uint8_t *buf;
/* get hash output size */
hLen = 20; /* SHA1 */
/* allocate memory */
buf = (uint8_t*)malloc(hLen);
if (buf == NULL) {
printf("error mem\n");
return -1;
}
/* start counter */
counter = 0;
while (masklen > 0) {
/* handle counter */
BYTE32(buf, counter);
++counter;
/* get hash of seed || counter */
unsigned char buffer[0x18];
memcpy(buffer, seed, seedlen);
memcpy(buffer + 0x14, buf, 4);
SHA1(buffer, 0x18, buf);
/* store it */
for (x = 0; x < hLen && masklen > 0; x++, masklen--)
*mask++ = buf[x];
}
free(buf);
return 0;
}
static int pkcs_1_pss_encode(const uint8_t *msghash, unsigned int msghashlen,
unsigned long saltlen, unsigned long modulus_bitlen,
uint8_t *out, unsigned int outlen)
{
unsigned char *DB, *mask, *salt, *hash;
unsigned long x, y, hLen, modulus_len;
int err = -1;
unsigned char *hashbuf;
unsigned int hashbuflen;
hLen = 20; /* SHA1 */
modulus_len = (modulus_bitlen >> 3) + (modulus_bitlen & 7 ? 1 : 0);
/* allocate ram for DB/mask/salt/hash of size modulus_len */
DB = (unsigned char*)malloc(modulus_len);
mask = (unsigned char*)malloc(modulus_len);
salt = (unsigned char*)malloc(modulus_len);
hash = (unsigned char*)malloc(modulus_len);
hashbuflen = 8 + msghashlen + saltlen;
hashbuf = (unsigned char*)malloc(hashbuflen);
if (!(DB && mask && salt && hash && hashbuf)) {
printf("out of memory\n");
goto LBL_ERR;
}
/* generate random salt */
if (saltlen > 0) {
if (get_random(salt, saltlen) != (long)saltlen) {
printf("rnd failed\n");
goto LBL_ERR;
}
}
/* M = (eight) 0x00 || msghash || salt, hash = H(M) */
memset(hashbuf, 0, 8);
memcpy(hashbuf + 8, msghash, msghashlen);
memcpy(hashbuf + 8 + msghashlen, salt, saltlen);
SHA1(hashbuf, hashbuflen, hash);
/* generate DB = PS || 0x01 || salt, PS == modulus_len - saltlen - hLen - 2 zero bytes */
x = 0;
memset(DB + x, 0, modulus_len - saltlen - hLen - 2);
x += modulus_len - saltlen - hLen - 2;
DB[x++] = 0x01;
memcpy(DB + x, salt, saltlen);
x += saltlen;
err = pkcs_1_mgf1(hash, hLen, mask, modulus_len - hLen - 1);
if (err)
goto LBL_ERR;
/* xor against DB */
for (y = 0; y < (modulus_len - hLen - 1); y++)
DB[y] ^= mask[y];
/* output is DB || hash || 0xBC */
if (outlen < modulus_len) {
err = -1;
printf("error overflow\n");
goto LBL_ERR;
}
/* DB len = modulus_len - hLen - 1 */
y = 0;
memcpy(out + y, DB, modulus_len - hLen - 1);
y += modulus_len - hLen - 1;
/* hash */
memcpy(out + y, hash, hLen);
y += hLen;
/* 0xBC */
out[y] = 0xBC;
/* now clear the 8*modulus_len - modulus_bitlen most significant bits */
out[0] &= 0xFF >> ((modulus_len << 3) - (modulus_bitlen - 1));
err = 0;
LBL_ERR:
free(hashbuf);
free(hash);
free(salt);
free(mask);
free(DB);
return err;
}
/* DH */
int dh_gen_exp(uint8_t *dest, int dest_len, uint8_t *dh_g, int dh_g_len, uint8_t *dh_p, int dh_p_len)
{
DH *dh;
int len;
unsigned int gap;
dh = DH_new();
#if OPENSSL_VERSION_NUMBER < 0x10100000L
dh->p = BN_bin2bn(dh_p, dh_p_len, 0);
dh->g = BN_bin2bn(dh_g, dh_g_len, 0);
dh->flags |= DH_FLAG_NO_EXP_CONSTTIME;
#else
BIGNUM *p = BN_bin2bn(dh_p, dh_p_len, 0);
BIGNUM *g = BN_bin2bn(dh_g, dh_g_len, 0);
DH_set0_pqg(dh, p, NULL, g);
#endif
DH_generate_key(dh);
#if OPENSSL_VERSION_NUMBER < 0x10100000L
len = BN_num_bytes(dh->priv_key);
#else
const BIGNUM *pub_key, *priv_key;
DH_get0_key(dh, &pub_key, &priv_key);
len = BN_num_bytes(priv_key);
#endif
if (len > dest_len) {
printf("len > dest_len\n");
return -1;
}
gap = dest_len - len;
memset(dest, 0, gap);
#if OPENSSL_VERSION_NUMBER < 0x10100000L
BN_bn2bin(dh->priv_key, &dest[gap]);
#else
BN_bn2bin(priv_key, &dest[gap]);
#endif
DH_free(dh);
return 0;
}
/* dest = base ^ exp % mod */
int dh_mod_exp(uint8_t *dest, int dest_len, uint8_t *base, int base_len, uint8_t *mod, int mod_len, uint8_t *exp, int exp_len)
{
BIGNUM *bn_dest, *bn_base, *bn_exp, *bn_mod;
BN_CTX *ctx;
int len;
unsigned int gap;
bn_base = BN_bin2bn(base, base_len, NULL);
bn_exp = BN_bin2bn(exp, exp_len, NULL);
bn_mod = BN_bin2bn(mod, mod_len, NULL);
ctx = BN_CTX_new();
bn_dest = BN_new();
BN_mod_exp(bn_dest, bn_base, bn_exp, bn_mod, ctx);
BN_CTX_free(ctx);
len = BN_num_bytes(bn_dest);
if (len > dest_len) {
printf("len > dest_len\n");
return -1;
}
gap = dest_len - len;
memset(dest, 0, gap);
BN_bn2bin(bn_dest, &dest[gap]);
BN_free(bn_dest);
BN_free(bn_mod);
BN_free(bn_exp);
BN_free(bn_base);
return 0;
}
int dh_dhph_signature(uint8_t *out, uint8_t *nonce, uint8_t *dhph, RSA *r)
{
unsigned char dest[302];
uint8_t hash[20];
unsigned char dbuf[256];
dest[0x00] = 0x00; /* version */
dest[0x01] = 0x00;
dest[0x02] = 0x08; /* len (bits) */
dest[0x03] = 0x01; /* version data */
dest[0x04] = 0x01; /* msg_label */
dest[0x05] = 0x00;
dest[0x06] = 0x08; /* len (bits) */
dest[0x07] = 0x02; /* message data */
dest[0x08] = 0x02; /* auth_nonce */
dest[0x09] = 0x01;
dest[0x0a] = 0x00; /* len (bits) */
memcpy(&dest[0x0b], nonce, 32);
dest[0x2b] = 0x04; /* DHPH - DH public key host */
dest[0x2c] = 0x08;
dest[0x2d] = 0x00; /* len (bits) */
memcpy(&dest[0x2e], dhph, 256);
SHA1(dest, 0x12e, hash);
if (pkcs_1_pss_encode(hash, 20, 20, 0x800, dbuf, sizeof(dbuf))) {
printf("pss encode failed\n");
return -1;
}
RSA_private_encrypt(sizeof(dbuf), dbuf, out, r, RSA_NO_PADDING);
return 0;
}

8
libdvbci/dh_rsa_misc.h Normal file
View File

@@ -0,0 +1,8 @@
#ifndef __DH_RSA_MISC_H_
#define __DH_RSA_MISC_H_
int dh_gen_exp(uint8_t *dest, int dest_len, uint8_t *dh_g, int dh_g_len, uint8_t *dh_p, int dh_p_len);
int dh_mod_exp(uint8_t *dest, int dest_len, uint8_t *base, int base_len, uint8_t *mod, int mod_len, uint8_t *exp, int exp_len);
int dh_dhph_signature(uint8_t *out, uint8_t *nonce, uint8_t *dhph, RSA *r);
#endif

Some files were not shown because too many files have changed in this diff Show More