Changeset 3505 for pjproject


Ignore:
Timestamp:
Apr 7, 2011 7:22:35 AM (14 years ago)
Author:
bennylp
Message:

Re #1213: added printing error message when fails to open DirectShow? device

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/branches/projects/2.0-dev/pjmedia/src/pjmedia-videodev/dshow_dev.c

    r3489 r3505  
    3939#pragma comment(lib, "Strmiids.lib") 
    4040#pragma comment(lib, "Rpcrt4.lib") 
     41#pragma comment(lib, "Quartz.lib") 
    4142 
    4243#define THIS_FILE               "dshow_dev.c" 
     
    702703    if (vi) 
    703704        CoTaskMemFree(vi); 
    704     if (FAILED(hr)) 
    705         return hr; 
     705    if (FAILED(hr)) { 
     706        char msg[80]; 
     707        if (AMGetErrorText(hr, msg, sizeof(msg))) { 
     708            PJ_LOG(4,(THIS_FILE, "Error creating filter graph: %s (hr=0x%x)",  
     709                      msg, hr)); 
     710        } 
     711        return PJ_EUNKNOWN; 
     712    } 
    706713 
    707714    return PJ_SUCCESS; 
     
    771778on_error: 
    772779    dshow_stream_destroy((pjmedia_vid_dev_stream *)strm); 
    773     return PJ_EUNKNOWN; 
     780    return status; 
    774781} 
    775782 
     
    850857        hr = IMediaFilter_Run(stream->dgraph[i].media_filter, 0); 
    851858        if (FAILED(hr)) { 
    852             return hr; 
     859            char msg[80]; 
     860            if (AMGetErrorText(hr, msg, sizeof(msg))) { 
     861                PJ_LOG(4,(THIS_FILE, "Error starting media: %s", msg)); 
     862            } 
     863            return PJ_EUNKNOWN; 
    853864        } 
    854865    } 
Note: See TracChangeset for help on using the changeset viewer.