mirror of
https://github.com/outbackdingo/UltraGrid.git
synced 2026-03-21 09:40:18 +00:00
added DShow
This commit is contained in:
22
configure.ac
22
configure.ac
@@ -2148,6 +2148,27 @@ AC_SUBST(V4L2_OBJ)
|
||||
|
||||
LIB_MODULES="$LIB_MODULES $V4L2_LIBS"
|
||||
|
||||
# -----------------------------------------------------------------------------
|
||||
# DirectShow
|
||||
# -----------------------------------------------------------------------------
|
||||
dshow_req=auto
|
||||
AC_ARG_ENABLE(dshow,
|
||||
AS_HELP_STRING([--disable-dshow], [disable DirectShow support(default is auto)]),
|
||||
[dshow_req=$enableval],
|
||||
[dshow_req=auto]
|
||||
)
|
||||
|
||||
if test $system = Windows -a $dshow_req != no; then
|
||||
AC_DEFINE([HAVE_DSHOW], [1], [Build with DirectShow support])
|
||||
LIB_MODULES="$LIB_MODULES -lstrmiids -luuid -loleaut32 " #-lstrmbase -ldxguid -ldmoguids
|
||||
LIB_OBJS="$LIB_OBJS src/video_capture/DirectShowGrabber.o"
|
||||
dshow=yes
|
||||
fi
|
||||
|
||||
if test $dshow_req = yes -a $dshow = no; then
|
||||
AC_MSG_ERROR([DirectShow not found]);
|
||||
fi
|
||||
|
||||
# -------------------------------------------------------------------------------------------------
|
||||
# Libav
|
||||
# -------------------------------------------------------------------------------------------------
|
||||
@@ -2256,6 +2277,7 @@ RESULT=\
|
||||
License ..................... $license
|
||||
|
||||
DeckLink .................... $decklink
|
||||
DirectShow .................. $dshow
|
||||
DELTACAST ................... $deltacast
|
||||
DVS ......................... $dvs
|
||||
Linsys capture .............. $linsys
|
||||
|
||||
@@ -46,16 +46,17 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include <assert.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "config.h"
|
||||
#include "config_unix.h"
|
||||
#include "config_win32.h"
|
||||
#endif
|
||||
|
||||
#include <assert.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "debug.h"
|
||||
#include "host.h"
|
||||
|
||||
|
||||
@@ -45,6 +45,12 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "config.h"
|
||||
#include "config_unix.h"
|
||||
#include "config_win32.h"
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
#include <assert.h>
|
||||
#include <stdlib.h>
|
||||
@@ -55,8 +61,6 @@
|
||||
|
||||
#include "audio/audio.h"
|
||||
#include "portaudio.h"
|
||||
#include "config.h"
|
||||
#include "config_unix.h"
|
||||
#include "debug.h"
|
||||
#include "host.h"
|
||||
#include "utils/ring_buffer.h"
|
||||
|
||||
@@ -45,6 +45,12 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "config.h"
|
||||
#include "config_unix.h"
|
||||
#include "config_win32.h"
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
#include <assert.h>
|
||||
#include <stdlib.h>
|
||||
@@ -55,8 +61,6 @@
|
||||
|
||||
#include "audio/audio.h"
|
||||
#include "audio/playback/portaudio.h"
|
||||
#include "config.h"
|
||||
#include "config_unix.h"
|
||||
#include "debug.h"
|
||||
#include "utils/ring_buffer.h"
|
||||
|
||||
|
||||
@@ -43,6 +43,7 @@
|
||||
* $Revision: 1.1 $
|
||||
* $Date: 2007/11/08 09:48:59 $
|
||||
*/
|
||||
#define _WIN32_WINNT 0x0600
|
||||
#ifdef WIN32
|
||||
#ifndef _CONFIG_WIN32_H
|
||||
#define _CONFIG_WIN32_H
|
||||
@@ -62,16 +63,20 @@
|
||||
|
||||
// 0x0501 is Win XP, 0x0502 2003 Server, 0x0600 Win Vista and Win 7 is 0x0601
|
||||
#ifndef WINVER
|
||||
#define WINVER 0x0501
|
||||
#define WINVER 0x0600
|
||||
#endif /* WINVER */
|
||||
#ifndef _WIN32_WINNT
|
||||
#define _WIN32_WINNT 0x0501
|
||||
#define _WIN32_WINNT 0x0600
|
||||
#endif /* _WIN32_WINNT */
|
||||
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
|
||||
#include <crtdefs.h>
|
||||
|
||||
#include <winsock2.h>
|
||||
#include <ws2tcpip.h>
|
||||
#include <naptypes.h>
|
||||
#include <ntddndis.h>
|
||||
#include <Iphlpapi.h> // if_nametoindex
|
||||
|
||||
#include <mmreg.h>
|
||||
@@ -82,6 +87,11 @@
|
||||
#include <fcntl.h>
|
||||
#include <time.h>
|
||||
|
||||
#include <amstream.h>
|
||||
|
||||
EXTERN_C const CLSID CLSID_NullRenderer;
|
||||
EXTERN_C const CLSID CLSID_SampleGrabber;
|
||||
|
||||
typedef int ttl_t;
|
||||
typedef unsigned fd_t;
|
||||
typedef unsigned char byte;
|
||||
@@ -147,6 +157,11 @@ typedef DWORD gid_t;
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
// MinGW-w64 defines some broken macro for strtok_r in pthread.h
|
||||
// which can be accidently included before this resulting in compilation
|
||||
// error
|
||||
#undef strtok_r
|
||||
|
||||
#ifndef HAVE_STRTOK_R
|
||||
static inline char * strtok_r(char *str, const char *delim, char **save);
|
||||
|
||||
@@ -200,11 +215,21 @@ void ShowMessage(int level, char *msg);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifndef ECONNREFUSED
|
||||
#define ECONNREFUSED WSAECONNREFUSED
|
||||
#endif
|
||||
#ifndef ENETUNREACH
|
||||
#define ENETUNREACH WSAENETUNREACH
|
||||
#endif
|
||||
#ifndef EHOSTUNREACH
|
||||
#define EHOSTUNREACH WSAEHOSTUNREACH
|
||||
#endif
|
||||
#ifndef EWOULDBLOCK
|
||||
#define EWOULDBLOCK WSAEWOULDBLOCK
|
||||
#endif
|
||||
#ifndef EAFNOSUPPORT
|
||||
#define EAFNOSUPPORT WSAEAFNOSUPPORT
|
||||
#endif
|
||||
|
||||
#define M_PI 3.14159265358979323846
|
||||
|
||||
|
||||
8
src/tv.h
8
src/tv.h
@@ -44,6 +44,10 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
uint32_t get_local_mediatime(void);
|
||||
double tv_diff(struct timeval curr_time, struct timeval prev_time);
|
||||
uint32_t tv_diff_usec(struct timeval curr_time, struct timeval prev_time);
|
||||
@@ -51,3 +55,7 @@ void tv_add(struct timeval *ts, double offset_secs);
|
||||
void tv_add_usec(struct timeval *ts, double offset);
|
||||
int tv_gt(struct timeval a, struct timeval b);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
@@ -49,6 +49,10 @@
|
||||
#define __video_h
|
||||
#include "tile.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef enum {
|
||||
RGBA,
|
||||
UYVY,
|
||||
@@ -184,6 +188,9 @@ double compute_fps(int fps, int fpsd, int fd, int fi);
|
||||
#define AUX_YUV (1<<4)
|
||||
#define AUX_10Bit (1<<5)
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -55,6 +55,7 @@
|
||||
#include "debug.h"
|
||||
#include "video_codec.h"
|
||||
#include "video_capture.h"
|
||||
#include "video_capture/DirectShowGrabber.h"
|
||||
#include "video_capture/aggregate.h"
|
||||
#include "video_capture/decklink.h"
|
||||
#include "video_capture/deltacast.h"
|
||||
@@ -115,6 +116,19 @@ struct vidcap_device_api vidcap_device_table[] = {
|
||||
MK_STATIC(vidcap_aggregate_grab),
|
||||
NULL
|
||||
},
|
||||
#if defined HAVE_DSHOW || defined BUILD_LIBRARIES
|
||||
{
|
||||
/* The DirectShow capture card */
|
||||
0,
|
||||
NULL,
|
||||
MK_NAME(vidcap_dshow_probe),
|
||||
MK_NAME(vidcap_dshow_init),
|
||||
MK_NAME(vidcap_dshow_finish),
|
||||
MK_NAME(vidcap_dshow_done),
|
||||
MK_NAME(vidcap_dshow_grab),
|
||||
NULL
|
||||
},
|
||||
#endif /* HAVE_DSHOW */
|
||||
#if defined HAVE_SCREEN_CAP || defined BUILD_LIBRARIES
|
||||
{
|
||||
/* The screen capture card */
|
||||
|
||||
1192
src/video_capture/DirectShowGrabber.cpp
Normal file
1192
src/video_capture/DirectShowGrabber.cpp
Normal file
File diff suppressed because it is too large
Load Diff
28
src/video_capture/DirectShowGrabber.h
Normal file
28
src/video_capture/DirectShowGrabber.h
Normal file
@@ -0,0 +1,28 @@
|
||||
// The following ifdef block is the standard way of creating macros which make exporting
|
||||
// from a DLL simpler. All files within this DLL are compiled with the DIRECTSHOWGRABBER_EXPORTS
|
||||
// symbol defined on the command line. This symbol should not be defined on any project
|
||||
// that uses this DLL. This way any other project whose source files include this file see
|
||||
// DIRECTSHOWGRABBER_API functions as being imported from a DLL, whereas this DLL sees symbols
|
||||
// defined with this macro as being exported.
|
||||
#ifdef DIRECTSHOWGRABBER_EXPORTS
|
||||
#define DIRECTSHOWGRABBER_API __declspec(dllexport)
|
||||
#else
|
||||
#define DIRECTSHOWGRABBER_API __declspec(dllimport)
|
||||
#endif
|
||||
|
||||
#undef DIRECTSHOWGRABBER_API
|
||||
#define DIRECTSHOWGRABBER_API
|
||||
|
||||
#define VIDCAP_DSHOW_ID 0xD5CAD5CA
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
DIRECTSHOWGRABBER_API struct vidcap_type * vidcap_dshow_probe(void);
|
||||
DIRECTSHOWGRABBER_API void * vidcap_dshow_init(char *init_fmt, unsigned int flags);
|
||||
DIRECTSHOWGRABBER_API void vidcap_dshow_finish(void *state);
|
||||
DIRECTSHOWGRABBER_API void vidcap_dshow_done(void *state);
|
||||
DIRECTSHOWGRABBER_API struct video_frame * vidcap_dshow_grab(void *state, struct audio_frame **audio);
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
Reference in New Issue
Block a user