Support fow Windows

* DeckLink
* OpenGL
* FastDXT
This commit is contained in:
Navsteva
2012-10-16 15:14:43 +02:00
committed by Martin Pulec
parent 4073cb1c27
commit 6dfd098d2f
42 changed files with 13145 additions and 258 deletions

View File

@@ -0,0 +1,37 @@
/* -LICENSE-START-
* ** Copyright (c) 2011 Blackmagic Design
* **
* ** Permission is hereby granted, free of charge, to any person or organization
* ** obtaining a copy of the software and accompanying documentation covered by
* ** this license (the "Software") to use, reproduce, display, distribute,
* ** execute, and transmit the Software, and to prepare derivative works of the
* ** Software, and to permit third-parties to whom the Software is furnished to
* ** do so, all subject to the following:
* **
* ** The copyright notices in the Software and this entire statement, including
* ** the above license grant, this restriction and the following disclaimer,
* ** must be included in all copies of the Software, in whole or in part, and
* ** all derivative works of the Software, unless such copies or derivative
* ** works are solely in the form of machine-executable object code generated by
* ** a source language processor.
* **
* ** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* ** IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* ** FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
* ** SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
* ** FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
* ** ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* ** DEALINGS IN THE SOFTWARE.
* ** -LICENSE-END-
* */
/* DeckLinkAPIVersion.h */
#ifndef __DeckLink_API_Verison_h__
#define __DeckLink_API_Version_h__
#define BLACKMAGIC_DECKLINK_API_VERSION 0x08050000
#define BLACKMAGIC_DECKLINK_API_VERSION_STRING "8.5"
#endif // __DeckLink_API_Version_h__

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,313 @@
/* this ALWAYS GENERATED file contains the IIDs and CLSIDs */
/* link this file in with the server and any clients */
/* File created by MIDL compiler version 8.00.0595 */
/* at Wed Oct 17 12:55:42 2012
*/
/* Compiler settings for ..\..\include\DeckLinkAPI.idl:
Oicf, W1, Zp8, env=Win32 (32b run), target_arch=X86 8.00.0595
protocol : dce , ms_ext, c_ext, robust
error checks: allocation ref bounds_check enum stub_data
VC __declspec() decoration level:
__declspec(uuid()), __declspec(selectany), __declspec(novtable)
DECLSPEC_UUID(), MIDL_INTERFACE()
*/
/* @@MIDL_FILE_HEADING( ) */
#pragma warning( disable: 4049 ) /* more than 64k source lines */
#ifdef __cplusplus
extern "C"{
#endif
#include <rpc.h>
#include <rpcndr.h>
#ifdef _MIDL_USE_GUIDDEF_
#ifndef INITGUID
#define INITGUID
#include <guiddef.h>
#undef INITGUID
#else
#include <guiddef.h>
#endif
#define MIDL_DEFINE_GUID(type,name,l,w1,w2,b1,b2,b3,b4,b5,b6,b7,b8) \
DEFINE_GUID(name,l,w1,w2,b1,b2,b3,b4,b5,b6,b7,b8)
#else // !_MIDL_USE_GUIDDEF_
#ifndef __IID_DEFINED__
#define __IID_DEFINED__
typedef struct _IID
{
unsigned long x;
unsigned short s1;
unsigned short s2;
unsigned char c[8];
} IID;
#endif // __IID_DEFINED__
#ifndef CLSID_DEFINED
#define CLSID_DEFINED
typedef IID CLSID;
#endif // CLSID_DEFINED
#define MIDL_DEFINE_GUID(type,name,l,w1,w2,b1,b2,b3,b4,b5,b6,b7,b8) \
const type name = {l,w1,w2,{b1,b2,b3,b4,b5,b6,b7,b8}}
#endif !_MIDL_USE_GUIDDEF_
MIDL_DEFINE_GUID(IID, LIBID_DeckLinkAPI,0xD864517A,0xEDD5,0x466D,0x86,0x7D,0xC8,0x19,0xF1,0xC0,0x52,0xBB);
MIDL_DEFINE_GUID(IID, IID_IDeckLinkTimecode,0xBC6CFBD3,0x8317,0x4325,0xAC,0x1C,0x12,0x16,0x39,0x1E,0x93,0x40);
MIDL_DEFINE_GUID(IID, IID_IDeckLinkDisplayModeIterator,0x9C88499F,0xF601,0x4021,0xB8,0x0B,0x03,0x2E,0x4E,0xB4,0x1C,0x35);
MIDL_DEFINE_GUID(IID, IID_IDeckLinkDisplayMode,0x3EB2C1AB,0x0A3D,0x4523,0xA3,0xAD,0xF4,0x0D,0x7F,0xB1,0x4E,0x78);
MIDL_DEFINE_GUID(IID, IID_IDeckLink,0xC418FBDD,0x0587,0x48ED,0x8F,0xE5,0x64,0x0F,0x0A,0x14,0xAF,0x91);
MIDL_DEFINE_GUID(IID, IID_IDeckLinkConfiguration,0xC679A35B,0x610C,0x4D09,0xB7,0x48,0x1D,0x04,0x78,0x10,0x0F,0xC0);
MIDL_DEFINE_GUID(IID, IID_IDeckLinkDeckControlStatusCallback,0x53436FFB,0xB434,0x4906,0xBA,0xDC,0xAE,0x30,0x60,0xFF,0xE8,0xEF);
MIDL_DEFINE_GUID(IID, IID_IDeckLinkDeckControl,0x8E1C3ACE,0x19C7,0x4E00,0x8B,0x92,0xD8,0x04,0x31,0xD9,0x58,0xBE);
MIDL_DEFINE_GUID(IID, IID_IBMDStreamingDeviceNotificationCallback,0xF9531D64,0x3305,0x4B29,0xA3,0x87,0x7F,0x74,0xBB,0x0D,0x0E,0x84);
MIDL_DEFINE_GUID(IID, IID_IBMDStreamingH264InputCallback,0x823C475F,0x55AE,0x46F9,0x89,0x0C,0x53,0x7C,0xC5,0xCE,0xDC,0xCA);
MIDL_DEFINE_GUID(IID, IID_IBMDStreamingDiscovery,0x2C837444,0xF989,0x4D87,0x90,0x1A,0x47,0xC8,0xA3,0x6D,0x09,0x6D);
MIDL_DEFINE_GUID(IID, IID_IBMDStreamingVideoEncodingMode,0x1AB8035B,0xCD13,0x458D,0xB6,0xDF,0x5E,0x8F,0x7C,0x21,0x41,0xD9);
MIDL_DEFINE_GUID(IID, IID_IBMDStreamingMutableVideoEncodingMode,0x19BF7D90,0x1E0A,0x400D,0xB2,0xC6,0xFF,0xC4,0xE7,0x8A,0xD4,0x9D);
MIDL_DEFINE_GUID(IID, IID_IBMDStreamingVideoEncodingModePresetIterator,0x7AC731A3,0xC950,0x4AD0,0x80,0x4A,0x83,0x77,0xAA,0x51,0xC6,0xC4);
MIDL_DEFINE_GUID(IID, IID_IBMDStreamingDeviceInput,0x24B6B6EC,0x1727,0x44BB,0x98,0x18,0x34,0xFF,0x08,0x6A,0xCF,0x98);
MIDL_DEFINE_GUID(IID, IID_IBMDStreamingH264NALPacket,0xE260E955,0x14BE,0x4395,0x97,0x75,0x9F,0x02,0xCC,0x0A,0x9D,0x89);
MIDL_DEFINE_GUID(IID, IID_IBMDStreamingAudioPacket,0xD9EB5902,0x1AD2,0x43F4,0x9E,0x2C,0x3C,0xFA,0x50,0xB5,0xEE,0x19);
MIDL_DEFINE_GUID(IID, IID_IBMDStreamingMPEG2TSPacket,0x91810D1C,0x4FB3,0x4AAA,0xAE,0x56,0xFA,0x30,0x1D,0x3D,0xFA,0x4C);
MIDL_DEFINE_GUID(IID, IID_IBMDStreamingH264NALParser,0x5867F18C,0x5BFA,0x4CCC,0xB2,0xA7,0x9D,0xFD,0x14,0x04,0x17,0xD2);
MIDL_DEFINE_GUID(CLSID, CLSID_CBMDStreamingDiscovery,0x0CAA31F6,0x8A26,0x40B0,0x86,0xA4,0xBF,0x58,0xDC,0xCA,0x71,0x0C);
MIDL_DEFINE_GUID(CLSID, CLSID_CBMDStreamingH264NALParser,0x7753EFBD,0x951C,0x407C,0x97,0xA5,0x23,0xC7,0x37,0xB7,0x3B,0x52);
MIDL_DEFINE_GUID(IID, IID_IDeckLinkVideoOutputCallback,0x20AA5225,0x1958,0x47CB,0x82,0x0B,0x80,0xA8,0xD5,0x21,0xA6,0xEE);
MIDL_DEFINE_GUID(IID, IID_IDeckLinkInputCallback,0xDD04E5EC,0x7415,0x42AB,0xAE,0x4A,0xE8,0x0C,0x4D,0xFC,0x04,0x4A);
MIDL_DEFINE_GUID(IID, IID_IDeckLinkMemoryAllocator,0xB36EB6E7,0x9D29,0x4AA8,0x92,0xEF,0x84,0x3B,0x87,0xA2,0x89,0xE8);
MIDL_DEFINE_GUID(IID, IID_IDeckLinkAudioOutputCallback,0x403C681B,0x7F46,0x4A12,0xB9,0x93,0x2B,0xB1,0x27,0x08,0x4E,0xE6);
MIDL_DEFINE_GUID(IID, IID_IDeckLinkIterator,0x50FB36CD,0x3063,0x4B73,0xBD,0xBB,0x95,0x80,0x87,0xF2,0xD8,0xBA);
MIDL_DEFINE_GUID(IID, IID_IDeckLinkAPIInformation,0x7BEA3C68,0x730D,0x4322,0xAF,0x34,0x8A,0x71,0x52,0xB5,0x32,0xA4);
MIDL_DEFINE_GUID(IID, IID_IDeckLinkOutput,0xA3EF0963,0x0862,0x44ED,0x92,0xA9,0xEE,0x89,0xAB,0xF4,0x31,0xC7);
MIDL_DEFINE_GUID(IID, IID_IDeckLinkInput,0x6D40EF78,0x28B9,0x4E21,0x99,0x0D,0x95,0xBB,0x77,0x50,0xA0,0x4F);
MIDL_DEFINE_GUID(IID, IID_IDeckLinkVideoFrame,0x3F716FE0,0xF023,0x4111,0xBE,0x5D,0xEF,0x44,0x14,0xC0,0x5B,0x17);
MIDL_DEFINE_GUID(IID, IID_IDeckLinkMutableVideoFrame,0x69E2639F,0x40DA,0x4E19,0xB6,0xF2,0x20,0xAC,0xE8,0x15,0xC3,0x90);
MIDL_DEFINE_GUID(IID, IID_IDeckLinkVideoFrame3DExtensions,0xDA0F7E4A,0xEDC7,0x48A8,0x9C,0xDD,0x2D,0xB5,0x1C,0x72,0x9C,0xD7);
MIDL_DEFINE_GUID(IID, IID_IDeckLinkVideoInputFrame,0x05CFE374,0x537C,0x4094,0x9A,0x57,0x68,0x05,0x25,0x11,0x8F,0x44);
MIDL_DEFINE_GUID(IID, IID_IDeckLinkVideoFrameAncillary,0x732E723C,0xD1A4,0x4E29,0x9E,0x8E,0x4A,0x88,0x79,0x7A,0x00,0x04);
MIDL_DEFINE_GUID(IID, IID_IDeckLinkAudioInputPacket,0xE43D5870,0x2894,0x11DE,0x8C,0x30,0x08,0x00,0x20,0x0C,0x9A,0x66);
MIDL_DEFINE_GUID(IID, IID_IDeckLinkScreenPreviewCallback,0xB1D3F49A,0x85FE,0x4C5D,0x95,0xC8,0x0B,0x5D,0x5D,0xCC,0xD4,0x38);
MIDL_DEFINE_GUID(IID, IID_IDeckLinkGLScreenPreviewHelper,0x504E2209,0xCAC7,0x4C1A,0x9F,0xB4,0xC5,0xBB,0x62,0x74,0xD2,0x2F);
MIDL_DEFINE_GUID(IID, IID_IDeckLinkAttributes,0xABC11843,0xD966,0x44CB,0x96,0xE2,0xA1,0xCB,0x5D,0x31,0x35,0xC4);
MIDL_DEFINE_GUID(IID, IID_IDeckLinkKeyer,0x89AFCAF5,0x65F8,0x421E,0x98,0xF7,0x96,0xFE,0x5F,0x5B,0xFB,0xA3);
MIDL_DEFINE_GUID(IID, IID_IDeckLinkVideoConversion,0x3BBCB8A2,0xDA2C,0x42D9,0xB5,0xD8,0x88,0x08,0x36,0x44,0xE9,0x9A);
MIDL_DEFINE_GUID(CLSID, CLSID_CDeckLinkIterator,0x1F2E109A,0x8F4F,0x49E4,0x92,0x03,0x13,0x55,0x95,0xCB,0x6F,0xA5);
MIDL_DEFINE_GUID(CLSID, CLSID_CDeckLinkAPIInformation,0x263CA19F,0xED09,0x482E,0x9F,0x9D,0x84,0x00,0x57,0x83,0xA2,0x37);
MIDL_DEFINE_GUID(CLSID, CLSID_CDeckLinkGLScreenPreviewHelper,0xF63E77C7,0xB655,0x4A4A,0x9A,0xD0,0x3C,0xA8,0x5D,0x39,0x43,0x43);
MIDL_DEFINE_GUID(CLSID, CLSID_CDeckLinkVideoConversion,0x7DBBBB11,0x5B7B,0x467D,0xAE,0xA4,0xCE,0xA4,0x68,0xFD,0x36,0x8C);
MIDL_DEFINE_GUID(IID, IID_IDeckLinkDeckControlStatusCallback_v8_1,0xE5F693C1,0x4283,0x4716,0xB1,0x8F,0xC1,0x43,0x15,0x21,0x95,0x5B);
MIDL_DEFINE_GUID(IID, IID_IDeckLinkDeckControl_v8_1,0x522A9E39,0x0F3C,0x4742,0x94,0xEE,0xD8,0x0D,0xE3,0x35,0xDA,0x1D);
MIDL_DEFINE_GUID(IID, IID_IDeckLink_v8_0,0x62BFF75D,0x6569,0x4E55,0x8D,0x4D,0x66,0xAA,0x03,0x82,0x9A,0xBC);
MIDL_DEFINE_GUID(IID, IID_IDeckLinkIterator_v8_0,0x74E936FC,0xCC28,0x4A67,0x81,0xA0,0x1E,0x94,0xE5,0x2D,0x4E,0x69);
MIDL_DEFINE_GUID(CLSID, CLSID_CDeckLinkIterator_v8_0,0xD9EDA3B3,0x2887,0x41FA,0xB7,0x24,0x01,0x7C,0xF1,0xEB,0x1D,0x37);
MIDL_DEFINE_GUID(IID, IID_IDeckLinkDeckControl_v7_9,0xA4D81043,0x0619,0x42B7,0x8E,0xD6,0x60,0x2D,0x29,0x04,0x1D,0xF7);
MIDL_DEFINE_GUID(IID, IID_IDeckLinkDisplayModeIterator_v7_6,0x455D741F,0x1779,0x4800,0x86,0xF5,0x0B,0x5D,0x13,0xD7,0x97,0x51);
MIDL_DEFINE_GUID(IID, IID_IDeckLinkDisplayMode_v7_6,0x87451E84,0x2B7E,0x439E,0xA6,0x29,0x43,0x93,0xEA,0x4A,0x85,0x50);
MIDL_DEFINE_GUID(IID, IID_IDeckLinkOutput_v7_6,0x29228142,0xEB8C,0x4141,0xA6,0x21,0xF7,0x40,0x26,0x45,0x09,0x55);
MIDL_DEFINE_GUID(IID, IID_IDeckLinkInput_v7_6,0x300C135A,0x9F43,0x48E2,0x99,0x06,0x6D,0x79,0x11,0xD9,0x3C,0xF1);
MIDL_DEFINE_GUID(IID, IID_IDeckLinkTimecode_v7_6,0xEFB9BCA6,0xA521,0x44F7,0xBD,0x69,0x23,0x32,0xF2,0x4D,0x9E,0xE6);
MIDL_DEFINE_GUID(IID, IID_IDeckLinkVideoFrame_v7_6,0xA8D8238E,0x6B18,0x4196,0x99,0xE1,0x5A,0xF7,0x17,0xB8,0x3D,0x32);
MIDL_DEFINE_GUID(IID, IID_IDeckLinkMutableVideoFrame_v7_6,0x46FCEE00,0xB4E6,0x43D0,0x91,0xC0,0x02,0x3A,0x7F,0xCE,0xB3,0x4F);
MIDL_DEFINE_GUID(IID, IID_IDeckLinkVideoInputFrame_v7_6,0x9A74FA41,0xAE9F,0x47AC,0x8C,0xF4,0x01,0xF4,0x2D,0xD5,0x99,0x65);
MIDL_DEFINE_GUID(IID, IID_IDeckLinkScreenPreviewCallback_v7_6,0x373F499D,0x4B4D,0x4518,0xAD,0x22,0x63,0x54,0xE5,0xA5,0x82,0x5E);
MIDL_DEFINE_GUID(IID, IID_IDeckLinkGLScreenPreviewHelper_v7_6,0xBA575CD9,0xA15E,0x497B,0xB2,0xC2,0xF9,0xAF,0xE7,0xBE,0x4E,0xBA);
MIDL_DEFINE_GUID(IID, IID_IDeckLinkVideoConversion_v7_6,0x3EB504C9,0xF97D,0x40FE,0xA1,0x58,0xD4,0x07,0xD4,0x8C,0xB5,0x3B);
MIDL_DEFINE_GUID(IID, IID_IDeckLinkConfiguration_v7_6,0xB8EAD569,0xB764,0x47F0,0xA7,0x3F,0xAE,0x40,0xDF,0x6C,0xBF,0x10);
MIDL_DEFINE_GUID(IID, IID_IDeckLinkVideoOutputCallback_v7_6,0xE763A626,0x4A3C,0x49D1,0xBF,0x13,0xE7,0xAD,0x36,0x92,0xAE,0x52);
MIDL_DEFINE_GUID(IID, IID_IDeckLinkInputCallback_v7_6,0x31D28EE7,0x88B6,0x4CB1,0x89,0x7A,0xCD,0xBF,0x79,0xA2,0x64,0x14);
MIDL_DEFINE_GUID(CLSID, CLSID_CDeckLinkGLScreenPreviewHelper_v7_6,0xD398CEE7,0x4434,0x4CA3,0x9B,0xA6,0x5A,0xE3,0x45,0x56,0xB9,0x05);
MIDL_DEFINE_GUID(CLSID, CLSID_CDeckLinkVideoConversion_v7_6,0xFFA84F77,0x73BE,0x4FB7,0xB0,0x3E,0xB5,0xE4,0x4B,0x9F,0x75,0x9B);
MIDL_DEFINE_GUID(IID, IID_IDeckLinkInputCallback_v7_3,0xFD6F311D,0x4D00,0x444B,0x9E,0xD4,0x1F,0x25,0xB5,0x73,0x0A,0xD0);
MIDL_DEFINE_GUID(IID, IID_IDeckLinkOutput_v7_3,0x271C65E3,0xC323,0x4344,0xA3,0x0F,0xD9,0x08,0xBC,0xB2,0x0A,0xA3);
MIDL_DEFINE_GUID(IID, IID_IDeckLinkInput_v7_3,0x4973F012,0x9925,0x458C,0x87,0x1C,0x18,0x77,0x4C,0xDB,0xBE,0xCB);
MIDL_DEFINE_GUID(IID, IID_IDeckLinkVideoInputFrame_v7_3,0xCF317790,0x2894,0x11DE,0x8C,0x30,0x08,0x00,0x20,0x0C,0x9A,0x66);
MIDL_DEFINE_GUID(IID, IID_IDeckLinkDisplayModeIterator_v7_1,0xB28131B6,0x59AC,0x4857,0xB5,0xAC,0xCD,0x75,0xD5,0x88,0x3E,0x2F);
MIDL_DEFINE_GUID(IID, IID_IDeckLinkDisplayMode_v7_1,0xAF0CD6D5,0x8376,0x435E,0x84,0x33,0x54,0xF9,0xDD,0x53,0x0A,0xC3);
MIDL_DEFINE_GUID(IID, IID_IDeckLinkVideoFrame_v7_1,0x333F3A10,0x8C2D,0x43CF,0xB7,0x9D,0x46,0x56,0x0F,0xEE,0xA1,0xCE);
MIDL_DEFINE_GUID(IID, IID_IDeckLinkVideoInputFrame_v7_1,0xC8B41D95,0x8848,0x40EE,0x9B,0x37,0x6E,0x34,0x17,0xFB,0x11,0x4B);
MIDL_DEFINE_GUID(IID, IID_IDeckLinkAudioInputPacket_v7_1,0xC86DE4F6,0xA29F,0x42E3,0xAB,0x3A,0x13,0x63,0xE2,0x9F,0x07,0x88);
MIDL_DEFINE_GUID(IID, IID_IDeckLinkVideoOutputCallback_v7_1,0xEBD01AFA,0xE4B0,0x49C6,0xA0,0x1D,0xED,0xB9,0xD1,0xB5,0x5F,0xD9);
MIDL_DEFINE_GUID(IID, IID_IDeckLinkInputCallback_v7_1,0x7F94F328,0x5ED4,0x4E9F,0x97,0x29,0x76,0xA8,0x6B,0xDC,0x99,0xCC);
MIDL_DEFINE_GUID(IID, IID_IDeckLinkOutput_v7_1,0xAE5B3E9B,0x4E1E,0x4535,0xB6,0xE8,0x48,0x0F,0xF5,0x2F,0x6C,0xE5);
MIDL_DEFINE_GUID(IID, IID_IDeckLinkInput_v7_1,0x2B54EDEF,0x5B32,0x429F,0xBA,0x11,0xBB,0x99,0x05,0x96,0xEA,0xCD);
#undef MIDL_DEFINE_GUID
#ifdef __cplusplus
}
#endif

