Fixed handling of web cams
This commit is contained in:
parent
6f6c44446c
commit
2ebe81cb0e
@ -71,8 +71,6 @@ bool FFmpegDecoder::open(const std::string & filename, FFmpegParameters* paramet
|
|||||||
#else
|
#else
|
||||||
avdevice_register_all();
|
avdevice_register_all();
|
||||||
|
|
||||||
OSG_NOTICE<<"Attempting to stream "<<filename<<std::endl;
|
|
||||||
|
|
||||||
if (parameters)
|
if (parameters)
|
||||||
{
|
{
|
||||||
av_dict_set(parameters->getOptions(), "video_size", "640x480", 0);
|
av_dict_set(parameters->getOptions(), "video_size", "640x480", 0);
|
||||||
@ -84,11 +82,11 @@ bool FFmpegDecoder::open(const std::string & filename, FFmpegParameters* paramet
|
|||||||
|
|
||||||
if (iformat)
|
if (iformat)
|
||||||
{
|
{
|
||||||
OSG_NOTICE<<"Found input format: "<<format<<std::endl;
|
OSG_INFO<<"Found input format: "<<format<<std::endl;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
OSG_NOTICE<<"Failed to find input format: "<<format<<std::endl;
|
OSG_INFO<<"Failed to find input format: "<<format<<std::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -130,13 +130,14 @@ public:
|
|||||||
const std::string ext = osgDB::getLowerCaseFileExtension(filename);
|
const std::string ext = osgDB::getLowerCaseFileExtension(filename);
|
||||||
if (ext=="ffmpeg") return readImage(osgDB::getNameLessExtension(filename),options);
|
if (ext=="ffmpeg") return readImage(osgDB::getNameLessExtension(filename),options);
|
||||||
|
|
||||||
if (filename.compare(0, 5, "/dev/")==0)
|
|
||||||
{
|
|
||||||
return readImageStream(filename, NULL);
|
|
||||||
}
|
|
||||||
|
|
||||||
osg::ref_ptr<osgFFmpeg::FFmpegParameters> parameters(new osgFFmpeg::FFmpegParameters);
|
osg::ref_ptr<osgFFmpeg::FFmpegParameters> parameters(new osgFFmpeg::FFmpegParameters);
|
||||||
parseOptions(parameters.get(), options);
|
parseOptions(parameters.get(), options);
|
||||||
|
|
||||||
|
if (filename.compare(0, 5, "/dev/")==0)
|
||||||
|
{
|
||||||
|
return readImageStream(filename, parameters.get());
|
||||||
|
}
|
||||||
|
|
||||||
if (parameters->isFormatAvailable())
|
if (parameters->isFormatAvailable())
|
||||||
{
|
{
|
||||||
return readImageStream(filename, parameters.get());
|
return readImageStream(filename, parameters.get());
|
||||||
|
Loading…
Reference in New Issue
Block a user