Skip to content
Snippets Groups Projects
Commit 52a2d75c authored by Dan Minor's avatar Dan Minor
Browse files

Bug 1552755 - Small fixes to backport the updated video capture code; r=ng

A few small changes are required to backport the updated windows capture code
to our version of webrtc.org. These are largely path changes, but
DetachFromThread has been renamed to Detach, and they seem to have a working
overload for ostream operator<< for VideoType that I have not been able to
track down. It is also necessary to add our local modification for pid_t back
to the GetDeviceName method, but it is not used for video capture anyways.

Depends on D33337

Differential Revision: https://phabricator.services.mozilla.com/D33338

--HG--
extra : moz-landing-system : lando
parent a03a64be
No related branches found
No related tags found
No related merge requests found
......@@ -13,7 +13,7 @@
#include "modules/video_capture/video_capture_config.h"
#include "modules/video_capture/windows/help_functions_ds.h"
#include "rtc_base/logging.h"
#include "rtc_base/string_utils.h"
#include "rtc_base/stringutils.h"
#include <dvdmedia.h>
......@@ -107,7 +107,8 @@ int32_t DeviceInfoDS::GetDeviceName(uint32_t deviceNumber,
char* deviceUniqueIdUTF8,
uint32_t deviceUniqueIdUTF8Length,
char* productUniqueIdUTF8,
uint32_t productUniqueIdUTF8Length) {
uint32_t productUniqueIdUTF8Length,
pid_t *pid) {
ReadLockScoped cs(_apiLock);
const int32_t result = GetDeviceInfo(
deviceNumber, deviceNameUTF8, deviceNameLength, deviceUniqueIdUTF8,
......
......@@ -47,7 +47,8 @@ class DeviceInfoDS : public DeviceInfoImpl {
char* deviceUniqueIdUTF8,
uint32_t deviceUniqueIdUTF8Length,
char* productUniqueIdUTF8,
uint32_t productUniqueIdUTF8Length) override;
uint32_t productUniqueIdUTF8Length,
pid_t* pid) override;
/*
* Display OS /capture device specific settings dialog
......
......@@ -14,6 +14,7 @@
#include "modules/video_capture/windows/help_functions_ds.h"
#include "rtc_base/checks.h"
#include "rtc_base/logging.h"
#include <cguid.h>
......
......@@ -16,8 +16,8 @@
#include <type_traits>
#include <utility>
#include "api/scoped_refptr.h"
#include "rtc_base/ref_counter.h"
#include "rtc_base/scoped_ref_ptr.h"
#include "rtc_base/refcounter.h"
DEFINE_GUID(MEDIASUBTYPE_I420,
0x30323449,
......
......@@ -14,7 +14,7 @@
#include "rtc_base/checks.h"
#include "rtc_base/logging.h"
#include "rtc_base/platform_thread.h"
#include "rtc_base/string_utils.h"
#include "rtc_base/stringutils.h"
#include <dvdmedia.h> // VIDEOINFOHEADER2
#include <initguid.h>
......@@ -245,7 +245,7 @@ class MediaTypesEnum : public IEnumMediaTypes {
auto it = std::find(format_preference_order_.begin(),
format_preference_order_.end(), capability_.videoType);
if (it != format_preference_order_.end()) {
RTC_LOG(LS_INFO) << "Selected video type: " << *it;
RTC_LOG(LS_INFO) << "Selected video type: " << static_cast<int32_t>(*it);
// Move it to the front of the list, if it isn't already there.
if (it != format_preference_order_.begin()) {
format_preference_order_.splice(format_preference_order_.begin(),
......@@ -253,7 +253,7 @@ class MediaTypesEnum : public IEnumMediaTypes {
std::next(it));
}
} else {
RTC_LOG(LS_WARNING) << "Unsupported video type: " << *it
RTC_LOG(LS_WARNING) << "Unsupported video type: " << static_cast<int32_t>(*it)
<< ", using default preference list.";
}
}
......@@ -380,7 +380,7 @@ class MediaTypesEnum : public IEnumMediaTypes {
} // namespace
CaptureInputPin::CaptureInputPin(CaptureSinkFilter* filter) {
capture_checker_.Detach();
capture_checker_.DetachFromThread();
// No reference held to avoid circular references.
info_.pFilter = filter;
info_.dir = PINDIR_INPUT;
......@@ -404,7 +404,7 @@ void CaptureInputPin::OnFilterActivated() {
RTC_DCHECK_RUN_ON(&main_checker_);
runtime_error_ = false;
flushing_ = false;
capture_checker_.Detach();
capture_checker_.DetachFromThread();
capture_thread_id_ = 0;
}
......
......@@ -11,7 +11,7 @@
#ifndef MODULES_VIDEO_CAPTURE_MAIN_SOURCE_WINDOWS_VIDEO_CAPTURE_DS_H_
#define MODULES_VIDEO_CAPTURE_MAIN_SOURCE_WINDOWS_VIDEO_CAPTURE_DS_H_
#include "api/scoped_refptr.h"
#include "rtc_base/scoped_ref_ptr.h"
#include "modules/video_capture/video_capture_impl.h"
#include "modules/video_capture/windows/device_info_ds.h"
......
......@@ -8,9 +8,9 @@
* be found in the AUTHORS file in the root of the source tree.
*/
#include "api/scoped_refptr.h"
#include "rtc_base/scoped_ref_ptr.h"
#include "modules/video_capture/windows/video_capture_ds.h"
#include "rtc_base/ref_counted_object.h"
#include "rtc_base/refcountedobject.h"
namespace webrtc {
namespace videocapturemodule {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment