mirror of
https://projects.vdr-developer.org/git/vdr-plugin-softhddevice.git
synced 2023-10-10 17:16:51 +00:00
Compare commits
15 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
00cafd18ed | ||
|
|
ab4e89132e | ||
|
|
3585f1df19 | ||
|
|
e258c35537 | ||
|
|
91dbe46786 | ||
|
|
a7389111ff | ||
|
|
27e9a88e2f | ||
|
|
33e9c71aea | ||
|
|
bd84e3f3b9 | ||
|
|
364cc04736 | ||
| ec4a899bb8 | |||
|
|
dab31e2367 | ||
|
|
e613ff1f7e | ||
|
|
1886b745e5 | ||
|
|
422c378a5e |
34
ChangeLog
34
ChangeLog
@@ -1,5 +1,37 @@
|
|||||||
User johns
|
User johns
|
||||||
Date:
|
Date: Thu Feb 2 23:29:35 CET 2012
|
||||||
|
|
||||||
|
Release Version 0.4.6
|
||||||
|
Warn only on the first duplicated frame in sequence.
|
||||||
|
Increase audio buffer, if bigger audio delay is used.
|
||||||
|
Makes SkipLines configure in setup menu.
|
||||||
|
Auto-crop only enabled with normal 4:3 display mode.
|
||||||
|
Vaapi updates OSD when cropping changes.
|
||||||
|
Add A-V info output and compile time option.
|
||||||
|
Fix bug: VA-API intel software decoder broken by aspect commit.
|
||||||
|
Add support for 4:3 output modes.
|
||||||
|
Quicker auto-crop after channel switch.
|
||||||
|
Add auto-crop support for Intel VA-API backend.
|
||||||
|
Fix bug: Auto-Crop logo skip didn't use displayed width.
|
||||||
|
Workaround for mpeg2 FFMpeg + VA-API + Intel GPU hung.
|
||||||
|
Fix bug: Missing vaSyncSurface and vaDestroyImage.
|
||||||
|
Fix bug: Only black picture with VA-API hw decoder.
|
||||||
|
|
||||||
|
User HelAu
|
||||||
|
Date: Mon Jan 30 16:54:47 CET 2012
|
||||||
|
|
||||||
|
Add support to start the plugin in suspended mode.
|
||||||
|
|
||||||
|
User johns
|
||||||
|
Date: Mon Jan 30 15:58:21 CET 2012
|
||||||
|
|
||||||
|
Finished rewrite of video code, to support output modules.
|
||||||
|
Add aspect change support to software decoder path.
|
||||||
|
Repair software decoder with vaapi vdpau backend.
|
||||||
|
Add workaround for Intel VA-API MPEG GPU hung.
|
||||||
|
|
||||||
|
User johns
|
||||||
|
Date: Sat Jan 28 13:32:12 CET 2012
|
||||||
|
|
||||||
Release Version 0.4.5
|
Release Version 0.4.5
|
||||||
Add configurable skip lines at video top and bottom.
|
Add configurable skip lines at video top and bottom.
|
||||||
|
|||||||
1
Makefile
1
Makefile
@@ -19,6 +19,7 @@ GIT_REV = $(shell git describe --always 2>/dev/null)
|
|||||||
### Configuration (edit this for your needs)
|
### Configuration (edit this for your needs)
|
||||||
|
|
||||||
CONFIG := #-DDEBUG
|
CONFIG := #-DDEBUG
|
||||||
|
CONFIG += -DAV_INFO
|
||||||
#CONFIG += -DHAVE_PTHREAD_NAME
|
#CONFIG += -DHAVE_PTHREAD_NAME
|
||||||
CONFIG += $(shell pkg-config --exists vdpau && echo "-DUSE_VDPAU")
|
CONFIG += $(shell pkg-config --exists vdpau && echo "-DUSE_VDPAU")
|
||||||
CONFIG += $(shell pkg-config --exists libva && echo "-DUSE_VAAPI")
|
CONFIG += $(shell pkg-config --exists libva && echo "-DUSE_VAAPI")
|
||||||
|
|||||||
@@ -146,6 +146,8 @@ Setup: /etc/vdr/setup.conf
|
|||||||
if detected crop area is too small, cut max 'n' pixels at top and
|
if detected crop area is too small, cut max 'n' pixels at top and
|
||||||
bottom.
|
bottom.
|
||||||
|
|
||||||
|
softhddevice.SkipLines = 0
|
||||||
|
skip 'n' lines at top and bottom of the video picture.
|
||||||
|
|
||||||
softhddevice.Suspend.Close = 0
|
softhddevice.Suspend.Close = 0
|
||||||
1 suspend closes x11 window, connection and audio device.
|
1 suspend closes x11 window, connection and audio device.
|
||||||
|
|||||||
21
Todo
21
Todo
@@ -21,11 +21,10 @@ $Id: $
|
|||||||
missing:
|
missing:
|
||||||
software deinterlace (yadif, ...)
|
software deinterlace (yadif, ...)
|
||||||
software decoder with software deinterlace
|
software decoder with software deinterlace
|
||||||
zoom/fit-zoom 4:3 (SetVideoDisplayFormat, SetVideoFormat?)
|
|
||||||
ITU BT601, ITU BT709 (HD), RGB studio levels (16-235)?
|
ITU BT601, ITU BT709 (HD), RGB studio levels (16-235)?
|
||||||
suspend output / energie saver: stop and restart X11
|
suspend output / energie saver: stop and restart X11
|
||||||
|
suspend plugin didn't restore full-screen (is this wanted?)
|
||||||
Option deinterlace off / deinterlace force!
|
Option deinterlace off / deinterlace force!
|
||||||
Make output drivers better modular (under construction).
|
|
||||||
|
|
||||||
crash:
|
crash:
|
||||||
AudioPlayHandlerThread -> pthread_cond_wait
|
AudioPlayHandlerThread -> pthread_cond_wait
|
||||||
@@ -38,15 +37,18 @@ video:
|
|||||||
suspendoutput didn't show logo or black pictures
|
suspendoutput didn't show logo or black pictures
|
||||||
(must detect video format to show image)
|
(must detect video format to show image)
|
||||||
hard channel switch
|
hard channel switch
|
||||||
skip line not configurable from setup menu.
|
skip lines not configurable from setup menu.
|
||||||
|
OSD can only be shown after some stream could be shown
|
||||||
|
|
||||||
vdpau:
|
vdpau:
|
||||||
|
software decoder path not working
|
||||||
|
|
||||||
libva:
|
libva:
|
||||||
yaepghd (VaapiSetOutputPosition) support
|
yaepghd (VaapiSetOutputPosition) support
|
||||||
can associate only displayed part of osd
|
can associate only displayed part of osd
|
||||||
grab image for va-api
|
grab image for va-api
|
||||||
still many:
|
remove stderr output of libva init
|
||||||
|
still many: (workaround export NO_MPEG_HW=1)
|
||||||
[drm:i915_hangcheck_elapsed] *ERROR* Hangcheck timer elapsed... GPU hung
|
[drm:i915_hangcheck_elapsed] *ERROR* Hangcheck timer elapsed... GPU hung
|
||||||
[drm:i915_wait_request] *ERROR* i915_wait_request returns -11 ...
|
[drm:i915_wait_request] *ERROR* i915_wait_request returns -11 ...
|
||||||
|
|
||||||
@@ -54,21 +56,24 @@ libva: branch vaapi-ext
|
|||||||
add support for vaapi-ext
|
add support for vaapi-ext
|
||||||
|
|
||||||
libva-intel-driver:
|
libva-intel-driver:
|
||||||
|
deinterlace only supported with vaapi-ext
|
||||||
1080i does no v-sync (sometimes correct working with vaapi-ext)
|
1080i does no v-sync (sometimes correct working with vaapi-ext)
|
||||||
OSD has sometimes wrong size (workaround written)
|
OSD has sometimes wrong size (workaround written)
|
||||||
software decoder needs UV swab
|
sometimes software decoder deinterlace isn't working and 1080i channels
|
||||||
|
show artefacts
|
||||||
|
|
||||||
libva-vdpau-driver:
|
libva-vdpau-driver:
|
||||||
G210/GT520 OSD update too slow (needs hardware problem workaround)
|
G210/GT520 OSD update too slow (needs hardware problem workaround)
|
||||||
hangup on exit (VaapiDelDecoder -> VaapiCleanup
|
hangup on exit (VaapiDelDecoder -> VaapiCleanup
|
||||||
-> vaDestroyContext -> pthread_rwlock_wrlock)
|
-> vaDestroyContext -> pthread_rwlock_wrlock)
|
||||||
with auto-crop OSD has wrong position
|
OSD still has some problems with auto-crop and 4:3 zoom.
|
||||||
|
|
||||||
libva-xvba-driver:
|
libva-xvba-driver:
|
||||||
with auto-crop OSD has wrong position
|
|
||||||
|
|
||||||
x11:
|
x11:
|
||||||
disable screensaver
|
disable screensaver
|
||||||
|
skip multiple configure-notify, handle only the last one.
|
||||||
|
support embedded mode
|
||||||
|
|
||||||
audio:
|
audio:
|
||||||
write TS -> PES parser, which feeds audio before the next start packet
|
write TS -> PES parser, which feeds audio before the next start packet
|
||||||
@@ -85,6 +90,7 @@ audio/alsa:
|
|||||||
|
|
||||||
audio/oss:
|
audio/oss:
|
||||||
alsa oss emulation mixer "pcm" not working
|
alsa oss emulation mixer "pcm" not working
|
||||||
|
oss4 mixer channel not working
|
||||||
ring buffer overflow with alsa oss emulation
|
ring buffer overflow with alsa oss emulation
|
||||||
|
|
||||||
HDMI/SPDIF Passthrough:
|
HDMI/SPDIF Passthrough:
|
||||||
@@ -118,5 +124,6 @@ future features (not planed for 1.0 - 1.5)
|
|||||||
atmolight support
|
atmolight support
|
||||||
multistream handling
|
multistream handling
|
||||||
pip support
|
pip support
|
||||||
|
save and use auto-crop with channel zapping
|
||||||
|
|
||||||
upmix stereo to AC-3
|
upmix stereo to AC-3
|
||||||
|
|||||||
25
audio.c
25
audio.c
@@ -137,7 +137,7 @@ static unsigned AudioSampleRate; ///< audio sample rate in hz
|
|||||||
static unsigned AudioChannels; ///< number of audio channels
|
static unsigned AudioChannels; ///< number of audio channels
|
||||||
static const int AudioBytesProSample = 2; ///< number of bytes per sample
|
static const int AudioBytesProSample = 2; ///< number of bytes per sample
|
||||||
static int64_t AudioPTS; ///< audio pts clock
|
static int64_t AudioPTS; ///< audio pts clock
|
||||||
static const int AudioBufferTime = 450; ///< audio buffer time in ms
|
static const int AudioBufferTime = 350; ///< audio buffer time in ms
|
||||||
|
|
||||||
#ifdef USE_AUDIO_THREAD
|
#ifdef USE_AUDIO_THREAD
|
||||||
static pthread_t AudioThread; ///< audio play thread
|
static pthread_t AudioThread; ///< audio play thread
|
||||||
@@ -147,6 +147,8 @@ static pthread_cond_t AudioStartCond; ///< condition variable
|
|||||||
static const int AudioThread; ///< dummy audio thread
|
static const int AudioThread; ///< dummy audio thread
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
extern int VideoAudioDelay; /// import audio/video delay
|
||||||
|
|
||||||
#ifdef USE_AUDIORING
|
#ifdef USE_AUDIORING
|
||||||
|
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
@@ -900,6 +902,7 @@ static int AlsaSetup(int *freq, int *channels, int use_ac3)
|
|||||||
snd_pcm_uframes_t period_size;
|
snd_pcm_uframes_t period_size;
|
||||||
int err;
|
int err;
|
||||||
int ret;
|
int ret;
|
||||||
|
int delay;
|
||||||
snd_pcm_t *handle;
|
snd_pcm_t *handle;
|
||||||
|
|
||||||
if (!AlsaPCMHandle) { // alsa not running yet
|
if (!AlsaPCMHandle) { // alsa not running yet
|
||||||
@@ -1085,11 +1088,14 @@ static int AlsaSetup(int *freq, int *channels, int use_ac3)
|
|||||||
|
|
||||||
AlsaStartThreshold = snd_pcm_frames_to_bytes(AlsaPCMHandle, period_size);
|
AlsaStartThreshold = snd_pcm_frames_to_bytes(AlsaPCMHandle, period_size);
|
||||||
// buffer time/delay in ms
|
// buffer time/delay in ms
|
||||||
|
delay = AudioBufferTime;
|
||||||
|
if (VideoAudioDelay > -100) {
|
||||||
|
delay += 100 + VideoAudioDelay / 90;
|
||||||
|
}
|
||||||
if (AlsaStartThreshold <
|
if (AlsaStartThreshold <
|
||||||
(*freq * *channels * AudioBytesProSample * AudioBufferTime) / 1000U) {
|
(*freq * *channels * AudioBytesProSample * delay) / 1000U) {
|
||||||
AlsaStartThreshold =
|
AlsaStartThreshold =
|
||||||
(*freq * *channels * AudioBytesProSample * AudioBufferTime) /
|
(*freq * *channels * AudioBytesProSample * delay) / 1000U;
|
||||||
1000U;
|
|
||||||
}
|
}
|
||||||
// no bigger, than the buffer
|
// no bigger, than the buffer
|
||||||
if (AlsaStartThreshold > RingBufferFreeBytes(AlsaRingBuffer)) {
|
if (AlsaStartThreshold > RingBufferFreeBytes(AlsaRingBuffer)) {
|
||||||
@@ -1622,6 +1628,7 @@ static int OssSetup(int *freq, int *channels, int use_ac3)
|
|||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
int tmp;
|
int tmp;
|
||||||
|
int delay;
|
||||||
|
|
||||||
if (OssPcmFildes == -1) { // OSS not ready
|
if (OssPcmFildes == -1) { // OSS not ready
|
||||||
return -1;
|
return -1;
|
||||||
@@ -1708,12 +1715,14 @@ static int OssSetup(int *freq, int *channels, int use_ac3)
|
|||||||
// start when enough bytes for initial write
|
// start when enough bytes for initial write
|
||||||
OssStartThreshold = bi.bytes + tmp;
|
OssStartThreshold = bi.bytes + tmp;
|
||||||
// buffer time/delay in ms
|
// buffer time/delay in ms
|
||||||
|
delay = AudioBufferTime;
|
||||||
|
if (VideoAudioDelay > -100) {
|
||||||
|
delay += 100 + VideoAudioDelay / 90;
|
||||||
|
}
|
||||||
if (OssStartThreshold <
|
if (OssStartThreshold <
|
||||||
(*freq * *channels * AudioBytesProSample * AudioBufferTime) /
|
(*freq * *channels * AudioBytesProSample * delay) / 1000U) {
|
||||||
1000U) {
|
|
||||||
OssStartThreshold =
|
OssStartThreshold =
|
||||||
(*freq * *channels * AudioBytesProSample * AudioBufferTime) /
|
(*freq * *channels * AudioBytesProSample * delay) / 1000U;
|
||||||
1000U;
|
|
||||||
}
|
}
|
||||||
// no bigger, than the buffer
|
// no bigger, than the buffer
|
||||||
if (OssStartThreshold > RingBufferFreeBytes(OssRingBuffer)) {
|
if (OssStartThreshold > RingBufferFreeBytes(OssRingBuffer)) {
|
||||||
|
|||||||
91
softhddev.c
91
softhddev.c
@@ -61,6 +61,8 @@ static char ConfigVdpauDecoder = 1; ///< use vdpau decoder, if possible
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
static char ConfigFullscreen; ///< fullscreen modus
|
static char ConfigFullscreen; ///< fullscreen modus
|
||||||
|
static char ConfigStartSuspended; ///< flag to start in suspend mode
|
||||||
|
static char ConfigStartX11Server; ///< flag start the x11 server
|
||||||
|
|
||||||
static pthread_mutex_t SuspendLockMutex; ///< suspend lock mutex
|
static pthread_mutex_t SuspendLockMutex; ///< suspend lock mutex
|
||||||
|
|
||||||
@@ -485,6 +487,50 @@ static void VideoNextPacket(int codec_id)
|
|||||||
avpkt->dts = AV_NOPTS_VALUE;
|
avpkt->dts = AV_NOPTS_VALUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
** Fix packet for FFMpeg.
|
||||||
|
**
|
||||||
|
** Some tv-stations sends mulitple pictures in a singe PES packet.
|
||||||
|
** Current ffmpeg 0.10 and libav-0.8 has problems with this.
|
||||||
|
** Split the packet into single picture packets.
|
||||||
|
*/
|
||||||
|
void FixPacketForFFMpeg(VideoDecoder * MyVideoDecoder, AVPacket * avpkt)
|
||||||
|
{
|
||||||
|
uint8_t *p;
|
||||||
|
int n;
|
||||||
|
AVPacket tmp[1];
|
||||||
|
int first;
|
||||||
|
|
||||||
|
p = avpkt->data;
|
||||||
|
n = avpkt->size;
|
||||||
|
*tmp = *avpkt;
|
||||||
|
|
||||||
|
first = 1;
|
||||||
|
while (n > 4) {
|
||||||
|
// scan for picture header 0x00000100
|
||||||
|
if (!p[0] && !p[1] && p[2] == 0x01 && !p[3]) {
|
||||||
|
if (first) {
|
||||||
|
first = 0;
|
||||||
|
n -= 4;
|
||||||
|
p += 4;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
// packet has already an picture header
|
||||||
|
tmp->size = p - tmp->data;
|
||||||
|
CodecVideoDecode(MyVideoDecoder, tmp);
|
||||||
|
// time-stamp only valid for first packet
|
||||||
|
tmp->pts = AV_NOPTS_VALUE;
|
||||||
|
tmp->dts = AV_NOPTS_VALUE;
|
||||||
|
tmp->data = p;
|
||||||
|
tmp->size = n;
|
||||||
|
}
|
||||||
|
--n;
|
||||||
|
++p;
|
||||||
|
}
|
||||||
|
|
||||||
|
CodecVideoDecode(MyVideoDecoder, tmp);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
** Decode from PES packet ringbuffer.
|
** Decode from PES packet ringbuffer.
|
||||||
*/
|
*/
|
||||||
@@ -559,7 +605,33 @@ int VideoDecode(void)
|
|||||||
avpkt->size = avpkt->stream_index;
|
avpkt->size = avpkt->stream_index;
|
||||||
avpkt->stream_index = 0;
|
avpkt->stream_index = 0;
|
||||||
|
|
||||||
|
if (0) {
|
||||||
|
static int done;
|
||||||
|
|
||||||
|
if (done < 2) {
|
||||||
|
int fildes;
|
||||||
|
int who_designed_this_is____;
|
||||||
|
|
||||||
|
if (done == 0)
|
||||||
|
fildes =
|
||||||
|
open("frame0.pes", O_WRONLY | O_TRUNC | O_CREAT, 0666);
|
||||||
|
else if (done == 1)
|
||||||
|
fildes =
|
||||||
|
open("frame1.pes", O_WRONLY | O_TRUNC | O_CREAT, 0666);
|
||||||
|
else
|
||||||
|
fildes =
|
||||||
|
open("frame2.pes", O_WRONLY | O_TRUNC | O_CREAT, 0666);
|
||||||
|
done++;
|
||||||
|
who_designed_this_is____ = write(fildes, avpkt->data, avpkt->size);
|
||||||
|
close(fildes);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (last_codec_id == CODEC_ID_MPEG2VIDEO) {
|
||||||
|
FixPacketForFFMpeg(MyVideoDecoder, avpkt);
|
||||||
|
} else {
|
||||||
CodecVideoDecode(MyVideoDecoder, avpkt);
|
CodecVideoDecode(MyVideoDecoder, avpkt);
|
||||||
|
}
|
||||||
|
|
||||||
avpkt->size = saved_size;
|
avpkt->size = saved_size;
|
||||||
|
|
||||||
@@ -894,6 +966,10 @@ uint8_t *GrabImage(int *size, int jpeg, int quality, int width, int height)
|
|||||||
*/
|
*/
|
||||||
void SetPlayMode(void)
|
void SetPlayMode(void)
|
||||||
{
|
{
|
||||||
|
if (ConfigStartSuspended) { // ignore first call, if start suspended
|
||||||
|
ConfigStartSuspended = 0;
|
||||||
|
return;
|
||||||
|
}
|
||||||
Resume();
|
Resume();
|
||||||
if (MyVideoDecoder) {
|
if (MyVideoDecoder) {
|
||||||
if (VideoCodecID != CODEC_ID_NONE) {
|
if (VideoCodecID != CODEC_ID_NONE) {
|
||||||
@@ -1079,8 +1155,6 @@ void OsdDrawARGB(int x, int y, int height, int width, const uint8_t * argb)
|
|||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
static char ConfigStartX11Server; ///< flag start the x11 server
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
** Return command line help string.
|
** Return command line help string.
|
||||||
*/
|
*/
|
||||||
@@ -1091,7 +1165,7 @@ const char *CommandLineHelp(void)
|
|||||||
" -d display\tdisplay of x11 server (fe. :0.0)\n"
|
" -d display\tdisplay of x11 server (fe. :0.0)\n"
|
||||||
" -f\t\tstart with fullscreen window (only with window manager)\n"
|
" -f\t\tstart with fullscreen window (only with window manager)\n"
|
||||||
" -g geometry\tx11 window geometry wxh+x+y\n"
|
" -g geometry\tx11 window geometry wxh+x+y\n"
|
||||||
" -x\t\tstart x11 server\n";
|
" -x\t\tstart x11 server\n" " -s\t\tstart in suspended mode\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -1106,7 +1180,7 @@ int ProcessArgs(int argc, char *const argv[])
|
|||||||
// Parse arguments.
|
// Parse arguments.
|
||||||
//
|
//
|
||||||
for (;;) {
|
for (;;) {
|
||||||
switch (getopt(argc, argv, "-a:p:d:fg:x")) {
|
switch (getopt(argc, argv, "-a:p:d:fg:xs")) {
|
||||||
case 'a': // audio device
|
case 'a': // audio device
|
||||||
AudioSetDevice(optarg);
|
AudioSetDevice(optarg);
|
||||||
continue;
|
continue;
|
||||||
@@ -1130,6 +1204,9 @@ int ProcessArgs(int argc, char *const argv[])
|
|||||||
case 'x': // x11 server
|
case 'x': // x11 server
|
||||||
ConfigStartX11Server = 1;
|
ConfigStartX11Server = 1;
|
||||||
continue;
|
continue;
|
||||||
|
case 's': // start in suspend mode
|
||||||
|
ConfigStartSuspended = 1;
|
||||||
|
continue;
|
||||||
case EOF:
|
case EOF:
|
||||||
break;
|
break;
|
||||||
case '-':
|
case '-':
|
||||||
@@ -1311,6 +1388,7 @@ void Start(void)
|
|||||||
}
|
}
|
||||||
CodecInit();
|
CodecInit();
|
||||||
|
|
||||||
|
if (!ConfigStartSuspended) {
|
||||||
// FIXME: AudioInit for HDMI after X11 startup
|
// FIXME: AudioInit for HDMI after X11 startup
|
||||||
AudioInit();
|
AudioInit();
|
||||||
MyAudioDecoder = CodecAudioNewDecoder();
|
MyAudioDecoder = CodecAudioNewDecoder();
|
||||||
@@ -1319,7 +1397,10 @@ void Start(void)
|
|||||||
if (!ConfigStartX11Server) {
|
if (!ConfigStartX11Server) {
|
||||||
StartVideo();
|
StartVideo();
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
SkipVideo = 1;
|
||||||
|
SkipAudio = 1;
|
||||||
|
}
|
||||||
pthread_mutex_init(&SuspendLockMutex, NULL);
|
pthread_mutex_init(&SuspendLockMutex, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ extern "C"
|
|||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
static const char *const VERSION = "0.4.5";
|
static const char *const VERSION = "0.4.6";
|
||||||
static const char *const DESCRIPTION =
|
static const char *const DESCRIPTION =
|
||||||
trNOOP("A software and GPU emulated HD device");
|
trNOOP("A software and GPU emulated HD device");
|
||||||
|
|
||||||
@@ -61,6 +61,8 @@ static const char *const Resolution[RESOLUTIONS] = {
|
|||||||
static char ConfigMakePrimary; ///< config primary wanted
|
static char ConfigMakePrimary; ///< config primary wanted
|
||||||
static char ConfigHideMainMenuEntry; ///< config hide main menu entry
|
static char ConfigHideMainMenuEntry; ///< config hide main menu entry
|
||||||
|
|
||||||
|
static int ConfigVideoSkipLines; ///< config skip lines top/bottom
|
||||||
|
|
||||||
/// config deinterlace
|
/// config deinterlace
|
||||||
static int ConfigVideoDeinterlace[RESOLUTIONS];
|
static int ConfigVideoDeinterlace[RESOLUTIONS];
|
||||||
|
|
||||||
@@ -77,7 +79,6 @@ static int ConfigVideoSharpen[RESOLUTIONS];
|
|||||||
static int ConfigVideoScaling[RESOLUTIONS];
|
static int ConfigVideoScaling[RESOLUTIONS];
|
||||||
|
|
||||||
static int ConfigVideoAudioDelay; ///< config audio delay
|
static int ConfigVideoAudioDelay; ///< config audio delay
|
||||||
static int ConfigVideoSkipLines; ///< config skip lines top/bottom
|
|
||||||
static int ConfigAudioPassthrough; ///< config audio pass-through
|
static int ConfigAudioPassthrough; ///< config audio pass-through
|
||||||
|
|
||||||
static int ConfigAutoCropInterval; ///< auto crop detection interval
|
static int ConfigAutoCropInterval; ///< auto crop detection interval
|
||||||
@@ -364,6 +365,7 @@ class cMenuSetupSoft:public cMenuSetupPage
|
|||||||
protected:
|
protected:
|
||||||
int MakePrimary;
|
int MakePrimary;
|
||||||
int HideMainMenuEntry;
|
int HideMainMenuEntry;
|
||||||
|
int SkipLines;
|
||||||
int Scaling[RESOLUTIONS];
|
int Scaling[RESOLUTIONS];
|
||||||
int Deinterlace[RESOLUTIONS];
|
int Deinterlace[RESOLUTIONS];
|
||||||
int SkipChromaDeinterlace[RESOLUTIONS];
|
int SkipChromaDeinterlace[RESOLUTIONS];
|
||||||
@@ -428,6 +430,11 @@ cMenuSetupSoft::cMenuSetupSoft(void)
|
|||||||
// video
|
// video
|
||||||
//
|
//
|
||||||
Add(SeparatorItem(tr("Video")));
|
Add(SeparatorItem(tr("Video")));
|
||||||
|
|
||||||
|
SkipLines = ConfigVideoSkipLines;
|
||||||
|
Add(new cMenuEditIntItem(tr("Skip lines top+bot (pixel)"), &SkipLines, 0,
|
||||||
|
64));
|
||||||
|
|
||||||
for (i = 0; i < RESOLUTIONS; ++i) {
|
for (i = 0; i < RESOLUTIONS; ++i) {
|
||||||
Add(SeparatorItem(resolution[i]));
|
Add(SeparatorItem(resolution[i]));
|
||||||
Scaling[i] = ConfigVideoScaling[i];
|
Scaling[i] = ConfigVideoScaling[i];
|
||||||
@@ -491,6 +498,9 @@ void cMenuSetupSoft::Store(void)
|
|||||||
SetupStore("HideMainMenuEntry", ConfigHideMainMenuEntry =
|
SetupStore("HideMainMenuEntry", ConfigHideMainMenuEntry =
|
||||||
HideMainMenuEntry);
|
HideMainMenuEntry);
|
||||||
|
|
||||||
|
SetupStore("SkipLines", ConfigVideoSkipLines = SkipLines);
|
||||||
|
VideoSetSkipLines(ConfigVideoSkipLines);
|
||||||
|
|
||||||
for (i = 0; i < RESOLUTIONS; ++i) {
|
for (i = 0; i < RESOLUTIONS; ++i) {
|
||||||
char buf[128];
|
char buf[128];
|
||||||
|
|
||||||
@@ -520,8 +530,10 @@ void cMenuSetupSoft::Store(void)
|
|||||||
|
|
||||||
SetupStore("AutoCrop.Interval", ConfigAutoCropInterval = AutoCropInterval);
|
SetupStore("AutoCrop.Interval", ConfigAutoCropInterval = AutoCropInterval);
|
||||||
SetupStore("AutoCrop.Delay", ConfigAutoCropDelay = AutoCropDelay);
|
SetupStore("AutoCrop.Delay", ConfigAutoCropDelay = AutoCropDelay);
|
||||||
SetupStore("AutoCrop.Tolerance", ConfigAutoCropTolerance = AutoCropTolerance);
|
SetupStore("AutoCrop.Tolerance", ConfigAutoCropTolerance =
|
||||||
VideoSetAutoCrop(ConfigAutoCropInterval, ConfigAutoCropDelay, ConfigAutoCropTolerance);
|
AutoCropTolerance);
|
||||||
|
VideoSetAutoCrop(ConfigAutoCropInterval, ConfigAutoCropDelay,
|
||||||
|
ConfigAutoCropTolerance);
|
||||||
|
|
||||||
SetupStore("Suspend.Close", ConfigSuspendClose = SuspendClose);
|
SetupStore("Suspend.Close", ConfigSuspendClose = SuspendClose);
|
||||||
SetupStore("Suspend.X11", ConfigSuspendX11 = SuspendX11);
|
SetupStore("Suspend.X11", ConfigSuspendX11 = SuspendX11);
|
||||||
@@ -625,6 +637,7 @@ class cSoftHdDevice:public cDevice
|
|||||||
virtual bool Poll(cPoller &, int = 0);
|
virtual bool Poll(cPoller &, int = 0);
|
||||||
virtual bool Flush(int = 0);
|
virtual bool Flush(int = 0);
|
||||||
virtual int64_t GetSTC(void);
|
virtual int64_t GetSTC(void);
|
||||||
|
virtual void SetVideoDisplayFormat(eVideoDisplayFormat);
|
||||||
virtual void GetVideoSize(int &, int &, double &);
|
virtual void GetVideoSize(int &, int &, double &);
|
||||||
virtual void GetOsdSize(int &, int &, double &);
|
virtual void GetOsdSize(int &, int &, double &);
|
||||||
virtual int PlayVideo(const uchar *, int);
|
virtual int PlayVideo(const uchar *, int);
|
||||||
@@ -740,6 +753,10 @@ bool cSoftHdDevice::SetPlayMode(ePlayMode play_mode)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
** Gets the current System Time Counter, which can be used to
|
||||||
|
** synchronize audio, video and subtitles.
|
||||||
|
*/
|
||||||
int64_t cSoftHdDevice::GetSTC(void)
|
int64_t cSoftHdDevice::GetSTC(void)
|
||||||
{
|
{
|
||||||
//dsyslog("[softhddev]%s:\n", __FUNCTION__);
|
//dsyslog("[softhddev]%s:\n", __FUNCTION__);
|
||||||
@@ -843,6 +860,28 @@ bool cSoftHdDevice::Flush(int timeout_ms)
|
|||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
/**
|
||||||
|
** Sets the video display format to the given one (only useful if this
|
||||||
|
** device has an MPEG decoder).
|
||||||
|
**
|
||||||
|
** @note FIXME: this function isn't called on the initial channel
|
||||||
|
*/
|
||||||
|
void cSoftHdDevice::
|
||||||
|
SetVideoDisplayFormat(eVideoDisplayFormat video_display_format)
|
||||||
|
{
|
||||||
|
static int last = -1;
|
||||||
|
|
||||||
|
cDevice::SetVideoDisplayFormat(video_display_format);
|
||||||
|
|
||||||
|
dsyslog("[softhddev]%s: %d\n", __FUNCTION__, video_display_format);
|
||||||
|
|
||||||
|
// called on every channel switch, no need to kill osd...
|
||||||
|
if (last != video_display_format) {
|
||||||
|
last = video_display_format;
|
||||||
|
::VideoSetDisplayFormat(video_display_format);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
** Returns the width, height and video_aspect ratio of the currently
|
** Returns the width, height and video_aspect ratio of the currently
|
||||||
** displayed video material.
|
** displayed video material.
|
||||||
@@ -1168,6 +1207,10 @@ bool cPluginSoftHdDevice::SetupParse(const char *name, const char *value)
|
|||||||
ConfigHideMainMenuEntry = atoi(value);
|
ConfigHideMainMenuEntry = atoi(value);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
if (!strcmp(name, "SkipLines")) {
|
||||||
|
VideoSetSkipLines(ConfigVideoSkipLines = atoi(value));
|
||||||
|
return true;
|
||||||
|
}
|
||||||
for (i = 0; i < RESOLUTIONS; ++i) {
|
for (i = 0; i < RESOLUTIONS; ++i) {
|
||||||
char buf[128];
|
char buf[128];
|
||||||
|
|
||||||
@@ -1204,10 +1247,6 @@ bool cPluginSoftHdDevice::SetupParse(const char *name, const char *value)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!strcmp(name, "SkipLines")) {
|
|
||||||
VideoSetSkipLines(ConfigVideoSkipLines = atoi(value));
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
if (!strcmp(name, "AudioDelay")) {
|
if (!strcmp(name, "AudioDelay")) {
|
||||||
VideoSetAudioDelay(ConfigVideoAudioDelay = atoi(value));
|
VideoSetAudioDelay(ConfigVideoAudioDelay = atoi(value));
|
||||||
return true;
|
return true;
|
||||||
@@ -1228,7 +1267,8 @@ bool cPluginSoftHdDevice::SetupParse(const char *name, const char *value)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (!strcmp(name, "AutoCrop.Tolerance")) {
|
if (!strcmp(name, "AutoCrop.Tolerance")) {
|
||||||
VideoSetAutoCrop(ConfigAutoCropInterval, ConfigAutoCropDelay, ConfigAutoCropTolerance = atoi(value));
|
VideoSetAutoCrop(ConfigAutoCropInterval, ConfigAutoCropDelay,
|
||||||
|
ConfigAutoCropTolerance = atoi(value));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1268,10 +1308,8 @@ const char **cPluginSoftHdDevice::SVDRPHelpPages(void)
|
|||||||
{
|
{
|
||||||
// FIXME: translation?
|
// FIXME: translation?
|
||||||
static const char *text[] = {
|
static const char *text[] = {
|
||||||
"SUSP\n"
|
"SUSP\n" " Suspend plugin.\n",
|
||||||
" Suspend plugin.\n",
|
"RESU\n" " Resume plugin.\n",
|
||||||
"RESU\n"
|
|
||||||
" Resume plugin.\n",
|
|
||||||
NULL
|
NULL
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
16
video.h
16
video.h
@@ -47,16 +47,17 @@ extern unsigned VideoGetSurface(VideoHwDecoder *);
|
|||||||
extern void VideoReleaseSurface(VideoHwDecoder *, unsigned);
|
extern void VideoReleaseSurface(VideoHwDecoder *, unsigned);
|
||||||
|
|
||||||
#ifdef LIBAVCODEC_VERSION
|
#ifdef LIBAVCODEC_VERSION
|
||||||
/// Render a ffmpeg frame.
|
|
||||||
extern void VideoRenderFrame(VideoHwDecoder *, AVCodecContext *, AVFrame *);
|
|
||||||
|
|
||||||
/// Get ffmpeg vaapi context.
|
|
||||||
extern struct vaapi_context *VideoGetVaapiContext(VideoHwDecoder *);
|
|
||||||
|
|
||||||
/// Callback to negotiate the PixelFormat.
|
/// Callback to negotiate the PixelFormat.
|
||||||
extern enum PixelFormat Video_get_format(VideoHwDecoder *, AVCodecContext *,
|
extern enum PixelFormat Video_get_format(VideoHwDecoder *, AVCodecContext *,
|
||||||
const enum PixelFormat *);
|
const enum PixelFormat *);
|
||||||
|
|
||||||
|
/// Render a ffmpeg frame.
|
||||||
|
extern void VideoRenderFrame(VideoHwDecoder *, const AVCodecContext *,
|
||||||
|
const AVFrame *);
|
||||||
|
|
||||||
|
/// Get ffmpeg vaapi context.
|
||||||
|
extern struct vaapi_context *VideoGetVaapiContext(VideoHwDecoder *);
|
||||||
|
|
||||||
#ifdef AVCODEC_VDPAU_H
|
#ifdef AVCODEC_VDPAU_H
|
||||||
/// Draw vdpau render state.
|
/// Draw vdpau render state.
|
||||||
extern void VideoDrawRenderState(VideoHwDecoder *,
|
extern void VideoDrawRenderState(VideoHwDecoder *,
|
||||||
@@ -79,6 +80,9 @@ extern void VideoSetOutputPosition(int, int, int, int);
|
|||||||
/// Set video mode.
|
/// Set video mode.
|
||||||
extern void VideoSetVideoMode(int, int, int, int);
|
extern void VideoSetVideoMode(int, int, int, int);
|
||||||
|
|
||||||
|
/// Set display format.
|
||||||
|
extern void VideoSetDisplayFormat(int);
|
||||||
|
|
||||||
/// Set video fullscreen mode.
|
/// Set video fullscreen mode.
|
||||||
extern void VideoSetFullscreen(int);
|
extern void VideoSetFullscreen(int);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user