Commit 925fa299 authored by Eric Petit's avatar Eric Petit

ALL: * added possibility to choose the video norm (PAL/NTSC/SECAM)

      * added possibility to set the frequency (for tuner cards)
parent c031a0ff
......@@ -2,7 +2,7 @@
* v4linput.cpp: Veading from a v4l device (WebCam, tv tuner)
*-------------------------------------------------------------------------------
* (c)1999-2001 VideoLAN
* $Id: v4linput.cpp,v 1.6 2003/02/22 02:38:56 tooney Exp $
* $Id: v4linput.cpp,v 1.7 2003/02/22 05:46:01 titer Exp $
*
* Authors: Tristan Leteurtre <tooney@videolan.org>
*
......@@ -167,6 +167,12 @@ void C_v4lInput::OnStartStreaming(C_Broadcast* pBroadcast)
C_String strV4LBitrate = pApp->GetSetting(GetName()+".Bitrate", "1000");
pBroadcast->SetOption("v4l_bitrate", strV4LBitrate);
C_String strV4LNorm = pApp->GetSetting(GetName()+".Norm", "0");
pBroadcast->SetOption("v4l_norm", strV4LNorm);
C_String strV4LFrequency = pApp->GetSetting(GetName()+".Frequency", "7668");
pBroadcast->SetOption("v4l_frequency", strV4LFrequency);
C_String strReaderType;
C_String strConverterType;
......
......@@ -2,7 +2,7 @@
* v4lreader.cpp: Reading from a v4l device (WebCam, tv tuner)
*-------------------------------------------------------------------------------
* (c)1999-2002 VideoLAN
* $Id: v4lreader.cpp,v 1.9 2003/02/22 03:01:21 tooney Exp $
* $Id: v4lreader.cpp,v 1.10 2003/02/22 05:46:01 titer Exp $
*
* Authors: Tristan Leteurtre <tooney@videolan.org>
*
......@@ -138,6 +138,9 @@ C_v4lMpegReader::C_v4lMpegReader(C_Module* pModule,
m_iWidth = (strSize.SubString(0, (strSize.Find('x')))).ToInt();
m_iHeight = (strSize.SubString(strSize.Find('x')+1, strSize.Length())).ToInt();
}
m_iNorm = ( pBroadcast->GetOption( "v4l_norm" ) ).ToInt();
m_iFrequency = ( pBroadcast->GetOption( "v4l_frequency" ) ).ToInt();
}
......@@ -185,32 +188,38 @@ void C_v4lMpegReader::Init()
printf("Warning : Capture not supported !\n");
}
m_Vchan.channel = m_iCurrentChannel;
m_Vchan.channel = m_iCurrentChannel;
/* m_Vchan.type = 2;
m_Vchan.flags = 2;
m_Vchan.norm = 0;
*/
/* Get Channel Name*/
if (ioctl(m_hFd,VIDIOCGCHAN,&m_Vchan) < 0)
{
printf("Warning : could not get info on channel %u!\n",
m_iCurrentChannel);
}
printf("Info : Changing to channel %u (%s)\n",
m_Vchan.channel, m_Vchan.name);
if (ioctl(m_hFd,VIDIOCSCHAN,&m_Vchan) < 0)
{
printf("Warning : could not change to channel %u!\n",
if (ioctl(m_hFd,VIDIOCGCHAN,&m_Vchan) < 0)
{
printf("Warning : could not get info on channel %u!\n",
m_iCurrentChannel);
}
}
fprintf( stderr, "Info : Changing to channel %u (%s)\n",
m_Vchan.channel, m_Vchan.name);
m_Vchan.norm = m_iNorm; // PAL/NTSC/SECAM
if( ioctl( m_hFd, VIDIOCSCHAN, &m_Vchan ) < 0 )
{
fprintf( stderr, "Warning : could not change to channel %u!\n",
m_iCurrentChannel);
}
/* 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 )
{
fprintf( stderr, "Warning : could not change frequency\n" );
}
}
// /* Unmute Audio */
// ioctl(m_hFd, VIDIOCGAUDIO, &m_Audio);
// memcpy(&m_Audio_saved, &m_Audio, sizeof(m_Audio));
......
......@@ -2,7 +2,7 @@
* v4lreader.h: eading from a v4l device (WebCam, tv tuner)
*-------------------------------------------------------------------------------
* (c)1999-2002 VideoLAN
* $Id: v4lreader.h,v 1.5 2003/02/22 03:01:21 tooney Exp $
* $Id: v4lreader.h,v 1.6 2003/02/22 05:46:01 titer Exp $
*
* Authors: Arnaud de Bossoreille de Ribou <bozo@via.ecp.fr>
* Tristan Leteutre <tooney@videolan.org>
......@@ -84,8 +84,10 @@ protected:
// Grab frame
int m_iCurrentFrame;
// Video4Linux channel
// Video4Linux parameters
int m_iCurrentChannel;
int m_iNorm;
int m_iFrequency;
// parameters of the image
int m_iHeight, m_iWidth, m_iFrameRate;
......@@ -95,7 +97,6 @@ protected:
// variables for dsp reading
C_String m_strAudioDeviceName;
int m_iAudioFD; // file descriptor
};
......
......@@ -48,11 +48,11 @@ BEGIN "Inputs"
# --- Format:
# InputName = "Type"
# --- Example:
# local1 = "local" # Local input example
# local1 = "local" # Local input example
# kfir = "video" # Video input example (mpeg encoder)
# dvb = "dvb" # Video input example (DVB card)
# webcam = "v4l" # Video For Linux example (webcam)
# composite = "v4l" # Video For Linux example (composite)
# tuner = "v4l" # Video For Linux example (composite)
END
BEGIN "Input"
......@@ -110,11 +110,13 @@ END
# Video For Linux (V4L) configuration
BEGIN "webcam"
# --- Example:
Device = "/dev/video1" # Video4linux device (default is /dev/video)
Device = "/dev/video" # Video4linux device (default is /dev/video)
AudioDevice = "/dev/dsp" # Sound device (try /dev/dsp<X> or /dev/audio<X>)
Channel = "0" # Channel Source: Webcam often 0
# For TV Card, may be Tuner(0), Composite(1), Svide(2)
# For TV Card, may be Tuner(0), Composite(1),
# Svideo(2)
Norm = "0" # PAL=0, NTSC=1, SECAM=2
Size = "" # Size possibilities
......@@ -125,15 +127,20 @@ Size = "" # Size possibilities
#Size = "sif"
Bitrate = "500" # Bitrate (approx.) in kbps
END
# Video For Linux (V4L) configuration
BEGIN "composite"
BEGIN "tuner"
# --- Example:
Device = "/dev/video" # Video4linux device (default is /dev/video)
AudioDevice = "/dev/dsp" # Sound device (try /dev/dsp<X> or /dev/audio<X>)
Channel = "0" # Channel Source: Webcam often 0
# For TV Card, may be Tuner(0), Composite(1), Svide(2)
# For TV Card, may be Tuner(0), Composite(1),
# Svideo(2)
Norm = "0" # PAL=0, NTSC=1, SECAM=2
Frequency = "7668" # Frequency * 16
Size = "subQCIF" # Size possibilities
# - empty string : default size
......
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