Lines Matching refs:hr

29   HRESULT hr = ks_property.QueryFrom(pin);
30 if (SUCCEEDED(hr)) {
33 hr = ks_property->Get(AMPROPSETID_Pin, AMPROPERTY_PIN_CATEGORY, NULL, 0,
35 if (SUCCEEDED(hr) && (return_value == sizeof(pin_category))) {
46 HRESULT hr = pin->ConnectionMediaType(&connection_media_type);
47 return SUCCEEDED(hr) && connection_media_type.majortype == major_type;
61 HRESULT hr = dev_enum.CreateInstance(CLSID_SystemDeviceEnum, NULL,
63 if (FAILED(hr))
64 return hr;
67 hr = dev_enum->CreateClassEnumerator(device_class_id, enum_moniker.Receive(),
71 if (hr != S_OK)
79 hr = moniker->BindToStorage(0, 0, IID_IPropertyBag, prop_bag.ReceiveVoid());
80 if (FAILED(hr)) {
99 hr = moniker->BindToObject(0, 0, IID_IBaseFilter,
101 DLOG_IF(ERROR, FAILED(hr)) << "Failed to bind camera filter: "
102 << logging::SystemErrorCodeToString(hr);
110 if (!*filter && SUCCEEDED(hr))
111 hr = HRESULT_FROM_WIN32(ERROR_NOT_FOUND);
113 return hr;
125 HRESULT hr = filter->EnumPins(pin_enum.Receive());
130 hr = pin_enum->Reset(); // set to first pin
131 while ((hr = pin_enum->Next(1, pin.Receive(), NULL)) == S_OK) {
133 hr = pin->QueryDirection(&this_pin_dir);
244 HRESULT hr;
247 hr = InstantiateWDMFiltersAndPins();
249 hr = GetDeviceFilter(device_name_.id(), CLSID_VideoInputDeviceCategory,
254 << logging::SystemErrorCodeToString(hr);
274 hr = graph_builder_.CreateInstance(CLSID_FilterGraph, NULL,
276 if (FAILED(hr)) {
278 << logging::SystemErrorCodeToString(hr);
282 hr = graph_builder_.QueryInterface(media_control_.Receive());
283 if (FAILED(hr)) {
285 << logging::SystemErrorCodeToString(hr);
289 hr = graph_builder_->AddFilter(capture_filter_, NULL);
290 if (FAILED(hr)) {
292 << logging::SystemErrorCodeToString(hr);
302 hr = graph_builder_->AddFilter(sink_filter_, NULL);
303 if (FAILED(hr)) {
305 << logging::SystemErrorCodeToString(hr);
335 HRESULT hr = output_capture_pin_.QueryInterface(stream_config.Receive());
336 if (FAILED(hr)) {
342 hr = stream_config->GetNumberOfCapabilities(&count, &size);
343 if (FAILED(hr)) {
354 hr = stream_config->GetStreamCaps(
356 if (hr != S_OK) {
369 hr = stream_config->SetFormat(media_type.get());
370 if (FAILED(hr)) {
379 hr = mjpg_filter_.CreateInstance(CLSID_MjpegDec, NULL, CLSCTX_INPROC);
381 if (SUCCEEDED(hr)) {
386 hr = graph_builder_->AddFilter(mjpg_filter_, NULL);
389 if (FAILED(hr)) {
400 hr = graph_builder_->ConnectDirect(output_capture_pin_, input_mjpg_pin_,
403 hr += graph_builder_->ConnectDirect(output_mjpg_pin_, input_sink_pin_,
408 hr = graph_builder_->Connect(output_capture_pin_, input_sink_pin_);
410 hr = graph_builder_->ConnectDirect(output_capture_pin_, input_sink_pin_,
414 if (FAILED(hr)) {
419 hr = media_control_->Pause();
420 if (FAILED(hr)) {
431 hr = media_control_->Run();
432 if (FAILED(hr)) {
445 HRESULT hr = media_control_->Stop();
446 if (FAILED(hr)) {
464 if (FAILED(hr)) {
482 HRESULT hr = output_capture_pin_.QueryInterface(stream_config.Receive());
483 if (FAILED(hr)) {
485 "capture device: " << logging::SystemErrorCodeToString(hr);
491 hr = capture_filter_.QueryInterface(video_control.Receive());
492 DLOG_IF(WARNING, FAILED(hr)) << "IAMVideoControl Interface NOT SUPPORTED: "
493 << logging::SystemErrorCodeToString(hr);
496 hr = stream_config->GetNumberOfCapabilities(&count, &size);
497 if (FAILED(hr)) {
499 << logging::SystemErrorCodeToString(hr);
506 hr = stream_config->GetStreamCaps(i, media_type.Receive(), caps.get());
509 if (hr != S_OK) {
511 << logging::SystemErrorCodeToString(hr);
542 hr = video_control->GetFrameRateList(output_capture_pin_, i, size,
547 if (hr == S_OK && list_size > 0 && max_fps) {
579 HRESULT hr;
580 if (SUCCEEDED(hr = ks_propset.QueryFrom(capture_filter_)) &&
581 SUCCEEDED(hr = ks_propset->QuerySupported(PROPSETID_VIDCAP_VIDEOPROCAMP,
590 hr = ks_propset->Set(PROPSETID_VIDCAP_VIDEOPROCAMP,
593 DLOG_IF(ERROR, FAILED(hr)) << "Anti-flicker setting failed: "
594 << logging::SystemErrorCodeToString(hr);
595 DVLOG_IF(2, SUCCEEDED(hr)) << "Anti-flicker set correctly.";
607 HRESULT hr = VideoCaptureDeviceWin::GetDeviceFilter(
611 DPLOG_IF(ERROR, FAILED(hr)) << "Failed to bind WDM Crossbar filter";
612 if (FAILED(hr) || !crossbar_filter_)
624 hr = VideoCaptureDeviceWin::GetDeviceFilter(device_name_.capabilities_id(),
627 DPLOG_IF(ERROR, FAILED(hr)) << "Failed to bind WDM Capture filter";
628 if (FAILED(hr) || !capture_filter_)
644 HRESULT hr = graph_builder_->AddFilter(crossbar_filter_, NULL);
645 DPLOG_IF(ERROR, FAILED(hr)) << "Failed to add Crossbar filter to the graph";
646 if (FAILED(hr))
649 hr = graph_builder_->ConnectDirect(
651 DPLOG_IF(ERROR, FAILED(hr)) << "Failed to plug WDM filters to each other";
652 if (FAILED(hr))