Add preliminary DirectShow capture plugin
This covers the basics of devices. Mostly functional but not at 100% yet. Uses 'libdshowcapture' library to capture directshow video/audio. Both libdshowcapture and the plugin still need some work. Should at least capture basic webcams and capture cards for the time being.
This commit is contained in:
parent
1343d6bdee
commit
c55b1771cd
@ -2,6 +2,7 @@ include_directories(SYSTEM "${CMAKE_SOURCE_DIR}/libobs")
|
||||
|
||||
if(WIN32)
|
||||
add_subdirectory(win-wasapi)
|
||||
add_subdirectory(win-dshow)
|
||||
add_subdirectory(win-capture)
|
||||
elseif(APPLE)
|
||||
add_subdirectory(mac-avcapture)
|
||||
|
32
plugins/win-dshow/CMakeLists.txt
Normal file
32
plugins/win-dshow/CMakeLists.txt
Normal file
@ -0,0 +1,32 @@
|
||||
project(win-dshow)
|
||||
|
||||
set(win-dshow_SOURCES
|
||||
win-dshow.cpp)
|
||||
|
||||
set(libdshowcapture_SOURCES
|
||||
libdshowcapture/source/capture-filter.cpp
|
||||
libdshowcapture/source/device.cpp
|
||||
libdshowcapture/source/dshow-base.cpp
|
||||
libdshowcapture/source/dshow-enum.cpp
|
||||
libdshowcapture/source/dshow-formats.cpp
|
||||
libdshowcapture/source/dshow-media-type.cpp
|
||||
libdshowcapture/source/log.cpp)
|
||||
|
||||
set(libdshowcapture_HEADERS
|
||||
libdshowcapture/dshowcapture.hpp
|
||||
libdshowcapture/source/capture-filter.hpp
|
||||
libdshowcapture/source/device.hpp
|
||||
libdshowcapture/source/dshow-base.hpp
|
||||
libdshowcapture/source/dshow-enum.hpp
|
||||
libdshowcapture/source/dshow-formats.hpp
|
||||
libdshowcapture/source/dshow-media-type.hpp
|
||||
libdshowcapture/source/log.hpp)
|
||||
|
||||
add_library(win-dshow MODULE
|
||||
${win-dshow_SOURCES}
|
||||
${libdshowcapture_SOURCES}
|
||||
${libdshowcapture_HEADERS})
|
||||
target_link_libraries(win-dshow
|
||||
libobs)
|
||||
|
||||
install_obs_plugin(win-dshow)
|
765
plugins/win-dshow/win-dshow.cpp
Normal file
765
plugins/win-dshow/win-dshow.cpp
Normal file
@ -0,0 +1,765 @@
|
||||
#include <objbase.h>
|
||||
|
||||
#include <obs-module.h>
|
||||
#include <obs.hpp>
|
||||
#include <util/dstr.hpp>
|
||||
#include <util/util.hpp>
|
||||
#include <util/platform.h>
|
||||
#include "libdshowcapture/dshowcapture.hpp"
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
/*
|
||||
* TODO:
|
||||
* - handle disconnections and reconnections
|
||||
* - if device not present, wait for device to be plugged in
|
||||
*/
|
||||
|
||||
using namespace std;
|
||||
using namespace DShow;
|
||||
|
||||
/* settings defines that will cause errors if there are typos */
|
||||
#define RES_TYPE "res_type"
|
||||
#define RESOLUTION "resolution"
|
||||
#define LAST_RESOLUTION "last_resolution"
|
||||
#define VIDEO_DEVICE_ID "video_device_id"
|
||||
#define LAST_VIDEO_DEV_ID "last_video_device_id"
|
||||
#define FRAME_INTERVAL "frame_interval"
|
||||
#define VIDEO_FORMAT "video_format"
|
||||
|
||||
enum ResType {
|
||||
ResType_Preferred,
|
||||
ResType_Custom
|
||||
};
|
||||
|
||||
struct DShowInput {
|
||||
obs_source_t source;
|
||||
Device device;
|
||||
bool comInitialized;
|
||||
|
||||
VideoConfig videoConfig;
|
||||
AudioConfig audioConfig;
|
||||
|
||||
source_frame frame;
|
||||
|
||||
inline DShowInput(obs_source_t source_)
|
||||
: source (source_),
|
||||
device (InitGraph::False),
|
||||
comInitialized (false)
|
||||
{}
|
||||
|
||||
static void OnVideoData(DShowInput *input, unsigned char *data,
|
||||
size_t size, long long startTime, long long endTime);
|
||||
|
||||
void Update(obs_data_t settings);
|
||||
};
|
||||
|
||||
void encode_dstr(struct dstr *str)
|
||||
{
|
||||
dstr_replace(str, "#", "#22");
|
||||
dstr_replace(str, ":", "#3A");
|
||||
}
|
||||
|
||||
void decode_dstr(struct dstr *str)
|
||||
{
|
||||
dstr_replace(str, "#3A", ":");
|
||||
dstr_replace(str, "#22", "#");
|
||||
}
|
||||
|
||||
static inline video_format ConvertVideoFormat(VideoFormat format)
|
||||
{
|
||||
switch (format) {
|
||||
case VideoFormat::ARGB: return VIDEO_FORMAT_BGRA;
|
||||
case VideoFormat::XRGB: return VIDEO_FORMAT_BGRX;
|
||||
case VideoFormat::I420: return VIDEO_FORMAT_I420;
|
||||
case VideoFormat::NV12: return VIDEO_FORMAT_NV12;
|
||||
case VideoFormat::YVYU: return VIDEO_FORMAT_UYVY;
|
||||
case VideoFormat::YUY2: return VIDEO_FORMAT_YUY2;
|
||||
case VideoFormat::UYVY: return VIDEO_FORMAT_YVYU;
|
||||
case VideoFormat::MJPEG: return VIDEO_FORMAT_YUY2;
|
||||
default: return VIDEO_FORMAT_NONE;
|
||||
}
|
||||
}
|
||||
|
||||
void DShowInput::OnVideoData(DShowInput *input, unsigned char *data,
|
||||
size_t size, long long startTime, long long endTime)
|
||||
{
|
||||
const int cx = input->videoConfig.cx;
|
||||
const int cy = input->videoConfig.cy;
|
||||
|
||||
input->frame.timestamp = (uint64_t)startTime * 100;
|
||||
|
||||
if (input->videoConfig.format == VideoFormat::XRGB ||
|
||||
input->videoConfig.format == VideoFormat::ARGB) {
|
||||
input->frame.data[0] = data;
|
||||
input->frame.linesize[0] = cx * 4;
|
||||
|
||||
} else if (input->videoConfig.format == VideoFormat::YVYU ||
|
||||
input->videoConfig.format == VideoFormat::YUY2 ||
|
||||
input->videoConfig.format == VideoFormat::UYVY) {
|
||||
input->frame.data[0] = data;
|
||||
input->frame.linesize[0] = cx * 2;
|
||||
|
||||
} else if (input->videoConfig.format == VideoFormat::I420) {
|
||||
input->frame.data[0] = data;
|
||||
input->frame.data[1] = input->frame.data[0] + (cx * cy);
|
||||
input->frame.data[2] = input->frame.data[1] + (cx * cy / 4);
|
||||
input->frame.linesize[0] = cx;
|
||||
input->frame.linesize[1] = cx / 2;
|
||||
input->frame.linesize[2] = cx / 2;
|
||||
|
||||
} else {
|
||||
/* TODO: other formats */
|
||||
return;
|
||||
}
|
||||
|
||||
obs_source_output_video(input->source, &input->frame);
|
||||
|
||||
UNUSED_PARAMETER(endTime); /* it's the enndd tiimmes! */
|
||||
UNUSED_PARAMETER(size);
|
||||
}
|
||||
|
||||
static bool DecodeDeviceId(DeviceId &out, const char *device_id)
|
||||
{
|
||||
const char *path_str;
|
||||
DStr name, path;
|
||||
|
||||
if (!device_id || !*device_id)
|
||||
return false;
|
||||
|
||||
path_str = strchr(device_id, ':');
|
||||
if (!path_str)
|
||||
return false;
|
||||
|
||||
dstr_copy(path, path_str+1);
|
||||
dstr_copy(name, device_id);
|
||||
|
||||
size_t len = path_str - device_id;
|
||||
name->array[len] = 0;
|
||||
name->len = len;
|
||||
|
||||
decode_dstr(name);
|
||||
decode_dstr(path);
|
||||
|
||||
BPtr<wchar_t> wname = dstr_to_wcs(name);
|
||||
out.name = wname;
|
||||
|
||||
if (!dstr_isempty(path)) {
|
||||
BPtr<wchar_t> wpath = dstr_to_wcs(path);
|
||||
out.path = wpath;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
static inline bool ConvertRes(int &cx, int &cy, const char *res)
|
||||
{
|
||||
return sscanf(res, "%dx%d", &cx, &cy) == 2;
|
||||
}
|
||||
|
||||
void DShowInput::Update(obs_data_t settings)
|
||||
{
|
||||
const char *video_device_id, *res;
|
||||
DeviceId id;
|
||||
|
||||
video_device_id = obs_data_getstring (settings, VIDEO_DEVICE_ID);
|
||||
res = obs_data_getstring (settings, RESOLUTION);
|
||||
long long interval = obs_data_getint (settings, FRAME_INTERVAL);
|
||||
int resType = (int)obs_data_getint(settings, RES_TYPE);
|
||||
|
||||
VideoFormat format = (VideoFormat)obs_data_getint(settings,
|
||||
VIDEO_FORMAT);
|
||||
|
||||
obs_data_setstring(settings, LAST_VIDEO_DEV_ID, video_device_id);
|
||||
obs_data_setstring(settings, LAST_RESOLUTION, res);
|
||||
|
||||
if (!comInitialized) {
|
||||
CoInitialize(nullptr);
|
||||
comInitialized = true;
|
||||
}
|
||||
|
||||
if (!device.ResetGraph())
|
||||
return;
|
||||
|
||||
if (!DecodeDeviceId(id, video_device_id))
|
||||
return;
|
||||
|
||||
int cx, cy;
|
||||
if (!ConvertRes(cx, cy, res)) {
|
||||
blog(LOG_WARNING, "DShowInput::Update: Bad resolution '%s'",
|
||||
res);
|
||||
return;
|
||||
}
|
||||
|
||||
videoConfig.name = id.name.c_str();
|
||||
videoConfig.path = id.path.c_str();
|
||||
videoConfig.callback = CaptureProc(DShowInput::OnVideoData);
|
||||
videoConfig.param = this;
|
||||
videoConfig.useDefaultConfig = resType == ResType_Preferred;
|
||||
videoConfig.cx = cx;
|
||||
videoConfig.cy = cy;
|
||||
videoConfig.frameInterval = interval;
|
||||
videoConfig.internalFormat = format;
|
||||
|
||||
if (format == VideoFormat::MJPEG)
|
||||
videoConfig.format = VideoFormat::XRGB;
|
||||
else
|
||||
videoConfig.format = format;
|
||||
|
||||
device.SetVideoConfig(&videoConfig);
|
||||
|
||||
if (!device.ConnectFilters())
|
||||
return;
|
||||
|
||||
if (device.Start() != Result::Success)
|
||||
return;
|
||||
|
||||
frame.width = videoConfig.cx;
|
||||
frame.height = videoConfig.cy;
|
||||
frame.format = ConvertVideoFormat(videoConfig.format);
|
||||
frame.full_range = false;
|
||||
frame.flip = (videoConfig.format == VideoFormat::XRGB ||
|
||||
videoConfig.format == VideoFormat::ARGB);
|
||||
|
||||
if (!video_format_get_parameters(VIDEO_CS_601, VIDEO_RANGE_PARTIAL,
|
||||
frame.color_matrix,
|
||||
frame.color_range_min,
|
||||
frame.color_range_max)) {
|
||||
blog(LOG_ERROR, "Failed to get video format parameters for " \
|
||||
"video format %u", VIDEO_CS_601);
|
||||
}
|
||||
}
|
||||
|
||||
/* ------------------------------------------------------------------------- */
|
||||
|
||||
static const char *GetDShowInputName(const char *locale)
|
||||
{
|
||||
UNUSED_PARAMETER(locale);
|
||||
return "Video Capture Device";
|
||||
}
|
||||
|
||||
static void *CreateDShowInput(obs_data_t settings, obs_source_t source)
|
||||
{
|
||||
DShowInput *dshow = new DShowInput(source);
|
||||
|
||||
/* causes a deferred update in the video thread */
|
||||
obs_source_update(source, nullptr);
|
||||
|
||||
UNUSED_PARAMETER(settings);
|
||||
return dshow;
|
||||
}
|
||||
|
||||
static void DestroyDShowInput(void *data)
|
||||
{
|
||||
delete reinterpret_cast<DShowInput*>(data);
|
||||
}
|
||||
|
||||
static uint32_t GetDShowWidth(void *data)
|
||||
{
|
||||
return reinterpret_cast<DShowInput*>(data)->videoConfig.cx;
|
||||
}
|
||||
|
||||
static uint32_t GetDShowHeight(void *data)
|
||||
{
|
||||
return reinterpret_cast<DShowInput*>(data)->videoConfig.cy;
|
||||
}
|
||||
|
||||
static void UpdateDShowInput(void *data, obs_data_t settings)
|
||||
{
|
||||
reinterpret_cast<DShowInput*>(data)->Update(settings);
|
||||
}
|
||||
|
||||
static void GetDShowDefaults(obs_data_t settings)
|
||||
{
|
||||
obs_data_set_default_int(settings, RES_TYPE, ResType_Preferred);
|
||||
obs_data_set_default_int(settings, VIDEO_FORMAT, (int)VideoFormat::Any);
|
||||
}
|
||||
|
||||
struct PropertiesData {
|
||||
vector<VideoDevice> devices;
|
||||
|
||||
const bool GetDevice(VideoDevice &device, const char *encoded_id)
|
||||
{
|
||||
DeviceId deviceId;
|
||||
DecodeDeviceId(deviceId, encoded_id);
|
||||
|
||||
for (const VideoDevice &curDevice : devices) {
|
||||
if (deviceId.name.compare(curDevice.name) == 0 &&
|
||||
deviceId.path.compare(curDevice.path) == 0) {
|
||||
device = curDevice;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
struct Resolution {
|
||||
int cx, cy;
|
||||
|
||||
inline Resolution(int cx, int cy) : cx(cx), cy(cy) {}
|
||||
};
|
||||
|
||||
static void InsertResolution(vector<Resolution> &resolutions, int cx, int cy)
|
||||
{
|
||||
int bestCY = 0;
|
||||
size_t idx = 0;
|
||||
|
||||
for (; idx < resolutions.size(); idx++) {
|
||||
const Resolution &res = resolutions[idx];
|
||||
if (res.cx > cx)
|
||||
break;
|
||||
|
||||
if (res.cx == cx) {
|
||||
if (res.cy == cy)
|
||||
return;
|
||||
|
||||
if (!bestCY)
|
||||
bestCY = res.cy;
|
||||
else if (res.cy > bestCY)
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
resolutions.insert(resolutions.begin() + idx, Resolution(cx, cy));
|
||||
}
|
||||
|
||||
static inline void AddCap(vector<Resolution> &resolutions, const VideoInfo &cap)
|
||||
{
|
||||
InsertResolution(resolutions, cap.minCX, cap.minCY);
|
||||
InsertResolution(resolutions, cap.maxCX, cap.maxCY);
|
||||
}
|
||||
|
||||
#define MAX_LL 0x7FFFFFFFFFFFFFFFLL
|
||||
|
||||
#define MAKE_DSHOW_FPS(fps) (10000000LL/(fps))
|
||||
#define MAKE_DSHOW_FRACTIONAL_FPS(den, num) ((num)*10000000LL/(den))
|
||||
|
||||
struct FPSFormat {
|
||||
const char *text;
|
||||
long long interval;
|
||||
};
|
||||
|
||||
static const FPSFormat validFPSFormats[] = {
|
||||
{"60", MAKE_DSHOW_FPS(60)},
|
||||
{"59.94 NTSC", MAKE_DSHOW_FRACTIONAL_FPS(60000, 1001)},
|
||||
{"50", MAKE_DSHOW_FPS(50)},
|
||||
{"48 film", MAKE_DSHOW_FRACTIONAL_FPS(48000, 1001)},
|
||||
{"40", MAKE_DSHOW_FPS(40)},
|
||||
{"30", MAKE_DSHOW_FPS(30)},
|
||||
{"29.97 NTSC", MAKE_DSHOW_FRACTIONAL_FPS(30000, 1001)},
|
||||
{"25", MAKE_DSHOW_FPS(25)},
|
||||
{"24 film", MAKE_DSHOW_FRACTIONAL_FPS(24000, 1001)},
|
||||
{"20", MAKE_DSHOW_FPS(20)},
|
||||
{"15", MAKE_DSHOW_FPS(15)},
|
||||
{"10", MAKE_DSHOW_FPS(10)},
|
||||
{"5", MAKE_DSHOW_FPS(5)},
|
||||
{"4", MAKE_DSHOW_FPS(4)},
|
||||
{"3", MAKE_DSHOW_FPS(3)},
|
||||
{"2", MAKE_DSHOW_FPS(2)},
|
||||
{"1", MAKE_DSHOW_FPS(1)},
|
||||
};
|
||||
|
||||
#define DEVICE_INTERVAL_DIFF_LIMIT 20
|
||||
|
||||
static void AddFPSRates(obs_property_t p, const VideoInfo &cap)
|
||||
{
|
||||
for (const FPSFormat &format : validFPSFormats) {
|
||||
if (format.interval >= cap.minInterval &&
|
||||
format.interval <= cap.maxInterval) {
|
||||
obs_property_list_add_int(p, format.text,
|
||||
format.interval);
|
||||
|
||||
} else {
|
||||
/* account for slight inaccuracies in intervals
|
||||
* among different devices */
|
||||
long long interval = 0;
|
||||
long long diff = 0;
|
||||
|
||||
if (format.interval < cap.minInterval) {
|
||||
interval = cap.minInterval;
|
||||
diff = cap.minInterval - format.interval;
|
||||
} else if (format.interval > cap.maxInterval) {
|
||||
interval = cap.maxInterval;
|
||||
diff = format.interval - cap.minInterval;
|
||||
}
|
||||
|
||||
if (diff <= DEVICE_INTERVAL_DIFF_LIMIT)
|
||||
obs_property_list_add_int(p, format.text,
|
||||
interval);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static bool DeviceResolutionChanged(obs_properties_t props, obs_property_t p,
|
||||
obs_data_t settings)
|
||||
{
|
||||
PropertiesData *data = (PropertiesData*)obs_properties_get_param(props);
|
||||
const char *res, *last_res, *id;
|
||||
VideoDevice device;
|
||||
|
||||
id = obs_data_getstring(settings, VIDEO_DEVICE_ID);
|
||||
res = obs_data_getstring(settings, RESOLUTION);
|
||||
last_res = obs_data_getstring(settings, LAST_RESOLUTION);
|
||||
|
||||
if (!data->GetDevice(device, id))
|
||||
return true;
|
||||
|
||||
int cx, cy;
|
||||
if (!ConvertRes(cx, cy, res))
|
||||
return true;
|
||||
|
||||
p = obs_properties_get(props, FRAME_INTERVAL);
|
||||
obs_property_list_clear(p);
|
||||
|
||||
if (res && last_res && strcmp(res, last_res) != 0)
|
||||
obs_data_setint(settings, FRAME_INTERVAL, 0);
|
||||
|
||||
for (const VideoInfo &cap : device.caps) {
|
||||
if (cx >= cap.minCX && cx <= cap.maxCX &&
|
||||
cy >= cap.minCY && cy <= cap.maxCY) {
|
||||
AddFPSRates(p, cap);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
template<typename T> static inline T GetRating(T desired, T minVal, T maxVal,
|
||||
T &bestVal)
|
||||
{
|
||||
T rating = 0;
|
||||
|
||||
if (desired < minVal) {
|
||||
rating = minVal - desired;
|
||||
bestVal = minVal;
|
||||
|
||||
} else if (desired > maxVal) {
|
||||
rating = desired - maxVal;
|
||||
bestVal = maxVal;
|
||||
|
||||
} else {
|
||||
bestVal = desired;
|
||||
}
|
||||
|
||||
return rating;
|
||||
}
|
||||
|
||||
static void SetClosestResFPS(obs_properties_t props, obs_data_t settings)
|
||||
{
|
||||
PropertiesData *data = (PropertiesData*)obs_properties_get_param(props);
|
||||
const char *id = obs_data_getstring(settings, VIDEO_DEVICE_ID);
|
||||
VideoDevice device;
|
||||
|
||||
if (!data->GetDevice(device, id))
|
||||
return;
|
||||
|
||||
obs_video_info ovi;
|
||||
if (!obs_get_video_info(&ovi))
|
||||
return;
|
||||
|
||||
long long desiredInterval =
|
||||
MAKE_DSHOW_FRACTIONAL_FPS(ovi.fps_num, ovi.fps_den);
|
||||
|
||||
long long bestRating = MAX_LL;
|
||||
long long bestInterval = 0;
|
||||
int bestCX = 0, bestCY = 0;
|
||||
|
||||
for (const VideoInfo &cap : device.caps) {
|
||||
long long rating = 0;
|
||||
long long interval = 0;
|
||||
int cx = 0, cy = 0;
|
||||
|
||||
rating += GetRating<long long>(desiredInterval,
|
||||
cap.minInterval, cap.maxInterval, interval);
|
||||
rating += GetRating<int>(ovi.base_width,
|
||||
cap.minCX, cap.maxCX, cx);
|
||||
rating += GetRating<int>(ovi.base_height,
|
||||
cap.minCY, cap.maxCY, cy);
|
||||
|
||||
if (rating < bestRating) {
|
||||
bestInterval = interval;
|
||||
bestCX = cx;
|
||||
bestCY = cy;
|
||||
bestRating = rating;
|
||||
|
||||
if (rating == 0)
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (bestRating != MAX_LL) {
|
||||
string strRes;
|
||||
strRes = to_string(bestCX) + string("x") + to_string(bestCY);
|
||||
|
||||
obs_data_setstring(settings, RESOLUTION, strRes.c_str());
|
||||
obs_data_setint(settings, FRAME_INTERVAL, bestInterval);
|
||||
}
|
||||
}
|
||||
|
||||
struct VideoFormatName {
|
||||
VideoFormat format;
|
||||
const char *name;
|
||||
};
|
||||
|
||||
static const VideoFormatName videoFormatNames[] = {
|
||||
/* raw formats */
|
||||
{VideoFormat::ARGB, "ARGB"},
|
||||
{VideoFormat::XRGB, "XRGB"},
|
||||
|
||||
/* planar YUV formats */
|
||||
{VideoFormat::I420, "I420"},
|
||||
{VideoFormat::NV12, "NV12"},
|
||||
|
||||
/* packed YUV formats */
|
||||
{VideoFormat::YVYU, "YVYU"},
|
||||
{VideoFormat::YUY2, "YUY2"},
|
||||
{VideoFormat::UYVY, "UYVY"},
|
||||
{VideoFormat::HDYC, "HDYV"},
|
||||
|
||||
/* encoded formats */
|
||||
{VideoFormat::MPEG2, "MPEG2"},
|
||||
{VideoFormat::MJPEG, "MJPEG"},
|
||||
{VideoFormat::H264, "H264"}
|
||||
};
|
||||
|
||||
static void UpdateVideoFormats(obs_properties_t props, VideoDevice &device)
|
||||
{
|
||||
obs_property_t p = obs_properties_get(props, VIDEO_FORMAT);
|
||||
|
||||
obs_property_list_clear(p);
|
||||
obs_property_list_add_int(p, "Any", (int)VideoFormat::Any);
|
||||
|
||||
for (const VideoFormatName &name : videoFormatNames) {
|
||||
for (const VideoInfo &cap : device.caps) {
|
||||
if (cap.format == name.format) {
|
||||
obs_property_list_add_int(p, name.name,
|
||||
(int)name.format);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static bool DeviceSelectionChanged(obs_properties_t props, obs_property_t p,
|
||||
obs_data_t settings)
|
||||
{
|
||||
PropertiesData *data = (PropertiesData*)obs_properties_get_param(props);
|
||||
const char *id, *old_id;
|
||||
VideoDevice device;
|
||||
|
||||
id = obs_data_getstring(settings, VIDEO_DEVICE_ID);
|
||||
old_id = obs_data_getstring(settings, LAST_VIDEO_DEV_ID);
|
||||
|
||||
if (!data->GetDevice(device, id))
|
||||
return false;
|
||||
|
||||
vector<Resolution> resolutions;
|
||||
for (const VideoInfo &cap : device.caps)
|
||||
AddCap(resolutions, cap);
|
||||
|
||||
p = obs_properties_get(props, RESOLUTION);
|
||||
obs_property_list_clear(p);
|
||||
|
||||
for (size_t idx = resolutions.size(); idx > 0; idx--) {
|
||||
const Resolution &res = resolutions[idx-1];
|
||||
|
||||
string strRes;
|
||||
strRes += to_string(res.cx);
|
||||
strRes += "x";
|
||||
strRes += to_string(res.cy);
|
||||
|
||||
obs_property_list_add_string(p, strRes.c_str(), strRes.c_str());
|
||||
}
|
||||
|
||||
/* only reset resolution if device legitimately changed */
|
||||
if (old_id && id && strcmp(id, old_id) != 0) {
|
||||
SetClosestResFPS(props, settings);
|
||||
DeviceResolutionChanged(props, p, settings);
|
||||
obs_data_setint(settings, VIDEO_FORMAT, (int)VideoFormat::Any);
|
||||
}
|
||||
|
||||
UpdateVideoFormats(props, device);
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool VideoConfigClicked(obs_properties_t props, obs_property_t p,
|
||||
void *data)
|
||||
{
|
||||
DShowInput *input = reinterpret_cast<DShowInput*>(data);
|
||||
input->device.OpenDialog(nullptr, DialogType::ConfigVideo);
|
||||
|
||||
UNUSED_PARAMETER(props);
|
||||
UNUSED_PARAMETER(p);
|
||||
return false;
|
||||
}
|
||||
|
||||
static bool AudioConfigClicked(obs_properties_t props, obs_property_t p,
|
||||
void *data)
|
||||
{
|
||||
DShowInput *input = reinterpret_cast<DShowInput*>(data);
|
||||
input->device.OpenDialog(nullptr, DialogType::ConfigAudio);
|
||||
|
||||
UNUSED_PARAMETER(props);
|
||||
UNUSED_PARAMETER(p);
|
||||
return false;
|
||||
}
|
||||
|
||||
static bool CrossbarConfigClicked(obs_properties_t props, obs_property_t p,
|
||||
void *data)
|
||||
{
|
||||
DShowInput *input = reinterpret_cast<DShowInput*>(data);
|
||||
input->device.OpenDialog(nullptr, DialogType::ConfigCrossbar);
|
||||
|
||||
UNUSED_PARAMETER(props);
|
||||
UNUSED_PARAMETER(p);
|
||||
return false;
|
||||
}
|
||||
|
||||
static bool Crossbar2ConfigClicked(obs_properties_t props, obs_property_t p,
|
||||
void *data)
|
||||
{
|
||||
DShowInput *input = reinterpret_cast<DShowInput*>(data);
|
||||
input->device.OpenDialog(nullptr, DialogType::ConfigCrossbar2);
|
||||
|
||||
UNUSED_PARAMETER(props);
|
||||
UNUSED_PARAMETER(p);
|
||||
return false;
|
||||
}
|
||||
|
||||
static bool AddDevice(obs_property_t device_list, const VideoDevice &device)
|
||||
{
|
||||
DStr name, path, device_id;
|
||||
|
||||
dstr_from_wcs(name, device.name.c_str());
|
||||
dstr_from_wcs(path, device.path.c_str());
|
||||
|
||||
encode_dstr(path);
|
||||
|
||||
dstr_copy_dstr(device_id, name);
|
||||
encode_dstr(device_id);
|
||||
dstr_cat(device_id, ":");
|
||||
dstr_cat_dstr(device_id, path);
|
||||
|
||||
obs_property_list_add_string(device_list, name, device_id);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
static void PropertiesDataDestroy(void *data)
|
||||
{
|
||||
delete reinterpret_cast<PropertiesData*>(data);
|
||||
}
|
||||
|
||||
static bool ResTypeChanged(obs_properties_t props, obs_property_t p,
|
||||
obs_data_t settings)
|
||||
{
|
||||
int val = (int)obs_data_getint(settings, RES_TYPE);
|
||||
bool visible = (val != ResType_Preferred);
|
||||
|
||||
p = obs_properties_get(props, RESOLUTION);
|
||||
obs_property_set_visible(p, visible);
|
||||
|
||||
p = obs_properties_get(props, FRAME_INTERVAL);
|
||||
obs_property_set_visible(p, visible);
|
||||
|
||||
if (val == ResType_Custom)
|
||||
SetClosestResFPS(props, settings);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
static obs_properties_t GetDShowProperties(const char *locale)
|
||||
{
|
||||
obs_properties_t ppts = obs_properties_create(locale);
|
||||
PropertiesData *data = new PropertiesData;
|
||||
|
||||
obs_properties_set_param(ppts, data, PropertiesDataDestroy);
|
||||
|
||||
/* TODO: locale */
|
||||
obs_property_t p = obs_properties_add_list(ppts,
|
||||
VIDEO_DEVICE_ID, "Device",
|
||||
OBS_COMBO_TYPE_LIST, OBS_COMBO_FORMAT_STRING);
|
||||
|
||||
obs_property_set_modified_callback(p, DeviceSelectionChanged);
|
||||
|
||||
Device::EnumVideoDevices(data->devices);
|
||||
for (const VideoDevice &device : data->devices)
|
||||
AddDevice(p, device);
|
||||
|
||||
obs_properties_add_button(ppts, "video_config", "Configure Video",
|
||||
VideoConfigClicked);
|
||||
obs_properties_add_button(ppts, "xbar_config", "Configure Crossbar",
|
||||
CrossbarConfigClicked);
|
||||
|
||||
/* ------------------------------------- */
|
||||
|
||||
p = obs_properties_add_list(ppts, RES_TYPE, "Resolution/FPS Type",
|
||||
OBS_COMBO_TYPE_LIST, OBS_COMBO_FORMAT_INT);
|
||||
|
||||
obs_property_set_modified_callback(p, ResTypeChanged);
|
||||
|
||||
obs_property_list_add_int(p, "Device Preferred", ResType_Preferred);
|
||||
obs_property_list_add_int(p, "Custom", ResType_Custom);
|
||||
|
||||
p = obs_properties_add_list(ppts, RESOLUTION, "Resolution",
|
||||
OBS_COMBO_TYPE_EDITABLE, OBS_COMBO_FORMAT_STRING);
|
||||
|
||||
obs_property_set_modified_callback(p, DeviceResolutionChanged);
|
||||
|
||||
obs_properties_add_list(ppts, FRAME_INTERVAL, "FPS",
|
||||
OBS_COMBO_TYPE_LIST, OBS_COMBO_FORMAT_INT);
|
||||
|
||||
obs_properties_add_list(ppts, VIDEO_FORMAT, "Video Format",
|
||||
OBS_COMBO_TYPE_LIST, OBS_COMBO_FORMAT_INT);
|
||||
|
||||
return ppts;
|
||||
}
|
||||
|
||||
OBS_DECLARE_MODULE()
|
||||
|
||||
void DShowModuleLogCallback(LogType type, const wchar_t *msg, void *param)
|
||||
{
|
||||
int obs_type = LOG_DEBUG;
|
||||
|
||||
switch (type) {
|
||||
case LogType::Error: obs_type = LOG_ERROR; break;
|
||||
case LogType::Warning: obs_type = LOG_WARNING; break;
|
||||
case LogType::Info: obs_type = LOG_INFO; break;
|
||||
case LogType::Debug: obs_type = LOG_DEBUG; break;
|
||||
}
|
||||
|
||||
DStr dmsg;
|
||||
|
||||
dstr_from_wcs(dmsg, msg);
|
||||
blog(obs_type, "DShow: %s", dmsg->array);
|
||||
|
||||
UNUSED_PARAMETER(param);
|
||||
}
|
||||
|
||||
bool obs_module_load(uint32_t libobs_ver)
|
||||
{
|
||||
UNUSED_PARAMETER(libobs_ver);
|
||||
|
||||
SetLogCallback(DShowModuleLogCallback, nullptr);
|
||||
|
||||
obs_source_info info = {};
|
||||
info.id = "dshow_input";
|
||||
info.type = OBS_SOURCE_TYPE_INPUT;
|
||||
info.output_flags = OBS_SOURCE_VIDEO |
|
||||
OBS_SOURCE_ASYNC;
|
||||
info.getname = GetDShowInputName;
|
||||
info.create = CreateDShowInput;
|
||||
info.destroy = DestroyDShowInput;
|
||||
info.getwidth = GetDShowWidth;
|
||||
info.getheight = GetDShowHeight;
|
||||
info.update = UpdateDShowInput;
|
||||
info.defaults = GetDShowDefaults;
|
||||
info.properties = GetDShowProperties;
|
||||
obs_register_source(&info);
|
||||
|
||||
return true;
|
||||
}
|
@ -73,6 +73,11 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "rtmp-services", "rtmp-servi
|
||||
{6F1AC2AE-6424-401A-AF9F-A771E6BEE026} = {6F1AC2AE-6424-401A-AF9F-A771E6BEE026}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "win-dshow", "win-dshow\win-dshow.vcxproj", "{E733E9CB-EA71-4E77-BD28-2D06F4AA4677}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{6F1AC2AE-6424-401A-AF9F-A771E6BEE026} = {6F1AC2AE-6424-401A-AF9F-A771E6BEE026}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Mixed Platforms = Debug|Mixed Platforms
|
||||
@ -263,6 +268,18 @@ Global
|
||||
{15139C6C-8DD7-42A5-B907-7A1A9862FA39}.Release|Win32.Build.0 = Release|Win32
|
||||
{15139C6C-8DD7-42A5-B907-7A1A9862FA39}.Release|x64.ActiveCfg = Release|x64
|
||||
{15139C6C-8DD7-42A5-B907-7A1A9862FA39}.Release|x64.Build.0 = Release|x64
|
||||
{E733E9CB-EA71-4E77-BD28-2D06F4AA4677}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32
|
||||
{E733E9CB-EA71-4E77-BD28-2D06F4AA4677}.Debug|Mixed Platforms.Build.0 = Debug|Win32
|
||||
{E733E9CB-EA71-4E77-BD28-2D06F4AA4677}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{E733E9CB-EA71-4E77-BD28-2D06F4AA4677}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{E733E9CB-EA71-4E77-BD28-2D06F4AA4677}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{E733E9CB-EA71-4E77-BD28-2D06F4AA4677}.Debug|x64.Build.0 = Debug|x64
|
||||
{E733E9CB-EA71-4E77-BD28-2D06F4AA4677}.Release|Mixed Platforms.ActiveCfg = Release|Win32
|
||||
{E733E9CB-EA71-4E77-BD28-2D06F4AA4677}.Release|Mixed Platforms.Build.0 = Release|Win32
|
||||
{E733E9CB-EA71-4E77-BD28-2D06F4AA4677}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{E733E9CB-EA71-4E77-BD28-2D06F4AA4677}.Release|Win32.Build.0 = Release|Win32
|
||||
{E733E9CB-EA71-4E77-BD28-2D06F4AA4677}.Release|x64.ActiveCfg = Release|x64
|
||||
{E733E9CB-EA71-4E77-BD28-2D06F4AA4677}.Release|x64.Build.0 = Release|x64
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
|
189
vs/2013/win-dshow/win-dshow.vcxproj
Normal file
189
vs/2013/win-dshow/win-dshow.vcxproj
Normal file
@ -0,0 +1,189 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug|x64">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|x64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\..\..\plugins\win-dshow\libdshowcapture\source\capture-filter.cpp" />
|
||||
<ClCompile Include="..\..\..\plugins\win-dshow\libdshowcapture\source\device.cpp" />
|
||||
<ClCompile Include="..\..\..\plugins\win-dshow\libdshowcapture\source\dshow-base.cpp" />
|
||||
<ClCompile Include="..\..\..\plugins\win-dshow\libdshowcapture\source\dshow-enum.cpp" />
|
||||
<ClCompile Include="..\..\..\plugins\win-dshow\libdshowcapture\source\dshow-formats.cpp" />
|
||||
<ClCompile Include="..\..\..\plugins\win-dshow\libdshowcapture\source\dshow-media-type.cpp" />
|
||||
<ClCompile Include="..\..\..\plugins\win-dshow\libdshowcapture\source\dshowcapture.cpp" />
|
||||
<ClCompile Include="..\..\..\plugins\win-dshow\libdshowcapture\source\log.cpp" />
|
||||
<ClCompile Include="..\..\..\plugins\win-dshow\win-dshow.cpp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\..\..\plugins\win-dshow\libdshowcapture\dshowcapture.hpp" />
|
||||
<ClInclude Include="..\..\..\plugins\win-dshow\libdshowcapture\source\capture-filter.hpp" />
|
||||
<ClInclude Include="..\..\..\plugins\win-dshow\libdshowcapture\source\device.hpp" />
|
||||
<ClInclude Include="..\..\..\plugins\win-dshow\libdshowcapture\source\dshow-base.hpp" />
|
||||
<ClInclude Include="..\..\..\plugins\win-dshow\libdshowcapture\source\dshow-enum.hpp" />
|
||||
<ClInclude Include="..\..\..\plugins\win-dshow\libdshowcapture\source\dshow-formats.hpp" />
|
||||
<ClInclude Include="..\..\..\plugins\win-dshow\libdshowcapture\source\dshow-media-type.hpp" />
|
||||
<ClInclude Include="..\..\..\plugins\win-dshow\libdshowcapture\source\log.hpp" />
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>{E733E9CB-EA71-4E77-BD28-2D06F4AA4677}</ProjectGuid>
|
||||
<Keyword>Win32Proj</Keyword>
|
||||
<RootNamespace>windshow</RootNamespace>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v120</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v120</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v120</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v120</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;WINDSHOW_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>../../../libobs</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<AdditionalDependencies>strmiids.lib;libobs.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalLibraryDirectories>$(OutDir);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
</Link>
|
||||
<PostBuildEvent>
|
||||
<Command>copy "$(OutDir)$(TargetName)$(TargetExt)" "../../../build/obs-plugins/32bit/$(TargetName)$(TargetExt)"</Command>
|
||||
</PostBuildEvent>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;WINDSHOW_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>../../../libobs</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<AdditionalDependencies>strmiids.lib;libobs.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalLibraryDirectories>$(OutDir);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
</Link>
|
||||
<PostBuildEvent>
|
||||
<Command>copy "$(OutDir)$(TargetName)$(TargetExt)" "../../../build/obs-plugins/64bit/$(TargetName)$(TargetExt)"</Command>
|
||||
</PostBuildEvent>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;WINDSHOW_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>../../../libobs</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<AdditionalDependencies>strmiids.lib;libobs.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalLibraryDirectories>$(OutDir);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
</Link>
|
||||
<PostBuildEvent>
|
||||
<Command>copy "$(OutDir)$(TargetName)$(TargetExt)" "../../../build/obs-plugins/32bit/$(TargetName)$(TargetExt)"</Command>
|
||||
</PostBuildEvent>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;WINDSHOW_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>../../../libobs</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<AdditionalDependencies>strmiids.lib;libobs.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalLibraryDirectories>$(OutDir);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
</Link>
|
||||
<PostBuildEvent>
|
||||
<Command>copy "$(OutDir)$(TargetName)$(TargetExt)" "../../../build/obs-plugins/64bit/$(TargetName)$(TargetExt)"</Command>
|
||||
</PostBuildEvent>
|
||||
</ItemDefinitionGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
72
vs/2013/win-dshow/win-dshow.vcxproj.filters
Normal file
72
vs/2013/win-dshow/win-dshow.vcxproj.filters
Normal file
@ -0,0 +1,72 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<Filter Include="Source Files">
|
||||
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
|
||||
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Header Files">
|
||||
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
|
||||
<Extensions>h;hh;hpp;hxx;hm;inl;inc;xsd</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Resource Files">
|
||||
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
|
||||
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\..\..\plugins\win-dshow\win-dshow.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\plugins\win-dshow\libdshowcapture\source\capture-filter.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\plugins\win-dshow\libdshowcapture\source\device.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\plugins\win-dshow\libdshowcapture\source\dshow-base.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\plugins\win-dshow\libdshowcapture\source\dshow-enum.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\plugins\win-dshow\libdshowcapture\source\dshow-formats.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\plugins\win-dshow\libdshowcapture\source\dshow-media-type.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\plugins\win-dshow\libdshowcapture\source\dshowcapture.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\plugins\win-dshow\libdshowcapture\source\log.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\..\..\plugins\win-dshow\libdshowcapture\dshowcapture.hpp">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\plugins\win-dshow\libdshowcapture\source\capture-filter.hpp">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\plugins\win-dshow\libdshowcapture\source\device.hpp">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\plugins\win-dshow\libdshowcapture\source\dshow-base.hpp">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\plugins\win-dshow\libdshowcapture\source\dshow-enum.hpp">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\plugins\win-dshow\libdshowcapture\source\dshow-formats.hpp">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\plugins\win-dshow\libdshowcapture\source\dshow-media-type.hpp">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\plugins\win-dshow\libdshowcapture\source\log.hpp">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
</Project>
|
Loading…
x
Reference in New Issue
Block a user