mirror of
https://projects.vdr-developer.org/git/vdr-plugin-softhddevice.git
synced 2023-10-10 19:16:51 +02:00
Fix still picture handling.
This commit is contained in:
parent
6ca4d3c44f
commit
037f582bad
@ -1,6 +1,7 @@
|
||||
User johns
|
||||
Date:
|
||||
|
||||
Fix still picture handling.
|
||||
Fix for dead-lock in VdpauExit.
|
||||
Workaround for dead-lock in VdpauExit.
|
||||
VDPAU: Add very primitive software scaler for grab image.
|
||||
|
32
softhddev.c
32
softhddev.c
@ -902,10 +902,12 @@ void Freeze(void)
|
||||
void StillPicture(const uint8_t * data, int size)
|
||||
{
|
||||
int i;
|
||||
static uint8_t seq_end_mpeg[] = { 0x00, 0x00, 0x01, 0xB7 };
|
||||
static uint8_t seq_end_h264[] = { 0x00, 0x00, 0x00, 0x01, 0x10 };
|
||||
|
||||
// must be a PES start code
|
||||
if (size < 9 || !data || data[0] || data[1] || data[2] != 0x01) {
|
||||
Error(_("[softhddev] invalid PES video packet\n"));
|
||||
Error(_("[softhddev] invalid still video packet\n"));
|
||||
return;
|
||||
}
|
||||
if (VideoCodecID == CODEC_ID_NONE) {
|
||||
@ -913,14 +915,38 @@ void StillPicture(const uint8_t * data, int size)
|
||||
Error(_("[softhddev] no codec known for still picture\n"));
|
||||
return;
|
||||
}
|
||||
//Clear(); // flush video buffers
|
||||
|
||||
Clear(); // flush video buffers
|
||||
// +1 future for deinterlace
|
||||
for (i = -1; i < (VideoCodecID == CODEC_ID_MPEG2VIDEO ? 3 : 17); ++i) {
|
||||
PlayVideo(data, size); // reference frames
|
||||
//if ( 1 ) {
|
||||
const uint8_t *split;
|
||||
int n;
|
||||
|
||||
// split the I-frame into single pes packets
|
||||
split = data;
|
||||
n = size;
|
||||
do {
|
||||
int len;
|
||||
|
||||
len = (split[4] << 8) + split[5];
|
||||
if (len > n) {
|
||||
break;
|
||||
}
|
||||
PlayVideo(split, len + 6); // feed it
|
||||
split += 6 + len;
|
||||
n -= 6 + len;
|
||||
} while (n > 6);
|
||||
VideoNextPacket(VideoCodecID); // terminate last packet
|
||||
|
||||
if (VideoCodecID == CODEC_ID_H264) {
|
||||
VideoEnqueue(AV_NOPTS_VALUE, seq_end_h264, sizeof(seq_end_h264));
|
||||
} else {
|
||||
VideoEnqueue(AV_NOPTS_VALUE, seq_end_mpeg, sizeof(seq_end_mpeg));
|
||||
}
|
||||
VideoNextPacket(VideoCodecID); // terminate last packet
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
** Poll if device is ready. Called by replay.
|
||||
|
@ -795,8 +795,8 @@ void cSoftHdDevice::SetVolumeDevice(int volume)
|
||||
*/
|
||||
void cSoftHdDevice::StillPicture(const uchar * data, int length)
|
||||
{
|
||||
dsyslog("[softhddev]%s: %s\n", __FUNCTION__,
|
||||
data[0] == 0x47 ? "ts" : "pes");
|
||||
dsyslog("[softhddev]%s: %s %p %d\n", __FUNCTION__,
|
||||
data[0] == 0x47 ? "ts" : "pes", data, length);
|
||||
|
||||
if (data[0] == 0x47) { // ts sync
|
||||
cDevice::StillPicture(data, length);
|
||||
|
Loading…
Reference in New Issue
Block a user