Cleanups + Version 0.1.2 released.

This commit is contained in:
Johns 2011-12-24 15:27:46 +01:00
parent f18b0bda1c
commit 8b57af53b6
6 changed files with 16 additions and 82 deletions

View File

@ -1,5 +1,12 @@
User johns User johns
Date: Date: Sat Dec 24 15:26:27 CET 2011
Release Version 0.1.2
Fix wrong decoder->SurfaceField again.
Remove interlaced_frame debug, it can't be used.
Fix new video stream never resets, if buffers full.
Date: Fri Dec 23 21:31:27 CET 2011
Release Version 0.1.1 Release Version 0.1.1
Initial VDPAU decoder support. Initial VDPAU decoder support.

View File

@ -17,7 +17,7 @@ VERSION = $(shell grep 'static const char \*const VERSION *=' $(PLUGIN).cpp | aw
### Configuration (edit this for your needs) ### Configuration (edit this for your needs)
CONFIG := -DDEBUG CONFIG := #-DDEBUG
CONFIG += $(shell pkg-config --exists libva && echo "-DUSE_VAAPI") CONFIG += $(shell pkg-config --exists libva && echo "-DUSE_VAAPI")
CONFIG += $(shell pkg-config --exists vdpau && echo "-DUSE_VDPAU") CONFIG += $(shell pkg-config --exists vdpau && echo "-DUSE_VDPAU")

1
Todo
View File

@ -10,6 +10,7 @@ missing:
vdpau: vdpau:
1080i with temporal spatial too slow GT 520 1080i with temporal spatial too slow GT 520
Dr. Dish H264 black picture
libva-intel-driver: libva-intel-driver:
intel still has hangups most with 1080i intel still has hangups most with 1080i

View File

@ -417,7 +417,6 @@ void CodecVideoOpen(VideoDecoder * decoder, const char *name, int codec_id)
if (!(decoder->Frame = avcodec_alloc_frame())) { if (!(decoder->Frame = avcodec_alloc_frame())) {
Fatal(_("codec: can't allocate decoder frame\n")); Fatal(_("codec: can't allocate decoder frame\n"));
} }
// reset buggy ffmpeg/libav flag // reset buggy ffmpeg/libav flag
decoder->GetFormatDone = 0; decoder->GetFormatDone = 0;
} }

View File

@ -205,7 +205,6 @@ static char VideoClearBuffers; ///< clear video buffers
#ifdef DEBUG #ifdef DEBUG
static int VideoMaxPacketSize; ///< biggest used packet buffer static int VideoMaxPacketSize; ///< biggest used packet buffer
static uint32_t VideoStartTick; ///< video start tick
#endif #endif
/** /**
@ -221,13 +220,9 @@ static void VideoPacketInit(void)
for (i = 0; i < VIDEO_PACKET_MAX; ++i) { for (i = 0; i < VIDEO_PACKET_MAX; ++i) {
avpkt = &VideoPacketRb[i]; avpkt = &VideoPacketRb[i];
// build a clean ffmpeg av packet // build a clean ffmpeg av packet
av_init_packet(avpkt); if (av_new_packet(avpkt, VIDEO_BUFFER_SIZE)) {
avpkt->destruct = av_destruct_packet;
avpkt->data = av_malloc(VIDEO_BUFFER_SIZE);
if (!avpkt->data) {
Fatal(_("[softhddev]: out of memory\n")); Fatal(_("[softhddev]: out of memory\n"));
} }
avpkt->size = VIDEO_BUFFER_SIZE;
avpkt->priv = NULL; avpkt->priv = NULL;
} }
@ -263,21 +258,15 @@ static void VideoEnqueue(int64_t pts, const void *data, int size)
} }
#endif #endif
} }
#ifdef xxDEBUG
if (!avpkt->stream_index) { // debug save time of first packet
avpkt->pos = GetMsTicks();
}
#endif
if (!VideoStartTick) { // tick of first valid packet
VideoStartTick = GetMsTicks();
}
memcpy(avpkt->data + avpkt->stream_index, data, size); memcpy(avpkt->data + avpkt->stream_index, data, size);
avpkt->stream_index += size; avpkt->stream_index += size;
#ifdef DEBUG
if (avpkt->stream_index > VideoMaxPacketSize) { if (avpkt->stream_index > VideoMaxPacketSize) {
VideoMaxPacketSize = avpkt->stream_index; VideoMaxPacketSize = avpkt->stream_index;
Debug(3, "video: max used PES packet size: %d\n", VideoMaxPacketSize); Debug(3, "video: max used PES packet size: %d\n", VideoMaxPacketSize);
} }
#endif
} }
/** /**
@ -402,70 +391,6 @@ int VideoDecode(void)
return 0; return 0;
} }
#if 0
/**
** Flush video buffer.
*/
void VideoFlushInput(void)
{
// flush all buffered packets
while (atomic_read(&VideoPacketsFilled)) {
VideoPacketRead = (VideoPacketRead + 1) % VIDEO_PACKET_MAX;
atomic_dec(&VideoPacketsFilled);
}
VideoStartTick = 0;
}
/**
** Wakeup video handler.
*/
void VideoWakeup(void)
{
int filled;
uint32_t now;
uint64_t delay;
filled = atomic_read(&VideoPacketsFilled);
if (!filled) {
Debug(3, "video: wakeup no packets buffered\n");
return;
}
now = GetMsTicks();
if (filled < VIDEO_PACKET_MAX && VideoStartTick + 1000 > now) {
delay = AudioGetDelay() / 90;
if (delay < 100) { // no audio delay known
delay = 750;
}
delay -= 40;
if (VideoStartTick + delay > now) {
Debug(3, "video: %d packets %u/%lu delayed\n", filled,
(unsigned)(now - VideoStartTick), delay);
return;
}
}
VideoDecode();
#if 0
AVPacket *avpkt;
while (filled) {
avpkt = &VideoPacketRb[VideoPacketRead];
now = GetMsTicks();
if (avpkt->pos + 500 > now) {
Debug(3, "video: %d packets %u delayed\n", filled,
(unsigned)(now - avpkt->pos));
return;
}
filled = atomic_read(&VideoPacketsFilled);
}
#endif
}
#endif
/** /**
** Try video start. ** Try video start.
** **
@ -918,7 +843,9 @@ void Start(void)
*/ */
void Stop(void) void Stop(void)
{ {
#ifdef DEBUG
Debug(3, "video: max used PES packet size: %d\n", VideoMaxPacketSize); Debug(3, "video: max used PES packet size: %d\n", VideoMaxPacketSize);
#endif
// FIXME: // FIXME:
// don't let any thread enter our plugin, but can still crash, when // don't let any thread enter our plugin, but can still crash, when

View File

@ -39,7 +39,7 @@ extern "C" {
////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////
static const char *const VERSION = "0.1.1"; static const char *const VERSION = "0.1.2";
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");