From 340816d763203c8239ffa81be4174b97d4014332 Mon Sep 17 00:00:00 2001 From: Johns Date: Tue, 6 Mar 2012 12:16:47 +0100 Subject: [PATCH] Make soft start sync setup menu configurable. --- ChangeLog | 1 + README.txt | 4 ++++ Todo | 1 + softhddevice.cpp | 24 +++++++++++++++++++++--- video.c | 28 ++++++++++++++++++++++++++-- video.h | 3 +++ 6 files changed, 56 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index 3b3928f..524ef54 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,7 @@ User johns Date: + Make soft start sync setup menu configurable. Fix bug: StillPicture NAL end of sequence is 10 and not 0x10. Fix bug: AudioEnqueue crash without sound card. diff --git a/README.txt b/README.txt index dae09d8..83c9683 100644 --- a/README.txt +++ b/README.txt @@ -186,6 +186,10 @@ Setup: /etc/vdr/setup.conf 0 disable 60Hz display mode 1 enable 60Hz display mode + softhddevice.SoftStartSync = 0 + 0 disable soft start of audio/video sync + 1 enable soft start of audio/video sync + VideoDisplayFormat = ? 0 pan and scan 1 letter box diff --git a/Todo b/Todo index 70d0bf8..9955574 100644 --- a/Todo +++ b/Todo @@ -88,6 +88,7 @@ audio: samplerate problem resume/suspend. only wait for video start, if video is running. Not primary device, don't use and block audio/video. + Remote learning support. audio/alsa: better downmix of >2 channels on 2 channel hardware diff --git a/softhddevice.cpp b/softhddevice.cpp index ef35fa0..ca0a036 100644 --- a/softhddevice.cpp +++ b/softhddevice.cpp @@ -68,8 +68,9 @@ static char ConfigHideMainMenuEntry; ///< config hide main menu entry static uint32_t ConfigVideoBackground; ///< config video background color static int ConfigVideoSkipLines; ///< config skip lines top/bottom -static int ConfigVideoStudioLevels; ///< config use studio levels -static int ConfigVideo60HzMode; ///< config use 60Hz display mode +static char ConfigVideoStudioLevels; ///< config use studio levels +static char ConfigVideo60HzMode; ///< config use 60Hz display mode +static char ConfigVideoSoftStartSync; ///< config use softstart sync /// config deinterlace static int ConfigVideoDeinterlace[RESOLUTIONS]; @@ -421,6 +422,8 @@ class cMenuSetupSoft:public cMenuSetupPage uint32_t BackgroundAlpha; int SkipLines; int StudioLevels; + int _60HzMode; + int SoftStartSync; int Scaling[RESOLUTIONS]; int Deinterlace[RESOLUTIONS]; int SkipChromaDeinterlace[RESOLUTIONS]; @@ -503,6 +506,12 @@ cMenuSetupSoft::cMenuSetupSoft(void) StudioLevels = ConfigVideoStudioLevels; Add(new cMenuEditBoolItem(tr("Use studio levels (vdpau only)"), &StudioLevels, trVDR("no"), trVDR("yes"))); + _60HzMode = ConfigVideo60HzMode; + Add(new cMenuEditBoolItem(tr("60hz display mode"), &_60HzMode, trVDR("no"), + trVDR("yes"))); + SoftStartSync = ConfigVideoSoftStartSync; + Add(new cMenuEditBoolItem(tr("soft start a/v sync"), &SoftStartSync, + trVDR("no"), trVDR("yes"))); for (i = 0; i < RESOLUTIONS; ++i) { Add(SeparatorItem(resolution[i])); @@ -580,6 +589,10 @@ void cMenuSetupSoft::Store(void) VideoSetSkipLines(ConfigVideoSkipLines); SetupStore("StudioLevels", ConfigVideoStudioLevels = StudioLevels); VideoSetStudioLevels(ConfigVideoStudioLevels); + SetupStore("60HzMode", ConfigVideo60HzMode = _60HzMode); + VideoSet60HzMode(ConfigVideo60HzMode); + SetupStore("SoftStartSync", ConfigVideoSoftStartSync = SoftStartSync); + VideoSetSoftStartSync(ConfigVideoSoftStartSync); for (i = 0; i < RESOLUTIONS; ++i) { char buf[128]; @@ -928,6 +941,7 @@ void cSoftHdDevice::MakePrimaryDevice(bool on) cDevice::MakePrimaryDevice(on); if (on) { new cSoftOsdProvider(); + if (SuspendMode == SUSPEND_DETACHED) { Resume(); SuspendMode = 0; @@ -1124,7 +1138,7 @@ bool cSoftHdDevice::Flush(int timeout_ms) ** device has an MPEG decoder). */ void cSoftHdDevice:: SetVideoDisplayFormat(eVideoDisplayFormat - video_display_format) + video_display_format) { static int last = -1; @@ -1550,6 +1564,10 @@ bool cPluginSoftHdDevice::SetupParse(const char *name, const char *value) VideoSet60HzMode(ConfigVideo60HzMode = atoi(value)); return true; } + if (!strcasecmp(name, "SoftStartSync")) { + VideoSetSoftStartSync(ConfigVideoSoftStartSync = atoi(value)); + return true; + } for (i = 0; i < RESOLUTIONS; ++i) { char buf[128]; diff --git a/video.c b/video.c index a6a90b2..ff4e88c 100644 --- a/video.c +++ b/video.c @@ -331,9 +331,8 @@ int VideoAudioDelay; /// Default zoom mode static VideoZoomModes Video4to3ZoomMode; -static char VideoSoftStartSync = 1; ///< soft start sync audio/video - static char Video60HzMode; ///< handle 60hz displays +static char VideoSoftStartSync; ///< soft start sync audio/video static xcb_atom_t WmDeleteWindowAtom; ///< WM delete message atom static xcb_atom_t NetWmState; ///< wm-state message atom @@ -533,6 +532,15 @@ static void VideoUpdateOutput(AVRational input_aspect_ratio, int input_width, return; } +/// +/// Output video messages. +/// +/// Reduce output. +/// +static void VideoMessage(void) +{ +} + //---------------------------------------------------------------------------- // GLX //---------------------------------------------------------------------------- @@ -7469,6 +7477,11 @@ static void VdpauSyncDisplayFrame(VdpauDecoder * decoder) static void VdpauSyncRenderFrame(VdpauDecoder * decoder, const AVCodecContext * video_ctx, const AVFrame * frame) { + // FIXME: temp debug + if (0 && frame->pkt_pts != (int64_t) AV_NOPTS_VALUE) { + Info("render frame pts %s\n", Timestamp2String(frame->pkt_pts)); + } + VideoSetPts(&decoder->PTS, decoder->Interlaced, frame); if (!atomic_read(&decoder->SurfacesFilled)) { @@ -9004,6 +9017,7 @@ int VideoSetGeometry(const char *geometry) return 0; } +/// /// Set 60hz display mode. /// /// Pull up 50 Hz video for 60 Hz display. @@ -9015,6 +9029,16 @@ void VideoSet60HzMode(int onoff) Video60HzMode = onoff; } +/// +/// Set soft start audio/video sync. +/// +/// @param onoff enable / disable the soft start sync. +/// +void VideoSetSoftStartSync(int onoff) +{ + VideoSoftStartSync = onoff; +} + /// /// Set video output position. /// diff --git a/video.h b/video.h index 9fed9c9..77a4068 100644 --- a/video.h +++ b/video.h @@ -83,6 +83,9 @@ extern int VideoSetGeometry(const char *); /// Set 60Hz display mode. extern void VideoSet60HzMode(int); + /// Set soft start audio/video sync. +extern void VideoSetSoftStartSync(int); + /// Set video output position. extern void VideoSetOutputPosition(int, int, int, int);