View File

@@ -69,12 +69,12 @@ CFLAGS=$(CXXFLAGS) `sdl-config --cflags` -I/opt/local/include
# issues building viewdxt and playdxt on some systems
#
# default: main example 2dxt lib viewdxt playdxt
default: main example 2dxt lib
default: lib main example 2dxt
main: dxt.o main.o util.o intrinsic.o
example: example.o libdxt.o dxt.o util.o intrinsic.o
lib: libdxt.o dxt.o intrinsic.o
ar rcu libdxt.a libdxt.o dxt.o intrinsic.o
lib: libdxt.o dxt.o intrinsic.o util.o
ar rcu libdxt.a libdxt.o dxt.o intrinsic.o util.o
ranlib libdxt.a
2dxt: dxt.o 2dxt.o libdxt.o util.o intrinsic.o

View File

@@ -4,10 +4,10 @@ CC = @CC@
CXX = @CXX@
QMAKE = @QMAKE@
LINKER = @LINKER@
CFLAGS = -fPIC -g @DEFS@ @CFLAGS@ @X_CFLAGS@ -DPATH_PREFIX=@prefix@ -DLIB_DIR=@libdir@ -msse2
CFLAGS = -g @DEFS@ @CFLAGS@ @X_CFLAGS@ -DPATH_PREFIX=@prefix@ -DLIB_DIR=@libdir@ -msse2
CPPFLAGS = @CPPFLAGS@
CXXFLAGS = -fPIC -g @DEFS@ @CXXFLAGS@ -DPATH_PREFIX=@prefix@ -DLIB_DIR=@libdir@ -Wno-multichar -Wno-deprecated -msse2
NVCCFLAGS = @NVCCFLAGS@ -Xcompiler -fPIC
CXXFLAGS = -g @DEFS@ @CXXFLAGS@ -DPATH_PREFIX=@prefix@ -DLIB_DIR=@libdir@ -Wno-multichar -Wno-deprecated -msse2
NVCCFLAGS = @NVCCFLAGS@
LDFLAGS = @LDFLAGS@
LIBS += @LIBS@ @JACK_TRANS_LIB@ @MATHLIBS@ @COREAUDIO_LIB@ \
@X_PRE_LIBS@ @X_LIBS@ @X_EXTRA_LIBS@ -lm -pthread
@@ -68,6 +68,10 @@ OBJS = @OBJS@ \
@COREAUDIO_OBJ@ \
@JACK_TRANS_OBJ@ \
@SPEEX_OBJ@ \
src/compat/drand48.o \
src/compat/gettimeofday.o \
src/compat/inet_ntop.o \
src/compat/inet_pton.o \
src/compat/platform_semaphore.o \
src/compat/platform_time.o \
src/compat/usleep.o \
@@ -171,6 +175,9 @@ src/utils/packet_counter.o: src/utils/packet_counter.cpp src/utils/packet_counte
src/video_capture/DeckLinkAPIDispatch.o: $(DECKLINK_PATH)/DeckLinkAPIDispatch.cpp
$(CXX) $(CXXFLAGS) -c $(INC) -o src/video_capture/DeckLinkAPIDispatch.o $(DECKLINK_PATH)/DeckLinkAPIDispatch.cpp
src/video_capture/DeckLinkAPI_i.o: $(DECKLINK_PATH)/DeckLinkAPI_i.c
$(CC) $(CFLAGS) -c $(INC) -o src/video_capture/DeckLinkAPI_i.o $(DECKLINK_PATH)/DeckLinkAPI_i.c
src/video_display/sage_wrapper.o: src/video_display/sage_wrapper.cxx
$(CXX) $(CXXFLAGS) -c $(INC) -DQUANTA_USE_PTHREADS -DQUANTA_THREAD_SAFE -DGLSL_YUV -o src/video_display/sage_wrapper.o src/video_display/sage_wrapper.cxx

View File

@@ -4,6 +4,8 @@ AC_INIT([UltraGrid], [1.1], [ultragrid-dev@cesnet.cz])
AM_INIT_AUTOMAKE([1.10])
AC_PREREQ(2.61)
AC_CONFIG_SRCDIR([src/main.c])
AC_CONFIG_MACRO_DIR([m4])
LT_INIT
PARENT=`echo $PWD | sed -e 's%/[[^/]]*$%%'`
@@ -101,10 +103,10 @@ if expr "$host_os" : ".*darwin.*" > /dev/null; then
LDFLAGS="$LDFLAGS -m32 -mmacosx-version-min=10.5"
X_CFLAGS="$X_CFLAGS -I/usr/X11R6/include"
OBJS="$OBJS src/utils/autorelease_pool.o"
else if test "$host_os" = mingw32; then
else if expr "$host_os" : ".*mingw32.*" > /dev/null; then
system=Windows
AC_DEFINE([HAVE_WINDOWS], [1], [This is an Windows OS])
AC_DEFINE([WIN32], [1], [This is an Windows OS])
LIBS="$LIBS -lsetupapi -lWs2_32 -lIphlpapi"
else
system=Linux
LDFLAGS="$LDFLAGS -Wl,--dynamic-list-data"
@@ -143,6 +145,13 @@ then
AC_MSG_ERROR([Exiting due to unsatisfied dependency.])
fi
if test $system = MacOSX -o $system = Linux
then
CFLAGS="$CFLAGS -fPIC"
CXXFLAGS="$CXXFLAGS -fPIC"
NVCCFLAGS="$NVCCFLAGS -Xcompiler -fPIC"
fi
AH_BOTTOM([
/*
* Mac OS X Snow Leopard does not have posix_memalign
@@ -186,6 +195,23 @@ AC_DEFUN([DEFINE_GL], [
AC_SUBST(GL_COMMON_OBJ)
])
AC_MSG_CHECKING([if_nametoindex])
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
#include <windows.h>
#include <iphlpapi.h>
]], [[
if_nametoindex("eth");]]
)], HAVE_IF_NAMETOINDEX=yes, HAVE_IF_NAMETOINDEX=no)
AC_MSG_RESULT([$HAVE_IF_NAMETOINDEX])
AC_CHECK_FUNCS(strtok_r)
AC_CHECK_FUNCS(drand48)
if test $ac_cv_func_drand48 = no
then
AC_DEFINE([NEED_DRAND48], 1, [We need custom implementation of drand48.])
fi
# -------------------------------------------------------------------------------------------------
# Check for standard size types. The defaults are only valid on some
@@ -243,6 +269,8 @@ AC_CHECK_LIB(rt, timer_create)
AC_CHECK_FUNC(sin, MATHLIBS="", MATHLIBS="-lm")
AC_CHECK_LIB(ieee, main, [MATHLIBS="-lieee $MATHLIBS"])
AC_CHECK_FUNCS(inet_ntop)
AC_CHECK_FUNCS(inet_pton)
AC_SUBST(MATHLIBS)
# -------------------------------------------------------------------------------------------------
@@ -525,7 +553,7 @@ DECKLINK_INC=
case "$host_os" in
*darwin*)
if test -z $DECKLINK; then
if test -z $DECKLINK_INC; then
DECKLINK_INC=DeckLink/Mac
fi
OLD_LIBS=$LIBS
@@ -540,8 +568,29 @@ case "$host_os" in
fi
AC_LANG_POP(C++)
;;
*mingw*)
if test -z $DECKLINK_INC; then
DECKLINK_INC=DeckLink/Windows
fi
SAVED_LIBS=$LIBS
LIBS="$LIBS -lOle32"
AC_LANG_PUSH(C++)
AC_MSG_CHECKING([DeckLink usability])
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
#include "DeckLink/Windows/DeckLinkAPI_h.h"
#include "DeckLink/Windows/DeckLinkAPIVersion.h"
#include <objbase.h>
]],
[[IDeckLinkIterator *deckLinkIter; CoCreateInstance(CLSID_CDeckLinkIterator, NULL, CLSCTX_ALL, IID_IDeckLinkIterator, (void **) deckLinkIter);]])],FOUND_DECKLINK=yes,FOUND_DECKLINK=no)
LIBS=$SAVED_LIBS
if test $FOUND_DECKLINK = yes; then
DECKLINK_LIB="$DECKLINK_LIB -lOle32"
fi
AC_MSG_RESULT([$FOUND_DECKLINK])
AC_LANG_POP(C++)
;;
*)
if test -z $DECKLINK; then
if test -z $DECKLINK_INC; then
DECKLINK_INC=DeckLink/include
fi
@@ -565,7 +614,11 @@ then
DECKLINK_CAP_OBJ="src/video_capture/decklink.o"
DECKLINK_DISP_OBJ="src/video_display/decklink.o"
DECKLINK_SOUND_PLAY_OBJ="src/audio/playback/decklink.o"
DECKLINK_COMMON="src/video_capture/DeckLinkAPIDispatch.o"
if test $system = "Windows"; then
DECKLINK_COMMON="src/video_capture/DeckLinkAPI_i.o"
else
DECKLINK_COMMON="src/video_capture/DeckLinkAPIDispatch.o"
fi
AC_DEFINE([HAVE_DECKLINK], [1], [Build with DeckLink support])
LINKER=$CXX
AC_SUBST(DECKLINK_CAP_LIB_TARGET, "lib/ultragrid/vidcap_decklink.so.$video_capture_abi_version")
@@ -989,9 +1042,22 @@ AC_ARG_ENABLE(gl,
# lines does not inferre with something below
SAVED_LIBS=$LIBS
if test $system = Windows; then
AC_CHECK_HEADERS([GL/glew.h], AC_CHECK_LIB(GLEW, glewInit, FOUND_GLEW=yes, FOUND_GLEW=no), FOUND_GLEW=no)
AC_MSG_CHECKING([GLEW presence (library and headers)])
SAVED_LIBS=$LIBS
LIBS="$LIBS libglew32.a libglew32.dll.a"
AC_LINK_IFELSE([ AC_LANG_PROGRAM([
#define _STDCALL_SUPPORTED 1
#include <GL/glew.h>
], [
glewInit();
])],
[FOUND_GLEW=yes],[FOUND_GLEW=no])
LIBS=$SAVED_LIBS
AC_MSG_RESULT([$FOUND_GLEW])
#AC_CHECK_HEADERS([GL/glew.h], AC_CHECK_LIB(GLEW, glewInit, FOUND_GLEW=yes, FOUND_GLEW=no), FOUND_GLEW=no)
else
PKG_CHECK_MODULES([GLEW], [glew >= 1.5.2 ], [FOUND_GLEW=yes], [FOUND_GLEW=no])
AC_CHECK_HEADERS([GL/glew.h], AC_CHECK_LIB(GLEW, glewInit, FOUND_GLEW=yes, FOUND_GLEW=no), FOUND_GLEW=no)
#PKG_CHECK_MODULES([GLEW], [glew >= 1.5.2 ], [FOUND_GLEW=yes], [FOUND_GLEW=no])
fi
AC_SUBST(FOUND_GLEW)
LIBS=$SAVED_LIBS
@@ -1052,6 +1118,29 @@ case "$host_os" in
echo "OpenGL headers not found or not usable."
fi
;;
*mingw*)
AC_MSG_CHECKING([OpenGL support])
SAVED_LIBS=$LIBS
LIBS="$LIBS -lglut32win libglew32.a libglew32.dll.a -lopengl32"
AC_LINK_IFELSE([ AC_LANG_PROGRAM([
#define _STDCALL_SUPPORTED 1
#include <GL/glew.h>
#include <GL/glut.h>
], [glutMainLoop();
glewInit();
glBindTexture(GL_TEXTURE_2D, 0);
])],
[HAVE_GL=yes],[HAVE_GL=no])
LIBS=$SAVED_LIBS
AC_MSG_RESULT([$HAVE_GL])
if test "$HAVE_GL" = yes; then
GL_LIB="$GL_LIB -lglut32win libglew32.a libglew32.dll.a -lopengl32"
GL_OBJ="$GL_OBJ src/video_display/gl.o"
AC_DEFINE([HAVE_GL], [1], [Build with OpenGL output])
gl=yes
fi
;;
*)
AC_CHECK_HEADERS([GL/gl.h GL/glx.h ],
[FOUND_GL_H=yes],
@@ -1153,17 +1242,26 @@ case "$host_os" in
AC_CHECK_HEADER(X11/Xlib.h)
AC_CHECK_HEADER(X11/Xutil.h)
AC_CHECK_LIB(X11, XGetImage)
PKG_CHECK_MODULES([XFIXES], [xfixes],
[AC_DEFINE([HAVE_XFIXES], [1], [Build with XFixes support])],
[HAVE_XFIXES=no]
)
#PKG_CHECK_MODULES([XFIXES], [xfixes],
# [AC_DEFINE([HAVE_XFIXES], [1], [Build with XFixes support])],
# [HAVE_XFIXES=no]
# )
AC_CHECK_LIB(Xfixes, XFixesGetCursorImage)
AC_CHECK_HEADER(X11/extensions/Xfixes.h)
LIBS=$SAVED_LIBS
if test $screen_cap_req = yes -a $ac_cv_lib_X11_XGetImage = yes -a \
$ac_cv_header_X11_Xlib_h = yes -a $ac_cv_header_X11_Xutil_h = yes
then
screen_cap=yes
SCREEN_CAP_LIB="$SCREEN_CAP_LIB -lX11 $XFIXES_LIBS"
SCREEN_CAP_LIB="$SCREEN_CAP_LIB -lX11"
if test $ac_cv_lib_Xfixes_XFixesGetCursorImage = yes -a \
$ac_cv_header_X11_extensions_Xfixes_h = yes
then
AC_DEFINE([HAVE_XFIXES], [1], [Build with XFixes support])
SCREEN_CAP_LIB="$SCREEN_CAP_LIB -lXfixes"
fi
else
screen_cap=no
fi
@@ -1805,6 +1903,9 @@ case $host_os in
scale=no
fi
;;
*mingw32*)
scale=no
;;
*)
if test $scale_req = yes -a $FOUND_GLEW = yes \
-a $ac_cv_header_GL_glx_h = yes -a $ac_cv_header_X11_Xlib_h = yes -a \
@@ -1861,6 +1962,7 @@ AC_SUBST(QMAKE)
# V4L2
# -------------------------------------------------------------------------------------------------
v4l2=no
found_v4l2=no
AC_ARG_ENABLE(v4l2,
AS_HELP_STRING([--disable-v4l2], [disable V4L2 support(default is auto)]),
[v4l2_req=$enableval],
@@ -1868,7 +1970,19 @@ AC_ARG_ENABLE(v4l2,
)
if test $system = Linux; then
PKG_CHECK_MODULES([V4L2], [libv4l2 libv4lconvert], [found_v4l2=yes], [found_v4l2=no])
#PKG_CHECK_MODULES([V4L2], [libv4l2 libv4lconvert], [found_v4l2=yes], [found_v4l2=no])
SAVED_LIBS=$LIBS
AC_CHECK_LIB(v4l2, main)
AC_CHECK_HEADER(libv4l2.h)
AC_CHECK_LIB(v4lconvert, v4lconvert_create)
AC_CHECK_HEADER(libv4lconvert.h)
LIBS=$SAVED_LIBS
if test $v4l2_req = yes -a $ac_cv_lib_v4l2_main = yes -a $ac_cv_header_libv4l2_h = yes -a \
$ac_cv_lib_v4lconvert_v4lconvert_create = yes -a $ac_cv_header_libv4lconvert_h = yes
then
found_v4l2=yes
fi
fi
if test $v4l2_req = yes -a $found_v4l2 = yes
@@ -1876,6 +1990,7 @@ then
V4L2_OBJ="src/video_capture/v4l2.o"
AC_DEFINE([HAVE_V4L2], [1], [Build with V4L2 support])
AC_SUBST(V4L2_LIB_TARGET, "lib/ultragrid/vidcap_v4l2.so.$video_capture_abi_version")
V4L2_LIBS="$V4L2_LIBS -lv4l2 -lv4lconvert"
LIB_TARGETS="$LIB_TARGETS $V4L2_LIB_TARGET"
LIB_OBJS="$LIB_OBJS $V4L2_OBJ"
CFLAGS="$CFLAGS $V4L2_CFLAGS"

View File

@@ -105,9 +105,9 @@ LDGM_session_cpu::encode ( char* data_ptr, char* parity_ptr )
char *parity_packet;
for ( int m = 0; m < param_m; ++m) {
int e = posix_memalign(&ppacket, 16, packet_size);
ppacket = aligned_malloc(packet_size, 16);
if (e)
if (!ppacket)
{
printf ( "Error while using posix_memalign\n" );
return;
@@ -137,7 +137,7 @@ LDGM_session_cpu::encode ( char* data_ptr, char* parity_ptr )
//Add the new parity packet to overall parity
memcpy ( parity_ptr + m*packet_size, parity_packet, packet_size );
free(ppacket);
aligned_free(ppacket);
}
return ;
@@ -147,7 +147,7 @@ LDGM_session_cpu::encode ( char* data_ptr, char* parity_ptr )
LDGM_session_cpu::free_out_buf ( char *buf)
{
if ( buf != NULL )
free(buf);
aligned_free(buf);
}
void
LDGM_session_cpu::encode_naive ( char* data_ptr, char* parity_ptr )
@@ -159,8 +159,8 @@ LDGM_session_cpu::encode_naive ( char* data_ptr, char* parity_ptr )
for ( int m = 0; m < param_m; ++m) {
int e = posix_memalign(&ppacket, 16, packet_size);
if (e)
ppacket = aligned_malloc(packet_size, 16);
if (!ppacket)
{
printf ( "Error while using posix_memalign\n" );
return;
@@ -190,7 +190,7 @@ LDGM_session_cpu::encode_naive ( char* data_ptr, char* parity_ptr )
//Add the new parity packet to overall parity
memcpy ( parity_ptr + m*packet_size, parity_packet, packet_size );
free(ppacket);
aligned_free(ppacket);
}
return ;
@@ -210,7 +210,7 @@ LDGM_session_cpu::decode_frame ( char* received, int buf_size, int* frame_size,
// printf ( "p_size %d\n", p_size );
graph.set_data_size(p_size);
Timer_util timer;
//Timer_util timer;
int i;
int index = 0;

View File

@@ -137,8 +137,8 @@ LDGM_session::encode_frame ( char* frame, int frame_size, int* out_buf_size )
*out_buf_size = buf_size;
void *out_buf;
int error = posix_memalign(&out_buf, 16, buf_size);
if (error)
out_buf = aligned_malloc(buf_size, 16);
if (out_buf)
{
printf ( "Unable to allocate memmory using posix_memalign\n" );
return NULL;
@@ -153,7 +153,7 @@ LDGM_session::encode_frame ( char* frame, int frame_size, int* out_buf_size )
memcpy( ((char*)out_buf) + header_size, frame, frame_size);
timespec start, end;
Timer_util t;
//Timer_util t;
this->encode ( (char*)out_buf, ((char*)out_buf)+param_k*ps );
@@ -226,8 +226,8 @@ LDGM_session::encode_hdr_frame ( char *my_hdr, int my_hdr_size, char* frame, int
*out_buf_size = buf_size;
void *out_buf;
int error = posix_memalign(&out_buf, 16, buf_size);
if (error)
out_buf = aligned_malloc(buf_size, 16);
if (out_buf)
{
printf ( "Unable to allocate memmory using posix_memalign\n" );
return NULL;
@@ -243,7 +243,7 @@ LDGM_session::encode_hdr_frame ( char *my_hdr, int my_hdr_size, char* frame, int
memcpy( ((char*)out_buf) + header_size + my_hdr_size, frame, frame_size);
timespec start, end;
Timer_util t;
//Timer_util t;
this->encode ( (char*)out_buf, ((char*)out_buf)+param_k*ps );

View File

@@ -10,11 +10,17 @@
* =====================================================================================
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#include "config_unix.h"
#include "config_win32.h"
#endif // HAVE_CONFIG_H
#ifndef WIN32
#ifndef TIMER_INC
#define TIMER_INC
#include <time.h>
/*! \class Timer_util
@@ -76,3 +82,6 @@ class Timer_util
}; /* ----- end of class Timer_util ----- */
#endif /* ----- #ifndef TIMER_INC ----- */
#endif // WIN32

View File

@@ -105,6 +105,8 @@ struct state_audio {
pthread_t audio_sender_thread_id,
audio_receiver_thread_id;
bool audio_sender_thread_started,
audio_receiver_thread_started;
char *audio_channel_map;
const char *audio_scale;
@@ -164,6 +166,7 @@ struct state_audio * audio_cfg_init(char *addrs, int recv_port, int send_port, c
{
struct state_audio *s = NULL;
char *tmp, *unused = NULL;
UNUSED(unused);
char *addr;
audio_capture_init_devices();
@@ -202,6 +205,8 @@ struct state_audio * audio_cfg_init(char *addrs, int recv_port, int send_port, c
s->audio_channel_map = audio_channel_map;
s->audio_scale = audio_scale;
s->audio_sender_thread_started = s->audio_receiver_thread_started = false;
if(echo_cancellation) {
#ifdef HAVE_SPEEX
s->echo_state = echo_cancellation_init();
@@ -236,9 +241,13 @@ struct state_audio * audio_cfg_init(char *addrs, int recv_port, int send_port, c
free(tmp);
if (send_cfg != NULL) {
char *save_ptr = NULL;
char *device = strtok_r(send_cfg, ":", &save_ptr);
char *cfg = save_ptr;
char *cfg = NULL;
char *device = send_cfg;
if(strchr(device, ':')) {
char *delim = strchr(device, ':');
*delim = '\0';
cfg = delim + 1;
}
s->audio_capture_device = audio_capture_init(device, cfg);
@@ -251,9 +260,13 @@ struct state_audio * audio_cfg_init(char *addrs, int recv_port, int send_port, c
}
if (recv_cfg != NULL) {
char *save_ptr = NULL;
char *device = strtok_r(recv_cfg, ":", &save_ptr);
char *cfg = save_ptr;
char *cfg = NULL;
char *device = recv_cfg;
if(strchr(device, ':')) {
char *delim = strchr(device, ':');
*delim = '\0';
cfg = delim + 1;
}
s->audio_playback_device = audio_playback_init(device, cfg);
if(!s->audio_playback_device) {
@@ -270,7 +283,9 @@ struct state_audio * audio_cfg_init(char *addrs, int recv_port, int send_port, c
fprintf(stderr,
"Error creating audio thread. Quitting\n");
goto error;
}
} else {
s->audio_sender_thread_started = true;
}
}
if (recv_cfg != NULL) {
@@ -279,7 +294,9 @@ struct state_audio * audio_cfg_init(char *addrs, int recv_port, int send_port, c
fprintf(stderr,
"Error creating audio thread. Quitting\n");
goto error;
}
} else {
s->audio_receiver_thread_started = true;
}
}
s->sender = NET_NATIVE;
@@ -317,9 +334,9 @@ error:
void audio_join(struct state_audio *s) {
if(s) {
if(s->audio_receiver_thread_id)
if(s->audio_receiver_thread_started)
pthread_join(s->audio_receiver_thread_id, NULL);
if(s->audio_sender_thread_id)
if(s->audio_sender_thread_started)
pthread_join(s->audio_sender_thread_id, NULL);
}
}

View File

@@ -46,7 +46,11 @@
*
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#include "config_unix.h"
#include "config_win32.h"
#endif // HAVE_CONFIG_H
struct audio_frame;

View File

@@ -201,7 +201,7 @@ struct audio_frame * echo_cancel(struct echo_cancellation *s, struct audio_frame
if(rounded_data_len) {
char *data_to_write = malloc(rounded_data_len);
char *far = malloc(chunk_size);
char *far_end_tmp = malloc(chunk_size);
memcpy(data_to_write, s->near_end_residual, s->near_end_residual_size);
memcpy(data_to_write + s->near_end_residual_size,
@@ -222,13 +222,13 @@ struct audio_frame * echo_cancel(struct echo_cancellation *s, struct audio_frame
spx_int16_t *out_ptr = (spx_int16_t *) s->frame.data;
int read_len_far;
read_len_far = ring_buffer_read(s->far_end, far, chunk_size);
read_len_far = ring_buffer_read(s->far_end, far_end_tmp, chunk_size);
while((read_len_far == chunk_size) && s->frame.data_len < rounded_data_len) {
speex_echo_cancellation(s->echo_state, near_ptr,
(spx_int16_t *) far,
(spx_int16_t *) far_end_tmp,
out_ptr);
read_len_far = ring_buffer_read(s->far_end, far, chunk_size);
read_len_far = ring_buffer_read(s->far_end, far_end_tmp, chunk_size);
near_ptr += chunk_size;
out_ptr += chunk_size;
s->frame.data_len += chunk_size;
@@ -239,7 +239,7 @@ struct audio_frame * echo_cancel(struct echo_cancellation *s, struct audio_frame
}
free(data_to_write);
free(far);
free(far_end_tmp);
s->frame.data_len = rounded_data_len;

View File

@@ -67,19 +67,33 @@ extern "C" {
#include "audio/audio.h"
#include "audio/utils.h"
#ifdef WIN32
#include "DeckLinkAPI_h.h"
#else
#include "DeckLinkAPI.h"
#endif
#include "DeckLinkAPIVersion.h"
#ifdef __cplusplus
} // END of extern "C"
#endif
#ifdef WIN32
#include <objbase.h>
#endif
#ifdef HAVE_MACOSX
#define STRING CFStringRef
#elif defined WIN32
#define STRING BSTR
#else
#define STRING const char *
#endif
#ifndef WIN32
#define STDMETHODCALLTYPE
#endif
// defined int video_capture/decklink.cpp
void print_output_modes(IDeckLink *);
static int blackmagic_api_version_check(STRING *current_version);
@@ -120,17 +134,17 @@ public:
// IUnknown needs only a dummy implementation
virtual HRESULT QueryInterface (REFIID iid, LPVOID *ppv) {return E_NOINTERFACE;}
virtual ULONG AddRef () {return 1;}
virtual ULONG Release () {return 1;}
virtual HRESULT STDMETHODCALLTYPE QueryInterface (REFIID iid, LPVOID *ppv) {return E_NOINTERFACE;}
virtual ULONG STDMETHODCALLTYPE AddRef () {return 1;}
virtual ULONG STDMETHODCALLTYPE Release () {return 1;}
virtual HRESULT ScheduledFrameCompleted (IDeckLinkVideoFrame* completedFrame, BMDOutputFrameCompletionResult result) {
virtual HRESULT STDMETHODCALLTYPE ScheduledFrameCompleted (IDeckLinkVideoFrame* completedFrame, BMDOutputFrameCompletionResult result) {
s->deckLinkOutput->ScheduleVideoFrame(s->deckLinkFrame,
s->frames * s->frameRateDuration, s->frameRateDuration, s->frameRateScale);
s->frames++;
return S_OK;
}
virtual HRESULT ScheduledPlaybackHasStopped () { return S_OK; }
virtual HRESULT STDMETHODCALLTYPE ScheduledPlaybackHasStopped () { return S_OK; }
//virtual HRESULT RenderAudioSamples (bool preroll);
};
@@ -138,9 +152,18 @@ static int blackmagic_api_version_check(STRING *current_version)
{
int ret = TRUE;
*current_version = NULL;
IDeckLinkAPIInformation *APIInformation = NULL;
HRESULT result;
IDeckLinkAPIInformation *APIInformation = CreateDeckLinkAPIInformationInstance();
if(APIInformation == NULL) {
#ifdef WIN32
result = CoCreateInstance(CLSID_CDeckLinkAPIInformation, NULL, CLSCTX_ALL,
IID_IDeckLinkAPIInformation, (void **) &APIInformation);
#else
APIInformation = CreateDeckLinkAPIInformationInstance();
if(APIInformation == NULL)
#endif
{
return FALSE;
}
int64_t value;
@@ -171,8 +194,14 @@ void decklink_playback_help(const char *driver_name)
UNUSED(driver_name);
// Create an IDeckLinkIterator object to enumerate all DeckLink cards in the system
#ifdef WIN32
result = CoCreateInstance(CLSID_CDeckLinkIterator, NULL, CLSCTX_ALL,
IID_IDeckLinkIterator, (void **) &deckLinkIterator);
if (FAILED(result))
#else
deckLinkIterator = CreateDeckLinkIteratorInstance();
if (deckLinkIterator == NULL)
#endif
{
fprintf(stderr, "\nA DeckLink iterator could not be created. The DeckLink drivers may not be installed or are outdated.\n");
fprintf(stderr, "This UltraGrid version was compiled with DeckLink drivers %s. You should have at least this version.\n\n",
@@ -191,6 +220,9 @@ void decklink_playback_help(const char *driver_name)
#ifdef HAVE_MACOSX
deviceNameCString = (char *) malloc(128);
CFStringGetCString(deviceNameString, (char *) deviceNameCString, 128, kCFStringEncodingMacRoman);
#elif defined WIN32
deviceNameCString = (char *) malloc(128);
wcstombs((char *) deviceNameCString, deviceNameString, 128);
#else
deviceNameCString = deviceNameString;
#endif
@@ -227,10 +259,20 @@ void *decklink_playback_init(char *index_str)
HRESULT result;
IDeckLinkConfiguration* deckLinkConfiguration = NULL;
// for Decklink Studio which has switchable XLR - analog 3 and 4 or AES/EBU 3,4 and 5,6
BMDAudioOutputAnalogAESSwitch audioConnection = 0;
BMDAudioOutputAnalogAESSwitch audioConnection = (BMDAudioOutputAnalogAESSwitch) 0;
int cardIdx = 0;
int dnum = 0;
#ifdef WIN32
// Initialize COM on this thread
result = CoInitialize(NULL);
if(FAILED(result)) {
fprintf(stderr, "Initialization of COM failed - result = "
"08x.\n", result);
return NULL;
}
#endif
STRING current_version;
if(!blackmagic_api_version_check(&current_version)) {
fprintf(stderr, "\nThe DeckLink drivers may not be installed or are outdated.\n");
@@ -242,6 +284,9 @@ void *decklink_playback_init(char *index_str)
#ifdef HAVE_MACOSX
currentVersionCString = (char *) malloc(128);
CFStringGetCString(current_version, (char *) currentVersionCString, 128, kCFStringEncodingMacRoman);
#elif defined WIN32
currentVersionCString = (char *) malloc(128);
wcstombs((char *) currentVersionCString, current_version, 128);
#else
currentVersionCString = current_version;
#endif
@@ -273,8 +318,14 @@ void *decklink_playback_init(char *index_str)
}
// Initialize the DeckLink API
#ifdef WIN32
result = CoCreateInstance(CLSID_CDeckLinkIterator, NULL, CLSCTX_ALL,
IID_IDeckLinkIterator, (void **) &deckLinkIterator);
if (FAILED(result))
#else
deckLinkIterator = CreateDeckLinkIteratorInstance();
if (!deckLinkIterator)
#endif
{
fprintf(stderr, "\nA DeckLink iterator could not be created. The DeckLink drivers may not be installed or are outdated.\n");
fprintf(stderr, "This UltraGrid version was compiled with DeckLink drivers %s. You should have at least this version.\n\n",
@@ -371,7 +422,11 @@ void decklink_put_frame(void *state, struct audio_frame *frame)
struct state_decklink *s = (struct state_decklink *)state;
unsigned int sampleFrameCount = s->audio.data_len / (s->audio.bps *
s->audio.ch_count);
#ifdef WIN32
unsigned long int sampleFramesWritten;
#else
unsigned int sampleFramesWritten;
#endif
/* we got probably count that cannot be played directly (probably 1) */
if(s->output_audio_channel_count != s->audio.ch_count) {

View File

@@ -49,6 +49,7 @@
#ifdef HAVE_CONFIG_H
#include "config.h"
#include "config_unix.h"
#include "config_win32.h"
#endif
#include "audio/playback/none.h"
#include "debug.h"

View File

@@ -11,8 +11,6 @@
* $Date: 2007/11/08 09:48:59 $
*/
#include "config_unix.h"
#include "config_win32.h"
#include "bitstream.h"
typedef struct s_bitstream {

View File

@@ -12,6 +12,12 @@
*
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#include "config_unix.h"
#include "config_win32.h"
#endif // HAVE_CONFIG_H
#ifndef RAT_BITSTREAM_H
#define RAT_BITSTREAM_H

View File

@@ -1,5 +1,9 @@
#ifdef HAVE_CONFIG_H
#include "config.h"
#include "config_unix.h"
#include "config_win32.h"
#endif
#include "drand48.h"
#ifdef NEED_DRAND48

View File

@@ -1,17 +1,73 @@
#ifdef HAVE_CONFIG_H
#include "config.h"
#include "config_unix.h"
#include "config_win32.h"
#endif // HAVE_CONFIG_H
#ifdef WIN32
#include <time.h>
#include <windows.h>
#include <winbase.h>
#include "debug.h"
#include "gettimeofday.h"
#if defined(NEED_GETTIMEOFDAY) && defined(WIN32)
static LARGE_INTEGER start_LI;
LARGE_INTEGER freq = {.QuadPart = 0};
static time_t start_time;
int gettimeofday(struct timeval *tp, void *tz)
static void gettimeofday_init();
static void gettimeofday_init() {
time_t tmp;
HANDLE process;
DWORD prio;
process = GetCurrentProcess();
prio = GetPriorityClass(process);
int ret = SetPriorityClass(process, REALTIME_PRIORITY_CLASS);
if(!ret) {
fprintf(stderr, "SetPriorityClass failed.\n");
}
tmp = time(NULL);
while( (start_time = time(NULL)) == tmp)
;
QueryPerformanceFrequency(&freq);
QueryPerformanceCounter(&start_LI);
SetPriorityClass(process, prio);
}
#if defined(_MSC_VER) || defined(_MSC_EXTENSIONS)
#define DELTA_EPOCH_IN_MICROSECS 11644473600000000Ui64
#else
#define DELTA_EPOCH_IN_MICROSECS 11644473600000000ULL
#endif
// Definition of a gettimeofday function
int gettimeofday_replacement(struct timeval *tv, void *tz)
{
struct _timeb timebuffer;
UNUSED(tz);
LARGE_INTEGER val;
_ftime(&timebuffer);
tp->tv_sec = timebuffer.time;
tp->tv_usec = timebuffer.millitm * 1000;
return 0;
if(freq.QuadPart == 0) {
gettimeofday_init();
}
QueryPerformanceFrequency(&freq);
QueryPerformanceCounter(&val);
long long int difference = val.QuadPart - start_LI.QuadPart;
tv->tv_sec = start_time + difference / freq.QuadPart;
tv->tv_usec = (long long)((double) difference * 1000*1000 / freq.QuadPart) % (1000 * 1000);
return 0;
}
#endif

View File

@@ -1,6 +1,10 @@
#ifdef NEED_GETTIMEOFDAY
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
int gettimeofday(struct timeval *tp, void *);
int gettimeofday_replacement(struct timeval *tp, void *tz);
#endif
#ifdef __cplusplus
}
#endif /* __cplusplus */

View File

@@ -21,10 +21,13 @@
*
*/
#ifndef HAVE_INET_NTOP
#ifdef HAVE_CONFIG_H
#include "config.h"
#include "config_unix.h"
#include "config_win32.h"
#endif // HAVE_CONFIG_H
#ifndef HAVE_INET_NTOP
#include "inet_ntop.h"
#define IN6ADDRSZ 16

View File

@@ -46,7 +46,12 @@
*
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#include "config_unix.h"
#include "config_win32.h"
#endif // HAVE_CONFIG_H
#include "debug.h"
#ifdef HAVE_MACOSX

View File

@@ -47,6 +47,8 @@
*/
#include "config.h"
#include "config_unix.h"
#include "config_win32.h"
#ifndef _PLATFORM_SEMAPHORE_H
#define _PLATFORM_SEMAPHORE_H

View File

@@ -187,5 +187,27 @@ typedef int fd_t;
#define max(a, b) (((a) > (b))? (a): (b))
#define min(a, b) (((a) < (b))? (a): (b))
#ifndef HAVE_ALIGNED_ALLOC
static inline void *aligned_malloc(size_t size, size_t alignment);
static inline void *aligned_malloc(size_t size, size_t alignment)
{
void *ptr = NULL;
int ret;
ret = posix_memalign(&ptr, alignment, size);
if(ret) {
errno = ret;
}
if(ret == 0) {
return ptr;
} else {
return NULL;
}
}
#define aligned_free free
#endif // HAVE_ALIGNED_ALLOC
#endif /* _CONFIG_UNIX_H */
#endif /* NDEF WIN32 */

View File

@@ -47,6 +47,9 @@
#ifndef _CONFIG_WIN32_H
#define _CONFIG_WIN32_H
// define compatibility version
#define __MSVCRT_VERSION__ 0x7000
#include <assert.h>
#include <process.h>
#include <malloc.h>
@@ -56,26 +59,17 @@
#include <math.h>
#include <stdlib.h> /* abs() */
#include <string.h>
#ifndef MUSICA_IPV6
#include <winsock2.h>
#endif
#ifdef HAVE_IPv6
#ifdef MUSICA_IPV6
#include <winsock6.h>
#else
#ifdef WIN2K_IPV6
#ifndef _WIN32_WINNT
#define _WIN32_WINNT 0x0501
#endif /* _WIN32_WINNT */
#define WIN32_LEAN_AND_MEAN
#include <winsock2.h>
#include <ws2tcpip.h>
#include <tpipv6.h>
#else
#include <ws2ip6.h>
#include <ws2tcpip.h>
#endif
#endif
#endif
#include <Iphlpapi.h> // if_nametoindex
#include <mmreg.h>
#include <msacm.h>
#include <mmsystem.h>
#include <windows.h>
#include <io.h>
@@ -94,13 +88,6 @@ typedef unsigned int fd_t;
* the definitions below are valid for 32-bit architectures and will have to
* be adjusted for 16- or 64-bit architectures
*/
typedef u_char uint8_t;
typedef u_short uint16_t;
typedef u_long uint32_t;
typedef char int8_t;
typedef short int16_t;
typedef int int32_t;
typedef __int64 int64_t;
typedef unsigned int in_addr_t;
#ifndef TRUE
@@ -114,14 +101,11 @@ typedef unsigned int in_addr_t;
#define NEED_INET_ATON
#include <time.h> /* For clock_t */
#include "usleep.h"
#include "compat/usleep.h"
#define srand48 lbl_srandom
#define lrand48 lbl_random
#define IN_CLASSD(i) (((int)(i) & 0xf0000000) == 0xe0000000)
#define IN_MULTICAST(i) IN_CLASSD(i)
typedef char *caddr_t;
typedef int ssize_t;
@@ -150,12 +134,8 @@ struct utsname {
char machine[SYS_NMLN];
};
struct timezone {
int tz_minuteswest;
int tz_dsttime;
};
struct timezone;
typedef DWORD pid_t;
typedef DWORD uid_t;
typedef DWORD gid_t;
@@ -163,9 +143,34 @@ typedef DWORD gid_t;
extern "C" {
#endif
#ifndef HAVE_STRTOK_R
static inline char * strtok_r(char *str, const char *delim, char **save);
/*
* Public domain licensed code taken from:
* http://en.wikibooks.org/wiki/C_Programming/Strings#The_strtok_function
*/
static inline char *strtok_r(char *s, const char *delimiters, char **lasts)
{
char *sbegin, *send;
sbegin = s ? s : *lasts;
sbegin += strspn(sbegin, delimiters);
if (*sbegin == '\0') {
/* *lasts = ""; */
*lasts = sbegin;
return NULL;
}
send = sbegin + strcspn(sbegin, delimiters);
if (*send != '\0')
*send++ = '\0';
*lasts = send;
return sbegin;
}
#endif
int uname(struct utsname *);
int getopt(int, char * const *, const char *);
int strncasecmp(const char *, const char*, int len);
//int strncasecmp(const char *, const char*, int len);
int srandom(int);
int random(void);
double drand48();
@@ -183,7 +188,6 @@ const char * w32_make_version_info(char * rat_verion);
#define strcasecmp _stricmp
#define strncasecmp _strnicmp
int RegGetValue(HKEY *, char *, char*, char*, int);
void ShowMessage(int level, char *msg);
#define bcopy(from,to,len) memcpy(to,from,len)
@@ -196,8 +200,35 @@ void ShowMessage(int level, char *msg);
#define ENETUNREACH WSAENETUNREACH
#define EHOSTUNREACH WSAEHOSTUNREACH
#define EWOULDBLOCK WSAEWOULDBLOCK
#define EAFNOSUPPORT WSAEAFNOSUPPORT
#define M_PI 3.14159265358979323846
#ifndef TRUE
#define TRUE 1
#define FALSE 0
#endif // TRUE
#include <malloc.h>
#ifndef HAVE_ALIGNED_ALLOC
#define aligned_malloc _aligned_malloc
#define aligned_free _aligned_free
#endif
#ifdef HAVE_STDINT_H
#include <stdint.h>
#endif
// MinGW has this
#include <pthread.h>
#include <sys/stat.h>
// MinGW-w64 defines some broken macro for strtok_r in pthread.h
#undef strtok_r
#include "compat/gettimeofday.h"
#define gettimeofday gettimeofday_replacement
#endif
#endif

View File

@@ -52,6 +52,8 @@
#include "config_win32.h"
#endif // HAVE_CONFIG_H
#ifndef WIN32
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -509,3 +511,6 @@ ihdtv_receive(ihdtv_connection * connection, char *buffer,
return 0;
}
#endif // WIN32

View File

@@ -46,17 +46,18 @@
*
*/
#ifndef _IHDTV_H_
#define _IHDTV_H_
#ifdef HAVE_CONFIG_H
#include "config.h"
#include "config_unix.h"
#include "config_win32.h"
#endif // HAVE_CONFIG_H
#ifndef WIN32
#ifndef _IHDTV_H_
#define _IHDTV_H_
#include <ctype.h>
#include <sys/socket.h>
#include "video_codec.h"
@@ -120,3 +121,6 @@ int
ihdtv_send(ihdtv_connection *tx_connection, struct video_frame *tx_frame, unsigned long buffer_length);
#endif
#endif // WIN32

View File

@@ -51,15 +51,16 @@
*
*/
#include <string.h>
#include <stdlib.h>
#include <getopt.h>
#include <pthread.h>
#ifdef HAVE_CONFIG_H
#include "config.h"
#include "config_unix.h"
#include "config_win32.h"
#endif // HAVE_CONFIG_H
#include <string.h>
#include <stdlib.h>
#include <getopt.h>
#include <pthread.h>
#include "debug.h"
#include "host.h"
#include "perf.h"
@@ -501,6 +502,7 @@ static struct tx *initialize_transmit(unsigned requested_mtu, char *fec)
return tx_init(requested_mtu, fec);
}
#ifndef WIN32
static void *ihdtv_receiver_thread(void *arg)
{
ihdtv_connection *connection = (ihdtv_connection *) ((void **)arg)[0];
@@ -536,6 +538,7 @@ static void *ihdtv_sender_thread(void *arg)
return 0;
}
#endif // WIN32
static struct vcodec_state *new_decoder(struct state_uv *uv) {
struct vcodec_state *state = malloc(sizeof(struct vcodec_state));
@@ -604,7 +607,7 @@ static void *receiver_thread(void *arg)
timeout.tv_usec = 999999 / 59.94;
ret = rtp_recv_poll_r(uv->network_devices, &timeout, uv->ts);
/*
/*
if (ret == FALSE) {
printf("Failed to receive data\n");
}
@@ -897,7 +900,6 @@ int main(int argc, char *argv[])
char *audio_send = NULL;
char *jack_cfg = NULL;
char *requested_fec = NULL;
char *save_ptr = NULL;
char *audio_channel_map = NULL;
char *audio_scale = "mixauto";
@@ -910,9 +912,12 @@ int main(int argc, char *argv[])
struct state_uv *uv;
int ch;
pthread_t receiver_thread_id = 0,
compress_thread_id = 0,
ihdtv_sender_thread_id = 0;
pthread_t receiver_thread_id,
compress_thread_id,
ihdtv_sender_thread_id;
bool receiver_thread_started = false,
compress_thread_started = false,
ihdtv_sender_started = false;
unsigned vidcap_flags = 0,
display_flags = 0;
@@ -999,18 +1004,24 @@ int main(int argc, char *argv[])
list_video_display_devices();
return 0;
}
uv->requested_display = strtok_r(optarg, ":", &save_ptr);
if(save_ptr && strlen(save_ptr) > 0)
display_cfg = save_ptr;
uv->requested_display = optarg;
if(strchr(optarg, ':')) {
char *delim = strchr(optarg, ':');
*delim = '\0';
display_cfg = delim + 1;
}
break;
case 't':
if (!strcmp(optarg, "help")) {
list_video_capture_devices();
return 0;
}
uv->requested_capture = strtok_r(optarg, ":", &save_ptr);
if(save_ptr && strlen(save_ptr) > 0)
capture_cfg = save_ptr;
uv->requested_capture = optarg;
if(strchr(optarg, ':')) {
char *delim = strchr(optarg, ':');
*delim = '\0';
capture_cfg = delim + 1;
}
break;
case 'm':
uv->requested_mtu = atoi(optarg);
@@ -1154,6 +1165,21 @@ int main(int argc, char *argv[])
}
}
#ifdef WIN32
WSADATA wsaData;
int err = WSAStartup(MAKEWORD(2, 2), &wsaData);
if(err != 0) {
fprintf(stderr, "WSAStartup failed with error %d.", err);
return EXIT_FAILURE;
}
if(LOBYTE(wsaData.wVersion) != 2 || HIBYTE(wsaData.wVersion) != 2) {
fprintf(stderr, "Counld not found usable version of Winsock.\n");
WSACleanup();
return EXIT_FAILURE;
}
#endif
char *tmp_requested_fec = strdup(DEFAULT_AUDIO_FEC);
uv->audio = audio_cfg_init (network_device, uv->recv_port_number + 2,
uv->send_port_number + 2, audio_send, audio_recv,
@@ -1206,6 +1232,7 @@ int main(int argc, char *argv[])
#endif /* USE_RT */
if (uv->use_ihdtv_protocol) {
#ifndef WIN32
ihdtv_connection tx_connection, rx_connection;
printf("Initializing ihdtv protocol\n");
@@ -1245,7 +1272,9 @@ int main(int argc, char *argv[])
fprintf(stderr,
"Error creating receiver thread. Quitting\n");
return 1;
}
} else {
receiver_thread_started = true;
}
}
if (strcmp("none", uv->requested_capture) != 0) {
@@ -1271,11 +1300,14 @@ int main(int argc, char *argv[])
fprintf(stderr,
"Error creating sender thread. Quitting\n");
return 1;
}
} else {
ihdtv_sender_started = true;
}
}
while (!0) // was 'should_exit'
sleep(1);
#endif // WIN32
} else {
if ((uv->network_devices =
initialize_network(network_device, uv->recv_port_number,
@@ -1337,7 +1369,9 @@ int main(int argc, char *argv[])
perror("Unable to create display thread!\n");
exit_uv(EXIT_FAILURE);
goto cleanup_wait_display;
}
} else {
receiver_thread_started = true;
}
}
if (strcmp("none", uv->requested_capture) != 0) {
@@ -1348,7 +1382,9 @@ int main(int argc, char *argv[])
perror("Unable to create capture thread!\n");
exit_uv(EXIT_FAILURE);
goto cleanup_wait_capture;
}
} else {
compress_thread_started = true;
}
}
}
@@ -1365,14 +1401,14 @@ int main(int argc, char *argv[])
display_run(uv->display_device);
cleanup_wait_display:
if (strcmp("none", uv->requested_display) != 0 && receiver_thread_id)
if (strcmp("none", uv->requested_display) != 0 && receiver_thread_started)
pthread_join(receiver_thread_id, NULL);
cleanup_wait_capture:
if (strcmp("none", uv->requested_capture) != 0 &&
(uv->use_ihdtv_protocol ?
ihdtv_sender_thread_id :
compress_thread_id))
ihdtv_sender_started :
compress_thread_started))
pthread_join(uv->use_ihdtv_protocol ?
ihdtv_sender_thread_id :
compress_thread_id,
@@ -1427,6 +1463,10 @@ cleanup:
muntrace();
#endif
#ifdef WIN32
WSACleanup();
#endif
printf("Exit\n");
return exit_status;

View File

@@ -56,6 +56,7 @@
#include <iostream>
#include <errno.h>
#include <limits.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -164,11 +165,25 @@ struct ldgm_state_encoder {
char filename[512];
char path[256];
#ifdef WIN32
TCHAR tmpPath[MAX_PATH];
UINT ret = GetTempPath(MAX_PATH, tmpPath);
if(ret == 0 || ret > MAX_PATH) {
fprintf(stderr, "Unable to get temporary directory name.\n");
throw 1;
}
snprintf(path, 256, "%s\\ultragrid\\", tmpPath);
#else
snprintf(path, 256, "/var/tmp/ultragrid-%d/", (int) getuid());
#endif
int res;
#ifdef WIN32
res = mkdir(path);
#else
res = mkdir(path, 0755);
#endif
if(res != 0) {
if(errno != EEXIST) {
perror("mkdir");
@@ -233,8 +248,23 @@ struct ldgm_state_decoder {
int res;
#ifdef WIN32
TCHAR tmpPath[MAX_PATH];
UINT ret = GetTempPath(MAX_PATH, tmpPath);
if(ret == 0 || ret > MAX_PATH) {
fprintf(stderr, "Unable to get temporary directory name.\n");
throw 1;
}
snprintf(path, 256, "%s\\ultragrid\\", tmpPath);
#else
snprintf(path, 256, "/var/tmp/ultragrid-%d/", (int) getuid());
#endif
#ifdef WIN32
res = mkdir(path);
#else
res = mkdir(path, 0755);
#endif // WIN32
if(res != 0) {
if(errno != EEXIST) {
perror("mkdir");

View File

@@ -49,9 +49,7 @@
#include "debug.h"
#include "memory.h"
#include "compat/inet_pton.h"
/*
#include "compat/inet_ntop.h"
*/
#include "compat/vsnprintf.h"
#include "net_udp.h"
@@ -141,7 +139,7 @@ static void socket_error(const char *msg, ...)
#define WSERR(x) {#x,x}
struct wse {
char errname[20];
int errno;
int errno_code;
};
struct wse ws_errs[] = {
WSERR(WSANOTINITIALISED), WSERR(WSAENETDOWN), WSERR(WSAEACCES),
@@ -158,7 +156,7 @@ static void socket_error(const char *msg, ...)
int i, e = WSAGetLastError();
i = 0;
while (ws_errs[i].errno && ws_errs[i].errno != e) {
while (ws_errs[i].errno_code && ws_errs[i].errno_code != e) {
i++;
}
va_start(ap, msg);
@@ -228,6 +226,8 @@ winsock_versions_setsockopt(SOCKET s, int level, int optname,
#ifdef NEED_INET_ATON_STATIC
static
#endif
int inet_aton(const char *name, struct in_addr *addr);
int inet_aton(const char *name, struct in_addr *addr)
{
addr->s_addr = inet_addr(name);
@@ -288,16 +288,24 @@ static socket_udp *udp_init4(const char *addr, const char *iface,
memcpy(&(s->addr4), h->h_addr_list[0], sizeof(s->addr4));
}
if (iface != NULL) {
#ifdef HAVE_IF_NAMETOINDEX
if ((ifindex = if_nametoindex(iface)) == 0) {
debug_msg("Illegal interface specification\n");
free(s);
return NULL;
}
#else
fprintf(stderr, "Cannot set interface name, if_nametoindex not supported.\n");
#endif
} else {
ifindex = 0;
}
s->fd = socket(AF_INET, SOCK_DGRAM, 0);
#ifdef WIN32
if (s->fd == INVALID_SOCKET) {
#else
if (s->fd < 0) {
#endif
socket_error("Unable to initialize socket");
return NULL;
}
@@ -333,7 +341,9 @@ static socket_udp *udp_init4(const char *addr, const char *iface,
return NULL;
}
if (IN_MULTICAST(ntohl(s->addr4.s_addr))) {
#ifndef WIN32
char loop = 1;
#endif
struct ip_mreq imr;
imr.imr_multiaddr.s_addr = s->addr4.s_addr;
@@ -405,6 +415,24 @@ static inline int udp_send4(socket_udp * s, char *buffer, int buflen)
sizeof(s_in));
}
#ifdef WIN32
static inline int udp_sendv4(socket_udp * s, LPWSABUF vector, int count)
{
struct sockaddr_in s_in;
assert(s != NULL);
assert(s->mode == IPv4);
s_in.sin_family = AF_INET;
s_in.sin_addr.s_addr = s->addr4.s_addr;
s_in.sin_port = htons(s->tx_port);
DWORD bytesSent;
return WSASendTo(s->fd, vector, count, &bytesSent, 0,
(struct sockaddr *) &s_in,
sizeof(s_in), NULL, NULL);
}
#else
static inline int udp_sendv4(socket_udp * s, struct iovec *vector, int count)
{
struct msghdr msg;
@@ -428,6 +456,7 @@ static inline int udp_sendv4(socket_udp * s, struct iovec *vector, int count)
return sendmsg(s->fd, &msg, 0);
}
#endif // WIN32
static const char *udp_host_addr4(void)
{
@@ -566,11 +595,15 @@ static socket_udp *udp_init6(const char *addr, const char *iface,
int err;
if (iface != NULL) {
#ifdef HAVE_IF_NAMETOINDEX
if ((ifindex = if_nametoindex(iface)) == 0) {
debug_msg("Illegal interface specification\n");
free(s);
return NULL;
}
#else
fprintf(stderr, "Cannot set interface name under Win32.\n");
#endif
} else {
ifindex = 0;
}
@@ -595,7 +628,11 @@ static socket_udp *udp_init6(const char *addr, const char *iface,
freeaddrinfo(res0);
s->fd = socket(AF_INET6, SOCK_DGRAM, 0);
#ifdef WIN32
if (s->fd == INVALID_SOCKET) {
#else
if (s->fd < 0) {
#endif
socket_error("socket");
return NULL;
}
@@ -723,6 +760,18 @@ static int udp_send6(socket_udp * s, char *buffer, int buflen)
#endif
}
#ifdef WIN32
static int udp_sendv6(socket_udp * s, LPWSABUF vector, int count)
{
assert(s != NULL);
assert(s->mode == IPv6);
DWORD bytesSent;
return WSASendTo(s->fd, vector, count, &bytesSent, 0,
(struct sockaddr *) &s->sock6,
sizeof(s->sock6), NULL, NULL);
}
#else
static int udp_sendv6(socket_udp * s, struct iovec *vector, int count)
{
#ifdef HAVE_IPv6
@@ -746,6 +795,7 @@ static int udp_sendv6(socket_udp * s, struct iovec *vector, int count)
return -1;
#endif
}
#endif // WIN32
static const char *udp_host_addr6(socket_udp * s)
{
@@ -948,7 +998,11 @@ int udp_send(socket_udp * s, char *buffer, int buflen)
return -1;
}
#ifdef WIN32
int udp_sendv(socket_udp * s, LPWSABUF vector, int count)
#else
int udp_sendv(socket_udp * s, struct iovec *vector, int count)
#endif // WIN32
{
switch (s->mode) {
case IPv4:
@@ -1017,6 +1071,7 @@ int udp_recv(socket_udp * s, char *buffer, int buflen)
return udp_do_recv(s, buffer, buflen, 0);
}
#ifndef WIN32
int udp_recvv(socket_udp * s, struct msghdr *m)
{
if (recvmsg(s->fd, m, 0) == -1) {
@@ -1025,6 +1080,7 @@ int udp_recvv(socket_udp * s, struct msghdr *m)
}
return 0;
}
#endif // WIN32
/**
* udp_fd_set:

View File

@@ -36,6 +36,12 @@
* $Date: 2007/11/08 09:48:59 $
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#include "config_unix.h"
#include "config_win32.h"
#endif // HAVE_CONFIG_H
#ifndef _NET_UDP
#define _NET_UDP
@@ -55,7 +61,11 @@ int udp_recv(socket_udp *s, char *buffer, int buflen);
int udp_send(socket_udp *s, char *buffer, int buflen);
int udp_recvv(socket_udp *s, struct msghdr *m);
#ifdef WIN32
int udp_sendv(socket_udp *s, LPWSABUF vector, int count);
#else
int udp_sendv(socket_udp *s, struct iovec *vector, int count);
#endif
const char *udp_host_addr(socket_udp *s);
int udp_fd(socket_udp *s);

View File

@@ -348,7 +348,11 @@ pbuf_decode(struct pbuf *playout_buf, struct timeval curr_time,
curr = playout_buf->frst;
while (curr != NULL) {
if (!curr->decoded && tv_gt(curr_time, curr->playout_time)) {
if (!curr->decoded
#ifndef WIN32
&& tv_gt(curr_time, curr->playout_time)
#endif
) {
if (frame_complete(curr)) {
int ret = decode_func(curr->cdata, data);
curr->decoded = 1;

View File

@@ -73,6 +73,7 @@
#include "compat/gettimeofday.h"
#include "crypto/crypt_des.h"
#include "crypto/crypt_aes.h"
#include "compat/drand48.h"
#include "tv.h"
#include "crypto/md5.h"
#include "ntp.h"
@@ -899,7 +900,7 @@ static char *get_cname(socket_udp * s)
struct passwd *pwent;
#else
char *name;
int namelen;
DWORD namelen;
#endif
cname = (char *)malloc(MAXCNAMELEN + 1);
@@ -2527,7 +2528,11 @@ rtp_send_data_hdr(struct rtp *session,
uint8_t *buffer = NULL;
rtp_packet *packet = NULL;
uint8_t initVec[8] = { 0, 0, 0, 0, 0, 0, 0, 0 };
#ifdef WIN32
WSABUF send_vector[3];
#else
struct iovec send_vector[3];
#endif
int send_vector_len;
check_database(session);
@@ -2577,8 +2582,13 @@ rtp_send_data_hdr(struct rtp *session,
buffer = (uint8_t *) malloc(20 + RTP_PACKET_HEADER_SIZE);
packet = (rtp_packet *) buffer;
}
#ifdef WIN32
send_vector[0].buf = buffer + RTP_PACKET_HEADER_SIZE;
send_vector[0].len = buffer_len;
#else
send_vector[0].iov_base = buffer + RTP_PACKET_HEADER_SIZE;
send_vector[0].iov_len = buffer_len;
#endif
send_vector_len = 1;
/* These are internal pointers into the buffer... */
@@ -2628,14 +2638,24 @@ rtp_send_data_hdr(struct rtp *session,
}
/* ...the payload header... */
if (phdr != NULL) {
#ifdef WIN32
send_vector[send_vector_len].buf = phdr;
send_vector[send_vector_len].len = phdr_len;
#else
send_vector[send_vector_len].iov_base = phdr;
send_vector[send_vector_len].iov_len = phdr_len;
#endif
send_vector_len++;
}
/* ...and the media data... */
if (data_len > 0) {
#ifdef WIN32
send_vector[send_vector_len].buf = data;
send_vector[send_vector_len].len = data_len;
#else
send_vector[send_vector_len].iov_base = data;
send_vector[send_vector_len].iov_len = data_len;
#endif
send_vector_len++;
}
#ifdef NDEF /* FIXME */

View File

@@ -50,9 +50,13 @@
*
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#include "config_unix.h"
#include "config_win32.h"
#endif // HAVE_CONFIG_H
#include "crypto/random.h"
#include "debug.h"
#include "perf.h"
#include "audio/audio.h"
@@ -78,15 +82,19 @@ enum fec_scheme_t {
#define FEC_MAX_MULT 10
#if HAVE_MACOSX
#ifdef HAVE_MACOSX
#define GET_STARTTIME gettimeofday(&start, NULL)
#define GET_STOPTIME gettimeofday(&stop, NULL)
#define GET_DELTA delta = (stop.tv_usec - start.tv_usec) * 1000L
#else /* HAVE_MACOSX */
#elif defined HAVE_LINUX
#define GET_STARTTIME clock_gettime(CLOCK_REALTIME, &start)
#define GET_STOPTIME clock_gettime(CLOCK_REALTIME, &stop)
#define GET_DELTA delta = stop.tv_nsec - start.tv_nsec
#endif /* HAVE_MACOSX */
#else // Windows
#define GET_STARTTIME {QueryPerformanceFrequency(&freq); QueryPerformanceCounter(&start); }
#define GET_STOPTIME { QueryPerformanceCounter(&stop); }
#define GET_DELTA delta = (long)((double)(stop.QuadPart - start.QuadPart) * 1000 * 1000 * 1000 / freq.QuadPart);
#endif
static bool fec_is_ldgm(struct tx *tx);
@@ -162,37 +170,38 @@ struct tx *tx_init(unsigned mtu, char *fec)
tx->avg_len = tx->avg_len_last = tx->sent_frames = 0u;
tx->fec_scheme = FEC_NONE;
if (fec) {
char *save_ptr = NULL;
char *item;
char *fec_cfg = NULL;
if(strchr(fec, ':')) {
char *delim = strchr(fec, ':');
*delim = '\0';
fec_cfg = delim + 1;
}
item = strtok_r(fec, ":", &save_ptr);
if(strcasecmp(item, "none") == 0) {
if(strcasecmp(fec, "none") == 0) {
tx->fec_scheme = FEC_NONE;
} else if(strcasecmp(item, "mult") == 0) {
} else if(strcasecmp(fec, "mult") == 0) {
tx->fec_scheme = FEC_MULT;
item = strtok_r(NULL, ":", &save_ptr);
assert(item);
tx->mult_count = (unsigned int) atoi(item);
assert(fec_cfg);
tx->mult_count = (unsigned int) atoi(fec_cfg);
assert(tx->mult_count <= FEC_MAX_MULT);
} else if(strcasecmp(item, "LDGM") == 0) {
} else if(strcasecmp(fec, "LDGM") == 0) {
tx->fec_scheme = FEC_LDGM;
item = save_ptr;
if(item && strlen(item) > 0 && strchr(item, '%') == NULL) {
tx->fec_state = ldgm_encoder_init_with_cfg(item);
if(fec_cfg && strlen(fec_cfg) > 0 && strchr(fec_cfg, '%') == NULL) {
tx->fec_state = ldgm_encoder_init_with_cfg(fec_cfg);
if(tx->fec_state == NULL) {
fprintf(stderr, "Unable to initialize LDGM.\n");
free(tx);
return NULL;
}
} else { // delay creation until we have avarage frame size
if(item && strlen(item) > 0 && strchr(item, '%') != NULL) {
tx->max_loss = atof(item);
if(fec_cfg && strlen(fec_cfg) > 0 && strchr(fec_cfg, '%') != NULL) {
tx->max_loss = atof(fec_cfg);
} else {
tx->max_loss = 5.0;
}
}
} else {
fprintf(stderr, "Unknown FEC: %s\n", item);
fprintf(stderr, "Unknown FEC: %s\n", fec);
free(tx);
return NULL;
}
@@ -256,11 +265,13 @@ tx_send_base(struct tx *tx, struct tile *tile, struct rtp *rtp_session,
int pt = PT_VIDEO; /* A value specified in our packet format */
char *data;
unsigned int pos;
#if HAVE_MACOSX
struct timeval start, stop;
#else /* HAVE_MACOSX */
#ifdef HAVE_LINUX
struct timespec start, stop;
#endif /* HAVE_MACOSX */
#elif defined HAVE_MACOSX
struct timeval start, stop;
#else // Windows
LARGE_INTEGER start, stop, freq;
#endif
long delta;
uint32_t tmp;
unsigned int fps, fpsd, fd, fi;
@@ -420,11 +431,13 @@ void audio_tx_send(struct tx* tx, struct rtp *rtp_session, audio_frame * buffer)
// see definition in rtp_callback.h
audio_payload_hdr_t payload_hdr;
uint32_t timestamp;
#if HAVE_MACOSX
struct timeval start, stop;
#else /* HAVE_MACOSX */
#ifdef HAVE_LINUX
struct timespec start, stop;
#endif /* HAVE_MACOSX */
#elif defined HAVE_MACOSX
struct timeval start, stop;
#else // Windows
LARGE_INTEGER start, stop, freq;
#endif
long delta;
int mult_pos[FEC_MAX_MULT];
int mult_index = 0;

View File

@@ -45,13 +45,19 @@
*
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#include "config_unix.h"
#include "config_win32.h"
#endif // HAVE_CONFIG_H
#ifndef WIN32
#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
#include <unistd.h>
#include "config.h"
#include "config_unix.h"
#include "utils/fs_lock.h"
struct fs_lock {
@@ -91,3 +97,5 @@ void fs_lock_destroy(struct fs_lock *s)
free(s);
}
#endif // WIN32

View File

@@ -146,11 +146,15 @@ vidcap_aggregate_init(char *init_fmt, unsigned int flags)
while((item = strtok_r(tmp, "#", &save_ptr))) {
char *device;
char *config = strdup(item);
char *save_ptr_dev = NULL;
char *device_cfg;
char *device_cfg = NULL;
unsigned int dev_flags = 0u;
device = strtok_r(config, ":", &save_ptr_dev);
device_cfg = save_ptr_dev;
device = config;
if(strchr(config, ':')) {
char *delim = strchr(config, ':');
*delim = '\0';
device_cfg = delim + 1;
}
if(i == 0) {
dev_flags = flags;
} else { // do not grab from second and other devices

View File

@@ -67,11 +67,19 @@ extern "C" {
} // END of extern "C"
#endif
#ifdef WIN32
#include <objbase.h>
#endif
#ifdef HAVE_DECKLINK /* From config.h */
#include "video_capture/decklink.h"
#ifdef WIN32
#include "DeckLinkAPI_h.h" /* From DeckLink SDK */
#else
#include "DeckLinkAPI.h" /* From DeckLink SDK */
#endif
#include "DeckLinkAPIVersion.h" /* From DeckLink SDK */
#define FRAME_TIMEOUT 60000000 // 30000000 // in nanoseconds
@@ -80,10 +88,16 @@ extern "C" {
#ifdef HAVE_MACOSX
#define STRING CFStringRef
#elif defined WIN32
#define STRING BSTR
#else
#define STRING const char *
#endif
#ifndef WIN32
#define STDMETHODCALLTYPE
#endif
// static int device = 0; // use first BlackMagic device
// static int mode = 5; // for Intensity
// static int mode = 6; // for Decklink 6) HD 1080i 59.94; 1920 x 1080; 29.97 FPS 7) HD 1080i 60; 1920 x 1080; 30 FPS
@@ -354,8 +368,18 @@ static int blackmagic_api_version_check(STRING *current_version)
int ret = TRUE;
*current_version = NULL;
IDeckLinkAPIInformation *APIInformation = CreateDeckLinkAPIInformationInstance();
if(APIInformation == NULL) {
IDeckLinkAPIInformation *APIInformation = NULL;
#ifdef WIN32
HRESULT result;
result = CoCreateInstance(CLSID_CDeckLinkAPIInformation, NULL, CLSCTX_ALL,
IID_IDeckLinkAPIInformation, (void **) &APIInformation);
if(FAILED(result))
#else
APIInformation = CreateDeckLinkAPIInformationInstance();
if(APIInformation == NULL)
#endif
{
return FALSE;
}
int64_t value;
@@ -390,8 +414,14 @@ decklink_help()
printf("\t\t(You can ommit device index, mode and color space provided that your cards supports format autodetection.)\n");
// Create an IDeckLinkIterator object to enumerate all DeckLink cards in the system
#ifdef WIN32
result = CoCreateInstance(CLSID_CDeckLinkIterator, NULL, CLSCTX_ALL,
IID_IDeckLinkIterator, (void **) &deckLinkIterator);
if (FAILED(result))
#else
deckLinkIterator = CreateDeckLinkIteratorInstance();
if (deckLinkIterator == NULL)
#endif
{
fprintf(stderr, "\nA DeckLink iterator could not be created. The DeckLink drivers may not be installed or are outdated.\n");
fprintf(stderr, "This UltraGrid version was compiled with DeckLink drivers %s. You should have at least this version.\n\n",
@@ -410,6 +440,9 @@ decklink_help()
#ifdef HAVE_MACOSX
deviceNameCString = (char *) malloc(128);
CFStringGetCString(deviceNameString, (char *)deviceNameCString, 128, kCFStringEncodingMacRoman);
#elif defined WIN32
deviceNameCString = (char *) malloc(128);
wcstombs((char *) deviceNameCString, deviceNameString, 128);
#else
deviceNameCString = deviceNameString;
#endif
@@ -506,6 +539,7 @@ settings_init(void *state, char *fmt)
}
if(fmt) {
char *save_ptr_top = NULL;
if(strcmp(fmt, "help") == 0) {
decklink_help();
return 0;
@@ -514,7 +548,7 @@ settings_init(void *state, char *fmt)
char *tmp;
// choose device
tmp = strtok(fmt, ":");
tmp = strtok_r(fmt, ":", &save_ptr_top);
if(!tmp) {
fprintf(stderr, "Wrong config %s\n", fmt);
return 0;
@@ -533,11 +567,11 @@ settings_init(void *state, char *fmt)
}
// choose mode
tmp = strtok(NULL, ":");
tmp = strtok_r(NULL, ":", &save_ptr_top);
if(tmp) {
s->mode = atoi(tmp);
tmp = strtok(NULL, ":");
tmp = strtok_r(NULL, ":", &save_ptr_top);
s->c_info = 0;
if(!tmp) {
int i;
@@ -560,7 +594,7 @@ settings_init(void *state, char *fmt)
return 0;
}
}
while((tmp = strtok(NULL, ":"))) {
while((tmp = strtok_r(NULL, ":", &save_ptr_top))) {
if(strcasecmp(tmp, "3D") == 0) {
s->stereo = TRUE;
} else if(strcasecmp(tmp, "timecode") == 0) {
@@ -675,6 +709,9 @@ static HRESULT set_display_mode_properties(struct vidcap_decklink_state *s, stru
#ifdef HAVE_MACOSX
displayModeCString = (char *) malloc(128);
CFStringGetCString(displayModeString, (char *) displayModeCString, 128, kCFStringEncodingMacRoman);
#elif defined WIN32
displayModeCString = (char *) malloc(128);
wcstombs((char *) displayModeCString, displayModeString, 128);
#else
displayModeCString = displayModeString;
#endif
@@ -717,10 +754,21 @@ vidcap_decklink_init(char *fmt, unsigned int flags)
IDeckLinkConfiguration* deckLinkConfiguration = NULL;
BMDAudioConnection audioConnection;
#ifdef WIN32
// Initialize COM on this thread
result = CoInitialize(NULL);
if(FAILED(result)) {
fprintf(stderr, "Initialization of COM failed - result = "
"08x.\n", result);
return NULL;
}
#endif
STRING current_version;
if(!blackmagic_api_version_check(&current_version)) {
fprintf(stderr, "\nThe DeckLink drivers may not be installed or are outdated.\n");
fprintf(stderr, "This UltraGrid version was compiled against DeckLink drivers %s. You should have at least this version.\n\n",
fprintf(stderr, "\nThe DeckLink drivers may not be installed or are outdated.\n");
fprintf(stderr, "This UltraGrid version was compiled against DeckLink drivers %s. You should have at least this version.\n\n",
BLACKMAGIC_DECKLINK_API_VERSION_STRING);
fprintf(stderr, "Vendor download page is http://http://www.blackmagic-design.com/support/ \n");
if(current_version) {
@@ -728,6 +776,9 @@ vidcap_decklink_init(char *fmt, unsigned int flags)
#ifdef HAVE_MACOSX
currentVersionCString = (char *) malloc(128);
CFStringGetCString(current_version, (char *) currentVersionCString, 128, kCFStringEncodingMacRoman);
#elif defined WIN32
currentVersionCString = (char *) malloc(128);
wcstombs((char *) currentVersionCString, current_version, 128);
#else
currentVersionCString = current_version;
#endif
@@ -739,7 +790,7 @@ vidcap_decklink_init(char *fmt, unsigned int flags)
} else {
fprintf(stderr, "No installed drivers detected\n");
}
fprintf(stderr, "\n");
fprintf(stderr, "\n");
return NULL;
}
@@ -756,7 +807,7 @@ vidcap_decklink_init(char *fmt, unsigned int flags)
s->stereo = FALSE;
s->use_timecode = FALSE;
s->autodetect_mode = FALSE;
s->connection = 0;
s->connection = (BMDVideoConnection) 0;
s->flags = 0;
// SET UP device and mode
@@ -812,8 +863,14 @@ vidcap_decklink_init(char *fmt, unsigned int flags)
dnum = 0;
deckLink = NULL;
// Create an IDeckLinkIterator object to enumerate all DeckLink cards in the system
deckLinkIterator = CreateDeckLinkIteratorInstance();
#ifdef WIN32
result = CoCreateInstance(CLSID_CDeckLinkIterator, NULL, CLSCTX_ALL,
IID_IDeckLinkIterator, (void **) &deckLinkIterator);
if (FAILED(result))
#else
deckLinkIterator = CreateDeckLinkIteratorInstance();
if (deckLinkIterator == NULL)
#endif
{
fprintf(stderr, "\nA DeckLink iterator could not be created. The DeckLink drivers may not be installed or are outdated.\n");
fprintf(stderr, "This UltraGrid version was compiled with DeckLink drivers %s. You should have at least this version.\n\n",
@@ -847,6 +904,9 @@ vidcap_decklink_init(char *fmt, unsigned int flags)
#ifdef HAVE_MACOSX
deviceNameCString = (char *) malloc(128);
CFStringGetCString(deviceNameString, (char *) deviceNameCString, 128, kCFStringEncodingMacRoman);
#elif defined WIN32
deviceNameCString = (char *) malloc(128);
wcstombs((char *) deviceNameCString, deviceNameString, 128);
#else
deviceNameCString = deviceNameString;
#endif
@@ -908,7 +968,11 @@ vidcap_decklink_init(char *fmt, unsigned int flags)
}
if(s->autodetect_mode) {
#ifdef WIN32
BOOL autodetection;
#else
bool autodetection;
#endif
if(deckLinkAttributes->GetFlag(BMDDeckLinkSupportsInputFormatDetection, &autodetection) != S_OK) {
fprintf(stderr, "[DeckLink] Could not verify if device supports autodetection.\n");
goto error;
@@ -1354,6 +1418,9 @@ print_output_modes (IDeckLink* deckLink)
#ifdef HAVE_MACOSX
displayModeCString = (char *) malloc(128);
CFStringGetCString(displayModeString, (char *) displayModeCString, 128, kCFStringEncodingMacRoman);
#elif defined WIN32
displayModeCString = (char *) malloc(128);
wcstombs((char *) displayModeCString, displayModeString, 128);
#else
displayModeCString = displayModeString;
#endif

View File

@@ -669,8 +669,8 @@ void vc_copylineRGB(unsigned char *dst, const unsigned char *src, int dst_len, i
void vc_copylineRGBAtoRGB(unsigned char *dst2, const unsigned char *src2, int dst_len)
{
register uint32_t * src = src2;
register uint32_t * dst = dst2;
register const uint32_t * src = (const uint32_t *) src2;
register uint32_t * dst = (uint32_t *) dst2;
while(dst_len > 0) {
register uint32_t in1 = *src++;
register uint32_t in2 = *src++;
@@ -686,8 +686,8 @@ void vc_copylineRGBAtoRGB(unsigned char *dst2, const unsigned char *src2, int ds
void vc_copylineRGBAtoRGBwithShift(unsigned char *dst2, const unsigned char *src2, int dst_len, int rshift, int gshift, int bshift)
{
register uint32_t * src = src2;
register uint32_t * dst = dst2;
register const uint32_t * src = (const uint32_t *) src2;
register uint32_t * dst = (uint32_t *) dst2;
while(dst_len > 0) {
register uint32_t in1 = *src++;
register uint32_t in2 = *src++;
@@ -713,8 +713,8 @@ void vc_copylineRGBAtoRGBwithShift(unsigned char *dst2, const unsigned char *src
void vc_copylineABGRtoRGB(unsigned char *dst2, const unsigned char *src2, int dst_len)
{
register uint32_t * src = src2;
register uint32_t * dst = dst2;
register const uint32_t * src = (const uint32_t *) src2;
register uint32_t * dst = (uint32_t *) dst2;
while(dst_len > 0) {
register uint32_t in1 = *src++;
register uint32_t in2 = *src++;

View File

@@ -44,9 +44,13 @@
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#include "config_unix.h"
#include "config_win32.h"
#endif // HAVE_CONFIG_H
#include "host.h"
#include "config.h"
#include "debug.h"
#include "fastdxt.h"
#include <pthread.h>
@@ -225,9 +229,9 @@ static int reconfigure_compress(struct video_compress *compress, int width,
*
* see: http://www.mythtv.org/pipermail/mythtv-dev/2006-January/044309.html
*/
compress->output_data = (unsigned char *)memalign(16, width * compress->dxt_height * 4);
compress->output_data = (unsigned char *)aligned_malloc(width * compress->dxt_height * 4, 16);
for(i = 0; i < 2; ++i) {
compress->tile[i]->data = (char *)memalign(16, width * compress->dxt_height * 4);
compress->tile[i]->data = (char *)aligned_malloc(width * compress->dxt_height * 4, 16);
}
#endif /* HAVE_MACOSX */
memset(compress->output_data, 0, width * compress->dxt_height * 4);
@@ -361,7 +365,7 @@ struct video_frame * fastdxt_compress(void *args, struct video_frame *tx, int bu
platform_sem_wait(&compress->thread_done[x]);
}
out_tile->data_len = out_tile->width * compress->dxt_height / 2;
out_tile->data_len = tx->tiles[0].width * compress->dxt_height / 2;
pthread_mutex_unlock(&(compress->lock));
@@ -450,6 +454,12 @@ void fastdxt_done(void *args)
for (x = 0; x < compress->num_threads; ++x)
free(compress->buffer[x]);
aligned_free(compress->output_data);
for(x = 0; x < 2; ++x) {
aligned_free(compress->tile[x]->data);
}
free(compress);

View File

@@ -144,11 +144,14 @@ void *display_aggregate_init(char *fmt, unsigned int flags)
while((item = strtok_r(tmp, "#", &save_ptr))) {
char *device;
char *config = strdup(item);
char *save_ptr_dev = NULL;
char *device_cfg;
char *device_cfg = NULL;
unsigned int dev_flags = 0u;
device = strtok_r(config, ":", &save_ptr_dev);
device_cfg = save_ptr_dev;
device = config;
if(strchr(config, ':')) {
char *delim = strchr(config, ':');
*delim = '\0';
device_cfg = delim + 1;
}
if(i == 0) {
dev_flags = flags;
} else { // push audio only to first device

View File

@@ -49,6 +49,13 @@
*
*
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#include "config_unix.h"
#include "config_win32.h"
#endif // HAVE_CONFIG_H
#define MODULE_NAME "[Decklink display] "
#ifdef __cplusplus
@@ -57,9 +64,6 @@ extern "C" {
#include "host.h"
#include "debug.h"
#include "config.h"
#include "config_unix.h"
#include "config_win32.h"
#include "video_codec.h"
#include "tv.h"
#include "video_display/decklink.h"
@@ -68,19 +72,33 @@ extern "C" {
#include "audio/audio.h"
#include "audio/utils.h"
#ifdef WIN32
#include "DeckLinkAPI_h.h"
#else
#include "DeckLinkAPI.h"
#endif
#include "DeckLinkAPIVersion.h"
#ifdef __cplusplus
} // END of extern "C"
#endif
#ifdef WIN32
#include <objbase.h>
#endif
#ifdef HAVE_MACOSX
#define STRING CFStringRef
#elif WIN32
#define STRING BSTR
#else
#define STRING const char *
#endif
#ifndef WIN32
#define STDMETHODCALLTYPE
#endif
enum link {
LINK_UNSPECIFIED,
LINK_3G,
@@ -103,12 +121,19 @@ public:
PlaybackDelegate (struct state_decklink* owner, int index);
// IUnknown needs only a dummy implementation
virtual HRESULT QueryInterface (REFIID iid, LPVOID *ppv) {return E_NOINTERFACE;}
virtual ULONG AddRef () {return 1;}
virtual ULONG Release () {return 1;}
virtual HRESULT STDMETHODCALLTYPE QueryInterface (REFIID iid, LPVOID *ppv) {return E_NOINTERFACE;}
virtual ULONG STDMETHODCALLTYPE AddRef () {return 1;}
virtual ULONG STDMETHODCALLTYPE Release () {return 1;}
virtual HRESULT ScheduledFrameCompleted (IDeckLinkVideoFrame* completedFrame, BMDOutputFrameCompletionResult result);
virtual HRESULT ScheduledPlaybackHasStopped ();
virtual HRESULT STDMETHODCALLTYPE ScheduledFrameCompleted (IDeckLinkVideoFrame* completedFrame, BMDOutputFrameCompletionResult result)
{
completedFrame->Release();
return S_OK;
}
virtual HRESULT STDMETHODCALLTYPE ScheduledPlaybackHasStopped (){
return S_OK;
}
//virtual HRESULT RenderAudioSamples (bool preroll);
};
@@ -118,24 +143,24 @@ class DeckLinkTimecode : public IDeckLinkTimecode{
public:
DeckLinkTimecode() : timecode(0) {}
/* IDeckLinkTimecode */
virtual BMDTimecodeBCD GetBCD (void) { return timecode; }
virtual HRESULT GetComponents (/* out */ uint8_t *hours, /* out */ uint8_t *minutes, /* out */ uint8_t *seconds, /* out */ uint8_t *frames) {
virtual BMDTimecodeBCD STDMETHODCALLTYPE GetBCD (void) { return timecode; }
virtual HRESULT STDMETHODCALLTYPE GetComponents (/* out */ uint8_t *hours, /* out */ uint8_t *minutes, /* out */ uint8_t *seconds, /* out */ uint8_t *frames) {
*frames = (timecode & 0xf) + ((timecode & 0xf0) >> 4) * 10;
*seconds = ((timecode & 0xf00) >> 8) + ((timecode & 0xf000) >> 12) * 10;
*minutes = ((timecode & 0xf0000) >> 16) + ((timecode & 0xf00000) >> 20) * 10;
*hours = ((timecode & 0xf000000) >> 24) + ((timecode & 0xf0000000) >> 28) * 10;
return S_OK;
}
virtual HRESULT GetString (/* out */ STRING *timecode) { return E_FAIL; }
virtual BMDTimecodeFlags GetFlags (void) { return bmdTimecodeFlagDefault; }
virtual HRESULT GetTimecodeUserBits (/* out */ BMDTimecodeUserBits *userBits) { if (!userBits) return E_POINTER; else return S_OK; }
virtual HRESULT STDMETHODCALLTYPE GetString (/* out */ STRING *timecode) { return E_FAIL; }
virtual BMDTimecodeFlags STDMETHODCALLTYPE GetFlags (void) { return bmdTimecodeFlagDefault; }
virtual HRESULT STDMETHODCALLTYPE GetTimecodeUserBits (/* out */ BMDTimecodeUserBits *userBits) { if (!userBits) return E_POINTER; else return S_OK; }
/* IUnknown */
virtual HRESULT QueryInterface (REFIID iid, LPVOID *ppv) {return E_NOINTERFACE;}
virtual ULONG AddRef () {return 1;}
virtual ULONG Release () {return 1;}
virtual HRESULT STDMETHODCALLTYPE QueryInterface (REFIID iid, LPVOID *ppv) {return E_NOINTERFACE;}
virtual ULONG STDMETHODCALLTYPE AddRef () {return 1;}
virtual ULONG STDMETHODCALLTYPE Release () {return 1;}
void SetBCD(BMDTimecodeBCD timecode) { this->timecode = timecode; }
void STDMETHODCALLTYPE SetBCD(BMDTimecodeBCD timecode) { this->timecode = timecode; }
};
class DeckLinkFrame;
@@ -158,28 +183,28 @@ class DeckLinkFrame : public IDeckLinkMutableVideoFrame
public:
static DeckLinkFrame *Create(long width, long height, long rawBytes, BMDPixelFormat pixelFormat);
/* IUnknown */
virtual HRESULT QueryInterface(REFIID, void**);
virtual ULONG AddRef();
virtual ULONG Release();
virtual HRESULT STDMETHODCALLTYPE QueryInterface(REFIID, void**);
virtual ULONG STDMETHODCALLTYPE AddRef();
virtual ULONG STDMETHODCALLTYPE Release();
/* IDeckLinkVideoFrame */
long GetWidth (void);
long GetHeight (void);
long GetRowBytes (void);
BMDPixelFormat GetPixelFormat (void);
BMDFrameFlags GetFlags (void);
HRESULT GetBytes (/* out */ void **buffer);
long STDMETHODCALLTYPE GetWidth (void);
long STDMETHODCALLTYPE GetHeight (void);
long STDMETHODCALLTYPE GetRowBytes (void);
BMDPixelFormat STDMETHODCALLTYPE GetPixelFormat (void);
BMDFrameFlags STDMETHODCALLTYPE GetFlags (void);
HRESULT STDMETHODCALLTYPE GetBytes (/* out */ void **buffer);
HRESULT GetTimecode (/* in */ BMDTimecodeFormat format, /* out */ IDeckLinkTimecode **timecode);
HRESULT GetAncillaryData (/* out */ IDeckLinkVideoFrameAncillary **ancillary);
HRESULT STDMETHODCALLTYPE GetTimecode (/* in */ BMDTimecodeFormat format, /* out */ IDeckLinkTimecode **timecode);
HRESULT STDMETHODCALLTYPE GetAncillaryData (/* out */ IDeckLinkVideoFrameAncillary **ancillary);
/* IDeckLinkMutableVideoFrame */
HRESULT SetFlags(BMDFrameFlags);
HRESULT SetTimecode(BMDTimecodeFormat, IDeckLinkTimecode*);
HRESULT SetTimecodeFromComponents(BMDTimecodeFormat, uint8_t, uint8_t, uint8_t, uint8_t, BMDTimecodeFlags);
HRESULT SetAncillaryData(IDeckLinkVideoFrameAncillary*);
HRESULT SetTimecodeUserBits(BMDTimecodeFormat, BMDTimecodeUserBits);
HRESULT STDMETHODCALLTYPE SetFlags(BMDFrameFlags);
HRESULT STDMETHODCALLTYPE SetTimecode(BMDTimecodeFormat, IDeckLinkTimecode*);
HRESULT STDMETHODCALLTYPE SetTimecodeFromComponents(BMDTimecodeFormat, uint8_t, uint8_t, uint8_t, uint8_t, BMDTimecodeFlags);
HRESULT STDMETHODCALLTYPE SetAncillaryData(IDeckLinkVideoFrameAncillary*);
HRESULT STDMETHODCALLTYPE SetTimecodeUserBits(BMDTimecodeFormat, BMDTimecodeUserBits);
};
class DeckLink3DFrame : public DeckLinkFrame, public IDeckLinkVideoFrame3DExtensions
@@ -200,13 +225,13 @@ class DeckLink3DFrame : public DeckLinkFrame, public IDeckLinkVideoFrame3DExtens
static DeckLink3DFrame *Create(long width, long height, long rawBytes, BMDPixelFormat pixelFormat);
/* IUnknown */
HRESULT QueryInterface(REFIID, void**);
ULONG AddRef();
ULONG Release();
HRESULT STDMETHODCALLTYPE QueryInterface(REFIID, void**);
ULONG STDMETHODCALLTYPE AddRef();
ULONG STDMETHODCALLTYPE Release();
/* IDeckLinkVideoFrame3DExtensions */
BMDVideo3DPackingFormat Get3DPackingFormat();
HRESULT GetFrameForRightEye(IDeckLinkVideoFrame**);
BMDVideo3DPackingFormat STDMETHODCALLTYPE Get3DPackingFormat();
HRESULT STDMETHODCALLTYPE GetFrameForRightEye(IDeckLinkVideoFrame**);
};
#define DECKLINK_MAGIC DISPLAY_DECKLINK_ID
@@ -267,8 +292,14 @@ static void show_help(void)
printf("\t-d decklink:<device_number(s)>[:timecode][:3G|:dual-link][:3D[:HDMI3DPacking=<packing>]][:fast]\n");
printf("\t\tcoma-separated numbers of output devices\n");
// Create an IDeckLinkIterator object to enumerate all DeckLink cards in the system
#ifdef WIN32
result = CoCreateInstance(CLSID_CDeckLinkIterator, NULL, CLSCTX_ALL,
IID_IDeckLinkIterator, (void **) &deckLinkIterator);
if (FAILED(result))
#else
deckLinkIterator = CreateDeckLinkIteratorInstance();
if (deckLinkIterator == NULL)
#endif
{
fprintf(stderr, "\nA DeckLink iterator could not be created. The DeckLink drivers may not be installed or are outdated.\n");
fprintf(stderr, "This UltraGrid version was compiled with DeckLink drivers %s. You should have at least this version.\n\n",
@@ -287,6 +318,9 @@ static void show_help(void)
#ifdef HAVE_MACOSX
deviceNameCString = (char *) malloc(128);
CFStringGetCString(deviceNameString, (char *) deviceNameCString, 128, kCFStringEncodingMacRoman);
#elif WIN32
deviceNameCString = (char *) malloc(128);
wcstombs((char *) deviceNameCString, deviceNameString, 128);
#else
deviceNameCString = deviceNameString;
#endif
@@ -421,8 +455,11 @@ int display_decklink_putf(void *state, struct video_frame *frame)
gettimeofday(&tv, NULL);
#ifdef WIN32
long unsigned int i;
#else
uint32_t i;
#endif
s->state[0].deckLinkOutput->GetBufferedVideoFrameCount(&i);
//if (i > 2)
if (0)
@@ -430,7 +467,8 @@ int display_decklink_putf(void *state, struct video_frame *frame)
else {
for (int j = 0; j < s->devices_cnt; ++j) {
if(s->emit_timecode) {
s->state[j].deckLinkFrame->SetTimecode(bmdVideoOutputRP188, s->timecode);
s->state[j].deckLinkFrame->SetTimecode(
bmdTimecodeRP188Any, s->timecode);
}
#ifdef DECKLINK_LOW_LATENCY
@@ -489,6 +527,9 @@ static BMDDisplayMode get_mode(IDeckLinkOutput *deckLinkOutput, struct video_des
#ifdef HAVE_MACOSX
modeNameCString = (char *) malloc(128);
CFStringGetCString(modeNameString, (char *) modeNameCString, 128, kCFStringEncodingMacRoman);
#elif defined WIN32
modeNameCString = (char *) malloc(128);
wcstombs((char *) modeNameCString, modeNameString, 128);
#else
modeNameCString = modeNameString;
#endif
@@ -656,9 +697,17 @@ static int blackmagic_api_version_check(STRING *current_version)
{
int ret = TRUE;
*current_version = NULL;
IDeckLinkAPIInformation *APIInformation = NULL;
HRESULT result;
IDeckLinkAPIInformation *APIInformation = CreateDeckLinkAPIInformationInstance();
#ifdef WIN32
result = CoCreateInstance(CLSID_CDeckLinkAPIInformation, NULL, CLSCTX_ALL,
IID_IDeckLinkAPIInformation, (void **) &APIInformation);
if(FAILED(result)) {
#else
APIInformation = CreateDeckLinkAPIInformationInstance();
if(APIInformation == NULL) {
#endif
return FALSE;
}
int64_t value;
@@ -689,8 +738,18 @@ void *display_decklink_init(char *fmt, unsigned int flags)
int dnum = 0;
IDeckLinkConfiguration* deckLinkConfiguration = NULL;
// for Decklink Studio which has switchable XLR - analog 3 and 4 or AES/EBU 3,4 and 5,6
BMDAudioOutputAnalogAESSwitch audioConnection = 0;
BMDVideo3DPackingFormat HDMI3DPacking = 0;
BMDAudioOutputAnalogAESSwitch audioConnection = (BMDAudioOutputAnalogAESSwitch) 0;
BMDVideo3DPackingFormat HDMI3DPacking = (BMDVideo3DPackingFormat) 0;
#ifndef WIN32
// Initialize COM on this thread
if(FAILED(result)) {
fprintf(stderr, "Initialize of COM failed - result = "
"08x.\n", result);
return NULL;
}
#endif // WIN32
STRING current_version;
if(!blackmagic_api_version_check(&current_version)) {
@@ -703,6 +762,9 @@ void *display_decklink_init(char *fmt, unsigned int flags)
#ifdef HAVE_MACOSX
currentVersionCString = (char *) malloc(128);
CFStringGetCString(current_version, (char *) currentVersionCString, 128, kCFStringEncodingMacRoman);
#elif defined WIN32
currentVersionCString = (char *) malloc(128);
wcstombs((char *) currentVersionCString, current_version, 128);
#else
currentVersionCString = current_version;
#endif
@@ -789,8 +851,14 @@ void *display_decklink_init(char *fmt, unsigned int flags)
gettimeofday(&s->tv, NULL);
// Initialize the DeckLink API
#ifdef WIN32
result = CoCreateInstance(CLSID_CDeckLinkIterator, NULL, CLSCTX_ALL,
IID_IDeckLinkIterator, (void **) &deckLinkIterator);
if (FAILED(result))
#else
deckLinkIterator = CreateDeckLinkIteratorInstance();
if (!deckLinkIterator)
#endif
{
fprintf(stderr, "\nA DeckLink iterator could not be created. The DeckLink drivers may not be installed or are outdated.\n");
fprintf(stderr, "This UltraGrid version was compiled with DeckLink drivers %s. You should have at least this version.\n\n",
@@ -832,7 +900,7 @@ void *display_decklink_init(char *fmt, unsigned int flags)
s->play_audio = TRUE;
switch(flags & (DISPLAY_FLAG_AUDIO_EMBEDDED | DISPLAY_FLAG_AUDIO_AESEBU | DISPLAY_FLAG_AUDIO_ANALOG)) {
case DISPLAY_FLAG_AUDIO_EMBEDDED:
audioConnection = 0;
audioConnection = (BMDAudioOutputAnalogAESSwitch) 0;
break;
case DISPLAY_FLAG_AUDIO_AESEBU:
audioConnection = bmdAudioOutputSwitchAESEBU;
@@ -1078,17 +1146,6 @@ PlaybackDelegate::PlaybackDelegate (struct state_decklink * owner, int index)
{
}
HRESULT PlaybackDelegate::ScheduledFrameCompleted (IDeckLinkVideoFrame* completedFrame, BMDOutputFrameCompletionResult result)
{
completedFrame->Release();
return S_OK;
}
HRESULT PlaybackDelegate::ScheduledPlaybackHasStopped ()
{
return S_OK;
}
/*
* AUDIO
*/
@@ -1106,7 +1163,11 @@ void display_decklink_put_audio_frame(void *state, struct audio_frame *frame)
struct state_decklink *s = (struct state_decklink *)state;
unsigned int sampleFrameCount = s->audio.data_len / (s->audio.bps *
s->audio.ch_count);
#ifdef WIN32
unsigned long int sampleFramesWritten;
#else
unsigned int sampleFramesWritten;
#endif
/* we got probably count that cannot be played directly (probably 1) */
if(s->output_audio_channel_count != s->audio.ch_count) {
@@ -1190,6 +1251,7 @@ int display_decklink_reconfigure_audio(void *state, int quant_samples, int chann
return TRUE;
}
#ifndef WIN32
bool operator==(const REFIID & first, const REFIID & second){
return (first.byte0 == second.byte0) &&
(first.byte1 == second.byte1) &&
@@ -1208,6 +1270,7 @@ bool operator==(const REFIID & first, const REFIID & second){
(first.byte14 == second.byte14) &&
(first.byte15 == second.byte15);
}
#endif
HRESULT DeckLinkFrame::QueryInterface(REFIID id, void**frame)
{

View File

@@ -59,7 +59,7 @@
#include <OpenGL/OpenGL.h> // CGL
#include <OpenGL/glext.h>
#include <GLUT/glut.h>
#else /* HAVE_MACOSX */
#elif defined HAVE_LINUX
#include <GL/glew.h>
#include <GL/gl.h>
#include <GL/glx.h>
@@ -68,8 +68,12 @@
#ifdef FREEGLUT
#include <GL/freeglut_ext.h>
#endif /* FREEGLUT */
#else // wihdows
#include <GL/glew.h>
#include <GL/glut.h>
#endif /* HAVE_MACOSX */
#include <signal.h>
#include <assert.h>
#include <pthread.h>
@@ -284,7 +288,7 @@ static void gl_check_error()
void * display_gl_init(char *fmt, unsigned int flags) {
UNUSED(flags);
struct state_gl *s;
#ifdef HAVE_LINUX
#if defined HAVE_LINUX || defined WIN32
GLenum err;
#endif // HAVE_LINUX
@@ -356,7 +360,7 @@ void * display_gl_init(char *fmt, unsigned int flags) {
char *tmp, *gl_ver_major;
char *save_ptr = NULL;
#ifndef HAVE_MACOSX
#ifdef HAVE_LINUX
x11_enter_thread();
#endif
@@ -369,7 +373,7 @@ void * display_gl_init(char *fmt, unsigned int flags) {
NSApplicationLoad();
#endif
#ifndef HAVE_MACOSX
#ifdef HAVE_LINUX
glutSetOption(GLUT_ACTION_ON_WINDOW_CLOSE, GLUT_ACTION_CONTINUE_EXECUTION);
#endif
glutIdleFunc(glut_idle_callback);
@@ -380,7 +384,7 @@ void * display_gl_init(char *fmt, unsigned int flags) {
glutDisplayFunc(glutSwapBuffers);
#ifdef HAVE_MACOSX
glutWMCloseFunc(glut_close_callback);
#else
#elif HAVE_LINUX
glutCloseFunc(glut_close_callback);
#endif
glutReshapeFunc(gl_resize);
@@ -396,12 +400,12 @@ void * display_gl_init(char *fmt, unsigned int flags) {
}
free(tmp);
#ifdef HAVE_LINUX
#if defined HAVE_LINUX || defined WIN32
err = glewInit();
if (GLEW_OK != err)
{
/* Problem: glewInit failed, something is seriously wrong. */
fprintf(stderr, "GLEW Error: %s\n", glewGetErrorString(err));
fprintf(stderr, "GLEW Error: %d\n", err);
goto error;
}
#endif /* HAVE_LINUX */
@@ -612,7 +616,7 @@ static void display_gl_enable_sync_on_vblank() {
int swap_interval = 1;
CGLContextObj cgl_context = CGLGetCurrentContext();
CGLSetParameter(cgl_context, kCGLCPSwapInterval, &swap_interval);
#else
#elif HAVE_LINUX
/* using GLX_SGI_swap_control
*
* Also it is worth considering to use GLX_EXT_swap_control (instead?).
@@ -840,7 +844,12 @@ static void glut_key_callback(unsigned char key, int x, int y)
glut_resize_window(gl);
break;
case 'q':
#ifdef WIN32
glutDestroyWindow(gl->window);
exit(1);
#else
exit_uv(0);
#endif
break;
case 'd':
gl->deinterlace = gl->deinterlace ? FALSE : TRUE;
@@ -853,6 +862,9 @@ void display_gl_run(void *arg)
{
UNUSED(arg);
#ifdef WIN32
glutMainLoop();
#else
while(!should_exit_main_loop) {
glut_idle_callback();
#ifndef HAVE_MACOSX
@@ -861,6 +873,7 @@ void display_gl_run(void *arg)
glutCheckLoop();
#endif
}
#endif
}
@@ -1114,10 +1127,9 @@ int display_gl_putf(void *state, struct video_frame *frame)
s->image_display = (s->image_display + 1) % 2;
}
/* ...and signal the worker */
pthread_mutex_lock(&s->lock);
s->new_frame = TRUE;
s->new_frame = 1;
pthread_mutex_unlock(&s->lock);
return 0;
}

View File

@@ -316,5 +316,6 @@ void vo_postprocess_get_out_desc(struct vo_postprocess_state *s, struct video_de
bool vo_postprocess_get_property(struct vo_postprocess_state *s, int property, void *val, size_t *len)
{
if(s) return s->handle->get_property(s, property, val, len);
else return false;
}