testing/fixing

pull/421/head
m-bene 2014-05-05 15:54:13 +02:00
parent ceff5a98ea
commit ae0ee9b3b3
3 changed files with 10 additions and 7 deletions

View File

@ -121,11 +121,11 @@ int FfmpegCamera::PrimeCapture()
// Handle options // Handle options
AVDictionary *opts = 0; AVDictionary *opts = 0;
StringVector opVect = split(Options(), ","); StringVector opVect = split(Options(), ",");
for (int i=0; i<opVect.size(), i++) for (size_t i=0; i<opVect.size(); i++)
{ {
StringVector parts = split(opVect[i],"="); StringVector parts = split(opVect[i],"=");
if (parts.size() > 1) if (parts.size() > 1)
av_dict_set(&opts, trimSpaces(parts[0]), trimSpaces(parts[1])); av_dict_set(&opts, trimSpaces(parts[0]).c_str(), trimSpaces(parts[1]).c_str(), 0);
} }
if ( avformat_open_input( &mFormatContext, mPath.c_str(), NULL, &opts ) !=0 ) if ( avformat_open_input( &mFormatContext, mPath.c_str(), NULL, &opts ) !=0 )
#endif #endif

View File

@ -147,12 +147,15 @@ int LibvlcCamera::PrimeCapture()
if (opVect.size() > 0) if (opVect.size() > 0)
{ {
mOptArgV = new char*[opVect.size()];cmd mOptArgV = new char*[opVect.size()];
for (int i=0; i< opVect.size(); i++) Debug(2, "Size of Option Array: %d",opVect.size());
mOptArgV[i] = opVect[i].c_str(); for (size_t i=0; i< opVect.size(); i++) {
mOptArgV[i] = (char *)opVect[i].c_str();
Debug(2, "set option %d to %s", i, opVect[i].c_str());
}
} }
mLibvlcInstance = libvlc_new (opVect.size(), optArgV); mLibvlcInstance = libvlc_new (opVect.size(), (const char* const*)mOptArgV);
if(mLibvlcInstance == NULL) if(mLibvlcInstance == NULL)
Fatal("Unable to create libvlc instance due to: %s", libvlc_errmsg()); Fatal("Unable to create libvlc instance due to: %s", libvlc_errmsg());

View File

@ -46,7 +46,7 @@ class LibvlcCamera : public Camera
protected: protected:
std::string mPath; std::string mPath;
std::string mOptions; std::string mOptions;
unisgned char **mOptArgV; char **mOptArgV;
LibvlcPrivateData mLibvlcData; LibvlcPrivateData mLibvlcData;
std::string mTargetChroma; std::string mTargetChroma;
uint8_t mBpp; uint8_t mBpp;