locked
Prevent caching for HTTP video stream RRS feed

  • Question

  • I have real trouble with video stream that I am getting from IP camera. It creates cache file in Temporary Interned Files folder, and after 4 days completely trashed my HDD. I found one topic where developer tried to use property that prevents caching, but had no success. I really dont want to write my own schema resolver but seems to me no other option. Here what I am doing:

    CComPtr<IPropertyStore> pPropStore;
    IpCamCredentialManager *pCredentials = new (std::nothrow) IpCamCredentialManager(username, pass);
    // Configure the property store.
    hr = PSCreateMemoryPropertyStore(IID_PPV_ARGS(&pPropStore));
    if (SUCCEEDED(hr))
    {
    // Credential property
    PROPERTYKEY key;
    key.fmtid =  MFNETSOURCE_CREDENTIAL_MANAGER;
    key.pid = 0;
    PROPVARIANT var;
    var.vt = VT_UNKNOWN;
    pCredentials->QueryInterface(IID_PPV_ARGS(&var.punkVal));

    hr = pPropStore->SetValue(key, var);
    PropVariantClear(&var);

    // NO CACHE property
    key.fmtid = MFNETSOURCE_CACHEENABLED;
    key.pid = 0;
    var.vt = VT_I4;
    var.lVal = VARIANT_FALSE;

    hr = pPropStore->SetValue(key, var);
    PropVariantClear(&var);
    }

    CComPtr<IUnknown> pCancelCookie;
    LOG_TRACE("Try to open URL: " << sURL);

    hr = pSourceResolver_->BeginCreateObjectFromURL(
    sURL.c_str(),               // URL of the source.
    MF_RESOLUTION_MEDIASOURCE | 
    MF_RESOLUTION_CONTENT_DOES_NOT_HAVE_TO_MATCH_EXTENSION_OR_MIME_TYPE,  
    pPropStore,                 // Optional property store for extra parameters
    &pCancelCookie,
    this,
    NULL);
    BREAK_ON_FAIL(hr);

    This code works fine but cache file gets created and it is real problem.

    Any ideas ?

    Thanks

    Aleksey

    Tuesday, March 25, 2014 2:44 AM