Commit f0db48bb authored by IOhannes m zmölnig's avatar IOhannes m zmölnig
Browse files

consistent verbosity for video plugins

parent 9d40c2b5
......@@ -39,12 +39,6 @@ using namespace gem::plugins;
#include "Gem/RTE.h"
#include "Gem/Exception.h"
#if 0
# define debug ::post
#else
# define debug
#endif
/////////////////////////////////////////////////////////
//
// videoAVT
......@@ -65,7 +59,6 @@ struct PvApiInitClass {
PvApiInitClass(void) {
unsigned long major=0, minor=0;
PvVersion(&major, &minor);
// post("Prosilica AVT SDK %d.%d", major, minor);
if(ePvErrResources==PvInitialize()) {
throw(GemException("unable to initialization PvAPI"));
......@@ -212,14 +205,14 @@ bool videoAVT :: openDevice(gem::Properties&props)
tPvCameraInfo*cameraList=new tPvCameraInfo[cameraNum];
if(m_devicenum>=0) {
verbose(1, "AVT trying to open #%d of %d devices", m_devicenum, cameraNum);
verbose(0, "[GEM:videoAVT] trying to open #%d of %d devices", m_devicenum, cameraNum);
if(cameraNum>m_devicenum && (cameraList[m_devicenum].PermittedAccess == ePvAccessMaster)) {
if (PvCameraOpen(cameraList[m_devicenum].UniqueId, ePvAccessMaster, &m_grabber) != ePvErrSuccess) {
m_grabber=NULL;
}
}
} else {
verbose(1, "AVT trying to open device '%s'", m_devicename.c_str());
verbose(0, "[GEM:videoAVT] trying to open device '%s'", m_devicename.c_str());
/*
cameraList[i].SerialString,
cameraList[i].DisplayName,
......@@ -231,7 +224,7 @@ bool videoAVT :: openDevice(gem::Properties&props)
const unsigned long uid=strtoul(m_devicename.c_str(), NULL, 0);
if(NULL==m_grabber && 0==errno) {
verbose(1, "checking UniqueID: 0x% 8x", uid);
verbose(1, "[GEM:videoAVT] checking UniqueID: 0x% 8x", uid);
for(i=0; i<cameraNum; i++) {
if(uid==cameraList[i].UniqueId && PvCameraOpen(cameraList[i].UniqueId, ePvAccessMaster, &m_grabber) == ePvErrSuccess) {
break;
......@@ -240,7 +233,7 @@ bool videoAVT :: openDevice(gem::Properties&props)
}
if(NULL==m_grabber) {
verbose(1, "checking SerialString: %s", m_devicename.c_str());
verbose(1, "[GEM:videoAVT] checking SerialString: %s", m_devicename.c_str());
for(i=0; i<cameraNum; i++) {
if(m_devicename==cameraList[i].SerialString && PvCameraOpen(cameraList[i].UniqueId, ePvAccessMaster, &m_grabber) == ePvErrSuccess) {
break;
......@@ -248,7 +241,7 @@ bool videoAVT :: openDevice(gem::Properties&props)
}
}
if(NULL==m_grabber) {
verbose(1, "checking DisplayName: %s", m_devicename.c_str());
verbose(1, "[GEM:videoAVT] checking DisplayName: %s", m_devicename.c_str());
for(i=0; i<cameraNum; i++) {
if(m_devicename==cameraList[i].DisplayName && PvCameraOpen(cameraList[i].UniqueId, ePvAccessMaster, &m_grabber) == ePvErrSuccess) {
break;
......@@ -268,7 +261,7 @@ bool videoAVT :: openDevice(gem::Properties&props)
unsigned long IpAddr=ipv4->sin_addr.s_addr ; // byte order??
if(OldAddr==IpAddr)continue;
OldAddr=IpAddr;
verbose(1, "AVT trying to connect to %3d.%3d.%3d.%3d",
verbose(0, "[GEM:videoAVT] trying to connect to %3d.%3d.%3d.%3d",
(IpAddr & 0x0FF),
(IpAddr & 0x0FF00)>>8,
(IpAddr & 0x0FF0000)>>16,
......@@ -319,7 +312,7 @@ bool videoAVT :: startTransfer()
{
PvCaptureStart(m_grabber);
if(!PvCommandRun(m_grabber,"AcquisitionStart")) {
error("AVT::AcquistionStart failed");
error("[GEM:videoAVT] AcquistionStart failed");
} else {
PvCaptureQueueFrame(m_grabber, &m_frames[0], (tPvFrameCallback) grabCB);
}
......@@ -336,7 +329,7 @@ bool videoAVT :: stopTransfer()
PvCaptureQueueClear(m_grabber);
if(!PvCommandRun(m_grabber,"AcquisitionStop")) {
error("AVT::AcquistionStop failed");
error("[GEM:videoAVT] AcquistionStop failed");
}
PvCaptureEnd(m_grabber);
......
......@@ -136,11 +136,11 @@ bool videoDC1394 :: openDevice(gem::Properties&props){
err=dc1394_camera_enumerate (m_dc, &list); /* Find cameras */
if(DC1394_SUCCESS!=err) {
error("videoDC1394: %s: failed to enumerate", dc1394_error_get_string(err));
verbose(0, "[GEM:videoDC1394] %s: failed to enumerate", dc1394_error_get_string(err));
return false;
}
if (list->num < 1) {
error("videoDC1394: no cameras found");
verbose(0, "[GEM:videoDC1394] no cameras found");
dc1394_camera_free_list (list);
return false;
}
......@@ -172,16 +172,16 @@ bool videoDC1394 :: openDevice(gem::Properties&props){
list->ids[devicenum].unit);
} else {
m_dccamera=NULL;
error("videoDC1394: only found %d cameras but requested #%d!", list->num, devicenum);
verbose(0, "[GEM:videoDC1394] only found %d cameras but requested #%d!", list->num, devicenum);
}
dc1394_camera_free_list (list);
if(!m_dccamera) {
error("videoDC1394: could not access camera!");
verbose(0, "[GEM:videoDC1394] could not access camera!");
return false;
}
verbose(1, "videoDC1394: using camera with GUID %s", guid2string(m_dccamera->guid, m_dccamera->unit).c_str());
verbose(1, "[GEM:videoDC1394] using camera with GUID %s", guid2string(m_dccamera->guid, m_dccamera->unit).c_str());
setProperties(props);
......@@ -193,7 +193,7 @@ bool videoDC1394 :: openDevice(gem::Properties&props){
err=dc1394_video_get_supported_modes(m_dccamera,&video_modes);
if(DC1394_SUCCESS!=err) {
error("can't get video modes");
verbose(0, "[GEM:videoDC1394] can't get video modes");
closeDevice();
return false;
}
......@@ -202,11 +202,11 @@ bool videoDC1394 :: openDevice(gem::Properties&props){
if(props.get("channel", d)) // this used to be 'channel' rather than 'isochannel'
mode=d;
verbose(1, "trying mode %d", mode);
verbose(1, "[GEM:videoDC1394] trying mode %d", mode);
if(mode>=0) {
if(mode>=video_modes.num) {
error("requested channel %d/%d out of bounds", mode, video_modes.num);
verbose(0, "[GEM:videoDC1394] requested channel %d/%d out of bounds", mode, video_modes.num);
mode=-1;
}
}
......@@ -215,13 +215,13 @@ bool videoDC1394 :: openDevice(gem::Properties&props){
for (i=video_modes.num-1;i>=0;i--) {
unsigned int w=0, h=0;
if(DC1394_SUCCESS==dc1394_get_image_size_from_video_mode(m_dccamera, video_modes.modes[i], &w, &h)) {
verbose(1, "videomode[%02d/%d]=%dx%d", i, video_modes.num, w, h);
} else verbose(1, "videomode %d refused dimen: %d", i, video_modes.modes[i]);
verbose(1, "[GEM:videoDC1394] videomode[%02d/%d]=%dx%d", i, video_modes.num, w, h);
} else verbose(1, "[GEM:videoDC1394] videomode %d refused dimen: %d", i, video_modes.modes[i]);
dc1394_get_color_coding_from_video_mode(m_dccamera,video_modes.modes[i], &coding);
dc1394bool_t iscolor=DC1394_FALSE;
if(DC1394_SUCCESS==dc1394_is_color(coding, &iscolor)) {
verbose(1, "videomode[%02d/%d] %d is%scolor", i, video_modes.num, coding, (iscolor?" ":" NOT "));
verbose(1, "[GEM:videoDC1394] videomode[%02d/%d] %d is%scolor", i, video_modes.num, coding, (iscolor?" ":" NOT "));
}
if(mode<0) { // find a mode matching the user's needs
......@@ -244,30 +244,30 @@ bool videoDC1394 :: openDevice(gem::Properties&props){
}
}
if (i < 0) {
error("Could not get a valid mode");
verbose(0, "[GEM:videoDC1394] Could not get a valid mode");
closeDevice();
return false;
}
} else {
verbose(1, "using mode %d", mode);
verbose(1, "[GEM:videoDC1394] using mode %d", mode);
video_mode=video_modes.modes[mode];
}
if(1) {
unsigned int w=0, h=0;
if(DC1394_SUCCESS==dc1394_get_image_size_from_video_mode(m_dccamera, video_mode, &w, &h)) {
verbose(1, "videomode[%d]=%dx%d", video_mode, w, h);
verbose(1, "[GEM:videoDC1394] videomode[%d]=%dx%d", video_mode, w, h);
}
dc1394_get_color_coding_from_video_mode(m_dccamera,video_mode, &coding);
dc1394bool_t iscolor=DC1394_FALSE;
if(DC1394_SUCCESS==dc1394_is_color(coding, &iscolor)) {
verbose(1, "videomode %d is%scolor", coding, (iscolor?" ":" NOT "));
verbose(1, "[GEM:videoDC1394] videomode %d is%scolor", coding, (iscolor?" ":" NOT "));
}
}
err=dc1394_video_set_mode(m_dccamera, video_mode);
if(DC1394_SUCCESS!=err) {
error("unable to set specified mode, using default");
verbose(0, "[GEM:videoDC1394] unable to set specified mode, using default");
}
}
......@@ -279,11 +279,11 @@ bool videoDC1394 :: openDevice(gem::Properties&props){
err=dc1394_video_set_operation_mode(m_dccamera, (dc1394operation_mode_t)operation_mode);
if(DC1394_SUCCESS==err)
break;
verbose(1, "failed to set operation mode to %d", operation_mode);
verbose(1, "[GEM:videoDC1394] failed to set operation mode to %d", operation_mode);
operation_mode--;
}
if(DC1394_SUCCESS!=err) {
error("unable to set operation mode...continuing anyhow");
verbose(0, "[GEM:videoDC1394] unable to set operation mode...continuing anyhow");
}
}
......@@ -297,12 +297,12 @@ bool videoDC1394 :: openDevice(gem::Properties&props){
err=dc1394_video_set_iso_speed(m_dccamera, (dc1394speed_t)speed);
if(DC1394_SUCCESS==err)
break;
verbose(1, "failed to set ISO speed to %d", 100*(1<<speed));
verbose(1, "[GEM:videoDC1394] failed to set ISO speed to %d", 100*(1<<speed));
speed--;
}
if(DC1394_SUCCESS!=err) {
error("unable to set ISO speed...trying to set to original (%d)", 100*(1<<orgspeed));
verbose(0, "[GEM:videoDC1394] unable to set ISO speed...trying to set to original (%d)", 100*(1<<orgspeed));
dc1394_video_get_iso_speed(m_dccamera, &orgspeed);
}
}
......@@ -321,7 +321,7 @@ bool videoDC1394 :: openDevice(gem::Properties&props){
err=dc1394_video_set_framerate(m_dccamera, framerate);
float fr=0;
dc1394_framerate_as_float(framerate, &fr);
verbose(1, "DC1394: set framerate to %g", fr);
verbose(1, "[GEM:videoDC1394] set framerate to %g", fr);
}
}
......@@ -329,11 +329,11 @@ bool videoDC1394 :: openDevice(gem::Properties&props){
4, /* 4 DMA buffers */
DC1394_CAPTURE_FLAGS_DEFAULT); /* Setup capture */
if(DC1394_SUCCESS!=err) {
error("videoDC1394: %s: failed to enumerate", dc1394_error_get_string(err));
verbose(0, "[GEM:videoDC1394] %s: failed to enumerate", dc1394_error_get_string(err));
return false;
}
verbose(1, "DC1394: Successfully opened...");
verbose(1, "[GEM:videoDC1394] Successfully opened...");
return true;
}
////////////////////////////////////////////////////////
......@@ -370,7 +370,7 @@ bool videoDC1394 :: stopTransfer()
/* Stop transmission */
dc1394error_t err=dc1394_video_set_transmission(m_dccamera, DC1394_OFF);
if(DC1394_SUCCESS!=err) {
error("unable to stop transmission");
error("[GEM:videoDC1394] unable to stop transmission");
}
return true;
}
......@@ -386,7 +386,7 @@ std::vector<std::string>videoDC1394 :: enumerate(){
int i=0;
for(i=0; i<list->num; i++) {
// post("IIDC#%02d: %"PRIx64"\t%x\t%s", i, list->ids[i].guid, list->ids[i].unit, buf);
// verbose(1, "[GEM:videoDC1394] IIDC#%02d: %"PRIx64"\t%x\t%s", i, list->ids[i].guid, list->ids[i].unit, buf);
result.push_back(guid2string(list->ids[i].guid, list->ids[i].unit));
}
return result;
......@@ -506,7 +506,7 @@ void videoDC1394::getProperties(gem::Properties&props) {
dc1394error_t err=DC1394_SUCCESS;
#define DC1394_TRYGET(x) \
if(DC1394_SUCCESS!=(err=dc1394_video_get_##x)) { \
error("videoDC1394: getting '%s' failed with '%s'", \
verbose(0, "[GEM:videoDC1394] getting '%s' failed with '%s'", \
key.c_str(), \
dc1394_error_get_string(err)); \
continue; \
......@@ -813,14 +813,14 @@ void videoDC1394::setProperties(gem::Properties&props) {
mode = DC1394_FEATURE_MODE_ONE_PUSH_AUTO;
}
err=dc1394_feature_set_mode(m_dccamera, feature, mode);
if (err!=DC1394_SUCCESS) error("can't set %s to %s",key.c_str(), svalue.c_str());
if (err!=DC1394_SUCCESS) verbose(0, "[GEM:videoDC1394] can't set %s to %s",key.c_str(), svalue.c_str());
}
}
}
}
}
if(DC1394_SUCCESS!=err) {
error("videoDC1394: setting '%s' failed with '%s'",
verbose(0, "[GEM:videoDC1394] setting '%s' failed with '%s'",
key.c_str(),
dc1394_error_get_string(err));
}
......
......@@ -126,7 +126,6 @@ public:
threeDExtensions->Release();
if (videoFrame->GetFlags() & bmdFrameHasNoInputSource) {
//printf("Frame received (#%lu) - No input signal detected\n", m_frameCount);
} else {
long w=videoFrame->GetWidth();
long h=videoFrame->GetHeight();
......@@ -160,7 +159,6 @@ public:
return S_OK;
mode->GetName((const char**)&displayModeName);
//printf("Video format changed to %s\n", displayModeName);
if (displayModeName)
free(displayModeName);
......@@ -170,7 +168,6 @@ public:
result = m_deckLinkInput->EnableVideoInput(mode->GetDisplayMode(), m_cfg_pixelFormat, m_cfg_inputFlags);
if (result != S_OK) {
//fprintf(stderr, "Failed to switch video mode\n");
goto bail;
}
......@@ -203,6 +200,7 @@ namespace {
const char*dmn = NULL;
if (S_OK == displayMode->GetName(&dmn)) {
bool found=(formatname == dmn);
verbose(1, "[GEM:videoDECKLINK] checking format '%s'", dmn);
free((void*)dmn);
if(found)break;
}
......
......@@ -154,7 +154,7 @@ bool videoDS :: openDevice(gem::Properties&props)
do {
// Get the interface for DirectShow's GraphBuilder
if (FAILED(hr = CoCreateInstance(CLSID_FilterGraph, NULL, CLSCTX_INPROC_SERVER, IID_IGraphBuilder, (void **)&m_pGB))) {
error("Could not get DShow GraphBuilder, hr 0x%X", hr);
verbose(0, "[GEM:videoDS] Could not get DShow GraphBuilder, hr 0x%X", hr);
break;
}
......@@ -171,13 +171,13 @@ bool videoDS :: openDevice(gem::Properties&props)
// Get the interface for DirectShow's CaptureGraphBuilder2 which allows the use of capture devices instead of file sources
if ( FAILED(hr = (CoCreateInstance(CLSID_CaptureGraphBuilder2, NULL, CLSCTX_INPROC_SERVER, IID_ICaptureGraphBuilder2, (void **)&m_pCG)))
|| FAILED(hr = m_pCG->SetFiltergraph(m_pGB))){
error("Could not get DShow GraphBuilder, hr 0x%X", hr);
verbose(0, "[GEM:videoDS] Could not get DShow GraphBuilder, hr 0x%X", hr);
break;
}
// Create the capture device.
if (FAILED(hr = FindCaptureDevice(device, &m_pCDbase))) {
error("Could not open device: %d\n", device);
verbose(0, "[GEM:videoDS] Could not open device: %d\n", device);
break;
}
......@@ -186,7 +186,7 @@ bool videoDS :: openDevice(gem::Properties&props)
IID_IBaseFilter, (void**)&SampleFilter);
if (hr != S_OK || NULL == SampleFilter) {
error("Unable to create SampleFilter interface %d", hr);
verbose(0, "[GEM:videoDS] Unable to create SampleFilter interface %d", hr);
return false;
}
......@@ -195,7 +195,7 @@ bool videoDS :: openDevice(gem::Properties&props)
hr = SampleFilter->QueryInterface(IID_ISampleGrabber, (void **)&SampleGrabber);
if (hr != S_OK || NULL == SampleGrabber) {
error("Unable to create SampleGrabber interface %d", hr);
verbose(0, "[GEM:videoDS] Unable to create SampleGrabber interface %d", hr);
return false;
}
......@@ -213,7 +213,7 @@ bool videoDS :: openDevice(gem::Properties&props)
hr = SampleGrabber->SetOneShot(FALSE);
if (hr != S_OK) {
error("Unable to setup sample grabber %d", hr);
verbose(0, "[GEM:videoDS] Unable to setup sample grabber %d", hr);
return false;
}
......@@ -222,7 +222,7 @@ bool videoDS :: openDevice(gem::Properties&props)
hr = SampleGrabber->SetBufferSamples(TRUE);
if (hr != S_OK) {
error("Unable to setup sample grabber %d", hr);
verbose(0, "[GEM:videoDS] Unable to setup sample grabber %d", hr);
return false;
}
......@@ -231,7 +231,7 @@ bool videoDS :: openDevice(gem::Properties&props)
IID_IBaseFilter, (void**)&NullFilter);
if (hr != S_OK || NULL == NullFilter) {
error("Unable to create NullFilter interface %d", hr);
verbose(0, "[GEM:videoDS] Unable to create NullFilter interface %d", hr);
return false;
}
......@@ -239,7 +239,7 @@ bool videoDS :: openDevice(gem::Properties&props)
if (FAILED(hr = m_pGB->AddFilter(m_pCDbase, L"Capture Device")) ||
FAILED(hr = m_pGB->AddFilter(SampleFilter, L"Sample Grabber")) ||
FAILED(hr = m_pGB->AddFilter(NullFilter, L"Null Renderer"))) {
error("Could not add the filters to the graph, hr 0x%X", hr);
verbose(0, "[GEM:videoDS] Could not add the filters to the graph, hr 0x%X", hr);
break;
}
......@@ -251,45 +251,45 @@ bool videoDS :: openDevice(gem::Properties&props)
//try Video only for devices with no audio
if (FAILED(hr = m_pCG->RenderStream(&PIN_CATEGORY_PREVIEW, &MEDIATYPE_Video,
m_pCDbase, SampleFilter, NullFilter))) {
error("Unable to connect to SampleGrabber.");
verbose(0, "[GEM:videoDS] Unable to connect to SampleGrabber.");
return false;
}
}
// QueryInterface for DirectShow interfaces
if (FAILED(hr = (m_pGB->QueryInterface(IID_IMediaFilter, (void **)&m_pMF)))) {
error("Could not get media filter interface, hr 0x%X", hr);
verbose(0, "[GEM:videoDS] Could not get media filter interface, hr 0x%X", hr);
break;
}
//MediaControl is used for Run, Stop, Pause and running state queries
if (FAILED(hr = (m_pGB->QueryInterface(IID_IMediaControl, (void **)&m_pMC)))) {
error("Could not get media control interface, hr 0x%X", hr);
verbose(0, "[GEM:videoDS] Could not get media control interface, hr 0x%X", hr);
break;
}
//not used right now
if (FAILED(hr = (m_pGB->QueryInterface(IID_IMediaEvent, (void **)&m_pME)))) {
error("Could not get media event interface, hr 0x%X", hr);
verbose(0, "[GEM:videoDS] Could not get media event interface, hr 0x%X", hr);
break;
}
//MediaSeeking for the end of a clip. not really used here
if (FAILED(hr = (m_pGB->QueryInterface(IID_IMediaSeeking, (void **)&m_pMS)))){
error("Could not get media seeking interface, hr 0x%X", hr);
verbose(0, "[GEM:videoDS] Could not get media seeking interface, hr 0x%X", hr);
break;
}
//for the position of a clip. not really used for device capture
if (FAILED(hr = (m_pGB->QueryInterface(IID_IMediaPosition, (void **)&m_pMP)))){
error("Could not get media position interface, hr 0x%X", hr);
verbose(0, "[GEM:videoDS] Could not get media position interface, hr 0x%X", hr);
break;
}
// Expose the filter graph so we can view it using GraphEdit
#ifdef REGISTER_FILTERGRAPH
if (FAILED(hr = AddGraphToRot(m_pGB, &m_GraphRegister))){
error("failed to register filter graph with ROT! hr=0x%X", hr);
verbose(0, "[GEM:videoDS] failed to register filter graph with ROT! hr=0x%X", hr);
m_GraphRegister = 0;
}
#endif
......@@ -297,7 +297,7 @@ bool videoDS :: openDevice(gem::Properties&props)
// Turn off the reference clock.
// if (FAILED(hr = m_pMF->SetSyncSource(NULL)))
// {
// error("failed to turn off the reference clock hr=0x%X", hr);
// verbose(0, "[GEM:videoDS] failed to turn off the reference clock hr=0x%X", hr);
// break;
// }
......@@ -375,21 +375,21 @@ std::vector<std::string>videoDS :: enumerate(void)
hr = CoCreateInstance (CLSID_SystemDeviceEnum, NULL, CLSCTX_INPROC,
IID_ICreateDevEnum, (void ** ) &pDevEnum);
if (FAILED(hr)) {
error("Couldn't create system enumerator!");
verbose(0, "[GEM:videoDS] Couldn't create system enumerator!");
break;
}
// Create an enumerator for the video capture devices
hr = pDevEnum->CreateClassEnumerator (CLSID_VideoInputDeviceCategory, &pClassEnum, 0);
if (FAILED(hr)) {
error("Couldn't create class enumerator!");
verbose(0, "[GEM:videoDS] Couldn't create class enumerator!");
break;
}
// If there are no enumerators for the requested type, then
// CreateClassEnumerator will succeed, but pClassEnum will be NULL.
if (pClassEnum == NULL) {
error("No video capture devices found!");
verbose(0, "[GEM:videoDS] No video capture devices found!");
break;
}
......@@ -408,7 +408,6 @@ std::vector<std::string>videoDS :: enumerate(void)
if (SUCCEEDED(hr)) {
std::string s=_bstr_t(varName.bstrVal);
result.push_back(s);
//post("Dev %d: %S", devIndex, varName.bstrVal);
}
VariantClear(&varName);
......@@ -476,7 +475,7 @@ void videoDS :: copyBuffer(void)
// Check for a format change.
if (NULL == SampleGrabber || FAILED(hr = SampleGrabber->GetConnectedMediaType(&pmt))) {
error("could not get sample media type.");
error("[GEM:videoDS] could not get sample media type.");
close();
return;
}
......@@ -538,7 +537,7 @@ bool videoDS :: startTransfer(void)
AM_MEDIA_TYPE mt;
BITMAPINFOHEADER* pbmih;
if (NULL == SampleGrabber || FAILED(hr = SampleGrabber->GetConnectedMediaType(&mt))) {
error("Could not get connect media type, hr 0x%X", hr);
error("[GEM:videoDS] Could not get connect media type, hr 0x%X", hr);
return false;
}
GetBitmapInfoHdr(&mt, &pbmih);
......@@ -548,7 +547,7 @@ bool videoDS :: startTransfer(void)
//starts the graph rendering
if (FAILED(hr = m_pMC->Run())) {
error("Could not start graph playback, hr 0x%X", hr);
error("[GEM:videoDS] Could not start graph playback, hr 0x%X", hr);
return false;
}
......@@ -563,7 +562,7 @@ bool videoDS :: stopTransfer(void)
{
HRESULT hr;
if (FAILED(hr = m_pMC->Stop())) {
error("Could not stop graph playback, hr 0x%X", hr);
error("[GEM:videoDS] Could not stop graph playback, hr 0x%X", hr);
return false;
}
return true;
......@@ -603,7 +602,7 @@ bool videoDS :: setDimen(int x, int y, int leftmargin, int rightmargin,
hr = pDV->put_IPDisplay(resolution);
if (FAILED(hr)) {
error("Could not set decoder resolution.");
error("[GEM:videoDS] Could not set decoder resolution.");
}
}
if(pDV)
......@@ -651,7 +650,7 @@ bool videoDS :: dialog(std::vector<std::string>dlg)
else if(type=="crossbar")
dialogCrossbar(m_pCG, m_pCDbase);
else
error ("dialog not known");
error("[GEM:videoDS] dialog '%s' not known", type.c_str());
}
}
......@@ -671,18 +670,18 @@ void videoDS :: startCapture(void)
memset(&WideFileName, 0, MAXPDSTRING * 2);
if (0 == MultiByteToWideChar(CP_ACP, 0, m_filename, strlen(m_filename), WideFileName,
MAXPDSTRING)) {
error("Unable to capture to %s", m_filename);
error("[GEM:videoDS] Unable to capture to %s", m_filename);
return;
}
// Set filename of output AVI. Returns pointer to a File Writer filter.
if (FAILED(hr = m_pCG->SetOutputFileName(&MEDIASUBTYPE_Avi, WideFileName,
&FileFilter, NULL))) {
error("Unable to set output filename.");
error("[GEM:videoDS] Unable to set output filename.");
return;
}
// Set AVI output option for interleaving.
if (FAILED(hr = SetAviOptions(FileFilter, INTERLEAVE_NONE))) {
error("Unable to set avi options.");
error("[GEM:videoDS] Unable to set avi options.");
return;
}
// Connect the Capture Device filter to the File Writer filter. Try using
......@@ -691,7 +690,7 @@ void videoDS :: startCapture(void)
m_pCDbase, NULL, FileFilter))) {
if (FAILED(hr = m_pCG->RenderStream(&PIN_CATEGORY_CAPTURE, &MEDIATYPE_Video,
m_pCDbase, NULL, FileFilter))) {
error("Unable to record to avi.");
error("[GEM:videoDS] Unable to record to avi.");
return;
}
}
......@@ -730,7 +729,7 @@ void videoDS :: fileMess(t_symbol *filename)
void videoDS :: recordMess(int state)
{
if (NULL==m_filename || 0 == m_filename[0]) {
error("No filename passed");
error("[GEM:videoDS] No filename passed");
return;
}
......@@ -829,13 +828,13 @@ void SetupCaptureDevice(ICaptureGraphBuilder2* pCG, IBaseFilter * pCDbase)
if (SUCCEEDED(hr = (pCG->FindInterface(NULL, NULL, pCDbase, IID_IAMVfwCaptureDialogs, (void **)&pDlg)))) {
if (S_OK == (pDlg->HasDialog(VfwCaptureDialog_Source)))
if (FAILED(hr = pDlg->ShowDialog(VfwCaptureDialog_Source, NULL)))
error("Could not show VFW Capture Source Dialog");
error("[GEM:videoDS] Could not show VFW Capture Source Dialog");
if (S_OK == (pDlg->HasDialog(VfwCaptureDialog_Format)))
if (FAILED(hr = pDlg->ShowDialog(VfwCaptureDialog_Format, NULL)))
error("Could not show VFW Capture Format Dialog");
error("[GEM:videoDS] Could not show VFW Capture Format Dialog");
if (S_OK == (pDlg->HasDialog(VfwCaptureDialog_Display)))
if (FAILED(hr = pDlg->ShowDialog(VfwCaptureDialog_Display, NULL)))
error("Could not show VFW Capture Display Dialog");
error("[GEM:videoDS] Could not show VFW Capture Display Dialog");
pDlg->Release();
}
......@@ -938,7 +937,7 @@ void dialogSource(ICaptureGraphBuilder2* pCG, IBaseFilter * pCDbase) {
if (pDlg) {
if (S_OK == (pDlg->HasDialog(VfwCaptureDialog_Source))) {
if (FAILED(hr = pDlg->ShowDialog(VfwCaptureDialog_Source, NULL))) {
error("Could not show VFW Capture Source Dialog");
error("[GEM:videoDS] Could not show VFW Capture Source Dialog");
}
}
} else {
......@@ -966,7 +965,7 @@ void dialogFormat(ICaptureGraphBuilder2* pCG, IBaseFilter * pCDbase) {
if (pDlg) {
if (S_OK == (pDlg->HasDialog(VfwCaptureDialog_Format)))