Commit c517f665 authored by Eric Petit's avatar Eric Petit

minor fixes and cleaning.

parent be8ef603
......@@ -2,7 +2,7 @@
* raw2ts.cpp: raw -> ES ffmpeg encoder -> TS
*-------------------------------------------------------------------------------
* (c)1999-2001 VideoLAN
* $Id: raw2ts.cpp,v 1.11 2003/02/22 02:38:56 tooney Exp $
* $Id: raw2ts.cpp,v 1.12 2003/02/24 20:13:31 titer Exp $
*
* Authors: Tristan Leteurtre <tooney@videolan.org>
* (inspirated from Fabrice Bellard...)
......@@ -137,7 +137,7 @@ void C_Raw2TsMpegConverter::InitWork()
/* Play with those parameters to modify quality / bitrate */
m_CodecContext->qmin = 2;
m_CodecContext->qmax = 15;
m_CodecContext->qmax = 31;
m_CodecContext->max_qdiff = 3;
//m_CodecContext->qblur = 0.5;
......
......@@ -2,7 +2,7 @@
* v4linput.cpp: Veading from a v4l device (WebCam, tv tuner)
*-------------------------------------------------------------------------------
* (c)1999-2001 VideoLAN
* $Id: v4linput.cpp,v 1.7 2003/02/22 05:46:01 titer Exp $
* $Id: v4linput.cpp,v 1.8 2003/02/24 20:13:31 titer Exp $
*
* Authors: Tristan Leteurtre <tooney@videolan.org>
*
......@@ -170,7 +170,7 @@ void C_v4lInput::OnStartStreaming(C_Broadcast* pBroadcast)
C_String strV4LNorm = pApp->GetSetting(GetName()+".Norm", "0");
pBroadcast->SetOption("v4l_norm", strV4LNorm);
C_String strV4LFrequency = pApp->GetSetting(GetName()+".Frequency", "7668");
C_String strV4LFrequency = pApp->GetSetting(GetName()+".Frequency", "-1");
pBroadcast->SetOption("v4l_frequency", strV4LFrequency);
C_String strReaderType;
......
......@@ -2,7 +2,7 @@
* v4lreader.cpp: Reading from a v4l device (WebCam, tv tuner)
*-------------------------------------------------------------------------------
* (c)1999-2002 VideoLAN
* $Id: v4lreader.cpp,v 1.10 2003/02/22 05:46:01 titer Exp $
* $Id: v4lreader.cpp,v 1.11 2003/02/24 20:13:32 titer Exp $
*
* Authors: Tristan Leteurtre <tooney@videolan.org>
*
......@@ -212,19 +212,35 @@ void C_v4lMpegReader::Init()
/* if it's a tuner, set the frequency */
if( m_Vchan.flags & VIDEO_VC_TUNER )
{
fprintf( stderr, "Info : changing to frequency %d\n", m_iFrequency );
if( ioctl( m_hFd, VIDIOCSFREQ, &m_iFrequency ) < 0 )
int oldFrequency;
if( ioctl( m_hFd, VIDIOCGFREQ, &oldFrequency ) < 0 )
{
fprintf( stderr, "Warning : could not change frequency\n" );
fprintf( stderr, "Warning : could not get frequency\n" );
}
/* set the frequency only if the user specified one.
otherwise, the current one is used */
if( m_iFrequency > 0 )
{
fprintf( stderr, "Info : changing from frequency %d to %d\n",
oldFrequency, m_iFrequency );
if( ioctl( m_hFd, VIDIOCSFREQ, &m_iFrequency ) < 0 )
{
fprintf( stderr, "Warning : could not change frequency\n" );
}
}
else
{
fprintf( stderr, "Info : current frequency is %d\n", oldFrequency );
}
}
// /* Unmute Audio */
// ioctl(m_hFd, VIDIOCGAUDIO, &m_Audio);
// memcpy(&m_Audio_saved, &m_Audio, sizeof(m_Audio));
// m_Audio.flags &= ~VIDEO_AUDIO_MUTE;
// ioctl(m_hFd, VIDIOCSAUDIO, &m_Audio);
/* unmute audio */
ioctl(m_hFd, VIDIOCGAUDIO, &m_Audio);
memcpy(&m_Audio_saved, &m_Audio, sizeof(m_Audio));
m_Audio.flags &= ~VIDEO_AUDIO_MUTE;
ioctl(m_hFd, VIDIOCSAUDIO, &m_Audio);
iRc = ioctl(m_hFd,VIDIOCGMBUF,&m_Vbuf);
......@@ -406,6 +422,12 @@ void C_v4lMpegReader::Init()
//------------------------------------------------------------------------------
void C_v4lMpegReader::Close()
{
/* mute audio */
ioctl(m_hFd, VIDIOCGAUDIO, &m_Audio);
memcpy(&m_Audio_saved, &m_Audio, sizeof(m_Audio));
m_Audio.flags &= VIDEO_AUDIO_MUTE;
ioctl(m_hFd, VIDIOCSAUDIO, &m_Audio);
close(m_hFd);
close(m_iAudioFD);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment