parent
94b2219209
commit
50dfb43596
|
@ -2,3 +2,20 @@ Debug
|
|||
*.user
|
||||
*.suo
|
||||
*.ncb
|
||||
/bindings/csharp/Release
|
||||
/tinyDAV/Release
|
||||
/tinySIGCOMP/Release
|
||||
/tinyBFCP/Release
|
||||
/tinyMSRP/Release
|
||||
/tinyHTTP/Release
|
||||
/tinyMEDIA/Release
|
||||
/tinyNET/Release
|
||||
/tinySAK/Release
|
||||
/plugins/pluginWinMF/Release
|
||||
/tinySIP/Release
|
||||
/tinySMS/Release
|
||||
/tinyIPSec/Release
|
||||
/tinySDP/Release
|
||||
/tinyRTP/Release
|
||||
/tinyXCAP/Release
|
||||
*.orig
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
./thirdparties/win32/tools/AStyle.exe --style=k/r --lineend=linux --mode=c --add-brackets --break-closing-brackets --recursive "*.c" "*.cxx" "*.h" "*.cc"
|
|
@ -33,8 +33,7 @@ IPSecCtx::IPSecCtx(tipsec_ipproto_t ipproto,
|
|||
: m_pCtx(NULL)
|
||||
{
|
||||
tipsec_ctx_t* pCtx = NULL;
|
||||
if (!IPSecCtx::sInitialized)
|
||||
{
|
||||
if (!IPSecCtx::sInitialized) {
|
||||
assert (tipsec_plugin_register_static(plugin_win_ipsec_vista_plugin_def_t) == 0);
|
||||
IPSecCtx::sInitialized = true;
|
||||
}
|
||||
|
|
|
@ -14,23 +14,42 @@
|
|||
|
||||
#ifdef __cplusplus
|
||||
/* SwigValueWrapper is described in swig.swg */
|
||||
template<typename T> class SwigValueWrapper {
|
||||
template<typename T> class SwigValueWrapper
|
||||
{
|
||||
struct SwigMovePointer {
|
||||
T *ptr;
|
||||
SwigMovePointer(T *p) : ptr(p) { }
|
||||
~SwigMovePointer() { delete ptr; }
|
||||
SwigMovePointer& operator=(SwigMovePointer& rhs) { T* oldptr = ptr; ptr = 0; delete oldptr; ptr = rhs.ptr; rhs.ptr = 0; return *this; }
|
||||
~SwigMovePointer() {
|
||||
delete ptr;
|
||||
}
|
||||
SwigMovePointer& operator=(SwigMovePointer& rhs) {
|
||||
T* oldptr = ptr;
|
||||
ptr = 0;
|
||||
delete oldptr;
|
||||
ptr = rhs.ptr;
|
||||
rhs.ptr = 0;
|
||||
return *this;
|
||||
}
|
||||
} pointer;
|
||||
SwigValueWrapper& operator=(const SwigValueWrapper<T>& rhs);
|
||||
SwigValueWrapper(const SwigValueWrapper<T>& rhs);
|
||||
public:
|
||||
SwigValueWrapper() : pointer(0) { }
|
||||
SwigValueWrapper& operator=(const T& t) { SwigMovePointer tmp(new T(t)); pointer = tmp; return *this; }
|
||||
operator T&() const { return *pointer.ptr; }
|
||||
T *operator&() { return pointer.ptr; }
|
||||
SwigValueWrapper& operator=(const T& t) {
|
||||
SwigMovePointer tmp(new T(t));
|
||||
pointer = tmp;
|
||||
return *this;
|
||||
}
|
||||
operator T&() const {
|
||||
return *pointer.ptr;
|
||||
}
|
||||
T *operator&() {
|
||||
return pointer.ptr;
|
||||
}
|
||||
};
|
||||
|
||||
template <typename T> T SwigValueInit() {
|
||||
template <typename T> T SwigValueInit()
|
||||
{
|
||||
return T();
|
||||
}
|
||||
#endif
|
||||
|
@ -205,7 +224,8 @@ static SWIG_CSharpExceptionArgument_t SWIG_csharp_exceptions_argument[] = {
|
|||
{ SWIG_CSharpArgumentOutOfRangeException, NULL }
|
||||
};
|
||||
|
||||
static void SWIGUNUSED SWIG_CSharpSetPendingException(SWIG_CSharpExceptionCodes code, const char *msg) {
|
||||
static void SWIGUNUSED SWIG_CSharpSetPendingException(SWIG_CSharpExceptionCodes code, const char *msg)
|
||||
{
|
||||
SWIG_CSharpExceptionCallback_t callback = SWIG_csharp_exceptions[SWIG_CSharpApplicationException].callback;
|
||||
if ((size_t)code < sizeof(SWIG_csharp_exceptions)/sizeof(SWIG_CSharpException_t)) {
|
||||
callback = SWIG_csharp_exceptions[code].callback;
|
||||
|
@ -213,7 +233,8 @@ static void SWIGUNUSED SWIG_CSharpSetPendingException(SWIG_CSharpExceptionCodes
|
|||
callback(msg);
|
||||
}
|
||||
|
||||
static void SWIGUNUSED SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpExceptionArgumentCodes code, const char *msg, const char *param_name) {
|
||||
static void SWIGUNUSED SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpExceptionArgumentCodes code, const char *msg, const char *param_name)
|
||||
{
|
||||
SWIG_CSharpExceptionArgumentCallback_t callback = SWIG_csharp_exceptions_argument[SWIG_CSharpArgumentException].callback;
|
||||
if ((size_t)code < sizeof(SWIG_csharp_exceptions_argument)/sizeof(SWIG_CSharpExceptionArgument_t)) {
|
||||
callback = SWIG_csharp_exceptions_argument[code].callback;
|
||||
|
@ -236,7 +257,8 @@ SWIGEXPORT void SWIGSTDCALL SWIGRegisterExceptionCallbacks_ipsec_lib(
|
|||
SWIG_CSharpExceptionCallback_t nullReferenceCallback,
|
||||
SWIG_CSharpExceptionCallback_t outOfMemoryCallback,
|
||||
SWIG_CSharpExceptionCallback_t overflowCallback,
|
||||
SWIG_CSharpExceptionCallback_t systemCallback) {
|
||||
SWIG_CSharpExceptionCallback_t systemCallback)
|
||||
{
|
||||
SWIG_csharp_exceptions[SWIG_CSharpApplicationException].callback = applicationCallback;
|
||||
SWIG_csharp_exceptions[SWIG_CSharpArithmeticException].callback = arithmeticCallback;
|
||||
SWIG_csharp_exceptions[SWIG_CSharpDivideByZeroException].callback = divideByZeroCallback;
|
||||
|
@ -256,7 +278,8 @@ extern "C"
|
|||
SWIGEXPORT void SWIGSTDCALL SWIGRegisterExceptionArgumentCallbacks_ipsec_lib(
|
||||
SWIG_CSharpExceptionArgumentCallback_t argumentCallback,
|
||||
SWIG_CSharpExceptionArgumentCallback_t argumentNullCallback,
|
||||
SWIG_CSharpExceptionArgumentCallback_t argumentOutOfRangeCallback) {
|
||||
SWIG_CSharpExceptionArgumentCallback_t argumentOutOfRangeCallback)
|
||||
{
|
||||
SWIG_csharp_exceptions_argument[SWIG_CSharpArgumentException].callback = argumentCallback;
|
||||
SWIG_csharp_exceptions_argument[SWIG_CSharpArgumentNullException].callback = argumentNullCallback;
|
||||
SWIG_csharp_exceptions_argument[SWIG_CSharpArgumentOutOfRangeException].callback = argumentOutOfRangeCallback;
|
||||
|
@ -271,7 +294,8 @@ static SWIG_CSharpStringHelperCallback SWIG_csharp_string_callback = NULL;
|
|||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
#endif
|
||||
SWIGEXPORT void SWIGSTDCALL SWIGRegisterStringCallback_ipsec_lib(SWIG_CSharpStringHelperCallback callback) {
|
||||
SWIGEXPORT void SWIGSTDCALL SWIGRegisterStringCallback_ipsec_lib(SWIG_CSharpStringHelperCallback callback)
|
||||
{
|
||||
SWIG_csharp_string_callback = callback;
|
||||
}
|
||||
|
||||
|
@ -294,13 +318,16 @@ SWIGEXPORT void SWIGSTDCALL SWIGRegisterStringCallback_ipsec_lib(SWIG_CSharpStri
|
|||
#endif
|
||||
#include <string>
|
||||
|
||||
namespace Swig {
|
||||
namespace Swig
|
||||
{
|
||||
/* Director base class - not currently used in C# directors */
|
||||
class Director {
|
||||
class Director
|
||||
{
|
||||
};
|
||||
|
||||
/* Base class for director exceptions */
|
||||
class DirectorException {
|
||||
class DirectorException
|
||||
{
|
||||
protected:
|
||||
std::string swig_msg;
|
||||
|
||||
|
@ -317,7 +344,8 @@ namespace Swig {
|
|||
};
|
||||
|
||||
/* Pure virtual method exception */
|
||||
class DirectorPureVirtualException : public Swig::DirectorException {
|
||||
class DirectorPureVirtualException : public Swig::DirectorException
|
||||
{
|
||||
public:
|
||||
DirectorPureVirtualException(const char* msg) : DirectorException(std::string("Attempt to invoke pure virtual method ") + msg) {
|
||||
}
|
||||
|
@ -346,7 +374,8 @@ namespace Swig {
|
|||
extern "C" {
|
||||
#endif
|
||||
|
||||
SWIGEXPORT void * SWIGSTDCALL CSharp_new_IPSecCtx(int jarg1, unsigned int jarg2, int jarg3, int jarg4, int jarg5, int jarg6) {
|
||||
SWIGEXPORT void * SWIGSTDCALL CSharp_new_IPSecCtx(int jarg1, unsigned int jarg2, int jarg3, int jarg4, int jarg5, int jarg6)
|
||||
{
|
||||
void * jresult ;
|
||||
tipsec_ipproto_t arg1 ;
|
||||
bool arg2 ;
|
||||
|
@ -368,7 +397,8 @@ SWIGEXPORT void * SWIGSTDCALL CSharp_new_IPSecCtx(int jarg1, unsigned int jarg2,
|
|||
}
|
||||
|
||||
|
||||
SWIGEXPORT void SWIGSTDCALL CSharp_delete_IPSecCtx(void * jarg1) {
|
||||
SWIGEXPORT void SWIGSTDCALL CSharp_delete_IPSecCtx(void * jarg1)
|
||||
{
|
||||
IPSecCtx *arg1 = (IPSecCtx *) 0 ;
|
||||
|
||||
arg1 = (IPSecCtx *)jarg1;
|
||||
|
@ -376,7 +406,8 @@ SWIGEXPORT void SWIGSTDCALL CSharp_delete_IPSecCtx(void * jarg1) {
|
|||
}
|
||||
|
||||
|
||||
SWIGEXPORT int SWIGSTDCALL CSharp_IPSecCtx_start(void * jarg1) {
|
||||
SWIGEXPORT int SWIGSTDCALL CSharp_IPSecCtx_start(void * jarg1)
|
||||
{
|
||||
int jresult ;
|
||||
IPSecCtx *arg1 = (IPSecCtx *) 0 ;
|
||||
tipsec_error_t result;
|
||||
|
@ -388,7 +419,8 @@ SWIGEXPORT int SWIGSTDCALL CSharp_IPSecCtx_start(void * jarg1) {
|
|||
}
|
||||
|
||||
|
||||
SWIGEXPORT int SWIGSTDCALL CSharp_IPSecCtx_setLocal(void * jarg1, char * jarg2, char * jarg3, unsigned short jarg4, unsigned short jarg5) {
|
||||
SWIGEXPORT int SWIGSTDCALL CSharp_IPSecCtx_setLocal(void * jarg1, char * jarg2, char * jarg3, unsigned short jarg4, unsigned short jarg5)
|
||||
{
|
||||
int jresult ;
|
||||
IPSecCtx *arg1 = (IPSecCtx *) 0 ;
|
||||
char *arg2 = (char *) 0 ;
|
||||
|
@ -408,7 +440,8 @@ SWIGEXPORT int SWIGSTDCALL CSharp_IPSecCtx_setLocal(void * jarg1, char * jarg2,
|
|||
}
|
||||
|
||||
|
||||
SWIGEXPORT int SWIGSTDCALL CSharp_IPSecCtx_setKeys(void * jarg1, void * jarg2, void * jarg3) {
|
||||
SWIGEXPORT int SWIGSTDCALL CSharp_IPSecCtx_setKeys(void * jarg1, void * jarg2, void * jarg3)
|
||||
{
|
||||
int jresult ;
|
||||
IPSecCtx *arg1 = (IPSecCtx *) 0 ;
|
||||
tipsec_key_t *arg2 = (tipsec_key_t *) 0 ;
|
||||
|
@ -424,7 +457,8 @@ SWIGEXPORT int SWIGSTDCALL CSharp_IPSecCtx_setKeys(void * jarg1, void * jarg2, v
|
|||
}
|
||||
|
||||
|
||||
SWIGEXPORT int SWIGSTDCALL CSharp_IPSecCtx_setRemote(void * jarg1, unsigned int jarg2, unsigned int jarg3, unsigned short jarg4, unsigned short jarg5, unsigned long long jarg6) {
|
||||
SWIGEXPORT int SWIGSTDCALL CSharp_IPSecCtx_setRemote(void * jarg1, unsigned int jarg2, unsigned int jarg3, unsigned short jarg4, unsigned short jarg5, unsigned long long jarg6)
|
||||
{
|
||||
int jresult ;
|
||||
IPSecCtx *arg1 = (IPSecCtx *) 0 ;
|
||||
tipsec_spi_t arg2 ;
|
||||
|
@ -446,7 +480,8 @@ SWIGEXPORT int SWIGSTDCALL CSharp_IPSecCtx_setRemote(void * jarg1, unsigned int
|
|||
}
|
||||
|
||||
|
||||
SWIGEXPORT int SWIGSTDCALL CSharp_IPSecCtx_stop(void * jarg1) {
|
||||
SWIGEXPORT int SWIGSTDCALL CSharp_IPSecCtx_stop(void * jarg1)
|
||||
{
|
||||
int jresult ;
|
||||
IPSecCtx *arg1 = (IPSecCtx *) 0 ;
|
||||
tipsec_error_t result;
|
||||
|
@ -458,7 +493,8 @@ SWIGEXPORT int SWIGSTDCALL CSharp_IPSecCtx_stop(void * jarg1) {
|
|||
}
|
||||
|
||||
|
||||
SWIGEXPORT unsigned int SWIGSTDCALL CSharp_IPSecCtx_getSpiUC(void * jarg1) {
|
||||
SWIGEXPORT unsigned int SWIGSTDCALL CSharp_IPSecCtx_getSpiUC(void * jarg1)
|
||||
{
|
||||
unsigned int jresult ;
|
||||
IPSecCtx *arg1 = (IPSecCtx *) 0 ;
|
||||
tipsec_spi_t result;
|
||||
|
@ -470,7 +506,8 @@ SWIGEXPORT unsigned int SWIGSTDCALL CSharp_IPSecCtx_getSpiUC(void * jarg1) {
|
|||
}
|
||||
|
||||
|
||||
SWIGEXPORT unsigned int SWIGSTDCALL CSharp_IPSecCtx_getSpiUS(void * jarg1) {
|
||||
SWIGEXPORT unsigned int SWIGSTDCALL CSharp_IPSecCtx_getSpiUS(void * jarg1)
|
||||
{
|
||||
unsigned int jresult ;
|
||||
IPSecCtx *arg1 = (IPSecCtx *) 0 ;
|
||||
tipsec_spi_t result;
|
||||
|
@ -482,7 +519,8 @@ SWIGEXPORT unsigned int SWIGSTDCALL CSharp_IPSecCtx_getSpiUS(void * jarg1) {
|
|||
}
|
||||
|
||||
|
||||
SWIGEXPORT unsigned int SWIGSTDCALL CSharp_IPSecCtx_getSpiPC(void * jarg1) {
|
||||
SWIGEXPORT unsigned int SWIGSTDCALL CSharp_IPSecCtx_getSpiPC(void * jarg1)
|
||||
{
|
||||
unsigned int jresult ;
|
||||
IPSecCtx *arg1 = (IPSecCtx *) 0 ;
|
||||
tipsec_spi_t result;
|
||||
|
@ -494,7 +532,8 @@ SWIGEXPORT unsigned int SWIGSTDCALL CSharp_IPSecCtx_getSpiPC(void * jarg1) {
|
|||
}
|
||||
|
||||
|
||||
SWIGEXPORT unsigned int SWIGSTDCALL CSharp_IPSecCtx_getSpiPS(void * jarg1) {
|
||||
SWIGEXPORT unsigned int SWIGSTDCALL CSharp_IPSecCtx_getSpiPS(void * jarg1)
|
||||
{
|
||||
unsigned int jresult ;
|
||||
IPSecCtx *arg1 = (IPSecCtx *) 0 ;
|
||||
tipsec_spi_t result;
|
||||
|
|
|
@ -3,16 +3,14 @@
|
|||
|
||||
#include <stdint.h>
|
||||
|
||||
typedef enum CpuFamily_e
|
||||
{
|
||||
typedef enum CpuFamily_e {
|
||||
UNKNOWN = 0,
|
||||
ARM,
|
||||
X86
|
||||
}
|
||||
CpuFamily_t;
|
||||
|
||||
typedef enum CpuFeatures_e
|
||||
{
|
||||
typedef enum CpuFeatures_e {
|
||||
ARMv7 = 1,
|
||||
VFPv3 = 2,
|
||||
NEON = 4
|
||||
|
|
|
@ -110,12 +110,14 @@ read_file(const char* pathname, char* buffer, size_t buffsize)
|
|||
int fd, len;
|
||||
|
||||
fd = open(pathname, O_RDONLY);
|
||||
if (fd < 0)
|
||||
if (fd < 0) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
do {
|
||||
len = read(fd, buffer, buffsize);
|
||||
} while (len < 0 && errno == EINTR);
|
||||
}
|
||||
while (len < 0 && errno == EINTR);
|
||||
|
||||
close(fd);
|
||||
|
||||
|
@ -143,11 +145,13 @@ extract_cpuinfo_field(char* buffer, int buflen, const char* field)
|
|||
bufend = buffer + buflen;
|
||||
for (;;) {
|
||||
p = memmem(p, bufend-p, field, fieldlen);
|
||||
if (p == NULL)
|
||||
if (p == NULL) {
|
||||
goto EXIT;
|
||||
}
|
||||
|
||||
if (p == buffer || p[-1] == '\n')
|
||||
if (p == buffer || p[-1] == '\n') {
|
||||
break;
|
||||
}
|
||||
|
||||
p += fieldlen;
|
||||
}
|
||||
|
@ -155,20 +159,23 @@ extract_cpuinfo_field(char* buffer, int buflen, const char* field)
|
|||
/* Skip to the first column followed by a space */
|
||||
p += fieldlen;
|
||||
p = memchr(p, ':', bufend-p);
|
||||
if (p == NULL || p[1] != ' ')
|
||||
if (p == NULL || p[1] != ' ') {
|
||||
goto EXIT;
|
||||
}
|
||||
|
||||
/* Find the end of the line */
|
||||
p += 2;
|
||||
q = memchr(p, '\n', bufend-p);
|
||||
if (q == NULL)
|
||||
if (q == NULL) {
|
||||
q = bufend;
|
||||
}
|
||||
|
||||
/* Copy the line into a heap-allocated buffer */
|
||||
len = q-p;
|
||||
result = malloc(len+1);
|
||||
if (result == NULL)
|
||||
if (result == NULL) {
|
||||
goto EXIT;
|
||||
}
|
||||
|
||||
memcpy(result, p, len);
|
||||
result[len] = '\0';
|
||||
|
@ -190,23 +197,27 @@ has_list_item(const char* list, const char* item)
|
|||
const char* p = list;
|
||||
int itemlen = strlen(item);
|
||||
|
||||
if (list == NULL)
|
||||
if (list == NULL) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
while (*p) {
|
||||
const char* q;
|
||||
|
||||
/* skip spaces */
|
||||
while (*p == ' ' || *p == '\t')
|
||||
while (*p == ' ' || *p == '\t') {
|
||||
p++;
|
||||
}
|
||||
|
||||
/* find end of current list item */
|
||||
q = p;
|
||||
while (*q && *q != ' ' && *q != '\t')
|
||||
while (*q && *q != ' ' && *q != '\t') {
|
||||
q++;
|
||||
}
|
||||
|
||||
if (itemlen == q-p && !memcmp(p, item, itemlen))
|
||||
if (itemlen == q-p && !memcmp(p, item, itemlen)) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* skip to next item */
|
||||
p = q;
|
||||
|
@ -231,13 +242,15 @@ parse_decimal(const char* input, const char* limit, int* result)
|
|||
int val = 0;
|
||||
while (p < limit) {
|
||||
int d = (*p - '0');
|
||||
if ((unsigned)d >= 10U)
|
||||
if ((unsigned)d >= 10U) {
|
||||
break;
|
||||
}
|
||||
val = val*10 + d;
|
||||
p++;
|
||||
}
|
||||
if (p == input)
|
||||
if (p == input) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
*result = val;
|
||||
return p;
|
||||
|
@ -254,24 +267,28 @@ typedef struct {
|
|||
} CpuList;
|
||||
|
||||
static __inline__ void
|
||||
cpulist_init(CpuList* list) {
|
||||
cpulist_init(CpuList* list)
|
||||
{
|
||||
list->mask = 0;
|
||||
}
|
||||
|
||||
static __inline__ void
|
||||
cpulist_and(CpuList* list1, CpuList* list2) {
|
||||
cpulist_and(CpuList* list1, CpuList* list2)
|
||||
{
|
||||
list1->mask &= list2->mask;
|
||||
}
|
||||
|
||||
static __inline__ void
|
||||
cpulist_set(CpuList* list, int index) {
|
||||
cpulist_set(CpuList* list, int index)
|
||||
{
|
||||
if ((unsigned)index < 32) {
|
||||
list->mask |= (uint32_t)(1U << index);
|
||||
}
|
||||
}
|
||||
|
||||
static __inline__ int
|
||||
cpulist_count(CpuList* list) {
|
||||
cpulist_count(CpuList* list)
|
||||
{
|
||||
return __builtin_popcount(list->mask);
|
||||
}
|
||||
|
||||
|
@ -295,8 +312,7 @@ cpulist_parse(CpuList* list, const char* line, int line_len)
|
|||
/* NOTE: the input line coming from sysfs typically contains a
|
||||
* trailing newline, so take care of it in the code below
|
||||
*/
|
||||
while (p < end && *p != '\n')
|
||||
{
|
||||
while (p < end && *p != '\n') {
|
||||
int val, start_value, end_value;
|
||||
|
||||
/* Find the end of current item, and put it into 'q' */
|
||||
|
@ -307,8 +323,9 @@ cpulist_parse(CpuList* list, const char* line, int line_len)
|
|||
|
||||
/* Get first value */
|
||||
p = parse_decimal(p, q, &start_value);
|
||||
if (p == NULL)
|
||||
if (p == NULL) {
|
||||
goto BAD_FORMAT;
|
||||
}
|
||||
|
||||
end_value = start_value;
|
||||
|
||||
|
@ -317,9 +334,10 @@ cpulist_parse(CpuList* list, const char* line, int line_len)
|
|||
*/
|
||||
if (p < q && *p == '-') {
|
||||
p = parse_decimal(p+1, q, &end_value);
|
||||
if (p == NULL)
|
||||
if (p == NULL) {
|
||||
goto BAD_FORMAT;
|
||||
}
|
||||
}
|
||||
|
||||
/* Set bits CPU list bits */
|
||||
for (val = start_value; val <= end_value; val++) {
|
||||
|
@ -328,9 +346,10 @@ cpulist_parse(CpuList* list, const char* line, int line_len)
|
|||
|
||||
/* Jump to next item */
|
||||
p = q;
|
||||
if (p < end)
|
||||
if (p < end) {
|
||||
p++;
|
||||
}
|
||||
}
|
||||
|
||||
BAD_FORMAT:
|
||||
;
|
||||
|
@ -391,7 +410,7 @@ android_cpuInit(void)
|
|||
D("cpuinfo_len is (%d):\n%.*s\n", cpuinfo_len,
|
||||
cpuinfo_len >= 0 ? cpuinfo_len : 0, cpuinfo);
|
||||
|
||||
if (cpuinfo_len < 0) /* should not happen */ {
|
||||
if (cpuinfo_len < 0) { /* should not happen */
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -478,11 +497,13 @@ android_cpuInit(void)
|
|||
|
||||
D("found cpuFeatures = '%s'\n", cpuFeatures);
|
||||
|
||||
if (has_list_item(cpuFeatures, "vfpv3"))
|
||||
if (has_list_item(cpuFeatures, "vfpv3")) {
|
||||
g_cpuFeatures |= ANDROID_CPU_ARM_FEATURE_VFPv3;
|
||||
}
|
||||
|
||||
else if (has_list_item(cpuFeatures, "vfpv3d16"))
|
||||
else if (has_list_item(cpuFeatures, "vfpv3d16")) {
|
||||
g_cpuFeatures |= ANDROID_CPU_ARM_FEATURE_VFPv3;
|
||||
}
|
||||
|
||||
if (has_list_item(cpuFeatures, "neon")) {
|
||||
/* Note: Certain kernels only report neon but not vfpv3
|
||||
|
|
|
@ -14,23 +14,42 @@
|
|||
|
||||
#ifdef __cplusplus
|
||||
/* SwigValueWrapper is described in swig.swg */
|
||||
template<typename T> class SwigValueWrapper {
|
||||
template<typename T> class SwigValueWrapper
|
||||
{
|
||||
struct SwigMovePointer {
|
||||
T *ptr;
|
||||
SwigMovePointer(T *p) : ptr(p) { }
|
||||
~SwigMovePointer() { delete ptr; }
|
||||
SwigMovePointer& operator=(SwigMovePointer& rhs) { T* oldptr = ptr; ptr = 0; delete oldptr; ptr = rhs.ptr; rhs.ptr = 0; return *this; }
|
||||
~SwigMovePointer() {
|
||||
delete ptr;
|
||||
}
|
||||
SwigMovePointer& operator=(SwigMovePointer& rhs) {
|
||||
T* oldptr = ptr;
|
||||
ptr = 0;
|
||||
delete oldptr;
|
||||
ptr = rhs.ptr;
|
||||
rhs.ptr = 0;
|
||||
return *this;
|
||||
}
|
||||
} pointer;
|
||||
SwigValueWrapper& operator=(const SwigValueWrapper<T>& rhs);
|
||||
SwigValueWrapper(const SwigValueWrapper<T>& rhs);
|
||||
public:
|
||||
SwigValueWrapper() : pointer(0) { }
|
||||
SwigValueWrapper& operator=(const T& t) { SwigMovePointer tmp(new T(t)); pointer = tmp; return *this; }
|
||||
operator T&() const { return *pointer.ptr; }
|
||||
T *operator&() { return pointer.ptr; }
|
||||
SwigValueWrapper& operator=(const T& t) {
|
||||
SwigMovePointer tmp(new T(t));
|
||||
pointer = tmp;
|
||||
return *this;
|
||||
}
|
||||
operator T&() const {
|
||||
return *pointer.ptr;
|
||||
}
|
||||
T *operator&() {
|
||||
return pointer.ptr;
|
||||
}
|
||||
};
|
||||
|
||||
template <typename T> T SwigValueInit() {
|
||||
template <typename T> T SwigValueInit()
|
||||
{
|
||||
return T();
|
||||
}
|
||||
#endif
|
||||
|
@ -181,7 +200,8 @@ typedef struct {
|
|||
} SWIG_JavaExceptions_t;
|
||||
|
||||
|
||||
static void SWIGUNUSED SWIG_JavaThrowException(JNIEnv *jenv, SWIG_JavaExceptionCodes code, const char *msg) {
|
||||
static void SWIGUNUSED SWIG_JavaThrowException(JNIEnv *jenv, SWIG_JavaExceptionCodes code, const char *msg)
|
||||
{
|
||||
jclass excep;
|
||||
static const SWIG_JavaExceptions_t java_exceptions[] = {
|
||||
{ SWIG_JavaOutOfMemoryError, "java/lang/OutOfMemoryError" },
|
||||
|
@ -197,14 +217,16 @@ static void SWIGUNUSED SWIG_JavaThrowException(JNIEnv *jenv, SWIG_JavaExceptionC
|
|||
};
|
||||
const SWIG_JavaExceptions_t *except_ptr = java_exceptions;
|
||||
|
||||
while (except_ptr->code != code && except_ptr->code)
|
||||
while (except_ptr->code != code && except_ptr->code) {
|
||||
except_ptr++;
|
||||
}
|
||||
|
||||
jenv->ExceptionClear();
|
||||
excep = jenv->FindClass(except_ptr->java_exception);
|
||||
if (excep)
|
||||
if (excep) {
|
||||
jenv->ThrowNew(excep, msg);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* Contract support */
|
||||
|
@ -224,9 +246,11 @@ static void SWIGUNUSED SWIG_JavaThrowException(JNIEnv *jenv, SWIG_JavaExceptionC
|
|||
#include <iostream>
|
||||
#endif
|
||||
|
||||
namespace Swig {
|
||||
namespace Swig
|
||||
{
|
||||
/* Java object wrapper */
|
||||
class JObjectWrapper {
|
||||
class JObjectWrapper
|
||||
{
|
||||
public:
|
||||
JObjectWrapper() : jthis_(NULL), weak_global_(true) {
|
||||
}
|
||||
|
@ -239,13 +263,15 @@ namespace Swig {
|
|||
bool set(JNIEnv *jenv, jobject jobj, bool mem_own, bool weak_global) {
|
||||
if (!jthis_) {
|
||||
weak_global_ = weak_global;
|
||||
if (jobj)
|
||||
if (jobj) {
|
||||
jthis_ = ((weak_global_ || !mem_own) ? jenv->NewWeakGlobalRef(jobj) : jenv->NewGlobalRef(jobj));
|
||||
}
|
||||
#if defined(DEBUG_DIRECTOR_OWNED)
|
||||
std::cout << "JObjectWrapper::set(" << jobj << ", " << (weak_global ? "weak_global" : "global_ref") << ") -> " << jthis_ << std::endl;
|
||||
#endif
|
||||
return true;
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
#if defined(DEBUG_DIRECTOR_OWNED)
|
||||
std::cout << "JObjectWrapper::set(" << jobj << ", " << (weak_global ? "weak_global" : "global_ref") << ") -> already set" << std::endl;
|
||||
#endif
|
||||
|
@ -256,10 +282,12 @@ namespace Swig {
|
|||
jobject get(JNIEnv *jenv) const {
|
||||
#if defined(DEBUG_DIRECTOR_OWNED)
|
||||
std::cout << "JObjectWrapper::get(";
|
||||
if (jthis_)
|
||||
if (jthis_) {
|
||||
std::cout << jthis_;
|
||||
else
|
||||
}
|
||||
else {
|
||||
std::cout << "null";
|
||||
}
|
||||
std::cout << ") -> return new local ref" << std::endl;
|
||||
#endif
|
||||
return (jthis_ ? jenv->NewLocalRef(jthis_) : jthis_);
|
||||
|
@ -271,11 +299,14 @@ namespace Swig {
|
|||
#endif
|
||||
if (jthis_) {
|
||||
if (weak_global_) {
|
||||
if (jenv->IsSameObject(jthis_, NULL) == JNI_FALSE)
|
||||
if (jenv->IsSameObject(jthis_, NULL) == JNI_FALSE) {
|
||||
jenv->DeleteWeakGlobalRef((jweak)jthis_);
|
||||
} else
|
||||
}
|
||||
}
|
||||
else {
|
||||
jenv->DeleteGlobalRef(jthis_);
|
||||
}
|
||||
}
|
||||
|
||||
jthis_ = NULL;
|
||||
weak_global_ = true;
|
||||
|
@ -295,7 +326,8 @@ namespace Swig {
|
|||
jthis_ = jenv->NewWeakGlobalRef(jself);
|
||||
weak_global_ = true;
|
||||
}
|
||||
} else { /* Java releases ownership of C++ object's lifetime */
|
||||
}
|
||||
else { /* Java releases ownership of C++ object's lifetime */
|
||||
if (weak_global_) {
|
||||
jenv->DeleteWeakGlobalRef((jweak)jthis_);
|
||||
jthis_ = jenv->NewGlobalRef(jself);
|
||||
|
@ -312,7 +344,8 @@ namespace Swig {
|
|||
};
|
||||
|
||||
/* director base class */
|
||||
class Director {
|
||||
class Director
|
||||
{
|
||||
/* pointer to Java virtual machine */
|
||||
JavaVM *swig_jvm_;
|
||||
|
||||
|
@ -322,7 +355,8 @@ namespace Swig {
|
|||
friend class JNIEnvWrapper;
|
||||
#endif
|
||||
/* Utility class for managing the JNI environment */
|
||||
class JNIEnvWrapper {
|
||||
class JNIEnvWrapper
|
||||
{
|
||||
const Director *director_;
|
||||
JNIEnv *jenv_;
|
||||
public:
|
||||
|
@ -418,7 +452,8 @@ namespace Swig {
|
|||
extern "C" {
|
||||
#endif
|
||||
|
||||
SWIGEXPORT jlong JNICALL Java_org_doubango_utils_utilsJNI_new_1AndroidUtils(JNIEnv *jenv, jclass jcls) {
|
||||
SWIGEXPORT jlong JNICALL Java_org_doubango_utils_utilsJNI_new_1AndroidUtils(JNIEnv *jenv, jclass jcls)
|
||||
{
|
||||
jlong jresult = 0 ;
|
||||
AndroidUtils *result = 0 ;
|
||||
|
||||
|
@ -430,7 +465,8 @@ SWIGEXPORT jlong JNICALL Java_org_doubango_utils_utilsJNI_new_1AndroidUtils(JNIE
|
|||
}
|
||||
|
||||
|
||||
SWIGEXPORT void JNICALL Java_org_doubango_utils_utilsJNI_delete_1AndroidUtils(JNIEnv *jenv, jclass jcls, jlong jarg1) {
|
||||
SWIGEXPORT void JNICALL Java_org_doubango_utils_utilsJNI_delete_1AndroidUtils(JNIEnv *jenv, jclass jcls, jlong jarg1)
|
||||
{
|
||||
AndroidUtils *arg1 = (AndroidUtils *) 0 ;
|
||||
|
||||
(void)jenv;
|
||||
|
@ -440,7 +476,8 @@ SWIGEXPORT void JNICALL Java_org_doubango_utils_utilsJNI_delete_1AndroidUtils(JN
|
|||
}
|
||||
|
||||
|
||||
SWIGEXPORT jobject JNICALL Java_org_doubango_utils_utilsJNI_AndroidUtils_1getCpuFamily(JNIEnv *jenv, jclass jcls) {
|
||||
SWIGEXPORT jobject JNICALL Java_org_doubango_utils_utilsJNI_AndroidUtils_1getCpuFamily(JNIEnv *jenv, jclass jcls)
|
||||
{
|
||||
jobject jresult = 0 ;
|
||||
uint64_t result;
|
||||
|
||||
|
@ -468,7 +505,8 @@ SWIGEXPORT jobject JNICALL Java_org_doubango_utils_utilsJNI_AndroidUtils_1getCpu
|
|||
}
|
||||
|
||||
|
||||
SWIGEXPORT jobject JNICALL Java_org_doubango_utils_utilsJNI_AndroidUtils_1getCpuFeatures(JNIEnv *jenv, jclass jcls) {
|
||||
SWIGEXPORT jobject JNICALL Java_org_doubango_utils_utilsJNI_AndroidUtils_1getCpuFeatures(JNIEnv *jenv, jclass jcls)
|
||||
{
|
||||
jobject jresult = 0 ;
|
||||
uint64_t result;
|
||||
|
||||
|
|
|
@ -38,9 +38,15 @@ public:
|
|||
~AudioResampler();
|
||||
|
||||
public:
|
||||
inline bool isValid(){ return (m_pWrappedResampler != tsk_null); }
|
||||
inline uint32_t getOutputRequiredSizeInShort(){ return (m_nOutFreq * m_nFrameDuration)/1000; }
|
||||
inline uint32_t getInputRequiredSizeInShort(){ return (m_nInFreq * m_nFrameDuration)/1000; }
|
||||
inline bool isValid() {
|
||||
return (m_pWrappedResampler != tsk_null);
|
||||
}
|
||||
inline uint32_t getOutputRequiredSizeInShort() {
|
||||
return (m_nOutFreq * m_nFrameDuration)/1000;
|
||||
}
|
||||
inline uint32_t getInputRequiredSizeInShort() {
|
||||
return (m_nInFreq * m_nFrameDuration)/1000;
|
||||
}
|
||||
uint32_t process(const void* pInData, uint32_t nInSizeInBytes, void* pOutData, uint32_t nOutSizeInBytes);
|
||||
|
||||
private:
|
||||
|
|
|
@ -32,8 +32,7 @@
|
|||
# define __JNIENV void
|
||||
#endif
|
||||
|
||||
typedef enum twrap_media_type_e
|
||||
{
|
||||
typedef enum twrap_media_type_e {
|
||||
// because of Java don't use OR
|
||||
twrap_media_none = 0x00,
|
||||
|
||||
|
@ -53,13 +52,11 @@ twrap_media_type_t;
|
|||
#if !defined(SWIG)
|
||||
#include "tinymedia/tmedia_common.h"
|
||||
|
||||
struct media_type_bind_s
|
||||
{
|
||||
struct media_type_bind_s {
|
||||
twrap_media_type_t twrap;
|
||||
tmedia_type_t tnative;
|
||||
};
|
||||
static const struct media_type_bind_s __media_type_binds[] =
|
||||
{
|
||||
static const struct media_type_bind_s __media_type_binds[] = {
|
||||
{ twrap_media_msrp, tmedia_msrp },
|
||||
{ twrap_media_audio , tmedia_audio },
|
||||
{ twrap_media_video, tmedia_video },
|
||||
|
|
|
@ -107,7 +107,8 @@ int DDebugCallback::debug_info_cb(const void* arg, const char* fmt, ...)
|
|||
return ret;
|
||||
}
|
||||
|
||||
int DDebugCallback::debug_warn_cb(const void* arg, const char* fmt, ...){
|
||||
int DDebugCallback::debug_warn_cb(const void* arg, const char* fmt, ...)
|
||||
{
|
||||
va_list ap;
|
||||
int ret;
|
||||
|
||||
|
@ -118,7 +119,8 @@ int DDebugCallback::debug_warn_cb(const void* arg, const char* fmt, ...){
|
|||
return ret;
|
||||
}
|
||||
|
||||
int DDebugCallback::debug_error_cb(const void* arg, const char* fmt, ...){
|
||||
int DDebugCallback::debug_error_cb(const void* arg, const char* fmt, ...)
|
||||
{
|
||||
va_list ap;
|
||||
int ret;
|
||||
|
||||
|
@ -129,7 +131,8 @@ int DDebugCallback::debug_error_cb(const void* arg, const char* fmt, ...){
|
|||
return ret;
|
||||
}
|
||||
|
||||
int DDebugCallback::debug_fatal_cb(const void* arg, const char* fmt, ...){
|
||||
int DDebugCallback::debug_fatal_cb(const void* arg, const char* fmt, ...)
|
||||
{
|
||||
va_list ap;
|
||||
int ret;
|
||||
|
||||
|
|
|
@ -29,10 +29,18 @@ public:
|
|||
virtual ~DDebugCallback() {}
|
||||
|
||||
|
||||
virtual int OnDebugInfo(const char* message) { return -1; }
|
||||
virtual int OnDebugWarn(const char* message) { return -1; }
|
||||
virtual int OnDebugError(const char* message) { return -1; }
|
||||
virtual int OnDebugFatal(const char* message) { return -1; }
|
||||
virtual int OnDebugInfo(const char* message) {
|
||||
return -1;
|
||||
}
|
||||
virtual int OnDebugWarn(const char* message) {
|
||||
return -1;
|
||||
}
|
||||
virtual int OnDebugError(const char* message) {
|
||||
return -1;
|
||||
}
|
||||
virtual int OnDebugFatal(const char* message) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
#if !defined(SWIG)
|
||||
public:
|
||||
|
|
|
@ -143,7 +143,8 @@ unsigned MediaContentCPIM::getPayload(void* pOutput, unsigned nMaxsize)
|
|||
return nRetsize;
|
||||
}
|
||||
|
||||
const void* MediaContentCPIM::getPayloadPtr(){
|
||||
const void* MediaContentCPIM::getPayloadPtr()
|
||||
{
|
||||
if(!m_pContent || !TMEDIA_CONTENT_IS_CPIM(m_pContent)) {
|
||||
TSK_DEBUG_ERROR("Invalid internal object");
|
||||
return tsk_null;
|
||||
|
|
|
@ -21,6 +21,32 @@
|
|||
*/
|
||||
#include "MediaSessionMgr.h"
|
||||
|
||||
//
|
||||
// QoS
|
||||
//
|
||||
QoS::QoS(float qavg, float q1 /*= -1.f*/, float q2 /*= -1.f*/, float q3 /*= -1.f*/, float q4 /*= -1.f*/, float q5 /*= -1.f*/)
|
||||
: m_Qqvg(qavg)
|
||||
, m_VideoInWidth(0)
|
||||
, m_VideoOutWidth(0)
|
||||
, m_VideoInHeight(0)
|
||||
, m_VideoOutHeight(0)
|
||||
, m_BandwidthDownKbps(0)
|
||||
, m_BandwidthUpKbps(0)
|
||||
, m_VideoInAvgFps(0)
|
||||
, m_VideoDecAvgTime(0)
|
||||
, m_VideoEncAvgTime(0)
|
||||
{
|
||||
m_Qn[0] = q1;
|
||||
m_Qn[1] = q2;
|
||||
m_Qn[2] = q3;
|
||||
m_Qn[3] = q4;
|
||||
m_Qn[4] = q5;
|
||||
}
|
||||
|
||||
QoS::~QoS()
|
||||
{
|
||||
}
|
||||
|
||||
//
|
||||
// Codec
|
||||
//
|
||||
|
@ -38,10 +64,14 @@ twrap_media_type_t Codec::getMediaType()
|
|||
{
|
||||
if(m_pWrappedCodec) {
|
||||
switch(m_pWrappedCodec->type) {
|
||||
case tmedia_audio: return twrap_media_audio;
|
||||
case tmedia_video: return twrap_media_video;
|
||||
case tmedia_msrp: return twrap_media_msrp;
|
||||
default: break;
|
||||
case tmedia_audio:
|
||||
return twrap_media_audio;
|
||||
case tmedia_video:
|
||||
return twrap_media_video;
|
||||
case tmedia_msrp:
|
||||
return twrap_media_msrp;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
return twrap_media_none;
|
||||
|
@ -126,6 +156,35 @@ int32_t MediaSessionMgr::sessionGetInt32(twrap_media_type_t media, const char* k
|
|||
return value;
|
||||
}
|
||||
|
||||
QoS* MediaSessionMgr::sessionGetQoS(twrap_media_type_t media)
|
||||
{
|
||||
tmedia_type_t _media = twrap_get_native_media_type(media);
|
||||
tmedia_session_t* session = tmedia_session_mgr_find(m_pWrappedMgr, _media);
|
||||
if (session) {
|
||||
QoS* pQoS = new QoS(
|
||||
session->qos_metrics.qvag,
|
||||
session->qos_metrics.q1,
|
||||
session->qos_metrics.q2,
|
||||
session->qos_metrics.q3,
|
||||
session->qos_metrics.q4,
|
||||
session->qos_metrics.q5);
|
||||
if (pQoS && ((_media & tmedia_video) || (_media & tmedia_bfcp_video))) {
|
||||
pQoS->m_VideoInWidth = session->qos_metrics.video_in_width;
|
||||
pQoS->m_VideoInHeight = session->qos_metrics.video_in_height;
|
||||
pQoS->m_VideoOutWidth = session->qos_metrics.video_out_width;
|
||||
pQoS->m_VideoOutHeight = session->qos_metrics.video_out_height;
|
||||
pQoS->m_BandwidthDownKbps = session->qos_metrics.bw_down_est_kbps;
|
||||
pQoS->m_BandwidthUpKbps = session->qos_metrics.bw_up_est_kbps;
|
||||
pQoS->m_VideoInAvgFps = session->qos_metrics.video_in_avg_fps;
|
||||
pQoS->m_VideoDecAvgTime = session->qos_metrics.video_dec_avg_time;
|
||||
pQoS->m_VideoEncAvgTime = session->qos_metrics.video_enc_avg_time;
|
||||
}
|
||||
TSK_OBJECT_SAFE_FREE(session);
|
||||
return pQoS;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
bool MediaSessionMgr::consumerSetInt32(twrap_media_type_t media, const char* key, int32_t value)
|
||||
{
|
||||
tmedia_type_t _media = twrap_get_native_media_type(media);
|
||||
|
@ -171,7 +230,7 @@ Codec* MediaSessionMgr::producerGetCodec(twrap_media_type_t media)
|
|||
TSK_OBJECT_SAFE_FREE(_codec);
|
||||
return pCodec;
|
||||
}
|
||||
return tsk_null;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
#include "tinydav/audio/tdav_session_audio.h"
|
||||
|
@ -319,6 +378,16 @@ bool MediaSessionMgr::defaultsSetPrefVideoSize(tmedia_pref_video_size_t pref_vid
|
|||
return tmedia_defaults_set_pref_video_size(pref_video_size) == 0;
|
||||
}
|
||||
|
||||
bool MediaSessionMgr::defaultsSetPrefVideoSizeOutRange(tmedia_pref_video_size_t min, tmedia_pref_video_size_t max)
|
||||
{
|
||||
return tmedia_defaults_set_pref_video_size_range(min, max) == 0;
|
||||
}
|
||||
|
||||
bool MediaSessionMgr::defaultsSetAdaptativeVideoSizeOutEnabled(bool enabled)
|
||||
{
|
||||
return tmedia_defaults_set_adapt_video_size_range_enabled(enabled ? tsk_true : tsk_false) == 0;
|
||||
}
|
||||
|
||||
bool MediaSessionMgr::defaultsSetJbMargin(uint32_t jb_margin_ms)
|
||||
{
|
||||
return tmedia_defaults_set_jb_margin(jb_margin_ms) == 0;
|
||||
|
@ -404,34 +473,42 @@ int32_t MediaSessionMgr::defaultsGetNoiseSuppLevel()
|
|||
return tmedia_defaults_get_noise_supp_level();
|
||||
}
|
||||
|
||||
bool MediaSessionMgr::defaultsSet100relEnabled(bool _100rel_enabled){
|
||||
bool MediaSessionMgr::defaultsSet100relEnabled(bool _100rel_enabled)
|
||||
{
|
||||
return tmedia_defaults_set_100rel_enabled(_100rel_enabled ? tsk_true : tsk_false) == 0;
|
||||
}
|
||||
|
||||
bool MediaSessionMgr::defaultsGet100relEnabled(){
|
||||
bool MediaSessionMgr::defaultsGet100relEnabled()
|
||||
{
|
||||
return tmedia_defaults_get_100rel_enabled() == 0;
|
||||
}
|
||||
|
||||
bool MediaSessionMgr::defaultsSetScreenSize(int32_t sx, int32_t sy){
|
||||
bool MediaSessionMgr::defaultsSetScreenSize(int32_t sx, int32_t sy)
|
||||
{
|
||||
return tmedia_defaults_set_screen_size(sx, sy) == 0;
|
||||
}
|
||||
|
||||
bool MediaSessionMgr::defaultsSetAudioGain(int32_t producer_gain, int32_t consumer_gain){
|
||||
bool MediaSessionMgr::defaultsSetAudioGain(int32_t producer_gain, int32_t consumer_gain)
|
||||
{
|
||||
return tmedia_defaults_set_audio_gain(producer_gain, consumer_gain) == 0;
|
||||
}
|
||||
|
||||
bool MediaSessionMgr::defaultsSetAudioPtime(int32_t ptime){
|
||||
bool MediaSessionMgr::defaultsSetAudioPtime(int32_t ptime)
|
||||
{
|
||||
return tmedia_defaults_set_audio_ptime(ptime) == 0;
|
||||
}
|
||||
bool MediaSessionMgr::defaultsSetAudioChannels(int32_t channel_playback, int32_t channel_record){
|
||||
bool MediaSessionMgr::defaultsSetAudioChannels(int32_t channel_playback, int32_t channel_record)
|
||||
{
|
||||
return tmedia_defaults_set_audio_channels(channel_playback, channel_record) == 0;
|
||||
}
|
||||
|
||||
bool MediaSessionMgr::defaultsSetRtpPortRange(uint16_t range_start, uint16_t range_stop){
|
||||
bool MediaSessionMgr::defaultsSetRtpPortRange(uint16_t range_start, uint16_t range_stop)
|
||||
{
|
||||
return tmedia_defaults_set_rtp_port_range(range_start, range_stop) == 0;
|
||||
}
|
||||
|
||||
bool MediaSessionMgr::defaultsSetRtpSymetricEnabled(bool enabled){
|
||||
bool MediaSessionMgr::defaultsSetRtpSymetricEnabled(bool enabled)
|
||||
{
|
||||
return tmedia_defaults_set_rtp_symetric_enabled(enabled ? tsk_true : tsk_false) == 0;
|
||||
}
|
||||
|
||||
|
@ -457,103 +534,132 @@ bool MediaSessionMgr::defaultsSetInviteSessionTimers(int32_t timeout, const char
|
|||
return (ret == 0);
|
||||
}
|
||||
|
||||
bool MediaSessionMgr::defaultsSetSRtpMode(tmedia_srtp_mode_t mode){
|
||||
bool MediaSessionMgr::defaultsSetSRtpMode(tmedia_srtp_mode_t mode)
|
||||
{
|
||||
return (tmedia_defaults_set_srtp_mode(mode) == 0);
|
||||
}
|
||||
tmedia_srtp_mode_t MediaSessionMgr::defaultsGetSRtpMode(){
|
||||
tmedia_srtp_mode_t MediaSessionMgr::defaultsGetSRtpMode()
|
||||
{
|
||||
return tmedia_defaults_get_srtp_mode();
|
||||
}
|
||||
|
||||
bool MediaSessionMgr::defaultsSetSRtpType(tmedia_srtp_type_t srtp_type){
|
||||
bool MediaSessionMgr::defaultsSetSRtpType(tmedia_srtp_type_t srtp_type)
|
||||
{
|
||||
return (tmedia_defaults_set_srtp_type(srtp_type) == 0);
|
||||
}
|
||||
tmedia_srtp_type_t MediaSessionMgr::defaultsGetSRtpType(){
|
||||
tmedia_srtp_type_t MediaSessionMgr::defaultsGetSRtpType()
|
||||
{
|
||||
return tmedia_defaults_get_srtp_type();
|
||||
}
|
||||
|
||||
bool MediaSessionMgr::defaultsSetRtcpEnabled(bool enabled){
|
||||
bool MediaSessionMgr::defaultsSetRtcpEnabled(bool enabled)
|
||||
{
|
||||
return (tmedia_defaults_set_rtcp_enabled(enabled ? tsk_true : tsk_false) == 0);
|
||||
}
|
||||
bool MediaSessionMgr::defaultsGetRtcpEnabled(){
|
||||
bool MediaSessionMgr::defaultsGetRtcpEnabled()
|
||||
{
|
||||
return (tmedia_defaults_get_rtcp_enabled() == tsk_true);
|
||||
}
|
||||
|
||||
bool MediaSessionMgr::defaultsSetRtcpMuxEnabled(bool enabled){
|
||||
bool MediaSessionMgr::defaultsSetRtcpMuxEnabled(bool enabled)
|
||||
{
|
||||
return (tmedia_defaults_set_rtcpmux_enabled(enabled ? tsk_true : tsk_false) == 0);
|
||||
}
|
||||
bool MediaSessionMgr::defaultsGetRtcpMuxEnabled(){
|
||||
bool MediaSessionMgr::defaultsGetRtcpMuxEnabled()
|
||||
{
|
||||
return (tmedia_defaults_get_rtcpmux_enabled() == tsk_true);
|
||||
}
|
||||
|
||||
|
||||
bool MediaSessionMgr::defaultsSetStunEnabled(bool stun_enabled){
|
||||
bool MediaSessionMgr::defaultsSetStunEnabled(bool stun_enabled)
|
||||
{
|
||||
return (tmedia_defaults_set_stun_enabled(stun_enabled ? tsk_true : tsk_false) == 0);
|
||||
}
|
||||
bool MediaSessionMgr::defaultsSetIceStunEnabled(bool icestun_enabled){
|
||||
bool MediaSessionMgr::defaultsSetIceStunEnabled(bool icestun_enabled)
|
||||
{
|
||||
return (tmedia_defaults_set_icestun_enabled(icestun_enabled ? tsk_true : tsk_false) == 0);
|
||||
}
|
||||
bool MediaSessionMgr::defaultsSetIceTurnEnabled(bool iceturn_enabled){
|
||||
bool MediaSessionMgr::defaultsSetIceTurnEnabled(bool iceturn_enabled)
|
||||
{
|
||||
return (tmedia_defaults_set_iceturn_enabled(iceturn_enabled ? tsk_true : tsk_false) == 0);
|
||||
}
|
||||
bool MediaSessionMgr::defaultsSetStunServer(const char* server_ip, uint16_t server_port){
|
||||
bool MediaSessionMgr::defaultsSetStunServer(const char* server_ip, uint16_t server_port)
|
||||
{
|
||||
return (tmedia_defaults_set_stun_server(server_ip, server_port) == 0);
|
||||
}
|
||||
bool MediaSessionMgr::defaultsSetStunCred(const char* username, const char* password){
|
||||
bool MediaSessionMgr::defaultsSetStunCred(const char* username, const char* password)
|
||||
{
|
||||
return (tmedia_defaults_set_stun_cred(username, password) == 0);
|
||||
}
|
||||
bool MediaSessionMgr::defaultsSetIceEnabled(bool ice_enabled){
|
||||
bool MediaSessionMgr::defaultsSetIceEnabled(bool ice_enabled)
|
||||
{
|
||||
return (tmedia_defaults_set_ice_enabled(ice_enabled ? tsk_true : tsk_false) == 0);
|
||||
}
|
||||
|
||||
bool MediaSessionMgr::defaultsSetByPassEncoding(bool enabled){
|
||||
bool MediaSessionMgr::defaultsSetByPassEncoding(bool enabled)
|
||||
{
|
||||
return (tmedia_defaults_set_bypass_encoding(enabled ? tsk_true : tsk_false) == 0);
|
||||
}
|
||||
bool MediaSessionMgr::defaultsGetByPassEncoding(){
|
||||
bool MediaSessionMgr::defaultsGetByPassEncoding()
|
||||
{
|
||||
return (tmedia_defaults_get_bypass_encoding() == tsk_true);
|
||||
}
|
||||
bool MediaSessionMgr::defaultsSetByPassDecoding(bool enabled){
|
||||
bool MediaSessionMgr::defaultsSetByPassDecoding(bool enabled)
|
||||
{
|
||||
return (tmedia_defaults_set_bypass_decoding(enabled ? tsk_true : tsk_false) == 0);
|
||||
}
|
||||
bool MediaSessionMgr::defaultsGetByPassDecoding(){
|
||||
bool MediaSessionMgr::defaultsGetByPassDecoding()
|
||||
{
|
||||
return (tmedia_defaults_get_bypass_decoding() == tsk_true);
|
||||
}
|
||||
|
||||
bool MediaSessionMgr::defaultsSetVideoJbEnabled(bool enabled){
|
||||
bool MediaSessionMgr::defaultsSetVideoJbEnabled(bool enabled)
|
||||
{
|
||||
return (tmedia_defaults_set_videojb_enabled(enabled ? tsk_true : tsk_false) == 0);
|
||||
}
|
||||
bool MediaSessionMgr::defaultsGetVideoJbEnabled(){
|
||||
bool MediaSessionMgr::defaultsGetVideoJbEnabled()
|
||||
{
|
||||
return (tmedia_defaults_get_videojb_enabled() == tsk_true);
|
||||
}
|
||||
|
||||
bool MediaSessionMgr::defaultsSetVideoZeroArtifactsEnabled(bool enabled){
|
||||
bool MediaSessionMgr::defaultsSetVideoZeroArtifactsEnabled(bool enabled)
|
||||
{
|
||||
return (tmedia_defaults_set_video_zeroartifacts_enabled(enabled ? tsk_true : tsk_false) == 0);
|
||||
}
|
||||
bool MediaSessionMgr::defaultsGetVideoZeroArtifactsEnabled(){
|
||||
bool MediaSessionMgr::defaultsGetVideoZeroArtifactsEnabled()
|
||||
{
|
||||
return (tmedia_defaults_get_video_zeroartifacts_enabled() == tsk_true);
|
||||
}
|
||||
|
||||
bool MediaSessionMgr::defaultsSetRtpBuffSize(unsigned buffSize){
|
||||
bool MediaSessionMgr::defaultsSetRtpBuffSize(unsigned buffSize)
|
||||
{
|
||||
return (tmedia_defaults_set_rtpbuff_size(buffSize) == 0);
|
||||
}
|
||||
unsigned MediaSessionMgr::defaultsGetRtpBuffSize(){
|
||||
unsigned MediaSessionMgr::defaultsGetRtpBuffSize()
|
||||
{
|
||||
return tmedia_defaults_get_rtpbuff_size();
|
||||
}
|
||||
|
||||
bool MediaSessionMgr::defaultsSetAvpfTail(unsigned tail_min, unsigned tail_max){
|
||||
bool MediaSessionMgr::defaultsSetAvpfTail(unsigned tail_min, unsigned tail_max)
|
||||
{
|
||||
return (tmedia_defaults_set_avpf_tail(tail_min, tail_max) == 0);
|
||||
}
|
||||
|
||||
bool MediaSessionMgr::defaultsSetAvpfMode(enum tmedia_mode_e mode){
|
||||
bool MediaSessionMgr::defaultsSetAvpfMode(enum tmedia_mode_e mode)
|
||||
{
|
||||
return (tmedia_defaults_set_avpf_mode(mode) == 0);
|
||||
}
|
||||
|
||||
bool MediaSessionMgr::defaultsSetOpusMaxCaptureRate(uint32_t opus_maxcapturerate){
|
||||
bool MediaSessionMgr::defaultsSetOpusMaxCaptureRate(uint32_t opus_maxcapturerate)
|
||||
{
|
||||
return (tmedia_defaults_set_opus_maxcapturerate(opus_maxcapturerate) == 0);
|
||||
}
|
||||
bool MediaSessionMgr::defaultsSetOpusMaxPlaybackRate(uint32_t opus_maxplaybackrate){
|
||||
bool MediaSessionMgr::defaultsSetOpusMaxPlaybackRate(uint32_t opus_maxplaybackrate)
|
||||
{
|
||||
return (tmedia_defaults_set_opus_maxplaybackrate(opus_maxplaybackrate) == 0);
|
||||
}
|
||||
|
||||
bool MediaSessionMgr::defaultsSetMaxFds(int32_t max_fds) {
|
||||
bool MediaSessionMgr::defaultsSetMaxFds(int32_t max_fds)
|
||||
{
|
||||
return (tmedia_defaults_set_max_fds(max_fds) == 0);
|
||||
}
|
|
@ -28,6 +28,74 @@
|
|||
#include "Common.h"
|
||||
|
||||
class ProxyPlugin;
|
||||
class MediaSessionMgr;
|
||||
|
||||
class TINYWRAP_API QoS
|
||||
{
|
||||
friend class MediaSessionMgr;
|
||||
public:
|
||||
#if !defined(SWIG)
|
||||
QoS(float qavg, float q1 = -1.f, float q2 = -1.f, float q3 = -1.f, float q4 = -1.f, float q5 = -1.f);
|
||||
#endif
|
||||
virtual ~QoS();
|
||||
float getQavg() {
|
||||
return m_Qqvg;
|
||||
}
|
||||
float getQ1() {
|
||||
return m_Qn[0];
|
||||
}
|
||||
float getQ2() {
|
||||
return m_Qn[1];
|
||||
}
|
||||
float getQ3() {
|
||||
return m_Qn[2];
|
||||
}
|
||||
float getQ4() {
|
||||
return m_Qn[3];
|
||||
}
|
||||
float getQ5() {
|
||||
return m_Qn[4];
|
||||
}
|
||||
unsigned getVideoInWidth() {
|
||||
return m_VideoInWidth;
|
||||
}
|
||||
unsigned getVideoOutWidth() {
|
||||
return m_VideoOutWidth;
|
||||
}
|
||||
unsigned getVideoInHeight() {
|
||||
return m_VideoInHeight;
|
||||
}
|
||||
unsigned getVideoOutHeight() {
|
||||
return m_VideoOutHeight;
|
||||
}
|
||||
unsigned getBandwidthDownKbps() {
|
||||
return m_BandwidthDownKbps;
|
||||
}
|
||||
unsigned getBandwidthUpKbps() {
|
||||
return m_BandwidthUpKbps;
|
||||
}
|
||||
unsigned getVideoInAvgFps() {
|
||||
return m_VideoInAvgFps;
|
||||
}
|
||||
unsigned getVideoDecAvgTime() { // In millis
|
||||
return m_VideoDecAvgTime;
|
||||
}
|
||||
unsigned getVideoEncAvgTime() { // In millis
|
||||
return m_VideoEncAvgTime;
|
||||
}
|
||||
private:
|
||||
float m_Qqvg;
|
||||
float m_Qn[5];
|
||||
unsigned m_VideoInWidth;
|
||||
unsigned m_VideoOutWidth;
|
||||
unsigned m_VideoInHeight;
|
||||
unsigned m_VideoOutHeight;
|
||||
unsigned m_BandwidthDownKbps;
|
||||
unsigned m_BandwidthUpKbps;
|
||||
unsigned m_VideoInAvgFps;
|
||||
unsigned m_VideoDecAvgTime;
|
||||
unsigned m_VideoEncAvgTime;
|
||||
};
|
||||
|
||||
class TINYWRAP_API Codec
|
||||
{
|
||||
|
@ -39,8 +107,12 @@ public:
|
|||
|
||||
public:
|
||||
#if !defined(SWIG)
|
||||
const struct tmedia_codec_s* getWrappedCodec(){ return m_pWrappedCodec; }
|
||||
inline bool isOpened(){ return (m_pWrappedCodec && (m_pWrappedCodec->opened == tsk_true)); }
|
||||
const struct tmedia_codec_s* getWrappedCodec() {
|
||||
return m_pWrappedCodec;
|
||||
}
|
||||
inline bool isOpened() {
|
||||
return (m_pWrappedCodec && (m_pWrappedCodec->opened == tsk_true));
|
||||
}
|
||||
#endif
|
||||
twrap_media_type_t getMediaType();
|
||||
const char* getName();
|
||||
|
@ -65,6 +137,7 @@ public:
|
|||
public:
|
||||
bool sessionSetInt32(twrap_media_type_t media, const char* key, int32_t value);
|
||||
int32_t sessionGetInt32(twrap_media_type_t media, const char* key);
|
||||
QoS* sessionGetQoS(twrap_media_type_t media);
|
||||
|
||||
bool consumerSetInt32(twrap_media_type_t media, const char* key, int32_t value);
|
||||
bool consumerSetInt64(twrap_media_type_t media, const char* key, int64_t value);
|
||||
|
@ -89,7 +162,9 @@ public:
|
|||
uint64_t getSessionId(twrap_media_type_t media)const;
|
||||
|
||||
#if !defined(SWIG)
|
||||
inline const tmedia_session_mgr_t* getWrappedMgr()const { return m_pWrappedMgr; }
|
||||
inline const tmedia_session_mgr_t* getWrappedMgr()const {
|
||||
return m_pWrappedMgr;
|
||||
}
|
||||
#endif
|
||||
|
||||
// Defaults
|
||||
|
@ -103,6 +178,8 @@ public:
|
|||
static bool defaultsSetBandwidthVideoUploadMax(int32_t bw_video_up_max_kbps);
|
||||
static bool defaultsSetBandwidthVideoDownloadMax(int32_t bw_video_down_max_kbps);
|
||||
static bool defaultsSetPrefVideoSize(tmedia_pref_video_size_t pref_video_size);
|
||||
static bool defaultsSetPrefVideoSizeOutRange(tmedia_pref_video_size_t min, tmedia_pref_video_size_t max);
|
||||
static bool defaultsSetAdaptativeVideoSizeOutEnabled(bool enabled);
|
||||
static bool defaultsSetJbMargin(uint32_t jb_margin_ms);
|
||||
static bool defaultsSetJbMaxLateRate(uint32_t jb_late_rate_percent);
|
||||
static bool defaultsSetEchoTail(uint32_t echo_tail);
|
||||
|
|
|
@ -160,42 +160,74 @@ const tmsrp_header_t* MsrpMessage::getMsrpHeader(const char* name, unsigned inde
|
|||
if(index == 0) {
|
||||
hdr = (const tmsrp_header_t*)m_pMessage->To;
|
||||
goto bail;
|
||||
}else pos++; }
|
||||
}
|
||||
else {
|
||||
pos++;
|
||||
}
|
||||
}
|
||||
if(tsk_striequals(name, "From-Path")) {
|
||||
if(index == 0) {
|
||||
hdr = (const tmsrp_header_t*)m_pMessage->From;
|
||||
goto bail;
|
||||
}else pos++; }
|
||||
}
|
||||
else {
|
||||
pos++;
|
||||
}
|
||||
}
|
||||
if(tsk_striequals(name, "Message-ID")) {
|
||||
if(index == 0) {
|
||||
hdr = (const tmsrp_header_t*)m_pMessage->MessageID;
|
||||
goto bail;
|
||||
}else pos++; }
|
||||
}
|
||||
else {
|
||||
pos++;
|
||||
}
|
||||
}
|
||||
if(tsk_striequals(name, "Byte-Range")) {
|
||||
if(index == 0) {
|
||||
hdr = (const tmsrp_header_t*)m_pMessage->ByteRange;
|
||||
goto bail;
|
||||
}else pos++; }
|
||||
}
|
||||
else {
|
||||
pos++;
|
||||
}
|
||||
}
|
||||
if(tsk_striequals(name, "Failure-Report")) {
|
||||
if(index == 0) {
|
||||
hdr = (const tmsrp_header_t*)m_pMessage->FailureReport;
|
||||
goto bail;
|
||||
}else pos++; }
|
||||
}
|
||||
else {
|
||||
pos++;
|
||||
}
|
||||
}
|
||||
if(tsk_striequals(name, "Success-Report")) {
|
||||
if(index == 0) {
|
||||
hdr = (const tmsrp_header_t*)m_pMessage->SuccessReport;
|
||||
goto bail;
|
||||
}else pos++; }
|
||||
}
|
||||
else {
|
||||
pos++;
|
||||
}
|
||||
}
|
||||
if(tsk_striequals(name, "Status")) {
|
||||
if(index == 0) {
|
||||
hdr = (const tmsrp_header_t*)m_pMessage->Status;
|
||||
goto bail;
|
||||
}else pos++; }
|
||||
}
|
||||
else {
|
||||
pos++;
|
||||
}
|
||||
}
|
||||
if(tsk_striequals(name, "Content-Type")) {
|
||||
if(index == 0) {
|
||||
hdr = (const tmsrp_header_t*)m_pMessage->ContentType;
|
||||
goto bail;
|
||||
}else pos++; }
|
||||
}
|
||||
else {
|
||||
pos++;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* All other headers */
|
||||
|
|
|
@ -54,7 +54,9 @@ public:
|
|||
unsigned getMsrpContentLength();
|
||||
unsigned getMsrpContent(void* output, unsigned maxsize);
|
||||
#if !defined(SWIG)
|
||||
const tmsrp_message_t* getWrappedMsrpMessage() { return m_pMessage; }
|
||||
const tmsrp_message_t* getWrappedMsrpMessage() {
|
||||
return m_pMessage;
|
||||
}
|
||||
#endif
|
||||
|
||||
private:
|
||||
|
@ -86,7 +88,9 @@ class TINYWRAP_API MsrpCallback
|
|||
public:
|
||||
MsrpCallback() { }
|
||||
virtual ~MsrpCallback() {}
|
||||
virtual int OnEvent(const MsrpEvent* e) { return -1; }
|
||||
virtual int OnEvent(const MsrpEvent* e) {
|
||||
return -1;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -40,8 +40,7 @@
|
|||
|
||||
/* ============ Audio Consumer Interface ================= */
|
||||
|
||||
typedef struct twrap_consumer_proxy_audio_s
|
||||
{
|
||||
typedef struct twrap_consumer_proxy_audio_s {
|
||||
TDAV_DECLARE_CONSUMER_AUDIO;
|
||||
|
||||
uint64_t id;
|
||||
|
@ -206,16 +205,14 @@ static tsk_object_t* twrap_consumer_proxy_audio_dtor(tsk_object_t * self)
|
|||
return self;
|
||||
}
|
||||
/* object definition */
|
||||
static const tsk_object_def_t twrap_consumer_proxy_audio_def_s =
|
||||
{
|
||||
static const tsk_object_def_t twrap_consumer_proxy_audio_def_s = {
|
||||
sizeof(twrap_consumer_proxy_audio_t),
|
||||
twrap_consumer_proxy_audio_ctor,
|
||||
twrap_consumer_proxy_audio_dtor,
|
||||
tdav_consumer_audio_cmp,
|
||||
};
|
||||
/* plugin definition*/
|
||||
static const tmedia_consumer_plugin_def_t twrap_consumer_proxy_audio_plugin_def_s =
|
||||
{
|
||||
static const tmedia_consumer_plugin_def_t twrap_consumer_proxy_audio_plugin_def_s = {
|
||||
&twrap_consumer_proxy_audio_def_s,
|
||||
|
||||
tmedia_audio,
|
||||
|
@ -408,8 +405,7 @@ bool ProxyAudioConsumer::registerPlugin()
|
|||
|
||||
/* ============ Video Consumer Interface ================= */
|
||||
|
||||
typedef struct twrap_consumer_proxy_video_s
|
||||
{
|
||||
typedef struct twrap_consumer_proxy_video_s {
|
||||
TDAV_DECLARE_CONSUMER_VIDEO;
|
||||
|
||||
uint64_t id;
|
||||
|
@ -589,16 +585,14 @@ static tsk_object_t* twrap_consumer_proxy_video_dtor(tsk_object_t * self)
|
|||
return self;
|
||||
}
|
||||
/* object definition */
|
||||
static const tsk_object_def_t twrap_consumer_proxy_video_def_s =
|
||||
{
|
||||
static const tsk_object_def_t twrap_consumer_proxy_video_def_s = {
|
||||
sizeof(twrap_consumer_proxy_video_t),
|
||||
twrap_consumer_proxy_video_ctor,
|
||||
twrap_consumer_proxy_video_dtor,
|
||||
tsk_null,
|
||||
};
|
||||
/* plugin definition*/
|
||||
static const tmedia_consumer_plugin_def_t twrap_consumer_proxy_video_plugin_def_s =
|
||||
{
|
||||
static const tmedia_consumer_plugin_def_t twrap_consumer_proxy_video_plugin_def_s = {
|
||||
&twrap_consumer_proxy_video_def_s,
|
||||
|
||||
tmedia_video,
|
||||
|
@ -705,7 +699,8 @@ tmedia_chroma_t ProxyVideoConsumer::getChroma()const
|
|||
return m_eChroma;
|
||||
}
|
||||
|
||||
bool ProxyVideoConsumer::setAutoResizeDisplay(bool bAutoResizeDisplay){
|
||||
bool ProxyVideoConsumer::setAutoResizeDisplay(bool bAutoResizeDisplay)
|
||||
{
|
||||
if((m_pWrappedPlugin = (twrap_consumer_proxy_video_t*)tsk_object_ref(m_pWrappedPlugin))) {
|
||||
TMEDIA_CONSUMER(m_pWrappedPlugin)->video.display.auto_resize = bAutoResizeDisplay ? tsk_true : tsk_false;
|
||||
m_pWrappedPlugin = (twrap_consumer_proxy_video_t*)tsk_object_unref(m_pWrappedPlugin);
|
||||
|
|
|
@ -44,17 +44,31 @@ public:
|
|||
ProxyAudioConsumerCallback() { }
|
||||
virtual ~ProxyAudioConsumerCallback() { }
|
||||
|
||||
virtual int prepare(int ptime, int rate, int channels) { return -1; }
|
||||
virtual int start() { return -1; }
|
||||
virtual int pause() { return -1; }
|
||||
virtual int stop() { return -1; }
|
||||
virtual int prepare(int ptime, int rate, int channels) {
|
||||
return -1;
|
||||
}
|
||||
virtual int start() {
|
||||
return -1;
|
||||
}
|
||||
virtual int pause() {
|
||||
return -1;
|
||||
}
|
||||
virtual int stop() {
|
||||
return -1;
|
||||
}
|
||||
#if !defined(SWIG)
|
||||
// whether the audio buffer have to be stored in the JB then pulled using "ProxyAudioConsumer::pull()" or not
|
||||
virtual bool putInJitterBuffer(){ return true; }
|
||||
virtual bool putInJitterBuffer() {
|
||||
return true;
|
||||
}
|
||||
// whether we are using the "telepresence" system (PIVOT audio settings must not be changed)
|
||||
virtual bool isPivotSettings() { return false; }
|
||||
virtual bool isPivotSettings() {
|
||||
return false;
|
||||
}
|
||||
// only called if "putInJitterBuffer()" return "true"
|
||||
virtual int consume(const void* buffer_ptr, tsk_size_t buffer_size, const tsk_object_t* proto_hdr){ return -1; }
|
||||
virtual int consume(const void* buffer_ptr, tsk_size_t buffer_size, const tsk_object_t* proto_hdr) {
|
||||
return -1;
|
||||
}
|
||||
#endif
|
||||
};
|
||||
|
||||
|
@ -73,9 +87,13 @@ public:
|
|||
bool setGain(unsigned nGain);
|
||||
unsigned getGain();
|
||||
bool reset();
|
||||
void setCallback(ProxyAudioConsumerCallback* pCallback) { m_pCallback = pCallback; }
|
||||
void setCallback(ProxyAudioConsumerCallback* pCallback) {
|
||||
m_pCallback = pCallback;
|
||||
}
|
||||
#if !defined(SWIG)
|
||||
inline ProxyAudioConsumerCallback* getCallback()const { return m_pCallback; }
|
||||
inline ProxyAudioConsumerCallback* getCallback()const {
|
||||
return m_pCallback;
|
||||
}
|
||||
virtual inline bool isWrapping(tsk_object_t* pWrappedPlugin) {
|
||||
return m_pWrappedPlugin == pWrappedPlugin;
|
||||
}
|
||||
|
@ -111,13 +129,25 @@ public:
|
|||
ProxyVideoConsumerCallback() {}
|
||||
virtual ~ProxyVideoConsumerCallback() {}
|
||||
|
||||
virtual int prepare(int nWidth, int nHeight, int nFps) { return -1; }
|
||||
virtual int consume(const ProxyVideoFrame* frame) { return -1; }
|
||||
virtual int prepare(int nWidth, int nHeight, int nFps) {
|
||||
return -1;
|
||||
}
|
||||
virtual int consume(const ProxyVideoFrame* frame) {
|
||||
return -1;
|
||||
}
|
||||
// only called if a buffer is registered using setPullBuffer(). Otherwise, consume() will be called
|
||||
virtual int bufferCopied(unsigned nCopiedSize, unsigned nAvailableSize) { return -1; }
|
||||
virtual int start() { return -1; }
|
||||
virtual int pause() { return -1; }
|
||||
virtual int stop() { return -1; }
|
||||
virtual int bufferCopied(unsigned nCopiedSize, unsigned nAvailableSize) {
|
||||
return -1;
|
||||
}
|
||||
virtual int start() {
|
||||
return -1;
|
||||
}
|
||||
virtual int pause() {
|
||||
return -1;
|
||||
}
|
||||
virtual int stop() {
|
||||
return -1;
|
||||
}
|
||||
};
|
||||
|
||||
/* ============ ProxyVideoConsumer Class ================= */
|
||||
|
@ -135,7 +165,9 @@ public:
|
|||
unsigned getDecodedWidth();
|
||||
unsigned getDecodedHeight();
|
||||
|
||||
void setCallback(ProxyVideoConsumerCallback* pCallback) { m_pCallback = pCallback; }
|
||||
void setCallback(ProxyVideoConsumerCallback* pCallback) {
|
||||
m_pCallback = pCallback;
|
||||
}
|
||||
bool setAutoResizeDisplay(bool bAutoResizeDisplay);
|
||||
bool getAutoResizeDisplay()const;
|
||||
bool setConsumeBuffer(const void* pConsumeBufferPtr, unsigned nConsumeBufferSize);
|
||||
|
@ -143,9 +175,13 @@ public:
|
|||
bool reset();
|
||||
|
||||
#if !defined(SWIG)
|
||||
bool hasConsumeBuffer()const { return m_ConsumeBuffer.pConsumeBufferPtr && m_ConsumeBuffer.nConsumeBufferSize; }
|
||||
bool hasConsumeBuffer()const {
|
||||
return m_ConsumeBuffer.pConsumeBufferPtr && m_ConsumeBuffer.nConsumeBufferSize;
|
||||
}
|
||||
unsigned copyBuffer(const void* pBuffer, unsigned nSize)const;
|
||||
inline ProxyVideoConsumerCallback* getCallback()const { return m_pCallback; }
|
||||
inline ProxyVideoConsumerCallback* getCallback()const {
|
||||
return m_pCallback;
|
||||
}
|
||||
virtual inline bool isWrapping(tsk_object_t* wrapped_plugin) {
|
||||
return m_pWrappedPlugin == wrapped_plugin;
|
||||
}
|
||||
|
@ -156,13 +192,21 @@ public:
|
|||
|
||||
public:
|
||||
static bool registerPlugin();
|
||||
static void setDefaultChroma(tmedia_chroma_t eChroma){ s_eDefaultChroma = eChroma; }
|
||||
static void setDefaultAutoResizeDisplay(bool bAutoResizeDisplay){ s_bAutoResizeDisplay = bAutoResizeDisplay;}
|
||||
static void setDefaultChroma(tmedia_chroma_t eChroma) {
|
||||
s_eDefaultChroma = eChroma;
|
||||
}
|
||||
static void setDefaultAutoResizeDisplay(bool bAutoResizeDisplay) {
|
||||
s_bAutoResizeDisplay = bAutoResizeDisplay;
|
||||
}
|
||||
|
||||
#if !defined(SWIG)
|
||||
tmedia_chroma_t getChroma()const;
|
||||
static tmedia_chroma_t getDefaultChroma() { return s_eDefaultChroma; }
|
||||
static bool getDefaultAutoResizeDisplay() { return s_bAutoResizeDisplay; }
|
||||
static tmedia_chroma_t getDefaultChroma() {
|
||||
return s_eDefaultChroma;
|
||||
}
|
||||
static bool getDefaultAutoResizeDisplay() {
|
||||
return s_bAutoResizeDisplay;
|
||||
}
|
||||
#endif
|
||||
|
||||
private:
|
||||
|
@ -191,14 +235,24 @@ public:
|
|||
public: /* For Java/C# applications */
|
||||
unsigned getSize();
|
||||
unsigned getContent(void* pOutput, unsigned nMaxsize);
|
||||
inline unsigned getFrameWidth()const{ return m_nFrameWidth; }
|
||||
inline unsigned getFrameHeight()const{ return m_nFrameHeight; }
|
||||
inline unsigned getFrameWidth()const {
|
||||
return m_nFrameWidth;
|
||||
}
|
||||
inline unsigned getFrameHeight()const {
|
||||
return m_nFrameHeight;
|
||||
}
|
||||
|
||||
#if !defined(SWIG) /* For C/C++ applications */
|
||||
public:
|
||||
inline unsigned getBufferSize()const{ return m_nBufferSize; }
|
||||
inline const void* getBufferPtr()const{ return m_pBufferPtr; }
|
||||
inline const tsk_object_t* getProtoHdr()const{ return m_pProtoHdr; }
|
||||
inline unsigned getBufferSize()const {
|
||||
return m_nBufferSize;
|
||||
}
|
||||
inline const void* getBufferPtr()const {
|
||||
return m_pBufferPtr;
|
||||
}
|
||||
inline const tsk_object_t* getProtoHdr()const {
|
||||
return m_pProtoHdr;
|
||||
}
|
||||
#endif
|
||||
|
||||
private:
|
||||
|
|
|
@ -27,8 +27,7 @@
|
|||
//
|
||||
// "twrap_proxy_plugin_t" Declarations
|
||||
//
|
||||
typedef struct twrap_proxy_plugin_s
|
||||
{
|
||||
typedef struct twrap_proxy_plugin_s {
|
||||
TSK_DECLARE_OBJECT;
|
||||
ProxyPlugin* plugin;
|
||||
}
|
||||
|
@ -264,12 +263,15 @@ static int twrap_proxy_plugin_cmp(const tsk_object_t *_c1, const tsk_object_t *_
|
|||
if(c1 && c2) {
|
||||
return (c1->plugin == c2->plugin); // See "ProxyPlugin::operator =="
|
||||
}
|
||||
else if(!c1 && !c2) return 0;
|
||||
else return -1;
|
||||
else if(!c1 && !c2) {
|
||||
return 0;
|
||||
}
|
||||
else {
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
static const tsk_object_def_t twrap_proxy_plugin_def_s =
|
||||
{
|
||||
static const tsk_object_def_t twrap_proxy_plugin_def_s = {
|
||||
sizeof(twrap_proxy_plugin_t),
|
||||
twrap_proxy_plugin_ctor,
|
||||
twrap_proxy_plugin_dtor,
|
||||
|
|
|
@ -33,8 +33,7 @@ class ProxyAudioProducer;
|
|||
class ProxyVideoProducer;
|
||||
class ProxyPluginMgrCallback;
|
||||
|
||||
typedef enum twrap_proxy_plugin_type_e
|
||||
{
|
||||
typedef enum twrap_proxy_plugin_type_e {
|
||||
twrap_proxy_plugin_audio_producer,
|
||||
twrap_proxy_plugin_video_producer,
|
||||
twrap_proxy_plugin_audio_consumer,
|
||||
|
@ -68,7 +67,9 @@ public:
|
|||
int removePlugin(uint64_t id);
|
||||
int removePlugin(ProxyPlugin**);
|
||||
|
||||
inline ProxyPluginMgrCallback* getCallback(){ return this->callback; }
|
||||
inline ProxyPluginMgrCallback* getCallback() {
|
||||
return this->callback;
|
||||
}
|
||||
#endif
|
||||
|
||||
const ProxyPlugin* findPlugin(uint64_t id);
|
||||
|
@ -93,8 +94,12 @@ public:
|
|||
ProxyPluginMgrCallback() { }
|
||||
virtual ~ProxyPluginMgrCallback() { }
|
||||
|
||||
virtual int OnPluginCreated(uint64_t id, enum twrap_proxy_plugin_type_e type) { return -1; }
|
||||
virtual int OnPluginDestroyed(uint64_t id, enum twrap_proxy_plugin_type_e type) { return -1; }
|
||||
virtual int OnPluginCreated(uint64_t id, enum twrap_proxy_plugin_type_e type) {
|
||||
return -1;
|
||||
}
|
||||
virtual int OnPluginDestroyed(uint64_t id, enum twrap_proxy_plugin_type_e type) {
|
||||
return -1;
|
||||
}
|
||||
};
|
||||
|
||||
/* ============ ProxyPlugin Class ================= */
|
||||
|
@ -117,8 +122,12 @@ public:
|
|||
virtual inline uint64_t getMediaSessionId() = 0;
|
||||
#endif
|
||||
|
||||
inline twrap_proxy_plugin_type_t getType()const{ return this->type; }
|
||||
inline uint64_t getId()const{ return this->id; }
|
||||
inline twrap_proxy_plugin_type_t getType()const {
|
||||
return this->type;
|
||||
}
|
||||
inline uint64_t getId()const {
|
||||
return this->id;
|
||||
}
|
||||
|
||||
protected:
|
||||
uint64_t id;
|
||||
|
|
|
@ -37,8 +37,7 @@
|
|||
|
||||
|
||||
/* ============ Audio Media Producer Interface ================= */
|
||||
typedef struct twrap_producer_proxy_audio_s
|
||||
{
|
||||
typedef struct twrap_producer_proxy_audio_s {
|
||||
TDAV_DECLARE_PRODUCER_AUDIO;
|
||||
|
||||
uint64_t id;
|
||||
|
@ -166,16 +165,14 @@ static tsk_object_t* twrap_producer_proxy_audio_dtor(tsk_object_t * self)
|
|||
return self;
|
||||
}
|
||||
/* object definition */
|
||||
static const tsk_object_def_t twrap_producer_proxy_audio_def_s =
|
||||
{
|
||||
static const tsk_object_def_t twrap_producer_proxy_audio_def_s = {
|
||||
sizeof(twrap_producer_proxy_audio_t),
|
||||
twrap_producer_proxy_audio_ctor,
|
||||
twrap_producer_proxy_audio_dtor,
|
||||
tdav_producer_audio_cmp,
|
||||
};
|
||||
/* plugin definition*/
|
||||
static const tmedia_producer_plugin_def_t twrap_producer_proxy_audio_plugin_def_s =
|
||||
{
|
||||
static const tmedia_producer_plugin_def_t twrap_producer_proxy_audio_plugin_def_s = {
|
||||
&twrap_producer_proxy_audio_def_s,
|
||||
|
||||
tmedia_audio,
|
||||
|
@ -354,8 +351,7 @@ bool ProxyAudioProducer::registerPlugin()
|
|||
|
||||
|
||||
/* ============ Video Media Producer Interface ================= */
|
||||
typedef struct twrap_producer_proxy_video_s
|
||||
{
|
||||
typedef struct twrap_producer_proxy_video_s {
|
||||
TMEDIA_DECLARE_PRODUCER;
|
||||
|
||||
int rotation;
|
||||
|
@ -486,16 +482,14 @@ static tsk_object_t* twrap_producer_proxy_video_dtor(tsk_object_t * self)
|
|||
return self;
|
||||
}
|
||||
/* object definition */
|
||||
static const tsk_object_def_t twrap_producer_proxy_video_def_s =
|
||||
{
|
||||
static const tsk_object_def_t twrap_producer_proxy_video_def_s = {
|
||||
sizeof(twrap_producer_proxy_video_t),
|
||||
twrap_producer_proxy_video_ctor,
|
||||
twrap_producer_proxy_video_dtor,
|
||||
tsk_null,
|
||||
};
|
||||
/* plugin definition*/
|
||||
static const tmedia_producer_plugin_def_t twrap_producer_proxy_video_plugin_def_s =
|
||||
{
|
||||
static const tmedia_producer_plugin_def_t twrap_producer_proxy_video_plugin_def_s = {
|
||||
&twrap_producer_proxy_video_def_s,
|
||||
|
||||
tmedia_video,
|
||||
|
|
|
@ -44,12 +44,22 @@ public:
|
|||
ProxyAudioProducerCallback() { }
|
||||
virtual ~ProxyAudioProducerCallback() { }
|
||||
|
||||
virtual int prepare(int ptime, int rate, int channels) { return -1; }
|
||||
virtual int start() { return -1; }
|
||||
virtual int pause() { return -1; }
|
||||
virtual int stop() { return -1; }
|
||||
virtual int prepare(int ptime, int rate, int channels) {
|
||||
return -1;
|
||||
}
|
||||
virtual int start() {
|
||||
return -1;
|
||||
}
|
||||
virtual int pause() {
|
||||
return -1;
|
||||
}
|
||||
virtual int stop() {
|
||||
return -1;
|
||||
}
|
||||
// this function is called to signal that it's time to copy push data
|
||||
virtual int fillPushBuffer(){ return -1; }
|
||||
virtual int fillPushBuffer() {
|
||||
return -1;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
@ -67,10 +77,16 @@ public:
|
|||
int push(const void* pBuffer=tsk_null, unsigned nSize=0);
|
||||
bool setGain(unsigned nGain);
|
||||
unsigned getGain();
|
||||
void setCallback(ProxyAudioProducerCallback* pCallback) { m_pCallback = pCallback; }
|
||||
void setCallback(ProxyAudioProducerCallback* pCallback) {
|
||||
m_pCallback = pCallback;
|
||||
}
|
||||
#if !defined(SWIG)
|
||||
inline bool usePushCallback(){ return m_bUsePushCallback; }
|
||||
inline ProxyAudioProducerCallback* getCallback()const { return m_pCallback; }
|
||||
inline bool usePushCallback() {
|
||||
return m_bUsePushCallback;
|
||||
}
|
||||
inline ProxyAudioProducerCallback* getCallback()const {
|
||||
return m_pCallback;
|
||||
}
|
||||
virtual inline bool isWrapping(tsk_object_t* pWrappedPlugin) {
|
||||
return m_pWrappedPlugin == pWrappedPlugin;
|
||||
}
|
||||
|
@ -109,10 +125,18 @@ public:
|
|||
ProxyVideoProducerCallback() { }
|
||||
virtual ~ProxyVideoProducerCallback() { }
|
||||
|
||||
virtual int prepare(int width, int height, int fps) { return -1; }
|
||||
virtual int start() { return -1; }
|
||||
virtual int pause() { return -1; }
|
||||
virtual int stop() { return -1; }
|
||||
virtual int prepare(int width, int height, int fps) {
|
||||
return -1;
|
||||
}
|
||||
virtual int start() {
|
||||
return -1;
|
||||
}
|
||||
virtual int pause() {
|
||||
return -1;
|
||||
}
|
||||
virtual int stop() {
|
||||
return -1;
|
||||
}
|
||||
};
|
||||
|
||||
/* ============ ProxyVideoProducer Class ================= */
|
||||
|
@ -130,11 +154,15 @@ public:
|
|||
bool setMirror(bool bMirror);
|
||||
bool setActualCameraOutputSize(unsigned nWidth, unsigned nHeight);
|
||||
int push(const void* pBuffer, unsigned nSize);
|
||||
void setCallback(ProxyVideoProducerCallback* pCallback) { m_pCallback = pCallback; }
|
||||
void setCallback(ProxyVideoProducerCallback* pCallback) {
|
||||
m_pCallback = pCallback;
|
||||
}
|
||||
#if !defined(SWIG)
|
||||
int sendRaw(const void* pBuffer, unsigned nSize, unsigned nDuration, bool bMarker);
|
||||
int sendRaw(const void* pBuffer, unsigned nSize, const void* proto_hdr);
|
||||
inline ProxyVideoProducerCallback* getCallback()const { return m_pCallback; }
|
||||
inline ProxyVideoProducerCallback* getCallback()const {
|
||||
return m_pCallback;
|
||||
}
|
||||
virtual inline bool isWrapping(tsk_object_t* wrapped_plugin) {
|
||||
return m_pWrappedPlugin == wrapped_plugin;
|
||||
}
|
||||
|
@ -148,11 +176,15 @@ public:
|
|||
|
||||
public:
|
||||
static bool registerPlugin();
|
||||
static void setDefaultChroma(tmedia_chroma_t eChroma){ s_eDefaultChroma = eChroma; }
|
||||
static void setDefaultChroma(tmedia_chroma_t eChroma) {
|
||||
s_eDefaultChroma = eChroma;
|
||||
}
|
||||
|
||||
#if !defined(SWIG)
|
||||
tmedia_chroma_t getChroma()const;
|
||||
static tmedia_chroma_t getDefaultChroma() { return s_eDefaultChroma; }
|
||||
static tmedia_chroma_t getDefaultChroma() {
|
||||
return s_eDefaultChroma;
|
||||
}
|
||||
#endif
|
||||
|
||||
private:
|
||||
|
|
|
@ -309,8 +309,7 @@ SMSData* SMSEncoder::decode(const void* data, unsigned size, bool MobOrig)
|
|||
|
||||
switch(rp_message->mti) {
|
||||
case tsms_rpdu_type_data_mo:
|
||||
case tsms_rpdu_type_data_mt:
|
||||
{
|
||||
case tsms_rpdu_type_data_mt: {
|
||||
char* ascii = tsk_null;
|
||||
tsms_rpdu_data_t* rp_data = TSMS_RPDU_DATA(rp_message);
|
||||
if((tpdu = tsms_tpdu_message_deserialize(rp_data->udata->data, rp_data->udata->size, MobOrig))) {
|
||||
|
@ -333,8 +332,7 @@ SMSData* SMSEncoder::decode(const void* data, unsigned size, bool MobOrig)
|
|||
break;
|
||||
}
|
||||
case tsms_rpdu_type_ack_mo:
|
||||
case tsms_rpdu_type_ack_mt:
|
||||
{
|
||||
case tsms_rpdu_type_ack_mt: {
|
||||
tsms_rpdu_ack_t* rp_ack = TSMS_RPDU_ACK(rp_message);
|
||||
// ...do whatever you want
|
||||
if(rp_ack->udata && (tpdu = tsms_tpdu_message_deserialize(rp_ack->udata->data, rp_ack->udata->size, MobOrig))) {
|
||||
|
@ -344,8 +342,7 @@ SMSData* SMSEncoder::decode(const void* data, unsigned size, bool MobOrig)
|
|||
break;
|
||||
}
|
||||
case tsms_rpdu_type_error_mo:
|
||||
case tsms_rpdu_type_error_mt:
|
||||
{
|
||||
case tsms_rpdu_type_error_mt: {
|
||||
tsms_rpdu_error_t* rp_error = TSMS_RPDU_ERROR(rp_message);
|
||||
// ...do whatever you want
|
||||
if(rp_error->udata && (tpdu = tsms_tpdu_message_deserialize(rp_error->udata->data, rp_error->udata->size, MobOrig))) {
|
||||
|
@ -354,15 +351,13 @@ SMSData* SMSEncoder::decode(const void* data, unsigned size, bool MobOrig)
|
|||
decodedData = new SMSData(twrap_sms_type_error, rp_message->mr, tsk_null, 0);
|
||||
break;
|
||||
}
|
||||
case tsms_rpdu_type_smma_mo:
|
||||
{
|
||||
case tsms_rpdu_type_smma_mo: {
|
||||
// tsms_rpdu_smma_t* rp_smma = TSMS_RPDU_SMMA(rp_message);
|
||||
// ...do whatever you want
|
||||
decodedData = new SMSData(twrap_sms_type_smma, rp_message->mr, tsk_null, 0);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
{
|
||||
default: {
|
||||
TSK_DEBUG_INFO("Unknown RP-Message type (%u).", rp_message->mti);
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -27,8 +27,7 @@
|
|||
#include "tinysip.h" /* SIP/IMS */
|
||||
#include "tinysms.h" /* Binary SMS API*/
|
||||
|
||||
typedef enum twrap_rpmessage_type_e
|
||||
{
|
||||
typedef enum twrap_rpmessage_type_e {
|
||||
twrap_rpmessage_type_sms_none,
|
||||
twrap_rpmessage_type_sms_submit,
|
||||
twrap_rpmessage_type_sms_deliver,
|
||||
|
@ -37,8 +36,7 @@ typedef enum twrap_rpmessage_type_e
|
|||
}
|
||||
twrap_rpmessage_type_t;
|
||||
|
||||
typedef enum twrap_sms_type_e
|
||||
{
|
||||
typedef enum twrap_sms_type_e {
|
||||
twrap_sms_type_none,
|
||||
twrap_sms_type_rpdata,
|
||||
twrap_sms_type_smma,
|
||||
|
|
|
@ -38,16 +38,34 @@ class SipCallback
|
|||
public:
|
||||
SipCallback() { }
|
||||
virtual ~SipCallback() {}
|
||||
virtual int OnDialogEvent(const DialogEvent* e) { return -1; }
|
||||
virtual int OnStackEvent(const StackEvent* e) { return -1; }
|
||||
virtual int OnDialogEvent(const DialogEvent* e) {
|
||||
return -1;
|
||||
}
|
||||
virtual int OnStackEvent(const StackEvent* e) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
virtual int OnInviteEvent(const InviteEvent* e) { return -1; }
|
||||
virtual int OnMessagingEvent(const MessagingEvent* e) { return -1; }
|
||||
virtual int OnInfoEvent(const InfoEvent* e) { return -1; }
|
||||
virtual int OnOptionsEvent(const OptionsEvent* e) { return -1; }
|
||||
virtual int OnPublicationEvent(const PublicationEvent* e) { return -1; }
|
||||
virtual int OnRegistrationEvent(const RegistrationEvent* e) { return -1; }
|
||||
virtual int OnSubscriptionEvent(const SubscriptionEvent* e) { return -1; }
|
||||
virtual int OnInviteEvent(const InviteEvent* e) {
|
||||
return -1;
|
||||
}
|
||||
virtual int OnMessagingEvent(const MessagingEvent* e) {
|
||||
return -1;
|
||||
}
|
||||
virtual int OnInfoEvent(const InfoEvent* e) {
|
||||
return -1;
|
||||
}
|
||||
virtual int OnOptionsEvent(const OptionsEvent* e) {
|
||||
return -1;
|
||||
}
|
||||
virtual int OnPublicationEvent(const PublicationEvent* e) {
|
||||
return -1;
|
||||
}
|
||||
virtual int OnRegistrationEvent(const RegistrationEvent* e) {
|
||||
return -1;
|
||||
}
|
||||
virtual int OnSubscriptionEvent(const SubscriptionEvent* e) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
|
|
|
@ -58,7 +58,9 @@ public:
|
|||
const SipSession* getBaseSession() const;
|
||||
const SipMessage* getSipMessage() const;
|
||||
#if !defined(SWIG)
|
||||
const tsip_event_t * getWrappedEvent(){ return sipevent; }
|
||||
const tsip_event_t * getWrappedEvent() {
|
||||
return sipevent;
|
||||
}
|
||||
#endif
|
||||
#if !defined(SWIG)
|
||||
SipStack* getStack()const;
|
||||
|
|
|
@ -45,23 +45,53 @@ char* SdpMessage::getSdpHeaderValue(const char* media, char name, unsigned index
|
|||
tsdp_header_type_t type = tsdp_htype_Dummy;
|
||||
const tsdp_header_t* header;
|
||||
switch(name) {
|
||||
case 'a': type = tsdp_htype_A; break;
|
||||
case 'b': type = tsdp_htype_B; break;
|
||||
case 'c': type = tsdp_htype_C; break;
|
||||
case 'e': type = tsdp_htype_E; break;
|
||||
case 'i': type = tsdp_htype_I; break;
|
||||
case 'k': type = tsdp_htype_K; break;
|
||||
case 'm': type = tsdp_htype_M; break;
|
||||
case 'o': type = tsdp_htype_O; break;
|
||||
case 'a':
|
||||
type = tsdp_htype_A;
|
||||
break;
|
||||
case 'b':
|
||||
type = tsdp_htype_B;
|
||||
break;
|
||||
case 'c':
|
||||
type = tsdp_htype_C;
|
||||
break;
|
||||
case 'e':
|
||||
type = tsdp_htype_E;
|
||||
break;
|
||||
case 'i':
|
||||
type = tsdp_htype_I;
|
||||
break;
|
||||
case 'k':
|
||||
type = tsdp_htype_K;
|
||||
break;
|
||||
case 'm':
|
||||
type = tsdp_htype_M;
|
||||
break;
|
||||
case 'o':
|
||||
type = tsdp_htype_O;
|
||||
break;
|
||||
|
||||
|
||||
case 'p': type = tsdp_htype_P; break;
|
||||
case 'r': type = tsdp_htype_R; break;
|
||||
case 's': type = tsdp_htype_S; break;
|
||||
case 't': type = tsdp_htype_T; break;
|
||||
case 'u': type = tsdp_htype_U; break;
|
||||
case 'v': type = tsdp_htype_V; break;
|
||||
case 'z': type = tsdp_htype_Z; break;
|
||||
case 'p':
|
||||
type = tsdp_htype_P;
|
||||
break;
|
||||
case 'r':
|
||||
type = tsdp_htype_R;
|
||||
break;
|
||||
case 's':
|
||||
type = tsdp_htype_S;
|
||||
break;
|
||||
case 't':
|
||||
type = tsdp_htype_T;
|
||||
break;
|
||||
case 'u':
|
||||
type = tsdp_htype_U;
|
||||
break;
|
||||
case 'v':
|
||||
type = tsdp_htype_V;
|
||||
break;
|
||||
case 'z':
|
||||
type = tsdp_htype_Z;
|
||||
break;
|
||||
}
|
||||
|
||||
if((header = tsdp_message_get_headerAt(m_pSdpMessage, type, index))) {
|
||||
|
@ -149,47 +179,83 @@ const tsip_header_t* SipMessage::getSipHeader(const char* name, unsigned index /
|
|||
if(index == 0) {
|
||||
hdr = (const tsip_header_t*)m_pSipMessage->firstVia;
|
||||
goto bail;
|
||||
}else pos++; }
|
||||
}
|
||||
else {
|
||||
pos++;
|
||||
}
|
||||
}
|
||||
if(tsk_striequals(name, "f") || tsk_striequals(name, "from")) {
|
||||
if(index == 0) {
|
||||
hdr = (const tsip_header_t*)m_pSipMessage->From;
|
||||
goto bail;
|
||||
}else pos++; }
|
||||
}
|
||||
else {
|
||||
pos++;
|
||||
}
|
||||
}
|
||||
if(tsk_striequals(name, "t") || tsk_striequals(name, "to")) {
|
||||
if(index == 0) {
|
||||
hdr = (const tsip_header_t*)m_pSipMessage->To;
|
||||
goto bail;
|
||||
}else pos++; }
|
||||
}
|
||||
else {
|
||||
pos++;
|
||||
}
|
||||
}
|
||||
if(tsk_striequals(name, "m") || tsk_striequals(name, "contact")) {
|
||||
if(index == 0) {
|
||||
hdr = (const tsip_header_t*)m_pSipMessage->Contact;
|
||||
goto bail;
|
||||
}else pos++; }
|
||||
}
|
||||
else {
|
||||
pos++;
|
||||
}
|
||||
}
|
||||
if(tsk_striequals(name, "i") || tsk_striequals(name, "call-id")) {
|
||||
if(index == 0) {
|
||||
hdr = (const tsip_header_t*)m_pSipMessage->Call_ID;
|
||||
goto bail;
|
||||
}else pos++; }
|
||||
}
|
||||
else {
|
||||
pos++;
|
||||
}
|
||||
}
|
||||
if(tsk_striequals(name, "cseq")) {
|
||||
if(index == 0) {
|
||||
hdr = (const tsip_header_t*)m_pSipMessage->CSeq;
|
||||
goto bail;
|
||||
}else pos++; }
|
||||
}
|
||||
else {
|
||||
pos++;
|
||||
}
|
||||
}
|
||||
if(tsk_striequals(name, "expires")) {
|
||||
if(index == 0) {
|
||||
hdr = (const tsip_header_t*)m_pSipMessage->Expires;
|
||||
goto bail;
|
||||
}else pos++; }
|
||||
}
|
||||
else {
|
||||
pos++;
|
||||
}
|
||||
}
|
||||
if(tsk_striequals(name, "c") || tsk_striequals(name, "content-type")) {
|
||||
if(index == 0) {
|
||||
hdr = (const tsip_header_t*)m_pSipMessage->Content_Type;
|
||||
goto bail;
|
||||
}else pos++; }
|
||||
}
|
||||
else {
|
||||
pos++;
|
||||
}
|
||||
}
|
||||
if(tsk_striequals(name, "l") || tsk_striequals(name, "content-length")) {
|
||||
if(index == 0) {
|
||||
hdr = (const tsip_header_t*)m_pSipMessage->Content_Length;
|
||||
goto bail;
|
||||
}else pos++; }
|
||||
}
|
||||
else {
|
||||
pos++;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
tsk_list_foreach(item, m_pSipMessage->headers) {
|
||||
|
|
|
@ -37,7 +37,9 @@ public:
|
|||
char* getSdpHeaderValue(const char* media, char name, unsigned index = 0);
|
||||
char* getSdpHeaderAValue(const char* media, const char* attributeName);
|
||||
#if !defined(SWIG)
|
||||
const tsdp_message_t * getWrappedSdpMessage(){ return m_pSdpMessage; }
|
||||
const tsdp_message_t * getWrappedSdpMessage() {
|
||||
return m_pSdpMessage;
|
||||
}
|
||||
#endif
|
||||
|
||||
private:
|
||||
|
@ -63,7 +65,9 @@ public:
|
|||
unsigned getSipContent(void* output, unsigned maxsize);
|
||||
#if !defined(SWIG)
|
||||
const void* getSipContentPtr();
|
||||
const tsip_message_t* getWrappedSipMessage()const{ return m_pSipMessage; }
|
||||
const tsip_message_t* getWrappedSipMessage()const {
|
||||
return m_pSipMessage;
|
||||
}
|
||||
#endif
|
||||
const SdpMessage* getSdpMessage();
|
||||
|
||||
|
|
|
@ -26,8 +26,7 @@
|
|||
#include "Msrp.h"
|
||||
|
||||
/* ======================== AsyncAction ========================*/
|
||||
typedef struct twrap_async_action_s
|
||||
{
|
||||
typedef struct twrap_async_action_s {
|
||||
const tsip_ssession_handle_t *session;
|
||||
const ActionConfig* config;
|
||||
}
|
||||
|
|
|
@ -34,7 +34,8 @@ class MsrpCallback;
|
|||
class MediaSessionMgr;
|
||||
|
||||
/* ======================== T140Callback ========================*/
|
||||
class TINYWRAP_API T140CallbackData{
|
||||
class TINYWRAP_API T140CallbackData
|
||||
{
|
||||
public:
|
||||
#if !defined(SWIG)
|
||||
T140CallbackData(enum tmedia_t140_data_type_e data_type, const void* data_ptr, unsigned data_size) {
|
||||
|
@ -45,8 +46,12 @@ class TINYWRAP_API T140CallbackData{
|
|||
#endif
|
||||
virtual ~T140CallbackData() {}
|
||||
|
||||
inline enum tmedia_t140_data_type_e getType()const{ return m_eType; }
|
||||
inline unsigned getSize()const{ return m_nSize; }
|
||||
inline enum tmedia_t140_data_type_e getType()const {
|
||||
return m_eType;
|
||||
}
|
||||
inline unsigned getSize()const {
|
||||
return m_nSize;
|
||||
}
|
||||
inline unsigned getData(void* pOutput, unsigned nMaxsize)const {
|
||||
unsigned nRetsize = 0;
|
||||
if(pOutput && nMaxsize && m_pPtr) {
|
||||
|
@ -67,19 +72,26 @@ class TINYWRAP_API T140Callback
|
|||
public:
|
||||
T140Callback() {}
|
||||
virtual ~T140Callback() {}
|
||||
virtual int ondata(const T140CallbackData* pData){ return 0; }
|
||||
virtual int ondata(const T140CallbackData* pData) {
|
||||
return 0;
|
||||
}
|
||||
};
|
||||
|
||||
#if !defined(SWIG)
|
||||
class RtcpCallbackData{
|
||||
class RtcpCallbackData
|
||||
{
|
||||
public:
|
||||
RtcpCallbackData(enum tmedia_rtcp_event_type_e event_type, uint32_t ssrc_media) {
|
||||
m_eType = event_type;
|
||||
m_nSSRC = ssrc_media;
|
||||
}
|
||||
virtual ~RtcpCallbackData() {}
|
||||
inline enum tmedia_rtcp_event_type_e getType()const{ return m_eType; }
|
||||
inline uint32_t getSSRC()const{ return m_nSSRC; }
|
||||
inline enum tmedia_rtcp_event_type_e getType()const {
|
||||
return m_eType;
|
||||
}
|
||||
inline uint32_t getSSRC()const {
|
||||
return m_nSSRC;
|
||||
}
|
||||
private:
|
||||
enum tmedia_rtcp_event_type_e m_eType;
|
||||
uint32_t m_nSSRC;
|
||||
|
@ -90,7 +102,9 @@ class TINYWRAP_API RtcpCallback
|
|||
public:
|
||||
RtcpCallback() {}
|
||||
virtual ~RtcpCallback() {}
|
||||
virtual int onevent(const RtcpCallbackData* e){ return 0; }
|
||||
virtual int onevent(const RtcpCallbackData* e) {
|
||||
return 0;
|
||||
}
|
||||
};
|
||||
#endif /* #if !defined(SWIG) */
|
||||
|
||||
|
@ -129,7 +143,9 @@ public:
|
|||
#if !defined(SWIG)
|
||||
bool setWebSocketSrc(const char* host, int32_t port, const char* proto);
|
||||
const SipStack* getStack() const;
|
||||
const tsip_ssession_handle_t* getWrappedSession() { return m_pHandle; }
|
||||
const tsip_ssession_handle_t* getWrappedSession() {
|
||||
return m_pHandle;
|
||||
}
|
||||
#endif
|
||||
|
||||
private:
|
||||
|
|
|
@ -163,7 +163,8 @@ bool SipStack::setLocalPort(unsigned short port, const char* transport/*=tsk_nul
|
|||
TSIP_STACK_SET_NULL()) == 0);
|
||||
}
|
||||
|
||||
bool SipStack::setEarlyIMS(bool enabled){
|
||||
bool SipStack::setEarlyIMS(bool enabled)
|
||||
{
|
||||
return (tsip_stack_set(m_pHandle,
|
||||
TSIP_STACK_SET_EARLY_IMS(enabled? tsk_true : tsk_false),
|
||||
TSIP_STACK_SET_NULL()) == 0);
|
||||
|
@ -526,56 +527,56 @@ static int stack_callback(const tsip_event_t *sipevent)
|
|||
sipStack->Lock();
|
||||
|
||||
switch(sipevent->type) {
|
||||
case tsip_event_register:
|
||||
{ /* REGISTER */
|
||||
case tsip_event_register: {
|
||||
/* REGISTER */
|
||||
if(sipStack->getCallback()) {
|
||||
e = new RegistrationEvent(sipevent);
|
||||
sipStack->getCallback()->OnRegistrationEvent((const RegistrationEvent*)e);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case tsip_event_invite:
|
||||
{ /* INVITE */
|
||||
case tsip_event_invite: {
|
||||
/* INVITE */
|
||||
if(sipStack->getCallback()) {
|
||||
e = new InviteEvent(sipevent);
|
||||
sipStack->getCallback()->OnInviteEvent((const InviteEvent*)e);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case tsip_event_message:
|
||||
{ /* MESSAGE */
|
||||
case tsip_event_message: {
|
||||
/* MESSAGE */
|
||||
if(sipStack->getCallback()) {
|
||||
e = new MessagingEvent(sipevent);
|
||||
sipStack->getCallback()->OnMessagingEvent((const MessagingEvent*)e);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case tsip_event_info:
|
||||
{ /* INFO */
|
||||
case tsip_event_info: {
|
||||
/* INFO */
|
||||
if(sipStack->getCallback()) {
|
||||
e = new InfoEvent(sipevent);
|
||||
sipStack->getCallback()->OnInfoEvent((const InfoEvent*)e);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case tsip_event_options:
|
||||
{ /* OPTIONS */
|
||||
case tsip_event_options: {
|
||||
/* OPTIONS */
|
||||
if(sipStack->getCallback()) {
|
||||
e = new OptionsEvent(sipevent);
|
||||
sipStack->getCallback()->OnOptionsEvent((const OptionsEvent*)e);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case tsip_event_publish:
|
||||
{ /* PUBLISH */
|
||||
case tsip_event_publish: {
|
||||
/* PUBLISH */
|
||||
if(sipStack->getCallback()) {
|
||||
e = new PublicationEvent(sipevent);
|
||||
sipStack->getCallback()->OnPublicationEvent((const PublicationEvent*)e);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case tsip_event_subscribe:
|
||||
{ /* SUBSCRIBE */
|
||||
case tsip_event_subscribe: {
|
||||
/* SUBSCRIBE */
|
||||
if(sipStack->getCallback()) {
|
||||
e = new SubscriptionEvent(sipevent);
|
||||
sipStack->getCallback()->OnSubscriptionEvent((const SubscriptionEvent*)e);
|
||||
|
@ -583,8 +584,8 @@ static int stack_callback(const tsip_event_t *sipevent)
|
|||
break;
|
||||
}
|
||||
|
||||
case tsip_event_dialog:
|
||||
{ /* Common to all dialogs */
|
||||
case tsip_event_dialog: {
|
||||
/* Common to all dialogs */
|
||||
if(sipStack->getCallback()) {
|
||||
e = new DialogEvent(sipevent);
|
||||
sipStack->getCallback()->OnDialogEvent((const DialogEvent*)e);
|
||||
|
@ -592,8 +593,8 @@ static int stack_callback(const tsip_event_t *sipevent)
|
|||
break;
|
||||
}
|
||||
|
||||
case tsip_event_stack:
|
||||
{ /* Stack event */
|
||||
case tsip_event_stack: {
|
||||
/* Stack event */
|
||||
if(sipStack->getCallback()) {
|
||||
e = new StackEvent(sipevent);
|
||||
sipStack->getCallback()->OnStackEvent((const StackEvent*)e);
|
||||
|
@ -601,8 +602,8 @@ static int stack_callback(const tsip_event_t *sipevent)
|
|||
break;
|
||||
}
|
||||
|
||||
default:
|
||||
{ /* Unsupported */
|
||||
default: {
|
||||
/* Unsupported */
|
||||
TSK_DEBUG_WARN("%d not supported as SIP event.", sipevent->type);
|
||||
ret = -3;
|
||||
break;
|
||||
|
|
|
@ -29,8 +29,7 @@ unsigned XcapStack::count = 0;
|
|||
static int stack_callback(const thttp_event_t *httpevent);
|
||||
|
||||
/* =================================== XCAP Event ==================================== */
|
||||
typedef enum twrap_xcap_step_type_e
|
||||
{
|
||||
typedef enum twrap_xcap_step_type_e {
|
||||
txst_name,
|
||||
txst_pos,
|
||||
txst_att,
|
||||
|
@ -39,8 +38,7 @@ typedef enum twrap_xcap_step_type_e
|
|||
}
|
||||
twrap_xcap_step_type_t;
|
||||
|
||||
typedef struct twrap_xcap_step_s
|
||||
{
|
||||
typedef struct twrap_xcap_step_s {
|
||||
TSK_DECLARE_OBJECT;
|
||||
|
||||
twrap_xcap_step_type_t type;
|
||||
|
@ -77,8 +75,7 @@ static tsk_object_t* twrap_xcap_step_dtor(tsk_object_t * self)
|
|||
return self;
|
||||
}
|
||||
|
||||
static const tsk_object_def_t twrap_xcap_step_def_s =
|
||||
{
|
||||
static const tsk_object_def_t twrap_xcap_step_def_s = {
|
||||
sizeof(twrap_xcap_step_t),
|
||||
twrap_xcap_step_ctor,
|
||||
twrap_xcap_step_dtor,
|
||||
|
@ -86,7 +83,8 @@ static const tsk_object_def_t twrap_xcap_step_def_s =
|
|||
};
|
||||
const tsk_object_def_t *twrap_xcap_step_def_t = &twrap_xcap_step_def_s;
|
||||
|
||||
twrap_xcap_step_t* twrap_xcap_step_create(twrap_xcap_step_type_t type){
|
||||
twrap_xcap_step_t* twrap_xcap_step_create(twrap_xcap_step_type_t type)
|
||||
{
|
||||
twrap_xcap_step_t* step;
|
||||
if((step = (twrap_xcap_step_t*)tsk_object_new(twrap_xcap_step_def_t))) {
|
||||
step->type = type;
|
||||
|
|
|
@ -106,7 +106,9 @@ public:
|
|||
XcapCallback();
|
||||
virtual ~XcapCallback();
|
||||
|
||||
virtual int onEvent(const XcapEvent* e)const { return -1; }
|
||||
virtual int onEvent(const XcapEvent* e)const {
|
||||
return -1;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -33,6 +33,7 @@
|
|||
%newobject SipStack::getPreferredIdentity;
|
||||
%newobject SipStack::getLocalIPnPort;
|
||||
%newobject MediaSessionMgr::producerGetCodec;
|
||||
%newobject MediaSessionMgr::sessionGetQoS;
|
||||
|
||||
%newobject MessagingEvent::takeSessionOwnership;
|
||||
%newobject InviteEvent::takeCallSessionOwnership;
|
||||
|
|
|
@ -51,6 +51,12 @@ public class MediaSessionMgr : IDisposable {
|
|||
return ret;
|
||||
}
|
||||
|
||||
public QoS sessionGetQoS(twrap_media_type_t media) {
|
||||
IntPtr cPtr = tinyWRAPPINVOKE.MediaSessionMgr_sessionGetQoS(swigCPtr, (int)media);
|
||||
QoS ret = (cPtr == IntPtr.Zero) ? null : new QoS(cPtr, true);
|
||||
return ret;
|
||||
}
|
||||
|
||||
public bool consumerSetInt32(twrap_media_type_t media, string key, int value) {
|
||||
bool ret = tinyWRAPPINVOKE.MediaSessionMgr_consumerSetInt32(swigCPtr, (int)media, key, value);
|
||||
return ret;
|
||||
|
@ -149,6 +155,16 @@ public class MediaSessionMgr : IDisposable {
|
|||
return ret;
|
||||
}
|
||||
|
||||
public static bool defaultsSetPrefVideoSizeOutRange(tmedia_pref_video_size_t min, tmedia_pref_video_size_t max) {
|
||||
bool ret = tinyWRAPPINVOKE.MediaSessionMgr_defaultsSetPrefVideoSizeOutRange((int)min, (int)max);
|
||||
return ret;
|
||||
}
|
||||
|
||||
public static bool defaultsSetAdaptativeVideoSizeOutEnabled(bool enabled) {
|
||||
bool ret = tinyWRAPPINVOKE.MediaSessionMgr_defaultsSetAdaptativeVideoSizeOutEnabled(enabled);
|
||||
return ret;
|
||||
}
|
||||
|
||||
public static bool defaultsSetJbMargin(uint jb_margin_ms) {
|
||||
bool ret = tinyWRAPPINVOKE.MediaSessionMgr_defaultsSetJbMargin(jb_margin_ms);
|
||||
return ret;
|
||||
|
|
|
@ -0,0 +1,121 @@
|
|||
/* ----------------------------------------------------------------------------
|
||||
* This file was automatically generated by SWIG (http://www.swig.org).
|
||||
* Version 2.0.9
|
||||
*
|
||||
* Do not make changes to this file unless you know what you are doing--modify
|
||||
* the SWIG interface file instead.
|
||||
* ----------------------------------------------------------------------------- */
|
||||
|
||||
namespace org.doubango.tinyWRAP {
|
||||
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
public class QoS : IDisposable {
|
||||
private HandleRef swigCPtr;
|
||||
protected bool swigCMemOwn;
|
||||
|
||||
internal QoS(IntPtr cPtr, bool cMemoryOwn) {
|
||||
swigCMemOwn = cMemoryOwn;
|
||||
swigCPtr = new HandleRef(this, cPtr);
|
||||
}
|
||||
|
||||
internal static HandleRef getCPtr(QoS obj) {
|
||||
return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
|
||||
}
|
||||
|
||||
~QoS() {
|
||||
Dispose();
|
||||
}
|
||||
|
||||
public virtual void Dispose() {
|
||||
lock(this) {
|
||||
if (swigCPtr.Handle != IntPtr.Zero) {
|
||||
if (swigCMemOwn) {
|
||||
swigCMemOwn = false;
|
||||
tinyWRAPPINVOKE.delete_QoS(swigCPtr);
|
||||
}
|
||||
swigCPtr = new HandleRef(null, IntPtr.Zero);
|
||||
}
|
||||
GC.SuppressFinalize(this);
|
||||
}
|
||||
}
|
||||
|
||||
public float getQavg() {
|
||||
float ret = tinyWRAPPINVOKE.QoS_getQavg(swigCPtr);
|
||||
return ret;
|
||||
}
|
||||
|
||||
public float getQ1() {
|
||||
float ret = tinyWRAPPINVOKE.QoS_getQ1(swigCPtr);
|
||||
return ret;
|
||||
}
|
||||
|
||||
public float getQ2() {
|
||||
float ret = tinyWRAPPINVOKE.QoS_getQ2(swigCPtr);
|
||||
return ret;
|
||||
}
|
||||
|
||||
public float getQ3() {
|
||||
float ret = tinyWRAPPINVOKE.QoS_getQ3(swigCPtr);
|
||||
return ret;
|
||||
}
|
||||
|
||||
public float getQ4() {
|
||||
float ret = tinyWRAPPINVOKE.QoS_getQ4(swigCPtr);
|
||||
return ret;
|
||||
}
|
||||
|
||||
public float getQ5() {
|
||||
float ret = tinyWRAPPINVOKE.QoS_getQ5(swigCPtr);
|
||||
return ret;
|
||||
}
|
||||
|
||||
public uint getVideoInWidth() {
|
||||
uint ret = tinyWRAPPINVOKE.QoS_getVideoInWidth(swigCPtr);
|
||||
return ret;
|
||||
}
|
||||
|
||||
public uint getVideoOutWidth() {
|
||||
uint ret = tinyWRAPPINVOKE.QoS_getVideoOutWidth(swigCPtr);
|
||||
return ret;
|
||||
}
|
||||
|
||||
public uint getVideoInHeight() {
|
||||
uint ret = tinyWRAPPINVOKE.QoS_getVideoInHeight(swigCPtr);
|
||||
return ret;
|
||||
}
|
||||
|
||||
public uint getVideoOutHeight() {
|
||||
uint ret = tinyWRAPPINVOKE.QoS_getVideoOutHeight(swigCPtr);
|
||||
return ret;
|
||||
}
|
||||
|
||||
public uint getBandwidthDownKbps() {
|
||||
uint ret = tinyWRAPPINVOKE.QoS_getBandwidthDownKbps(swigCPtr);
|
||||
return ret;
|
||||
}
|
||||
|
||||
public uint getBandwidthUpKbps() {
|
||||
uint ret = tinyWRAPPINVOKE.QoS_getBandwidthUpKbps(swigCPtr);
|
||||
return ret;
|
||||
}
|
||||
|
||||
public uint getVideoInAvgFps() {
|
||||
uint ret = tinyWRAPPINVOKE.QoS_getVideoInAvgFps(swigCPtr);
|
||||
return ret;
|
||||
}
|
||||
|
||||
public uint getVideoDecAvgTime() {
|
||||
uint ret = tinyWRAPPINVOKE.QoS_getVideoDecAvgTime(swigCPtr);
|
||||
return ret;
|
||||
}
|
||||
|
||||
public uint getVideoEncAvgTime() {
|
||||
uint ret = tinyWRAPPINVOKE.QoS_getVideoEncAvgTime(swigCPtr);
|
||||
return ret;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
|
@ -264,6 +264,54 @@ class tinyWRAPPINVOKE {
|
|||
[DllImport("tinyWRAP", EntryPoint="CSharp_ActionConfig_setMediaInt")]
|
||||
public static extern IntPtr ActionConfig_setMediaInt(HandleRef jarg1, int jarg2, string jarg3, int jarg4);
|
||||
|
||||
[DllImport("tinyWRAP", EntryPoint="CSharp_delete_QoS")]
|
||||
public static extern void delete_QoS(HandleRef jarg1);
|
||||
|
||||
[DllImport("tinyWRAP", EntryPoint="CSharp_QoS_getQavg")]
|
||||
public static extern float QoS_getQavg(HandleRef jarg1);
|
||||
|
||||
[DllImport("tinyWRAP", EntryPoint="CSharp_QoS_getQ1")]
|
||||
public static extern float QoS_getQ1(HandleRef jarg1);
|
||||
|
||||
[DllImport("tinyWRAP", EntryPoint="CSharp_QoS_getQ2")]
|
||||
public static extern float QoS_getQ2(HandleRef jarg1);
|
||||
|
||||
[DllImport("tinyWRAP", EntryPoint="CSharp_QoS_getQ3")]
|
||||
public static extern float QoS_getQ3(HandleRef jarg1);
|
||||
|
||||
[DllImport("tinyWRAP", EntryPoint="CSharp_QoS_getQ4")]
|
||||
public static extern float QoS_getQ4(HandleRef jarg1);
|
||||
|
||||
[DllImport("tinyWRAP", EntryPoint="CSharp_QoS_getQ5")]
|
||||
public static extern float QoS_getQ5(HandleRef jarg1);
|
||||
|
||||
[DllImport("tinyWRAP", EntryPoint="CSharp_QoS_getVideoInWidth")]
|
||||
public static extern uint QoS_getVideoInWidth(HandleRef jarg1);
|
||||
|
||||
[DllImport("tinyWRAP", EntryPoint="CSharp_QoS_getVideoOutWidth")]
|
||||
public static extern uint QoS_getVideoOutWidth(HandleRef jarg1);
|
||||
|
||||
[DllImport("tinyWRAP", EntryPoint="CSharp_QoS_getVideoInHeight")]
|
||||
public static extern uint QoS_getVideoInHeight(HandleRef jarg1);
|
||||
|
||||
[DllImport("tinyWRAP", EntryPoint="CSharp_QoS_getVideoOutHeight")]
|
||||
public static extern uint QoS_getVideoOutHeight(HandleRef jarg1);
|
||||
|
||||
[DllImport("tinyWRAP", EntryPoint="CSharp_QoS_getBandwidthDownKbps")]
|
||||
public static extern uint QoS_getBandwidthDownKbps(HandleRef jarg1);
|
||||
|
||||
[DllImport("tinyWRAP", EntryPoint="CSharp_QoS_getBandwidthUpKbps")]
|
||||
public static extern uint QoS_getBandwidthUpKbps(HandleRef jarg1);
|
||||
|
||||
[DllImport("tinyWRAP", EntryPoint="CSharp_QoS_getVideoInAvgFps")]
|
||||
public static extern uint QoS_getVideoInAvgFps(HandleRef jarg1);
|
||||
|
||||
[DllImport("tinyWRAP", EntryPoint="CSharp_QoS_getVideoDecAvgTime")]
|
||||
public static extern uint QoS_getVideoDecAvgTime(HandleRef jarg1);
|
||||
|
||||
[DllImport("tinyWRAP", EntryPoint="CSharp_QoS_getVideoEncAvgTime")]
|
||||
public static extern uint QoS_getVideoEncAvgTime(HandleRef jarg1);
|
||||
|
||||
[DllImport("tinyWRAP", EntryPoint="CSharp_delete_Codec")]
|
||||
public static extern void delete_Codec(HandleRef jarg1);
|
||||
|
||||
|
@ -297,6 +345,9 @@ class tinyWRAPPINVOKE {
|
|||
[DllImport("tinyWRAP", EntryPoint="CSharp_MediaSessionMgr_sessionGetInt32")]
|
||||
public static extern int MediaSessionMgr_sessionGetInt32(HandleRef jarg1, int jarg2, string jarg3);
|
||||
|
||||
[DllImport("tinyWRAP", EntryPoint="CSharp_MediaSessionMgr_sessionGetQoS")]
|
||||
public static extern IntPtr MediaSessionMgr_sessionGetQoS(HandleRef jarg1, int jarg2);
|
||||
|
||||
[DllImport("tinyWRAP", EntryPoint="CSharp_MediaSessionMgr_consumerSetInt32")]
|
||||
public static extern bool MediaSessionMgr_consumerSetInt32(HandleRef jarg1, int jarg2, string jarg3, int jarg4);
|
||||
|
||||
|
@ -354,6 +405,12 @@ class tinyWRAPPINVOKE {
|
|||
[DllImport("tinyWRAP", EntryPoint="CSharp_MediaSessionMgr_defaultsSetPrefVideoSize")]
|
||||
public static extern bool MediaSessionMgr_defaultsSetPrefVideoSize(int jarg1);
|
||||
|
||||
[DllImport("tinyWRAP", EntryPoint="CSharp_MediaSessionMgr_defaultsSetPrefVideoSizeOutRange")]
|
||||
public static extern bool MediaSessionMgr_defaultsSetPrefVideoSizeOutRange(int jarg1, int jarg2);
|
||||
|
||||
[DllImport("tinyWRAP", EntryPoint="CSharp_MediaSessionMgr_defaultsSetAdaptativeVideoSizeOutEnabled")]
|
||||
public static extern bool MediaSessionMgr_defaultsSetAdaptativeVideoSizeOutEnabled(bool jarg1);
|
||||
|
||||
[DllImport("tinyWRAP", EntryPoint="CSharp_MediaSessionMgr_defaultsSetJbMargin")]
|
||||
public static extern bool MediaSessionMgr_defaultsSetJbMargin(uint jarg1);
|
||||
|
||||
|
|
|
@ -1488,6 +1488,194 @@ SWIGEXPORT void * SWIGSTDCALL CSharp_ActionConfig_setMediaInt(void * jarg1, int
|
|||
}
|
||||
|
||||
|
||||
SWIGEXPORT void SWIGSTDCALL CSharp_delete_QoS(void * jarg1) {
|
||||
QoS *arg1 = (QoS *) 0 ;
|
||||
|
||||
arg1 = (QoS *)jarg1;
|
||||
delete arg1;
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT float SWIGSTDCALL CSharp_QoS_getQavg(void * jarg1) {
|
||||
float jresult ;
|
||||
QoS *arg1 = (QoS *) 0 ;
|
||||
float result;
|
||||
|
||||
arg1 = (QoS *)jarg1;
|
||||
result = (float)(arg1)->getQavg();
|
||||
jresult = result;
|
||||
return jresult;
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT float SWIGSTDCALL CSharp_QoS_getQ1(void * jarg1) {
|
||||
float jresult ;
|
||||
QoS *arg1 = (QoS *) 0 ;
|
||||
float result;
|
||||
|
||||
arg1 = (QoS *)jarg1;
|
||||
result = (float)(arg1)->getQ1();
|
||||
jresult = result;
|
||||
return jresult;
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT float SWIGSTDCALL CSharp_QoS_getQ2(void * jarg1) {
|
||||
float jresult ;
|
||||
QoS *arg1 = (QoS *) 0 ;
|
||||
float result;
|
||||
|
||||
arg1 = (QoS *)jarg1;
|
||||
result = (float)(arg1)->getQ2();
|
||||
jresult = result;
|
||||
return jresult;
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT float SWIGSTDCALL CSharp_QoS_getQ3(void * jarg1) {
|
||||
float jresult ;
|
||||
QoS *arg1 = (QoS *) 0 ;
|
||||
float result;
|
||||
|
||||
arg1 = (QoS *)jarg1;
|
||||
result = (float)(arg1)->getQ3();
|
||||
jresult = result;
|
||||
return jresult;
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT float SWIGSTDCALL CSharp_QoS_getQ4(void * jarg1) {
|
||||
float jresult ;
|
||||
QoS *arg1 = (QoS *) 0 ;
|
||||
float result;
|
||||
|
||||
arg1 = (QoS *)jarg1;
|
||||
result = (float)(arg1)->getQ4();
|
||||
jresult = result;
|
||||
return jresult;
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT float SWIGSTDCALL CSharp_QoS_getQ5(void * jarg1) {
|
||||
float jresult ;
|
||||
QoS *arg1 = (QoS *) 0 ;
|
||||
float result;
|
||||
|
||||
arg1 = (QoS *)jarg1;
|
||||
result = (float)(arg1)->getQ5();
|
||||
jresult = result;
|
||||
return jresult;
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT unsigned int SWIGSTDCALL CSharp_QoS_getVideoInWidth(void * jarg1) {
|
||||
unsigned int jresult ;
|
||||
QoS *arg1 = (QoS *) 0 ;
|
||||
unsigned int result;
|
||||
|
||||
arg1 = (QoS *)jarg1;
|
||||
result = (unsigned int)(arg1)->getVideoInWidth();
|
||||
jresult = result;
|
||||
return jresult;
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT unsigned int SWIGSTDCALL CSharp_QoS_getVideoOutWidth(void * jarg1) {
|
||||
unsigned int jresult ;
|
||||
QoS *arg1 = (QoS *) 0 ;
|
||||
unsigned int result;
|
||||
|
||||
arg1 = (QoS *)jarg1;
|
||||
result = (unsigned int)(arg1)->getVideoOutWidth();
|
||||
jresult = result;
|
||||
return jresult;
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT unsigned int SWIGSTDCALL CSharp_QoS_getVideoInHeight(void * jarg1) {
|
||||
unsigned int jresult ;
|
||||
QoS *arg1 = (QoS *) 0 ;
|
||||
unsigned int result;
|
||||
|
||||
arg1 = (QoS *)jarg1;
|
||||
result = (unsigned int)(arg1)->getVideoInHeight();
|
||||
jresult = result;
|
||||
return jresult;
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT unsigned int SWIGSTDCALL CSharp_QoS_getVideoOutHeight(void * jarg1) {
|
||||
unsigned int jresult ;
|
||||
QoS *arg1 = (QoS *) 0 ;
|
||||
unsigned int result;
|
||||
|
||||
arg1 = (QoS *)jarg1;
|
||||
result = (unsigned int)(arg1)->getVideoOutHeight();
|
||||
jresult = result;
|
||||
return jresult;
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT unsigned int SWIGSTDCALL CSharp_QoS_getBandwidthDownKbps(void * jarg1) {
|
||||
unsigned int jresult ;
|
||||
QoS *arg1 = (QoS *) 0 ;
|
||||
unsigned int result;
|
||||
|
||||
arg1 = (QoS *)jarg1;
|
||||
result = (unsigned int)(arg1)->getBandwidthDownKbps();
|
||||
jresult = result;
|
||||
return jresult;
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT unsigned int SWIGSTDCALL CSharp_QoS_getBandwidthUpKbps(void * jarg1) {
|
||||
unsigned int jresult ;
|
||||
QoS *arg1 = (QoS *) 0 ;
|
||||
unsigned int result;
|
||||
|
||||
arg1 = (QoS *)jarg1;
|
||||
result = (unsigned int)(arg1)->getBandwidthUpKbps();
|
||||
jresult = result;
|
||||
return jresult;
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT unsigned int SWIGSTDCALL CSharp_QoS_getVideoInAvgFps(void * jarg1) {
|
||||
unsigned int jresult ;
|
||||
QoS *arg1 = (QoS *) 0 ;
|
||||
unsigned int result;
|
||||
|
||||
arg1 = (QoS *)jarg1;
|
||||
result = (unsigned int)(arg1)->getVideoInAvgFps();
|
||||
jresult = result;
|
||||
return jresult;
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT unsigned int SWIGSTDCALL CSharp_QoS_getVideoDecAvgTime(void * jarg1) {
|
||||
unsigned int jresult ;
|
||||
QoS *arg1 = (QoS *) 0 ;
|
||||
unsigned int result;
|
||||
|
||||
arg1 = (QoS *)jarg1;
|
||||
result = (unsigned int)(arg1)->getVideoDecAvgTime();
|
||||
jresult = result;
|
||||
return jresult;
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT unsigned int SWIGSTDCALL CSharp_QoS_getVideoEncAvgTime(void * jarg1) {
|
||||
unsigned int jresult ;
|
||||
QoS *arg1 = (QoS *) 0 ;
|
||||
unsigned int result;
|
||||
|
||||
arg1 = (QoS *)jarg1;
|
||||
result = (unsigned int)(arg1)->getVideoEncAvgTime();
|
||||
jresult = result;
|
||||
return jresult;
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT void SWIGSTDCALL CSharp_delete_Codec(void * jarg1) {
|
||||
Codec *arg1 = (Codec *) 0 ;
|
||||
|
||||
|
@ -1622,6 +1810,20 @@ SWIGEXPORT int SWIGSTDCALL CSharp_MediaSessionMgr_sessionGetInt32(void * jarg1,
|
|||
}
|
||||
|
||||
|
||||
SWIGEXPORT void * SWIGSTDCALL CSharp_MediaSessionMgr_sessionGetQoS(void * jarg1, int jarg2) {
|
||||
void * jresult ;
|
||||
MediaSessionMgr *arg1 = (MediaSessionMgr *) 0 ;
|
||||
twrap_media_type_t arg2 ;
|
||||
QoS *result = 0 ;
|
||||
|
||||
arg1 = (MediaSessionMgr *)jarg1;
|
||||
arg2 = (twrap_media_type_t)jarg2;
|
||||
result = (QoS *)(arg1)->sessionGetQoS(arg2);
|
||||
jresult = (void *)result;
|
||||
return jresult;
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT unsigned int SWIGSTDCALL CSharp_MediaSessionMgr_consumerSetInt32(void * jarg1, int jarg2, char * jarg3, int jarg4) {
|
||||
unsigned int jresult ;
|
||||
MediaSessionMgr *arg1 = (MediaSessionMgr *) 0 ;
|
||||
|
@ -1878,6 +2080,32 @@ SWIGEXPORT unsigned int SWIGSTDCALL CSharp_MediaSessionMgr_defaultsSetPrefVideoS
|
|||
}
|
||||
|
||||
|
||||
SWIGEXPORT unsigned int SWIGSTDCALL CSharp_MediaSessionMgr_defaultsSetPrefVideoSizeOutRange(int jarg1, int jarg2) {
|
||||
unsigned int jresult ;
|
||||
tmedia_pref_video_size_t arg1 ;
|
||||
tmedia_pref_video_size_t arg2 ;
|
||||
bool result;
|
||||
|
||||
arg1 = (tmedia_pref_video_size_t)jarg1;
|
||||
arg2 = (tmedia_pref_video_size_t)jarg2;
|
||||
result = (bool)MediaSessionMgr::defaultsSetPrefVideoSizeOutRange(arg1,arg2);
|
||||
jresult = result;
|
||||
return jresult;
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT unsigned int SWIGSTDCALL CSharp_MediaSessionMgr_defaultsSetAdaptativeVideoSizeOutEnabled(unsigned int jarg1) {
|
||||
unsigned int jresult ;
|
||||
bool arg1 ;
|
||||
bool result;
|
||||
|
||||
arg1 = jarg1 ? true : false;
|
||||
result = (bool)MediaSessionMgr::defaultsSetAdaptativeVideoSizeOutEnabled(arg1);
|
||||
jresult = result;
|
||||
return jresult;
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT unsigned int SWIGSTDCALL CSharp_MediaSessionMgr_defaultsSetJbMargin(unsigned int jarg1) {
|
||||
unsigned int jresult ;
|
||||
uint32_t arg1 ;
|
||||
|
|
|
@ -43,6 +43,11 @@ public class MediaSessionMgr {
|
|||
return tinyWRAPJNI.MediaSessionMgr_sessionGetInt32(swigCPtr, this, media.swigValue(), key);
|
||||
}
|
||||
|
||||
public QoS sessionGetQoS(twrap_media_type_t media) {
|
||||
long cPtr = tinyWRAPJNI.MediaSessionMgr_sessionGetQoS(swigCPtr, this, media.swigValue());
|
||||
return (cPtr == 0) ? null : new QoS(cPtr, true);
|
||||
}
|
||||
|
||||
public boolean consumerSetInt32(twrap_media_type_t media, String key, int value) {
|
||||
return tinyWRAPJNI.MediaSessionMgr_consumerSetInt32(swigCPtr, this, media.swigValue(), key, value);
|
||||
}
|
||||
|
@ -122,6 +127,14 @@ public class MediaSessionMgr {
|
|||
return tinyWRAPJNI.MediaSessionMgr_defaultsSetPrefVideoSize(pref_video_size.swigValue());
|
||||
}
|
||||
|
||||
public static boolean defaultsSetPrefVideoSizeOutRange(tmedia_pref_video_size_t min, tmedia_pref_video_size_t max) {
|
||||
return tinyWRAPJNI.MediaSessionMgr_defaultsSetPrefVideoSizeOutRange(min.swigValue(), max.swigValue());
|
||||
}
|
||||
|
||||
public static boolean defaultsSetAdaptativeVideoSizeOutEnabled(boolean enabled) {
|
||||
return tinyWRAPJNI.MediaSessionMgr_defaultsSetAdaptativeVideoSizeOutEnabled(enabled);
|
||||
}
|
||||
|
||||
public static boolean defaultsSetJbMargin(long jb_margin_ms) {
|
||||
return tinyWRAPJNI.MediaSessionMgr_defaultsSetJbMargin(jb_margin_ms);
|
||||
}
|
||||
|
|
|
@ -0,0 +1,98 @@
|
|||
/* ----------------------------------------------------------------------------
|
||||
* This file was automatically generated by SWIG (http://www.swig.org).
|
||||
* Version 2.0.9
|
||||
*
|
||||
* Do not make changes to this file unless you know what you are doing--modify
|
||||
* the SWIG interface file instead.
|
||||
* ----------------------------------------------------------------------------- */
|
||||
|
||||
package org.doubango.tinyWRAP;
|
||||
|
||||
public class QoS {
|
||||
private long swigCPtr;
|
||||
protected boolean swigCMemOwn;
|
||||
|
||||
protected QoS(long cPtr, boolean cMemoryOwn) {
|
||||
swigCMemOwn = cMemoryOwn;
|
||||
swigCPtr = cPtr;
|
||||
}
|
||||
|
||||
protected static long getCPtr(QoS obj) {
|
||||
return (obj == null) ? 0 : obj.swigCPtr;
|
||||
}
|
||||
|
||||
protected void finalize() {
|
||||
delete();
|
||||
}
|
||||
|
||||
public synchronized void delete() {
|
||||
if (swigCPtr != 0) {
|
||||
if (swigCMemOwn) {
|
||||
swigCMemOwn = false;
|
||||
tinyWRAPJNI.delete_QoS(swigCPtr);
|
||||
}
|
||||
swigCPtr = 0;
|
||||
}
|
||||
}
|
||||
|
||||
public float getQavg() {
|
||||
return tinyWRAPJNI.QoS_getQavg(swigCPtr, this);
|
||||
}
|
||||
|
||||
public float getQ1() {
|
||||
return tinyWRAPJNI.QoS_getQ1(swigCPtr, this);
|
||||
}
|
||||
|
||||
public float getQ2() {
|
||||
return tinyWRAPJNI.QoS_getQ2(swigCPtr, this);
|
||||
}
|
||||
|
||||
public float getQ3() {
|
||||
return tinyWRAPJNI.QoS_getQ3(swigCPtr, this);
|
||||
}
|
||||
|
||||
public float getQ4() {
|
||||
return tinyWRAPJNI.QoS_getQ4(swigCPtr, this);
|
||||
}
|
||||
|
||||
public float getQ5() {
|
||||
return tinyWRAPJNI.QoS_getQ5(swigCPtr, this);
|
||||
}
|
||||
|
||||
public long getVideoInWidth() {
|
||||
return tinyWRAPJNI.QoS_getVideoInWidth(swigCPtr, this);
|
||||
}
|
||||
|
||||
public long getVideoOutWidth() {
|
||||
return tinyWRAPJNI.QoS_getVideoOutWidth(swigCPtr, this);
|
||||
}
|
||||
|
||||
public long getVideoInHeight() {
|
||||
return tinyWRAPJNI.QoS_getVideoInHeight(swigCPtr, this);
|
||||
}
|
||||
|
||||
public long getVideoOutHeight() {
|
||||
return tinyWRAPJNI.QoS_getVideoOutHeight(swigCPtr, this);
|
||||
}
|
||||
|
||||
public long getBandwidthDownKbps() {
|
||||
return tinyWRAPJNI.QoS_getBandwidthDownKbps(swigCPtr, this);
|
||||
}
|
||||
|
||||
public long getBandwidthUpKbps() {
|
||||
return tinyWRAPJNI.QoS_getBandwidthUpKbps(swigCPtr, this);
|
||||
}
|
||||
|
||||
public long getVideoInAvgFps() {
|
||||
return tinyWRAPJNI.QoS_getVideoInAvgFps(swigCPtr, this);
|
||||
}
|
||||
|
||||
public long getVideoDecAvgTime() {
|
||||
return tinyWRAPJNI.QoS_getVideoDecAvgTime(swigCPtr, this);
|
||||
}
|
||||
|
||||
public long getVideoEncAvgTime() {
|
||||
return tinyWRAPJNI.QoS_getVideoEncAvgTime(swigCPtr, this);
|
||||
}
|
||||
|
||||
}
|
|
@ -43,6 +43,11 @@ public class MediaSessionMgr {
|
|||
return tinyWRAPJNI.MediaSessionMgr_sessionGetInt32(swigCPtr, this, media.swigValue(), key);
|
||||
}
|
||||
|
||||
public QoS sessionGetQoS(twrap_media_type_t media) {
|
||||
long cPtr = tinyWRAPJNI.MediaSessionMgr_sessionGetQoS(swigCPtr, this, media.swigValue());
|
||||
return (cPtr == 0) ? null : new QoS(cPtr, true);
|
||||
}
|
||||
|
||||
public boolean consumerSetInt32(twrap_media_type_t media, String key, int value) {
|
||||
return tinyWRAPJNI.MediaSessionMgr_consumerSetInt32(swigCPtr, this, media.swigValue(), key, value);
|
||||
}
|
||||
|
@ -122,6 +127,14 @@ public class MediaSessionMgr {
|
|||
return tinyWRAPJNI.MediaSessionMgr_defaultsSetPrefVideoSize(pref_video_size.swigValue());
|
||||
}
|
||||
|
||||
public static boolean defaultsSetPrefVideoSizeOutRange(tmedia_pref_video_size_t min, tmedia_pref_video_size_t max) {
|
||||
return tinyWRAPJNI.MediaSessionMgr_defaultsSetPrefVideoSizeOutRange(min.swigValue(), max.swigValue());
|
||||
}
|
||||
|
||||
public static boolean defaultsSetAdaptativeVideoSizeOutEnabled(boolean enabled) {
|
||||
return tinyWRAPJNI.MediaSessionMgr_defaultsSetAdaptativeVideoSizeOutEnabled(enabled);
|
||||
}
|
||||
|
||||
public static boolean defaultsSetJbMargin(long jb_margin_ms) {
|
||||
return tinyWRAPJNI.MediaSessionMgr_defaultsSetJbMargin(jb_margin_ms);
|
||||
}
|
||||
|
|
|
@ -0,0 +1,98 @@
|
|||
/* ----------------------------------------------------------------------------
|
||||
* This file was automatically generated by SWIG (http://www.swig.org).
|
||||
* Version 2.0.9
|
||||
*
|
||||
* Do not make changes to this file unless you know what you are doing--modify
|
||||
* the SWIG interface file instead.
|
||||
* ----------------------------------------------------------------------------- */
|
||||
|
||||
package org.doubango.tinyWRAP;
|
||||
|
||||
public class QoS {
|
||||
private long swigCPtr;
|
||||
protected boolean swigCMemOwn;
|
||||
|
||||
protected QoS(long cPtr, boolean cMemoryOwn) {
|
||||
swigCMemOwn = cMemoryOwn;
|
||||
swigCPtr = cPtr;
|
||||
}
|
||||
|
||||
protected static long getCPtr(QoS obj) {
|
||||
return (obj == null) ? 0 : obj.swigCPtr;
|
||||
}
|
||||
|
||||
protected void finalize() {
|
||||
delete();
|
||||
}
|
||||
|
||||
public synchronized void delete() {
|
||||
if (swigCPtr != 0) {
|
||||
if (swigCMemOwn) {
|
||||
swigCMemOwn = false;
|
||||
tinyWRAPJNI.delete_QoS(swigCPtr);
|
||||
}
|
||||
swigCPtr = 0;
|
||||
}
|
||||
}
|
||||
|
||||
public float getQavg() {
|
||||
return tinyWRAPJNI.QoS_getQavg(swigCPtr, this);
|
||||
}
|
||||
|
||||
public float getQ1() {
|
||||
return tinyWRAPJNI.QoS_getQ1(swigCPtr, this);
|
||||
}
|
||||
|
||||
public float getQ2() {
|
||||
return tinyWRAPJNI.QoS_getQ2(swigCPtr, this);
|
||||
}
|
||||
|
||||
public float getQ3() {
|
||||
return tinyWRAPJNI.QoS_getQ3(swigCPtr, this);
|
||||
}
|
||||
|
||||
public float getQ4() {
|
||||
return tinyWRAPJNI.QoS_getQ4(swigCPtr, this);
|
||||
}
|
||||
|
||||
public float getQ5() {
|
||||
return tinyWRAPJNI.QoS_getQ5(swigCPtr, this);
|
||||
}
|
||||
|
||||
public long getVideoInWidth() {
|
||||
return tinyWRAPJNI.QoS_getVideoInWidth(swigCPtr, this);
|
||||
}
|
||||
|
||||
public long getVideoOutWidth() {
|
||||
return tinyWRAPJNI.QoS_getVideoOutWidth(swigCPtr, this);
|
||||
}
|
||||
|
||||
public long getVideoInHeight() {
|
||||
return tinyWRAPJNI.QoS_getVideoInHeight(swigCPtr, this);
|
||||
}
|
||||
|
||||
public long getVideoOutHeight() {
|
||||
return tinyWRAPJNI.QoS_getVideoOutHeight(swigCPtr, this);
|
||||
}
|
||||
|
||||
public long getBandwidthDownKbps() {
|
||||
return tinyWRAPJNI.QoS_getBandwidthDownKbps(swigCPtr, this);
|
||||
}
|
||||
|
||||
public long getBandwidthUpKbps() {
|
||||
return tinyWRAPJNI.QoS_getBandwidthUpKbps(swigCPtr, this);
|
||||
}
|
||||
|
||||
public long getVideoInAvgFps() {
|
||||
return tinyWRAPJNI.QoS_getVideoInAvgFps(swigCPtr, this);
|
||||
}
|
||||
|
||||
public long getVideoDecAvgTime() {
|
||||
return tinyWRAPJNI.QoS_getVideoDecAvgTime(swigCPtr, this);
|
||||
}
|
||||
|
||||
public long getVideoEncAvgTime() {
|
||||
return tinyWRAPJNI.QoS_getVideoEncAvgTime(swigCPtr, this);
|
||||
}
|
||||
|
||||
}
|
|
@ -35,6 +35,22 @@ public class tinyWRAPJNI {
|
|||
public final static native long ActionConfig_setResponseLine(long jarg1, ActionConfig jarg1_, short jarg2, String jarg3);
|
||||
public final static native long ActionConfig_setMediaString(long jarg1, ActionConfig jarg1_, int jarg2, String jarg3, String jarg4);
|
||||
public final static native long ActionConfig_setMediaInt(long jarg1, ActionConfig jarg1_, int jarg2, String jarg3, int jarg4);
|
||||
public final static native void delete_QoS(long jarg1);
|
||||
public final static native float QoS_getQavg(long jarg1, QoS jarg1_);
|
||||
public final static native float QoS_getQ1(long jarg1, QoS jarg1_);
|
||||
public final static native float QoS_getQ2(long jarg1, QoS jarg1_);
|
||||
public final static native float QoS_getQ3(long jarg1, QoS jarg1_);
|
||||
public final static native float QoS_getQ4(long jarg1, QoS jarg1_);
|
||||
public final static native float QoS_getQ5(long jarg1, QoS jarg1_);
|
||||
public final static native long QoS_getVideoInWidth(long jarg1, QoS jarg1_);
|
||||
public final static native long QoS_getVideoOutWidth(long jarg1, QoS jarg1_);
|
||||
public final static native long QoS_getVideoInHeight(long jarg1, QoS jarg1_);
|
||||
public final static native long QoS_getVideoOutHeight(long jarg1, QoS jarg1_);
|
||||
public final static native long QoS_getBandwidthDownKbps(long jarg1, QoS jarg1_);
|
||||
public final static native long QoS_getBandwidthUpKbps(long jarg1, QoS jarg1_);
|
||||
public final static native long QoS_getVideoInAvgFps(long jarg1, QoS jarg1_);
|
||||
public final static native long QoS_getVideoDecAvgTime(long jarg1, QoS jarg1_);
|
||||
public final static native long QoS_getVideoEncAvgTime(long jarg1, QoS jarg1_);
|
||||
public final static native void delete_Codec(long jarg1);
|
||||
public final static native int Codec_getMediaType(long jarg1, Codec jarg1_);
|
||||
public final static native String Codec_getName(long jarg1, Codec jarg1_);
|
||||
|
@ -46,6 +62,7 @@ public class tinyWRAPJNI {
|
|||
public final static native void delete_MediaSessionMgr(long jarg1);
|
||||
public final static native boolean MediaSessionMgr_sessionSetInt32(long jarg1, MediaSessionMgr jarg1_, int jarg2, String jarg3, int jarg4);
|
||||
public final static native int MediaSessionMgr_sessionGetInt32(long jarg1, MediaSessionMgr jarg1_, int jarg2, String jarg3);
|
||||
public final static native long MediaSessionMgr_sessionGetQoS(long jarg1, MediaSessionMgr jarg1_, int jarg2);
|
||||
public final static native boolean MediaSessionMgr_consumerSetInt32(long jarg1, MediaSessionMgr jarg1_, int jarg2, String jarg3, int jarg4);
|
||||
public final static native boolean MediaSessionMgr_consumerSetInt64(long jarg1, MediaSessionMgr jarg1_, int jarg2, String jarg3, long jarg4);
|
||||
public final static native boolean MediaSessionMgr_producerSetInt32(long jarg1, MediaSessionMgr jarg1_, int jarg2, String jarg3, int jarg4);
|
||||
|
@ -65,6 +82,8 @@ public class tinyWRAPJNI {
|
|||
public final static native boolean MediaSessionMgr_defaultsSetBandwidthVideoUploadMax(int jarg1);
|
||||
public final static native boolean MediaSessionMgr_defaultsSetBandwidthVideoDownloadMax(int jarg1);
|
||||
public final static native boolean MediaSessionMgr_defaultsSetPrefVideoSize(int jarg1);
|
||||
public final static native boolean MediaSessionMgr_defaultsSetPrefVideoSizeOutRange(int jarg1, int jarg2);
|
||||
public final static native boolean MediaSessionMgr_defaultsSetAdaptativeVideoSizeOutEnabled(boolean jarg1);
|
||||
public final static native boolean MediaSessionMgr_defaultsSetJbMargin(long jarg1);
|
||||
public final static native boolean MediaSessionMgr_defaultsSetJbMaxLateRate(long jarg1);
|
||||
public final static native boolean MediaSessionMgr_defaultsSetEchoTail(long jarg1);
|
||||
|
|
|
@ -2407,6 +2407,241 @@ SWIGEXPORT jlong JNICALL Java_org_doubango_tinyWRAP_tinyWRAPJNI_ActionConfig_1se
|
|||
}
|
||||
|
||||
|
||||
SWIGEXPORT void JNICALL Java_org_doubango_tinyWRAP_tinyWRAPJNI_delete_1QoS(JNIEnv *jenv, jclass jcls, jlong jarg1) {
|
||||
QoS *arg1 = (QoS *) 0 ;
|
||||
|
||||
(void)jenv;
|
||||
(void)jcls;
|
||||
arg1 = *(QoS **)&jarg1;
|
||||
delete arg1;
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT jfloat JNICALL Java_org_doubango_tinyWRAP_tinyWRAPJNI_QoS_1getQavg(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) {
|
||||
jfloat jresult = 0 ;
|
||||
QoS *arg1 = (QoS *) 0 ;
|
||||
float result;
|
||||
|
||||
(void)jenv;
|
||||
(void)jcls;
|
||||
(void)jarg1_;
|
||||
arg1 = *(QoS **)&jarg1;
|
||||
result = (float)(arg1)->getQavg();
|
||||
jresult = (jfloat)result;
|
||||
return jresult;
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT jfloat JNICALL Java_org_doubango_tinyWRAP_tinyWRAPJNI_QoS_1getQ1(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) {
|
||||
jfloat jresult = 0 ;
|
||||
QoS *arg1 = (QoS *) 0 ;
|
||||
float result;
|
||||
|
||||
(void)jenv;
|
||||
(void)jcls;
|
||||
(void)jarg1_;
|
||||
arg1 = *(QoS **)&jarg1;
|
||||
result = (float)(arg1)->getQ1();
|
||||
jresult = (jfloat)result;
|
||||
return jresult;
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT jfloat JNICALL Java_org_doubango_tinyWRAP_tinyWRAPJNI_QoS_1getQ2(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) {
|
||||
jfloat jresult = 0 ;
|
||||
QoS *arg1 = (QoS *) 0 ;
|
||||
float result;
|
||||
|
||||
(void)jenv;
|
||||
(void)jcls;
|
||||
(void)jarg1_;
|
||||
arg1 = *(QoS **)&jarg1;
|
||||
result = (float)(arg1)->getQ2();
|
||||
jresult = (jfloat)result;
|
||||
return jresult;
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT jfloat JNICALL Java_org_doubango_tinyWRAP_tinyWRAPJNI_QoS_1getQ3(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) {
|
||||
jfloat jresult = 0 ;
|
||||
QoS *arg1 = (QoS *) 0 ;
|
||||
float result;
|
||||
|
||||
(void)jenv;
|
||||
(void)jcls;
|
||||
(void)jarg1_;
|
||||
arg1 = *(QoS **)&jarg1;
|
||||
result = (float)(arg1)->getQ3();
|
||||
jresult = (jfloat)result;
|
||||
return jresult;
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT jfloat JNICALL Java_org_doubango_tinyWRAP_tinyWRAPJNI_QoS_1getQ4(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) {
|
||||
jfloat jresult = 0 ;
|
||||
QoS *arg1 = (QoS *) 0 ;
|
||||
float result;
|
||||
|
||||
(void)jenv;
|
||||
(void)jcls;
|
||||
(void)jarg1_;
|
||||
arg1 = *(QoS **)&jarg1;
|
||||
result = (float)(arg1)->getQ4();
|
||||
jresult = (jfloat)result;
|
||||
return jresult;
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT jfloat JNICALL Java_org_doubango_tinyWRAP_tinyWRAPJNI_QoS_1getQ5(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) {
|
||||
jfloat jresult = 0 ;
|
||||
QoS *arg1 = (QoS *) 0 ;
|
||||
float result;
|
||||
|
||||
(void)jenv;
|
||||
(void)jcls;
|
||||
(void)jarg1_;
|
||||
arg1 = *(QoS **)&jarg1;
|
||||
result = (float)(arg1)->getQ5();
|
||||
jresult = (jfloat)result;
|
||||
return jresult;
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT jlong JNICALL Java_org_doubango_tinyWRAP_tinyWRAPJNI_QoS_1getVideoInWidth(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) {
|
||||
jlong jresult = 0 ;
|
||||
QoS *arg1 = (QoS *) 0 ;
|
||||
unsigned int result;
|
||||
|
||||
(void)jenv;
|
||||
(void)jcls;
|
||||
(void)jarg1_;
|
||||
arg1 = *(QoS **)&jarg1;
|
||||
result = (unsigned int)(arg1)->getVideoInWidth();
|
||||
jresult = (jlong)result;
|
||||
return jresult;
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT jlong JNICALL Java_org_doubango_tinyWRAP_tinyWRAPJNI_QoS_1getVideoOutWidth(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) {
|
||||
jlong jresult = 0 ;
|
||||
QoS *arg1 = (QoS *) 0 ;
|
||||
unsigned int result;
|
||||
|
||||
(void)jenv;
|
||||
(void)jcls;
|
||||
(void)jarg1_;
|
||||
arg1 = *(QoS **)&jarg1;
|
||||
result = (unsigned int)(arg1)->getVideoOutWidth();
|
||||
jresult = (jlong)result;
|
||||
return jresult;
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT jlong JNICALL Java_org_doubango_tinyWRAP_tinyWRAPJNI_QoS_1getVideoInHeight(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) {
|
||||
jlong jresult = 0 ;
|
||||
QoS *arg1 = (QoS *) 0 ;
|
||||
unsigned int result;
|
||||
|
||||
(void)jenv;
|
||||
(void)jcls;
|
||||
(void)jarg1_;
|
||||
arg1 = *(QoS **)&jarg1;
|
||||
result = (unsigned int)(arg1)->getVideoInHeight();
|
||||
jresult = (jlong)result;
|
||||
return jresult;
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT jlong JNICALL Java_org_doubango_tinyWRAP_tinyWRAPJNI_QoS_1getVideoOutHeight(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) {
|
||||
jlong jresult = 0 ;
|
||||
QoS *arg1 = (QoS *) 0 ;
|
||||
unsigned int result;
|
||||
|
||||
(void)jenv;
|
||||
(void)jcls;
|
||||
(void)jarg1_;
|
||||
arg1 = *(QoS **)&jarg1;
|
||||
result = (unsigned int)(arg1)->getVideoOutHeight();
|
||||
jresult = (jlong)result;
|
||||
return jresult;
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT jlong JNICALL Java_org_doubango_tinyWRAP_tinyWRAPJNI_QoS_1getBandwidthDownKbps(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) {
|
||||
jlong jresult = 0 ;
|
||||
QoS *arg1 = (QoS *) 0 ;
|
||||
unsigned int result;
|
||||
|
||||
(void)jenv;
|
||||
(void)jcls;
|
||||
(void)jarg1_;
|
||||
arg1 = *(QoS **)&jarg1;
|
||||
result = (unsigned int)(arg1)->getBandwidthDownKbps();
|
||||
jresult = (jlong)result;
|
||||
return jresult;
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT jlong JNICALL Java_org_doubango_tinyWRAP_tinyWRAPJNI_QoS_1getBandwidthUpKbps(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) {
|
||||
jlong jresult = 0 ;
|
||||
QoS *arg1 = (QoS *) 0 ;
|
||||
unsigned int result;
|
||||
|
||||
(void)jenv;
|
||||
(void)jcls;
|
||||
(void)jarg1_;
|
||||
arg1 = *(QoS **)&jarg1;
|
||||
result = (unsigned int)(arg1)->getBandwidthUpKbps();
|
||||
jresult = (jlong)result;
|
||||
return jresult;
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT jlong JNICALL Java_org_doubango_tinyWRAP_tinyWRAPJNI_QoS_1getVideoInAvgFps(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) {
|
||||
jlong jresult = 0 ;
|
||||
QoS *arg1 = (QoS *) 0 ;
|
||||
unsigned int result;
|
||||
|
||||
(void)jenv;
|
||||
(void)jcls;
|
||||
(void)jarg1_;
|
||||
arg1 = *(QoS **)&jarg1;
|
||||
result = (unsigned int)(arg1)->getVideoInAvgFps();
|
||||
jresult = (jlong)result;
|
||||
return jresult;
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT jlong JNICALL Java_org_doubango_tinyWRAP_tinyWRAPJNI_QoS_1getVideoDecAvgTime(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) {
|
||||
jlong jresult = 0 ;
|
||||
QoS *arg1 = (QoS *) 0 ;
|
||||
unsigned int result;
|
||||
|
||||
(void)jenv;
|
||||
(void)jcls;
|
||||
(void)jarg1_;
|
||||
arg1 = *(QoS **)&jarg1;
|
||||
result = (unsigned int)(arg1)->getVideoDecAvgTime();
|
||||
jresult = (jlong)result;
|
||||
return jresult;
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT jlong JNICALL Java_org_doubango_tinyWRAP_tinyWRAPJNI_QoS_1getVideoEncAvgTime(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) {
|
||||
jlong jresult = 0 ;
|
||||
QoS *arg1 = (QoS *) 0 ;
|
||||
unsigned int result;
|
||||
|
||||
(void)jenv;
|
||||
(void)jcls;
|
||||
(void)jarg1_;
|
||||
arg1 = *(QoS **)&jarg1;
|
||||
result = (unsigned int)(arg1)->getVideoEncAvgTime();
|
||||
jresult = (jlong)result;
|
||||
return jresult;
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT void JNICALL Java_org_doubango_tinyWRAP_tinyWRAPJNI_delete_1Codec(JNIEnv *jenv, jclass jcls, jlong jarg1) {
|
||||
Codec *arg1 = (Codec *) 0 ;
|
||||
|
||||
|
@ -2582,6 +2817,23 @@ SWIGEXPORT jint JNICALL Java_org_doubango_tinyWRAP_tinyWRAPJNI_MediaSessionMgr_1
|
|||
}
|
||||
|
||||
|
||||
SWIGEXPORT jlong JNICALL Java_org_doubango_tinyWRAP_tinyWRAPJNI_MediaSessionMgr_1sessionGetQoS(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jint jarg2) {
|
||||
jlong jresult = 0 ;
|
||||
MediaSessionMgr *arg1 = (MediaSessionMgr *) 0 ;
|
||||
twrap_media_type_t arg2 ;
|
||||
QoS *result = 0 ;
|
||||
|
||||
(void)jenv;
|
||||
(void)jcls;
|
||||
(void)jarg1_;
|
||||
arg1 = *(MediaSessionMgr **)&jarg1;
|
||||
arg2 = (twrap_media_type_t)jarg2;
|
||||
result = (QoS *)(arg1)->sessionGetQoS(arg2);
|
||||
*(QoS **)&jresult = result;
|
||||
return jresult;
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT jboolean JNICALL Java_org_doubango_tinyWRAP_tinyWRAPJNI_MediaSessionMgr_1consumerSetInt32(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jint jarg2, jstring jarg3, jint jarg4) {
|
||||
jboolean jresult = 0 ;
|
||||
MediaSessionMgr *arg1 = (MediaSessionMgr *) 0 ;
|
||||
|
@ -2925,6 +3177,36 @@ SWIGEXPORT jboolean JNICALL Java_org_doubango_tinyWRAP_tinyWRAPJNI_MediaSessionM
|
|||
}
|
||||
|
||||
|
||||
SWIGEXPORT jboolean JNICALL Java_org_doubango_tinyWRAP_tinyWRAPJNI_MediaSessionMgr_1defaultsSetPrefVideoSizeOutRange(JNIEnv *jenv, jclass jcls, jint jarg1, jint jarg2) {
|
||||
jboolean jresult = 0 ;
|
||||
tmedia_pref_video_size_t arg1 ;
|
||||
tmedia_pref_video_size_t arg2 ;
|
||||
bool result;
|
||||
|
||||
(void)jenv;
|
||||
(void)jcls;
|
||||
arg1 = (tmedia_pref_video_size_t)jarg1;
|
||||
arg2 = (tmedia_pref_video_size_t)jarg2;
|
||||
result = (bool)MediaSessionMgr::defaultsSetPrefVideoSizeOutRange(arg1,arg2);
|
||||
jresult = (jboolean)result;
|
||||
return jresult;
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT jboolean JNICALL Java_org_doubango_tinyWRAP_tinyWRAPJNI_MediaSessionMgr_1defaultsSetAdaptativeVideoSizeOutEnabled(JNIEnv *jenv, jclass jcls, jboolean jarg1) {
|
||||
jboolean jresult = 0 ;
|
||||
bool arg1 ;
|
||||
bool result;
|
||||
|
||||
(void)jenv;
|
||||
(void)jcls;
|
||||
arg1 = jarg1 ? true : false;
|
||||
result = (bool)MediaSessionMgr::defaultsSetAdaptativeVideoSizeOutEnabled(arg1);
|
||||
jresult = (jboolean)result;
|
||||
return jresult;
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT jboolean JNICALL Java_org_doubango_tinyWRAP_tinyWRAPJNI_MediaSessionMgr_1defaultsSetJbMargin(JNIEnv *jenv, jclass jcls, jlong jarg1) {
|
||||
jboolean jresult = 0 ;
|
||||
uint32_t arg1 ;
|
||||
|
|
|
@ -35,6 +35,22 @@ public class tinyWRAPJNI {
|
|||
public final static native long ActionConfig_setResponseLine(long jarg1, ActionConfig jarg1_, short jarg2, String jarg3);
|
||||
public final static native long ActionConfig_setMediaString(long jarg1, ActionConfig jarg1_, int jarg2, String jarg3, String jarg4);
|
||||
public final static native long ActionConfig_setMediaInt(long jarg1, ActionConfig jarg1_, int jarg2, String jarg3, int jarg4);
|
||||
public final static native void delete_QoS(long jarg1);
|
||||
public final static native float QoS_getQavg(long jarg1, QoS jarg1_);
|
||||
public final static native float QoS_getQ1(long jarg1, QoS jarg1_);
|
||||
public final static native float QoS_getQ2(long jarg1, QoS jarg1_);
|
||||
public final static native float QoS_getQ3(long jarg1, QoS jarg1_);
|
||||
public final static native float QoS_getQ4(long jarg1, QoS jarg1_);
|
||||
public final static native float QoS_getQ5(long jarg1, QoS jarg1_);
|
||||
public final static native long QoS_getVideoInWidth(long jarg1, QoS jarg1_);
|
||||
public final static native long QoS_getVideoOutWidth(long jarg1, QoS jarg1_);
|
||||
public final static native long QoS_getVideoInHeight(long jarg1, QoS jarg1_);
|
||||
public final static native long QoS_getVideoOutHeight(long jarg1, QoS jarg1_);
|
||||
public final static native long QoS_getBandwidthDownKbps(long jarg1, QoS jarg1_);
|
||||
public final static native long QoS_getBandwidthUpKbps(long jarg1, QoS jarg1_);
|
||||
public final static native long QoS_getVideoInAvgFps(long jarg1, QoS jarg1_);
|
||||
public final static native long QoS_getVideoDecAvgTime(long jarg1, QoS jarg1_);
|
||||
public final static native long QoS_getVideoEncAvgTime(long jarg1, QoS jarg1_);
|
||||
public final static native void delete_Codec(long jarg1);
|
||||
public final static native int Codec_getMediaType(long jarg1, Codec jarg1_);
|
||||
public final static native String Codec_getName(long jarg1, Codec jarg1_);
|
||||
|
@ -46,6 +62,7 @@ public class tinyWRAPJNI {
|
|||
public final static native void delete_MediaSessionMgr(long jarg1);
|
||||
public final static native boolean MediaSessionMgr_sessionSetInt32(long jarg1, MediaSessionMgr jarg1_, int jarg2, String jarg3, int jarg4);
|
||||
public final static native int MediaSessionMgr_sessionGetInt32(long jarg1, MediaSessionMgr jarg1_, int jarg2, String jarg3);
|
||||
public final static native long MediaSessionMgr_sessionGetQoS(long jarg1, MediaSessionMgr jarg1_, int jarg2);
|
||||
public final static native boolean MediaSessionMgr_consumerSetInt32(long jarg1, MediaSessionMgr jarg1_, int jarg2, String jarg3, int jarg4);
|
||||
public final static native boolean MediaSessionMgr_consumerSetInt64(long jarg1, MediaSessionMgr jarg1_, int jarg2, String jarg3, long jarg4);
|
||||
public final static native boolean MediaSessionMgr_producerSetInt32(long jarg1, MediaSessionMgr jarg1_, int jarg2, String jarg3, int jarg4);
|
||||
|
@ -65,6 +82,8 @@ public class tinyWRAPJNI {
|
|||
public final static native boolean MediaSessionMgr_defaultsSetBandwidthVideoUploadMax(int jarg1);
|
||||
public final static native boolean MediaSessionMgr_defaultsSetBandwidthVideoDownloadMax(int jarg1);
|
||||
public final static native boolean MediaSessionMgr_defaultsSetPrefVideoSize(int jarg1);
|
||||
public final static native boolean MediaSessionMgr_defaultsSetPrefVideoSizeOutRange(int jarg1, int jarg2);
|
||||
public final static native boolean MediaSessionMgr_defaultsSetAdaptativeVideoSizeOutEnabled(boolean jarg1);
|
||||
public final static native boolean MediaSessionMgr_defaultsSetJbMargin(long jarg1);
|
||||
public final static native boolean MediaSessionMgr_defaultsSetJbMaxLateRate(long jarg1);
|
||||
public final static native boolean MediaSessionMgr_defaultsSetEchoTail(long jarg1);
|
||||
|
|
|
@ -2407,6 +2407,241 @@ SWIGEXPORT jlong JNICALL Java_org_doubango_tinyWRAP_tinyWRAPJNI_ActionConfig_1se
|
|||
}
|
||||
|
||||
|
||||
SWIGEXPORT void JNICALL Java_org_doubango_tinyWRAP_tinyWRAPJNI_delete_1QoS(JNIEnv *jenv, jclass jcls, jlong jarg1) {
|
||||
QoS *arg1 = (QoS *) 0 ;
|
||||
|
||||
(void)jenv;
|
||||
(void)jcls;
|
||||
arg1 = *(QoS **)&jarg1;
|
||||
delete arg1;
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT jfloat JNICALL Java_org_doubango_tinyWRAP_tinyWRAPJNI_QoS_1getQavg(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) {
|
||||
jfloat jresult = 0 ;
|
||||
QoS *arg1 = (QoS *) 0 ;
|
||||
float result;
|
||||
|
||||
(void)jenv;
|
||||
(void)jcls;
|
||||
(void)jarg1_;
|
||||
arg1 = *(QoS **)&jarg1;
|
||||
result = (float)(arg1)->getQavg();
|
||||
jresult = (jfloat)result;
|
||||
return jresult;
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT jfloat JNICALL Java_org_doubango_tinyWRAP_tinyWRAPJNI_QoS_1getQ1(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) {
|
||||
jfloat jresult = 0 ;
|
||||
QoS *arg1 = (QoS *) 0 ;
|
||||
float result;
|
||||
|
||||
(void)jenv;
|
||||
(void)jcls;
|
||||
(void)jarg1_;
|
||||
arg1 = *(QoS **)&jarg1;
|
||||
result = (float)(arg1)->getQ1();
|
||||
jresult = (jfloat)result;
|
||||
return jresult;
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT jfloat JNICALL Java_org_doubango_tinyWRAP_tinyWRAPJNI_QoS_1getQ2(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) {
|
||||
jfloat jresult = 0 ;
|
||||
QoS *arg1 = (QoS *) 0 ;
|
||||
float result;
|
||||
|
||||
(void)jenv;
|
||||
(void)jcls;
|
||||
(void)jarg1_;
|
||||
arg1 = *(QoS **)&jarg1;
|
||||
result = (float)(arg1)->getQ2();
|
||||
jresult = (jfloat)result;
|
||||
return jresult;
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT jfloat JNICALL Java_org_doubango_tinyWRAP_tinyWRAPJNI_QoS_1getQ3(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) {
|
||||
jfloat jresult = 0 ;
|
||||
QoS *arg1 = (QoS *) 0 ;
|
||||
float result;
|
||||
|
||||
(void)jenv;
|
||||
(void)jcls;
|
||||
(void)jarg1_;
|
||||
arg1 = *(QoS **)&jarg1;
|
||||
result = (float)(arg1)->getQ3();
|
||||
jresult = (jfloat)result;
|
||||
return jresult;
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT jfloat JNICALL Java_org_doubango_tinyWRAP_tinyWRAPJNI_QoS_1getQ4(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) {
|
||||
jfloat jresult = 0 ;
|
||||
QoS *arg1 = (QoS *) 0 ;
|
||||
float result;
|
||||
|
||||
(void)jenv;
|
||||
(void)jcls;
|
||||
(void)jarg1_;
|
||||
arg1 = *(QoS **)&jarg1;
|
||||
result = (float)(arg1)->getQ4();
|
||||
jresult = (jfloat)result;
|
||||
return jresult;
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT jfloat JNICALL Java_org_doubango_tinyWRAP_tinyWRAPJNI_QoS_1getQ5(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) {
|
||||
jfloat jresult = 0 ;
|
||||
QoS *arg1 = (QoS *) 0 ;
|
||||
float result;
|
||||
|
||||
(void)jenv;
|
||||
(void)jcls;
|
||||
(void)jarg1_;
|
||||
arg1 = *(QoS **)&jarg1;
|
||||
result = (float)(arg1)->getQ5();
|
||||
jresult = (jfloat)result;
|
||||
return jresult;
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT jlong JNICALL Java_org_doubango_tinyWRAP_tinyWRAPJNI_QoS_1getVideoInWidth(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) {
|
||||
jlong jresult = 0 ;
|
||||
QoS *arg1 = (QoS *) 0 ;
|
||||
unsigned int result;
|
||||
|
||||
(void)jenv;
|
||||
(void)jcls;
|
||||
(void)jarg1_;
|
||||
arg1 = *(QoS **)&jarg1;
|
||||
result = (unsigned int)(arg1)->getVideoInWidth();
|
||||
jresult = (jlong)result;
|
||||
return jresult;
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT jlong JNICALL Java_org_doubango_tinyWRAP_tinyWRAPJNI_QoS_1getVideoOutWidth(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) {
|
||||
jlong jresult = 0 ;
|
||||
QoS *arg1 = (QoS *) 0 ;
|
||||
unsigned int result;
|
||||
|
||||
(void)jenv;
|
||||
(void)jcls;
|
||||
(void)jarg1_;
|
||||
arg1 = *(QoS **)&jarg1;
|
||||
result = (unsigned int)(arg1)->getVideoOutWidth();
|
||||
jresult = (jlong)result;
|
||||
return jresult;
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT jlong JNICALL Java_org_doubango_tinyWRAP_tinyWRAPJNI_QoS_1getVideoInHeight(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) {
|
||||
jlong jresult = 0 ;
|
||||
QoS *arg1 = (QoS *) 0 ;
|
||||
unsigned int result;
|
||||
|
||||
(void)jenv;
|
||||
(void)jcls;
|
||||
(void)jarg1_;
|
||||
arg1 = *(QoS **)&jarg1;
|
||||
result = (unsigned int)(arg1)->getVideoInHeight();
|
||||
jresult = (jlong)result;
|
||||
return jresult;
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT jlong JNICALL Java_org_doubango_tinyWRAP_tinyWRAPJNI_QoS_1getVideoOutHeight(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) {
|
||||
jlong jresult = 0 ;
|
||||
QoS *arg1 = (QoS *) 0 ;
|
||||
unsigned int result;
|
||||
|
||||
(void)jenv;
|
||||
(void)jcls;
|
||||
(void)jarg1_;
|
||||
arg1 = *(QoS **)&jarg1;
|
||||
result = (unsigned int)(arg1)->getVideoOutHeight();
|
||||
jresult = (jlong)result;
|
||||
return jresult;
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT jlong JNICALL Java_org_doubango_tinyWRAP_tinyWRAPJNI_QoS_1getBandwidthDownKbps(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) {
|
||||
jlong jresult = 0 ;
|
||||
QoS *arg1 = (QoS *) 0 ;
|
||||
unsigned int result;
|
||||
|
||||
(void)jenv;
|
||||
(void)jcls;
|
||||
(void)jarg1_;
|
||||
arg1 = *(QoS **)&jarg1;
|
||||
result = (unsigned int)(arg1)->getBandwidthDownKbps();
|
||||
jresult = (jlong)result;
|
||||
return jresult;
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT jlong JNICALL Java_org_doubango_tinyWRAP_tinyWRAPJNI_QoS_1getBandwidthUpKbps(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) {
|
||||
jlong jresult = 0 ;
|
||||
QoS *arg1 = (QoS *) 0 ;
|
||||
unsigned int result;
|
||||
|
||||
(void)jenv;
|
||||
(void)jcls;
|
||||
(void)jarg1_;
|
||||
arg1 = *(QoS **)&jarg1;
|
||||
result = (unsigned int)(arg1)->getBandwidthUpKbps();
|
||||
jresult = (jlong)result;
|
||||
return jresult;
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT jlong JNICALL Java_org_doubango_tinyWRAP_tinyWRAPJNI_QoS_1getVideoInAvgFps(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) {
|
||||
jlong jresult = 0 ;
|
||||
QoS *arg1 = (QoS *) 0 ;
|
||||
unsigned int result;
|
||||
|
||||
(void)jenv;
|
||||
(void)jcls;
|
||||
(void)jarg1_;
|
||||
arg1 = *(QoS **)&jarg1;
|
||||
result = (unsigned int)(arg1)->getVideoInAvgFps();
|
||||
jresult = (jlong)result;
|
||||
return jresult;
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT jlong JNICALL Java_org_doubango_tinyWRAP_tinyWRAPJNI_QoS_1getVideoDecAvgTime(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) {
|
||||
jlong jresult = 0 ;
|
||||
QoS *arg1 = (QoS *) 0 ;
|
||||
unsigned int result;
|
||||
|
||||
(void)jenv;
|
||||
(void)jcls;
|
||||
(void)jarg1_;
|
||||
arg1 = *(QoS **)&jarg1;
|
||||
result = (unsigned int)(arg1)->getVideoDecAvgTime();
|
||||
jresult = (jlong)result;
|
||||
return jresult;
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT jlong JNICALL Java_org_doubango_tinyWRAP_tinyWRAPJNI_QoS_1getVideoEncAvgTime(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) {
|
||||
jlong jresult = 0 ;
|
||||
QoS *arg1 = (QoS *) 0 ;
|
||||
unsigned int result;
|
||||
|
||||
(void)jenv;
|
||||
(void)jcls;
|
||||
(void)jarg1_;
|
||||
arg1 = *(QoS **)&jarg1;
|
||||
result = (unsigned int)(arg1)->getVideoEncAvgTime();
|
||||
jresult = (jlong)result;
|
||||
return jresult;
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT void JNICALL Java_org_doubango_tinyWRAP_tinyWRAPJNI_delete_1Codec(JNIEnv *jenv, jclass jcls, jlong jarg1) {
|
||||
Codec *arg1 = (Codec *) 0 ;
|
||||
|
||||
|
@ -2582,6 +2817,23 @@ SWIGEXPORT jint JNICALL Java_org_doubango_tinyWRAP_tinyWRAPJNI_MediaSessionMgr_1
|
|||
}
|
||||
|
||||
|
||||
SWIGEXPORT jlong JNICALL Java_org_doubango_tinyWRAP_tinyWRAPJNI_MediaSessionMgr_1sessionGetQoS(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jint jarg2) {
|
||||
jlong jresult = 0 ;
|
||||
MediaSessionMgr *arg1 = (MediaSessionMgr *) 0 ;
|
||||
twrap_media_type_t arg2 ;
|
||||
QoS *result = 0 ;
|
||||
|
||||
(void)jenv;
|
||||
(void)jcls;
|
||||
(void)jarg1_;
|
||||
arg1 = *(MediaSessionMgr **)&jarg1;
|
||||
arg2 = (twrap_media_type_t)jarg2;
|
||||
result = (QoS *)(arg1)->sessionGetQoS(arg2);
|
||||
*(QoS **)&jresult = result;
|
||||
return jresult;
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT jboolean JNICALL Java_org_doubango_tinyWRAP_tinyWRAPJNI_MediaSessionMgr_1consumerSetInt32(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jint jarg2, jstring jarg3, jint jarg4) {
|
||||
jboolean jresult = 0 ;
|
||||
MediaSessionMgr *arg1 = (MediaSessionMgr *) 0 ;
|
||||
|
@ -2925,6 +3177,36 @@ SWIGEXPORT jboolean JNICALL Java_org_doubango_tinyWRAP_tinyWRAPJNI_MediaSessionM
|
|||
}
|
||||
|
||||
|
||||
SWIGEXPORT jboolean JNICALL Java_org_doubango_tinyWRAP_tinyWRAPJNI_MediaSessionMgr_1defaultsSetPrefVideoSizeOutRange(JNIEnv *jenv, jclass jcls, jint jarg1, jint jarg2) {
|
||||
jboolean jresult = 0 ;
|
||||
tmedia_pref_video_size_t arg1 ;
|
||||
tmedia_pref_video_size_t arg2 ;
|
||||
bool result;
|
||||
|
||||
(void)jenv;
|
||||
(void)jcls;
|
||||
arg1 = (tmedia_pref_video_size_t)jarg1;
|
||||
arg2 = (tmedia_pref_video_size_t)jarg2;
|
||||
result = (bool)MediaSessionMgr::defaultsSetPrefVideoSizeOutRange(arg1,arg2);
|
||||
jresult = (jboolean)result;
|
||||
return jresult;
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT jboolean JNICALL Java_org_doubango_tinyWRAP_tinyWRAPJNI_MediaSessionMgr_1defaultsSetAdaptativeVideoSizeOutEnabled(JNIEnv *jenv, jclass jcls, jboolean jarg1) {
|
||||
jboolean jresult = 0 ;
|
||||
bool arg1 ;
|
||||
bool result;
|
||||
|
||||
(void)jenv;
|
||||
(void)jcls;
|
||||
arg1 = jarg1 ? true : false;
|
||||
result = (bool)MediaSessionMgr::defaultsSetAdaptativeVideoSizeOutEnabled(arg1);
|
||||
jresult = (jboolean)result;
|
||||
return jresult;
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT jboolean JNICALL Java_org_doubango_tinyWRAP_tinyWRAPJNI_MediaSessionMgr_1defaultsSetJbMargin(JNIEnv *jenv, jclass jcls, jlong jarg1) {
|
||||
jboolean jresult = 0 ;
|
||||
uint32_t arg1 ;
|
||||
|
|
|
@ -175,6 +175,52 @@ sub ACQUIRE {
|
|||
}
|
||||
|
||||
|
||||
############# Class : tinyWRAP::QoS ##############
|
||||
|
||||
package tinyWRAP::QoS;
|
||||
use vars qw(@ISA %OWNER %ITERATORS %BLESSEDMEMBERS);
|
||||
@ISA = qw( tinyWRAP );
|
||||
%OWNER = ();
|
||||
%ITERATORS = ();
|
||||
sub DESTROY {
|
||||
return unless $_[0]->isa('HASH');
|
||||
my $self = tied(%{$_[0]});
|
||||
return unless defined $self;
|
||||
delete $ITERATORS{$self};
|
||||
if (exists $OWNER{$self}) {
|
||||
tinyWRAPc::delete_QoS($self);
|
||||
delete $OWNER{$self};
|
||||
}
|
||||
}
|
||||
|
||||
*getQavg = *tinyWRAPc::QoS_getQavg;
|
||||
*getQ1 = *tinyWRAPc::QoS_getQ1;
|
||||
*getQ2 = *tinyWRAPc::QoS_getQ2;
|
||||
*getQ3 = *tinyWRAPc::QoS_getQ3;
|
||||
*getQ4 = *tinyWRAPc::QoS_getQ4;
|
||||
*getQ5 = *tinyWRAPc::QoS_getQ5;
|
||||
*getVideoInWidth = *tinyWRAPc::QoS_getVideoInWidth;
|
||||
*getVideoOutWidth = *tinyWRAPc::QoS_getVideoOutWidth;
|
||||
*getVideoInHeight = *tinyWRAPc::QoS_getVideoInHeight;
|
||||
*getVideoOutHeight = *tinyWRAPc::QoS_getVideoOutHeight;
|
||||
*getBandwidthDownKbps = *tinyWRAPc::QoS_getBandwidthDownKbps;
|
||||
*getBandwidthUpKbps = *tinyWRAPc::QoS_getBandwidthUpKbps;
|
||||
*getVideoInAvgFps = *tinyWRAPc::QoS_getVideoInAvgFps;
|
||||
*getVideoDecAvgTime = *tinyWRAPc::QoS_getVideoDecAvgTime;
|
||||
*getVideoEncAvgTime = *tinyWRAPc::QoS_getVideoEncAvgTime;
|
||||
sub DISOWN {
|
||||
my $self = shift;
|
||||
my $ptr = tied(%$self);
|
||||
delete $OWNER{$ptr};
|
||||
}
|
||||
|
||||
sub ACQUIRE {
|
||||
my $self = shift;
|
||||
my $ptr = tied(%$self);
|
||||
$OWNER{$ptr} = 1;
|
||||
}
|
||||
|
||||
|
||||
############# Class : tinyWRAP::Codec ##############
|
||||
|
||||
package tinyWRAP::Codec;
|
||||
|
@ -233,6 +279,7 @@ sub DESTROY {
|
|||
|
||||
*sessionSetInt32 = *tinyWRAPc::MediaSessionMgr_sessionSetInt32;
|
||||
*sessionGetInt32 = *tinyWRAPc::MediaSessionMgr_sessionGetInt32;
|
||||
*sessionGetQoS = *tinyWRAPc::MediaSessionMgr_sessionGetQoS;
|
||||
*consumerSetInt32 = *tinyWRAPc::MediaSessionMgr_consumerSetInt32;
|
||||
*consumerSetInt64 = *tinyWRAPc::MediaSessionMgr_consumerSetInt64;
|
||||
*producerSetInt32 = *tinyWRAPc::MediaSessionMgr_producerSetInt32;
|
||||
|
@ -252,6 +299,8 @@ sub DESTROY {
|
|||
*defaultsSetBandwidthVideoUploadMax = *tinyWRAPc::MediaSessionMgr_defaultsSetBandwidthVideoUploadMax;
|
||||
*defaultsSetBandwidthVideoDownloadMax = *tinyWRAPc::MediaSessionMgr_defaultsSetBandwidthVideoDownloadMax;
|
||||
*defaultsSetPrefVideoSize = *tinyWRAPc::MediaSessionMgr_defaultsSetPrefVideoSize;
|
||||
*defaultsSetPrefVideoSizeOutRange = *tinyWRAPc::MediaSessionMgr_defaultsSetPrefVideoSizeOutRange;
|
||||
*defaultsSetAdaptativeVideoSizeOutEnabled = *tinyWRAPc::MediaSessionMgr_defaultsSetAdaptativeVideoSizeOutEnabled;
|
||||
*defaultsSetJbMargin = *tinyWRAPc::MediaSessionMgr_defaultsSetJbMargin;
|
||||
*defaultsSetJbMaxLateRate = *tinyWRAPc::MediaSessionMgr_defaultsSetJbMaxLateRate;
|
||||
*defaultsSetEchoTail = *tinyWRAPc::MediaSessionMgr_defaultsSetEchoTail;
|
||||
|
|
|
@ -1549,70 +1549,71 @@ SWIG_Perl_SetModule(swig_module_info *module) {
|
|||
#define SWIGTYPE_p_ProxyVideoProducerCallback swig_types[32]
|
||||
#define SWIGTYPE_p_PublicationEvent swig_types[33]
|
||||
#define SWIGTYPE_p_PublicationSession swig_types[34]
|
||||
#define SWIGTYPE_p_RPMessage swig_types[35]
|
||||
#define SWIGTYPE_p_RegistrationEvent swig_types[36]
|
||||
#define SWIGTYPE_p_RegistrationSession swig_types[37]
|
||||
#define SWIGTYPE_p_SMSData swig_types[38]
|
||||
#define SWIGTYPE_p_SMSEncoder swig_types[39]
|
||||
#define SWIGTYPE_p_SafeObject swig_types[40]
|
||||
#define SWIGTYPE_p_SdpMessage swig_types[41]
|
||||
#define SWIGTYPE_p_SipCallback swig_types[42]
|
||||
#define SWIGTYPE_p_SipEvent swig_types[43]
|
||||
#define SWIGTYPE_p_SipMessage swig_types[44]
|
||||
#define SWIGTYPE_p_SipSession swig_types[45]
|
||||
#define SWIGTYPE_p_SipStack swig_types[46]
|
||||
#define SWIGTYPE_p_SipUri swig_types[47]
|
||||
#define SWIGTYPE_p_StackEvent swig_types[48]
|
||||
#define SWIGTYPE_p_SubscriptionEvent swig_types[49]
|
||||
#define SWIGTYPE_p_SubscriptionSession swig_types[50]
|
||||
#define SWIGTYPE_p_T140Callback swig_types[51]
|
||||
#define SWIGTYPE_p_T140CallbackData swig_types[52]
|
||||
#define SWIGTYPE_p_XcapCallback swig_types[53]
|
||||
#define SWIGTYPE_p_XcapEvent swig_types[54]
|
||||
#define SWIGTYPE_p_XcapMessage swig_types[55]
|
||||
#define SWIGTYPE_p_XcapSelector swig_types[56]
|
||||
#define SWIGTYPE_p_XcapStack swig_types[57]
|
||||
#define SWIGTYPE_p_char swig_types[58]
|
||||
#define SWIGTYPE_p_int swig_types[59]
|
||||
#define SWIGTYPE_p_long_long swig_types[60]
|
||||
#define SWIGTYPE_p_short swig_types[61]
|
||||
#define SWIGTYPE_p_signed_char swig_types[62]
|
||||
#define SWIGTYPE_p_tdav_codec_id_e swig_types[63]
|
||||
#define SWIGTYPE_p_thttp_event_type_e swig_types[64]
|
||||
#define SWIGTYPE_p_tmedia_bandwidth_level_e swig_types[65]
|
||||
#define SWIGTYPE_p_tmedia_chroma_e swig_types[66]
|
||||
#define SWIGTYPE_p_tmedia_codec_id_e swig_types[67]
|
||||
#define SWIGTYPE_p_tmedia_mode_e swig_types[68]
|
||||
#define SWIGTYPE_p_tmedia_pref_video_size_s swig_types[69]
|
||||
#define SWIGTYPE_p_tmedia_profile_e swig_types[70]
|
||||
#define SWIGTYPE_p_tmedia_qos_strength_e swig_types[71]
|
||||
#define SWIGTYPE_p_tmedia_qos_stype_e swig_types[72]
|
||||
#define SWIGTYPE_p_tmedia_srtp_mode_e swig_types[73]
|
||||
#define SWIGTYPE_p_tmedia_srtp_type_e swig_types[74]
|
||||
#define SWIGTYPE_p_tmedia_t140_data_type_e swig_types[75]
|
||||
#define SWIGTYPE_p_tmsrp_event_type_e swig_types[76]
|
||||
#define SWIGTYPE_p_tmsrp_request_type_e swig_types[77]
|
||||
#define SWIGTYPE_p_tsip_event_type_e swig_types[78]
|
||||
#define SWIGTYPE_p_tsip_info_event_type_e swig_types[79]
|
||||
#define SWIGTYPE_p_tsip_invite_event_type_e swig_types[80]
|
||||
#define SWIGTYPE_p_tsip_message_event_type_e swig_types[81]
|
||||
#define SWIGTYPE_p_tsip_options_event_type_e swig_types[82]
|
||||
#define SWIGTYPE_p_tsip_publish_event_type_e swig_types[83]
|
||||
#define SWIGTYPE_p_tsip_register_event_type_e swig_types[84]
|
||||
#define SWIGTYPE_p_tsip_request_type_e swig_types[85]
|
||||
#define SWIGTYPE_p_tsip_stack_mode_e swig_types[86]
|
||||
#define SWIGTYPE_p_tsip_subscribe_event_type_e swig_types[87]
|
||||
#define SWIGTYPE_p_tsk_list_t swig_types[88]
|
||||
#define SWIGTYPE_p_twrap_media_type_e swig_types[89]
|
||||
#define SWIGTYPE_p_twrap_proxy_plugin_type_e swig_types[90]
|
||||
#define SWIGTYPE_p_twrap_rpmessage_type_e swig_types[91]
|
||||
#define SWIGTYPE_p_twrap_sms_type_e swig_types[92]
|
||||
#define SWIGTYPE_p_unsigned_char swig_types[93]
|
||||
#define SWIGTYPE_p_unsigned_int swig_types[94]
|
||||
#define SWIGTYPE_p_unsigned_long_long swig_types[95]
|
||||
#define SWIGTYPE_p_unsigned_short swig_types[96]
|
||||
static swig_type_info *swig_types[98];
|
||||
static swig_module_info swig_module = {swig_types, 97, 0, 0, 0, 0};
|
||||
#define SWIGTYPE_p_QoS swig_types[35]
|
||||
#define SWIGTYPE_p_RPMessage swig_types[36]
|
||||
#define SWIGTYPE_p_RegistrationEvent swig_types[37]
|
||||
#define SWIGTYPE_p_RegistrationSession swig_types[38]
|
||||
#define SWIGTYPE_p_SMSData swig_types[39]
|
||||
#define SWIGTYPE_p_SMSEncoder swig_types[40]
|
||||
#define SWIGTYPE_p_SafeObject swig_types[41]
|
||||
#define SWIGTYPE_p_SdpMessage swig_types[42]
|
||||
#define SWIGTYPE_p_SipCallback swig_types[43]
|
||||
#define SWIGTYPE_p_SipEvent swig_types[44]
|
||||
#define SWIGTYPE_p_SipMessage swig_types[45]
|
||||
#define SWIGTYPE_p_SipSession swig_types[46]
|
||||
#define SWIGTYPE_p_SipStack swig_types[47]
|
||||
#define SWIGTYPE_p_SipUri swig_types[48]
|
||||
#define SWIGTYPE_p_StackEvent swig_types[49]
|
||||
#define SWIGTYPE_p_SubscriptionEvent swig_types[50]
|
||||
#define SWIGTYPE_p_SubscriptionSession swig_types[51]
|
||||
#define SWIGTYPE_p_T140Callback swig_types[52]
|
||||
#define SWIGTYPE_p_T140CallbackData swig_types[53]
|
||||
#define SWIGTYPE_p_XcapCallback swig_types[54]
|
||||
#define SWIGTYPE_p_XcapEvent swig_types[55]
|
||||
#define SWIGTYPE_p_XcapMessage swig_types[56]
|
||||
#define SWIGTYPE_p_XcapSelector swig_types[57]
|
||||
#define SWIGTYPE_p_XcapStack swig_types[58]
|
||||
#define SWIGTYPE_p_char swig_types[59]
|
||||
#define SWIGTYPE_p_int swig_types[60]
|
||||
#define SWIGTYPE_p_long_long swig_types[61]
|
||||
#define SWIGTYPE_p_short swig_types[62]
|
||||
#define SWIGTYPE_p_signed_char swig_types[63]
|
||||
#define SWIGTYPE_p_tdav_codec_id_e swig_types[64]
|
||||
#define SWIGTYPE_p_thttp_event_type_e swig_types[65]
|
||||
#define SWIGTYPE_p_tmedia_bandwidth_level_e swig_types[66]
|
||||
#define SWIGTYPE_p_tmedia_chroma_e swig_types[67]
|
||||
#define SWIGTYPE_p_tmedia_codec_id_e swig_types[68]
|
||||
#define SWIGTYPE_p_tmedia_mode_e swig_types[69]
|
||||
#define SWIGTYPE_p_tmedia_pref_video_size_s swig_types[70]
|
||||
#define SWIGTYPE_p_tmedia_profile_e swig_types[71]
|
||||
#define SWIGTYPE_p_tmedia_qos_strength_e swig_types[72]
|
||||
#define SWIGTYPE_p_tmedia_qos_stype_e swig_types[73]
|
||||
#define SWIGTYPE_p_tmedia_srtp_mode_e swig_types[74]
|
||||
#define SWIGTYPE_p_tmedia_srtp_type_e swig_types[75]
|
||||
#define SWIGTYPE_p_tmedia_t140_data_type_e swig_types[76]
|
||||
#define SWIGTYPE_p_tmsrp_event_type_e swig_types[77]
|
||||
#define SWIGTYPE_p_tmsrp_request_type_e swig_types[78]
|
||||
#define SWIGTYPE_p_tsip_event_type_e swig_types[79]
|
||||
#define SWIGTYPE_p_tsip_info_event_type_e swig_types[80]
|
||||
#define SWIGTYPE_p_tsip_invite_event_type_e swig_types[81]
|
||||
#define SWIGTYPE_p_tsip_message_event_type_e swig_types[82]
|
||||
#define SWIGTYPE_p_tsip_options_event_type_e swig_types[83]
|
||||
#define SWIGTYPE_p_tsip_publish_event_type_e swig_types[84]
|
||||
#define SWIGTYPE_p_tsip_register_event_type_e swig_types[85]
|
||||
#define SWIGTYPE_p_tsip_request_type_e swig_types[86]
|
||||
#define SWIGTYPE_p_tsip_stack_mode_e swig_types[87]
|
||||
#define SWIGTYPE_p_tsip_subscribe_event_type_e swig_types[88]
|
||||
#define SWIGTYPE_p_tsk_list_t swig_types[89]
|
||||
#define SWIGTYPE_p_twrap_media_type_e swig_types[90]
|
||||
#define SWIGTYPE_p_twrap_proxy_plugin_type_e swig_types[91]
|
||||
#define SWIGTYPE_p_twrap_rpmessage_type_e swig_types[92]
|
||||
#define SWIGTYPE_p_twrap_sms_type_e swig_types[93]
|
||||
#define SWIGTYPE_p_unsigned_char swig_types[94]
|
||||
#define SWIGTYPE_p_unsigned_int swig_types[95]
|
||||
#define SWIGTYPE_p_unsigned_long_long swig_types[96]
|
||||
#define SWIGTYPE_p_unsigned_short swig_types[97]
|
||||
static swig_type_info *swig_types[99];
|
||||
static swig_module_info swig_module = {swig_types, 98, 0, 0, 0, 0};
|
||||
#define SWIG_TypeQuery(name) SWIG_TypeQueryModule(&swig_module, &swig_module, name)
|
||||
#define SWIG_MangledTypeQuery(name) SWIG_MangledTypeQueryModule(&swig_module, &swig_module, name)
|
||||
|
||||
|
@ -1995,6 +1996,20 @@ SWIG_AsVal_short SWIG_PERL_DECL_ARGS_2(SV * obj, short *val)
|
|||
}
|
||||
|
||||
|
||||
SWIGINTERNINLINE SV *
|
||||
SWIG_From_double SWIG_PERL_DECL_ARGS_1(double value)
|
||||
{
|
||||
return sv_2mortal(newSVnv(value));
|
||||
}
|
||||
|
||||
|
||||
SWIGINTERNINLINE SV *
|
||||
SWIG_From_float SWIG_PERL_DECL_ARGS_1(float value)
|
||||
{
|
||||
return SWIG_From_double SWIG_PERL_CALL_ARGS_1(value);
|
||||
}
|
||||
|
||||
|
||||
SWIGINTERNINLINE SV *
|
||||
SWIG_FromCharPtrAndSize(const char* carray, size_t size)
|
||||
{
|
||||
|
@ -2149,20 +2164,6 @@ SWIG_AsVal_float SWIG_PERL_DECL_ARGS_2(SV * obj, float *val)
|
|||
}
|
||||
|
||||
|
||||
SWIGINTERNINLINE SV *
|
||||
SWIG_From_double SWIG_PERL_DECL_ARGS_1(double value)
|
||||
{
|
||||
return sv_2mortal(newSVnv(value));
|
||||
}
|
||||
|
||||
|
||||
SWIGINTERNINLINE SV *
|
||||
SWIG_From_float SWIG_PERL_DECL_ARGS_1(float value)
|
||||
{
|
||||
return SWIG_From_double SWIG_PERL_CALL_ARGS_1(value);
|
||||
}
|
||||
|
||||
|
||||
SWIGINTERN int
|
||||
SWIG_AsVal_unsigned_SS_short SWIG_PERL_DECL_ARGS_2(SV * obj, unsigned short *val)
|
||||
{
|
||||
|
@ -3110,6 +3111,453 @@ XS(_wrap_ActionConfig_setMediaInt) {
|
|||
}
|
||||
|
||||
|
||||
XS(_wrap_delete_QoS) {
|
||||
{
|
||||
QoS *arg1 = (QoS *) 0 ;
|
||||
void *argp1 = 0 ;
|
||||
int res1 = 0 ;
|
||||
int argvi = 0;
|
||||
dXSARGS;
|
||||
|
||||
if ((items < 1) || (items > 1)) {
|
||||
SWIG_croak("Usage: delete_QoS(self);");
|
||||
}
|
||||
res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_QoS, SWIG_POINTER_DISOWN | 0 );
|
||||
if (!SWIG_IsOK(res1)) {
|
||||
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_QoS" "', argument " "1"" of type '" "QoS *""'");
|
||||
}
|
||||
arg1 = reinterpret_cast< QoS * >(argp1);
|
||||
delete arg1;
|
||||
ST(argvi) = sv_newmortal();
|
||||
|
||||
XSRETURN(argvi);
|
||||
fail:
|
||||
|
||||
SWIG_croak_null();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
XS(_wrap_QoS_getQavg) {
|
||||
{
|
||||
QoS *arg1 = (QoS *) 0 ;
|
||||
void *argp1 = 0 ;
|
||||
int res1 = 0 ;
|
||||
int argvi = 0;
|
||||
float result;
|
||||
dXSARGS;
|
||||
|
||||
if ((items < 1) || (items > 1)) {
|
||||
SWIG_croak("Usage: QoS_getQavg(self);");
|
||||
}
|
||||
res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_QoS, 0 | 0 );
|
||||
if (!SWIG_IsOK(res1)) {
|
||||
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "QoS_getQavg" "', argument " "1"" of type '" "QoS *""'");
|
||||
}
|
||||
arg1 = reinterpret_cast< QoS * >(argp1);
|
||||
result = (float)(arg1)->getQavg();
|
||||
ST(argvi) = SWIG_From_float SWIG_PERL_CALL_ARGS_1(static_cast< float >(result)); argvi++ ;
|
||||
|
||||
XSRETURN(argvi);
|
||||
fail:
|
||||
|
||||
SWIG_croak_null();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
XS(_wrap_QoS_getQ1) {
|
||||
{
|
||||
QoS *arg1 = (QoS *) 0 ;
|
||||
void *argp1 = 0 ;
|
||||
int res1 = 0 ;
|
||||
int argvi = 0;
|
||||
float result;
|
||||
dXSARGS;
|
||||
|
||||
if ((items < 1) || (items > 1)) {
|
||||
SWIG_croak("Usage: QoS_getQ1(self);");
|
||||
}
|
||||
res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_QoS, 0 | 0 );
|
||||
if (!SWIG_IsOK(res1)) {
|
||||
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "QoS_getQ1" "', argument " "1"" of type '" "QoS *""'");
|
||||
}
|
||||
arg1 = reinterpret_cast< QoS * >(argp1);
|
||||
result = (float)(arg1)->getQ1();
|
||||
ST(argvi) = SWIG_From_float SWIG_PERL_CALL_ARGS_1(static_cast< float >(result)); argvi++ ;
|
||||
|
||||
XSRETURN(argvi);
|
||||
fail:
|
||||
|
||||
SWIG_croak_null();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
XS(_wrap_QoS_getQ2) {
|
||||
{
|
||||
QoS *arg1 = (QoS *) 0 ;
|
||||
void *argp1 = 0 ;
|
||||
int res1 = 0 ;
|
||||
int argvi = 0;
|
||||
float result;
|
||||
dXSARGS;
|
||||
|
||||
if ((items < 1) || (items > 1)) {
|
||||
SWIG_croak("Usage: QoS_getQ2(self);");
|
||||
}
|
||||
res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_QoS, 0 | 0 );
|
||||
if (!SWIG_IsOK(res1)) {
|
||||
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "QoS_getQ2" "', argument " "1"" of type '" "QoS *""'");
|
||||
}
|
||||
arg1 = reinterpret_cast< QoS * >(argp1);
|
||||
result = (float)(arg1)->getQ2();
|
||||
ST(argvi) = SWIG_From_float SWIG_PERL_CALL_ARGS_1(static_cast< float >(result)); argvi++ ;
|
||||
|
||||
XSRETURN(argvi);
|
||||
fail:
|
||||
|
||||
SWIG_croak_null();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
XS(_wrap_QoS_getQ3) {
|
||||
{
|
||||
QoS *arg1 = (QoS *) 0 ;
|
||||
void *argp1 = 0 ;
|
||||
int res1 = 0 ;
|
||||
int argvi = 0;
|
||||
float result;
|
||||
dXSARGS;
|
||||
|
||||
if ((items < 1) || (items > 1)) {
|
||||
SWIG_croak("Usage: QoS_getQ3(self);");
|
||||
}
|
||||
res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_QoS, 0 | 0 );
|
||||
if (!SWIG_IsOK(res1)) {
|
||||
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "QoS_getQ3" "', argument " "1"" of type '" "QoS *""'");
|
||||
}
|
||||
arg1 = reinterpret_cast< QoS * >(argp1);
|
||||
result = (float)(arg1)->getQ3();
|
||||
ST(argvi) = SWIG_From_float SWIG_PERL_CALL_ARGS_1(static_cast< float >(result)); argvi++ ;
|
||||
|
||||
XSRETURN(argvi);
|
||||
fail:
|
||||
|
||||
SWIG_croak_null();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
XS(_wrap_QoS_getQ4) {
|
||||
{
|
||||
QoS *arg1 = (QoS *) 0 ;
|
||||
void *argp1 = 0 ;
|
||||
int res1 = 0 ;
|
||||
int argvi = 0;
|
||||
float result;
|
||||
dXSARGS;
|
||||
|
||||
if ((items < 1) || (items > 1)) {
|
||||
SWIG_croak("Usage: QoS_getQ4(self);");
|
||||
}
|
||||
res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_QoS, 0 | 0 );
|
||||
if (!SWIG_IsOK(res1)) {
|
||||
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "QoS_getQ4" "', argument " "1"" of type '" "QoS *""'");
|
||||
}
|
||||
arg1 = reinterpret_cast< QoS * >(argp1);
|
||||
result = (float)(arg1)->getQ4();
|
||||
ST(argvi) = SWIG_From_float SWIG_PERL_CALL_ARGS_1(static_cast< float >(result)); argvi++ ;
|
||||
|
||||
XSRETURN(argvi);
|
||||
fail:
|
||||
|
||||
SWIG_croak_null();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
XS(_wrap_QoS_getQ5) {
|
||||
{
|
||||
QoS *arg1 = (QoS *) 0 ;
|
||||
void *argp1 = 0 ;
|
||||
int res1 = 0 ;
|
||||
int argvi = 0;
|
||||
float result;
|
||||
dXSARGS;
|
||||
|
||||
if ((items < 1) || (items > 1)) {
|
||||
SWIG_croak("Usage: QoS_getQ5(self);");
|
||||
}
|
||||
res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_QoS, 0 | 0 );
|
||||
if (!SWIG_IsOK(res1)) {
|
||||
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "QoS_getQ5" "', argument " "1"" of type '" "QoS *""'");
|
||||
}
|
||||
arg1 = reinterpret_cast< QoS * >(argp1);
|
||||
result = (float)(arg1)->getQ5();
|
||||
ST(argvi) = SWIG_From_float SWIG_PERL_CALL_ARGS_1(static_cast< float >(result)); argvi++ ;
|
||||
|
||||
XSRETURN(argvi);
|
||||
fail:
|
||||
|
||||
SWIG_croak_null();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
XS(_wrap_QoS_getVideoInWidth) {
|
||||
{
|
||||
QoS *arg1 = (QoS *) 0 ;
|
||||
void *argp1 = 0 ;
|
||||
int res1 = 0 ;
|
||||
int argvi = 0;
|
||||
unsigned int result;
|
||||
dXSARGS;
|
||||
|
||||
if ((items < 1) || (items > 1)) {
|
||||
SWIG_croak("Usage: QoS_getVideoInWidth(self);");
|
||||
}
|
||||
res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_QoS, 0 | 0 );
|
||||
if (!SWIG_IsOK(res1)) {
|
||||
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "QoS_getVideoInWidth" "', argument " "1"" of type '" "QoS *""'");
|
||||
}
|
||||
arg1 = reinterpret_cast< QoS * >(argp1);
|
||||
result = (unsigned int)(arg1)->getVideoInWidth();
|
||||
ST(argvi) = SWIG_From_unsigned_SS_int SWIG_PERL_CALL_ARGS_1(static_cast< unsigned int >(result)); argvi++ ;
|
||||
|
||||
XSRETURN(argvi);
|
||||
fail:
|
||||
|
||||
SWIG_croak_null();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
XS(_wrap_QoS_getVideoOutWidth) {
|
||||
{
|
||||
QoS *arg1 = (QoS *) 0 ;
|
||||
void *argp1 = 0 ;
|
||||
int res1 = 0 ;
|
||||
int argvi = 0;
|
||||
unsigned int result;
|
||||
dXSARGS;
|
||||
|
||||
if ((items < 1) || (items > 1)) {
|
||||
SWIG_croak("Usage: QoS_getVideoOutWidth(self);");
|
||||
}
|
||||
res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_QoS, 0 | 0 );
|
||||
if (!SWIG_IsOK(res1)) {
|
||||
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "QoS_getVideoOutWidth" "', argument " "1"" of type '" "QoS *""'");
|
||||
}
|
||||
arg1 = reinterpret_cast< QoS * >(argp1);
|
||||
result = (unsigned int)(arg1)->getVideoOutWidth();
|
||||
ST(argvi) = SWIG_From_unsigned_SS_int SWIG_PERL_CALL_ARGS_1(static_cast< unsigned int >(result)); argvi++ ;
|
||||
|
||||
XSRETURN(argvi);
|
||||
fail:
|
||||
|
||||
SWIG_croak_null();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
XS(_wrap_QoS_getVideoInHeight) {
|
||||
{
|
||||
QoS *arg1 = (QoS *) 0 ;
|
||||
void *argp1 = 0 ;
|
||||
int res1 = 0 ;
|
||||
int argvi = 0;
|
||||
unsigned int result;
|
||||
dXSARGS;
|
||||
|
||||
if ((items < 1) || (items > 1)) {
|
||||
SWIG_croak("Usage: QoS_getVideoInHeight(self);");
|
||||
}
|
||||
res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_QoS, 0 | 0 );
|
||||
if (!SWIG_IsOK(res1)) {
|
||||
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "QoS_getVideoInHeight" "', argument " "1"" of type '" "QoS *""'");
|
||||
}
|
||||
arg1 = reinterpret_cast< QoS * >(argp1);
|
||||
result = (unsigned int)(arg1)->getVideoInHeight();
|
||||
ST(argvi) = SWIG_From_unsigned_SS_int SWIG_PERL_CALL_ARGS_1(static_cast< unsigned int >(result)); argvi++ ;
|
||||
|
||||
XSRETURN(argvi);
|
||||
fail:
|
||||
|
||||
SWIG_croak_null();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
XS(_wrap_QoS_getVideoOutHeight) {
|
||||
{
|
||||
QoS *arg1 = (QoS *) 0 ;
|
||||
void *argp1 = 0 ;
|
||||
int res1 = 0 ;
|
||||
int argvi = 0;
|
||||
unsigned int result;
|
||||
dXSARGS;
|
||||
|
||||
if ((items < 1) || (items > 1)) {
|
||||
SWIG_croak("Usage: QoS_getVideoOutHeight(self);");
|
||||
}
|
||||
res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_QoS, 0 | 0 );
|
||||
if (!SWIG_IsOK(res1)) {
|
||||
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "QoS_getVideoOutHeight" "', argument " "1"" of type '" "QoS *""'");
|
||||
}
|
||||
arg1 = reinterpret_cast< QoS * >(argp1);
|
||||
result = (unsigned int)(arg1)->getVideoOutHeight();
|
||||
ST(argvi) = SWIG_From_unsigned_SS_int SWIG_PERL_CALL_ARGS_1(static_cast< unsigned int >(result)); argvi++ ;
|
||||
|
||||
XSRETURN(argvi);
|
||||
fail:
|
||||
|
||||
SWIG_croak_null();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
XS(_wrap_QoS_getBandwidthDownKbps) {
|
||||
{
|
||||
QoS *arg1 = (QoS *) 0 ;
|
||||
void *argp1 = 0 ;
|
||||
int res1 = 0 ;
|
||||
int argvi = 0;
|
||||
unsigned int result;
|
||||
dXSARGS;
|
||||
|
||||
if ((items < 1) || (items > 1)) {
|
||||
SWIG_croak("Usage: QoS_getBandwidthDownKbps(self);");
|
||||
}
|
||||
res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_QoS, 0 | 0 );
|
||||
if (!SWIG_IsOK(res1)) {
|
||||
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "QoS_getBandwidthDownKbps" "', argument " "1"" of type '" "QoS *""'");
|
||||
}
|
||||
arg1 = reinterpret_cast< QoS * >(argp1);
|
||||
result = (unsigned int)(arg1)->getBandwidthDownKbps();
|
||||
ST(argvi) = SWIG_From_unsigned_SS_int SWIG_PERL_CALL_ARGS_1(static_cast< unsigned int >(result)); argvi++ ;
|
||||
|
||||
XSRETURN(argvi);
|
||||
fail:
|
||||
|
||||
SWIG_croak_null();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
XS(_wrap_QoS_getBandwidthUpKbps) {
|
||||
{
|
||||
QoS *arg1 = (QoS *) 0 ;
|
||||
void *argp1 = 0 ;
|
||||
int res1 = 0 ;
|
||||
int argvi = 0;
|
||||
unsigned int result;
|
||||
dXSARGS;
|
||||
|
||||
if ((items < 1) || (items > 1)) {
|
||||
SWIG_croak("Usage: QoS_getBandwidthUpKbps(self);");
|
||||
}
|
||||
res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_QoS, 0 | 0 );
|
||||
if (!SWIG_IsOK(res1)) {
|
||||
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "QoS_getBandwidthUpKbps" "', argument " "1"" of type '" "QoS *""'");
|
||||
}
|
||||
arg1 = reinterpret_cast< QoS * >(argp1);
|
||||
result = (unsigned int)(arg1)->getBandwidthUpKbps();
|
||||
ST(argvi) = SWIG_From_unsigned_SS_int SWIG_PERL_CALL_ARGS_1(static_cast< unsigned int >(result)); argvi++ ;
|
||||
|
||||
XSRETURN(argvi);
|
||||
fail:
|
||||
|
||||
SWIG_croak_null();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
XS(_wrap_QoS_getVideoInAvgFps) {
|
||||
{
|
||||
QoS *arg1 = (QoS *) 0 ;
|
||||
void *argp1 = 0 ;
|
||||
int res1 = 0 ;
|
||||
int argvi = 0;
|
||||
unsigned int result;
|
||||
dXSARGS;
|
||||
|
||||
if ((items < 1) || (items > 1)) {
|
||||
SWIG_croak("Usage: QoS_getVideoInAvgFps(self);");
|
||||
}
|
||||
res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_QoS, 0 | 0 );
|
||||
if (!SWIG_IsOK(res1)) {
|
||||
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "QoS_getVideoInAvgFps" "', argument " "1"" of type '" "QoS *""'");
|
||||
}
|
||||
arg1 = reinterpret_cast< QoS * >(argp1);
|
||||
result = (unsigned int)(arg1)->getVideoInAvgFps();
|
||||
ST(argvi) = SWIG_From_unsigned_SS_int SWIG_PERL_CALL_ARGS_1(static_cast< unsigned int >(result)); argvi++ ;
|
||||
|
||||
XSRETURN(argvi);
|
||||
fail:
|
||||
|
||||
SWIG_croak_null();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
XS(_wrap_QoS_getVideoDecAvgTime) {
|
||||
{
|
||||
QoS *arg1 = (QoS *) 0 ;
|
||||
void *argp1 = 0 ;
|
||||
int res1 = 0 ;
|
||||
int argvi = 0;
|
||||
unsigned int result;
|
||||
dXSARGS;
|
||||
|
||||
if ((items < 1) || (items > 1)) {
|
||||
SWIG_croak("Usage: QoS_getVideoDecAvgTime(self);");
|
||||
}
|
||||
res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_QoS, 0 | 0 );
|
||||
if (!SWIG_IsOK(res1)) {
|
||||
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "QoS_getVideoDecAvgTime" "', argument " "1"" of type '" "QoS *""'");
|
||||
}
|
||||
arg1 = reinterpret_cast< QoS * >(argp1);
|
||||
result = (unsigned int)(arg1)->getVideoDecAvgTime();
|
||||
ST(argvi) = SWIG_From_unsigned_SS_int SWIG_PERL_CALL_ARGS_1(static_cast< unsigned int >(result)); argvi++ ;
|
||||
|
||||
XSRETURN(argvi);
|
||||
fail:
|
||||
|
||||
SWIG_croak_null();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
XS(_wrap_QoS_getVideoEncAvgTime) {
|
||||
{
|
||||
QoS *arg1 = (QoS *) 0 ;
|
||||
void *argp1 = 0 ;
|
||||
int res1 = 0 ;
|
||||
int argvi = 0;
|
||||
unsigned int result;
|
||||
dXSARGS;
|
||||
|
||||
if ((items < 1) || (items > 1)) {
|
||||
SWIG_croak("Usage: QoS_getVideoEncAvgTime(self);");
|
||||
}
|
||||
res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_QoS, 0 | 0 );
|
||||
if (!SWIG_IsOK(res1)) {
|
||||
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "QoS_getVideoEncAvgTime" "', argument " "1"" of type '" "QoS *""'");
|
||||
}
|
||||
arg1 = reinterpret_cast< QoS * >(argp1);
|
||||
result = (unsigned int)(arg1)->getVideoEncAvgTime();
|
||||
ST(argvi) = SWIG_From_unsigned_SS_int SWIG_PERL_CALL_ARGS_1(static_cast< unsigned int >(result)); argvi++ ;
|
||||
|
||||
XSRETURN(argvi);
|
||||
fail:
|
||||
|
||||
SWIG_croak_null();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
XS(_wrap_delete_Codec) {
|
||||
{
|
||||
Codec *arg1 = (Codec *) 0 ;
|
||||
|
@ -3468,6 +3916,44 @@ XS(_wrap_MediaSessionMgr_sessionGetInt32) {
|
|||
}
|
||||
|
||||
|
||||
XS(_wrap_MediaSessionMgr_sessionGetQoS) {
|
||||
{
|
||||
MediaSessionMgr *arg1 = (MediaSessionMgr *) 0 ;
|
||||
twrap_media_type_t arg2 ;
|
||||
void *argp1 = 0 ;
|
||||
int res1 = 0 ;
|
||||
int val2 ;
|
||||
int ecode2 = 0 ;
|
||||
int argvi = 0;
|
||||
QoS *result = 0 ;
|
||||
dXSARGS;
|
||||
|
||||
if ((items < 2) || (items > 2)) {
|
||||
SWIG_croak("Usage: MediaSessionMgr_sessionGetQoS(self,media);");
|
||||
}
|
||||
res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_MediaSessionMgr, 0 | 0 );
|
||||
if (!SWIG_IsOK(res1)) {
|
||||
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MediaSessionMgr_sessionGetQoS" "', argument " "1"" of type '" "MediaSessionMgr *""'");
|
||||
}
|
||||
arg1 = reinterpret_cast< MediaSessionMgr * >(argp1);
|
||||
ecode2 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(1), &val2);
|
||||
if (!SWIG_IsOK(ecode2)) {
|
||||
SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "MediaSessionMgr_sessionGetQoS" "', argument " "2"" of type '" "twrap_media_type_t""'");
|
||||
}
|
||||
arg2 = static_cast< twrap_media_type_t >(val2);
|
||||
result = (QoS *)(arg1)->sessionGetQoS(arg2);
|
||||
ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_QoS, SWIG_OWNER | SWIG_SHADOW); argvi++ ;
|
||||
|
||||
|
||||
XSRETURN(argvi);
|
||||
fail:
|
||||
|
||||
|
||||
SWIG_croak_null();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
XS(_wrap_MediaSessionMgr_consumerSetInt32) {
|
||||
{
|
||||
MediaSessionMgr *arg1 = (MediaSessionMgr *) 0 ;
|
||||
|
@ -4145,6 +4631,72 @@ XS(_wrap_MediaSessionMgr_defaultsSetPrefVideoSize) {
|
|||
}
|
||||
|
||||
|
||||
XS(_wrap_MediaSessionMgr_defaultsSetPrefVideoSizeOutRange) {
|
||||
{
|
||||
tmedia_pref_video_size_t arg1 ;
|
||||
tmedia_pref_video_size_t arg2 ;
|
||||
int val1 ;
|
||||
int ecode1 = 0 ;
|
||||
int val2 ;
|
||||
int ecode2 = 0 ;
|
||||
int argvi = 0;
|
||||
bool result;
|
||||
dXSARGS;
|
||||
|
||||
if ((items < 2) || (items > 2)) {
|
||||
SWIG_croak("Usage: MediaSessionMgr_defaultsSetPrefVideoSizeOutRange(min,max);");
|
||||
}
|
||||
ecode1 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(0), &val1);
|
||||
if (!SWIG_IsOK(ecode1)) {
|
||||
SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "MediaSessionMgr_defaultsSetPrefVideoSizeOutRange" "', argument " "1"" of type '" "tmedia_pref_video_size_t""'");
|
||||
}
|
||||
arg1 = static_cast< tmedia_pref_video_size_t >(val1);
|
||||
ecode2 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(1), &val2);
|
||||
if (!SWIG_IsOK(ecode2)) {
|
||||
SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "MediaSessionMgr_defaultsSetPrefVideoSizeOutRange" "', argument " "2"" of type '" "tmedia_pref_video_size_t""'");
|
||||
}
|
||||
arg2 = static_cast< tmedia_pref_video_size_t >(val2);
|
||||
result = (bool)MediaSessionMgr::defaultsSetPrefVideoSizeOutRange(arg1,arg2);
|
||||
ST(argvi) = SWIG_From_bool SWIG_PERL_CALL_ARGS_1(static_cast< bool >(result)); argvi++ ;
|
||||
|
||||
|
||||
XSRETURN(argvi);
|
||||
fail:
|
||||
|
||||
|
||||
SWIG_croak_null();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
XS(_wrap_MediaSessionMgr_defaultsSetAdaptativeVideoSizeOutEnabled) {
|
||||
{
|
||||
bool arg1 ;
|
||||
bool val1 ;
|
||||
int ecode1 = 0 ;
|
||||
int argvi = 0;
|
||||
bool result;
|
||||
dXSARGS;
|
||||
|
||||
if ((items < 1) || (items > 1)) {
|
||||
SWIG_croak("Usage: MediaSessionMgr_defaultsSetAdaptativeVideoSizeOutEnabled(enabled);");
|
||||
}
|
||||
ecode1 = SWIG_AsVal_bool SWIG_PERL_CALL_ARGS_2(ST(0), &val1);
|
||||
if (!SWIG_IsOK(ecode1)) {
|
||||
SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "MediaSessionMgr_defaultsSetAdaptativeVideoSizeOutEnabled" "', argument " "1"" of type '" "bool""'");
|
||||
}
|
||||
arg1 = static_cast< bool >(val1);
|
||||
result = (bool)MediaSessionMgr::defaultsSetAdaptativeVideoSizeOutEnabled(arg1);
|
||||
ST(argvi) = SWIG_From_bool SWIG_PERL_CALL_ARGS_1(static_cast< bool >(result)); argvi++ ;
|
||||
|
||||
XSRETURN(argvi);
|
||||
fail:
|
||||
|
||||
SWIG_croak_null();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
XS(_wrap_MediaSessionMgr_defaultsSetJbMargin) {
|
||||
{
|
||||
uint32_t arg1 ;
|
||||
|
@ -27523,6 +28075,7 @@ static swig_type_info _swigt__p_ProxyVideoProducer = {"_p_ProxyVideoProducer", "
|
|||
static swig_type_info _swigt__p_ProxyVideoProducerCallback = {"_p_ProxyVideoProducerCallback", "ProxyVideoProducerCallback *", 0, 0, (void*)"tinyWRAP::ProxyVideoProducerCallback", 0};
|
||||
static swig_type_info _swigt__p_PublicationEvent = {"_p_PublicationEvent", "PublicationEvent *", 0, 0, (void*)"tinyWRAP::PublicationEvent", 0};
|
||||
static swig_type_info _swigt__p_PublicationSession = {"_p_PublicationSession", "PublicationSession *", 0, 0, (void*)"tinyWRAP::PublicationSession", 0};
|
||||
static swig_type_info _swigt__p_QoS = {"_p_QoS", "QoS *", 0, 0, (void*)"tinyWRAP::QoS", 0};
|
||||
static swig_type_info _swigt__p_RPMessage = {"_p_RPMessage", "RPMessage *", 0, 0, (void*)"tinyWRAP::RPMessage", 0};
|
||||
static swig_type_info _swigt__p_RegistrationEvent = {"_p_RegistrationEvent", "RegistrationEvent *", 0, 0, (void*)"tinyWRAP::RegistrationEvent", 0};
|
||||
static swig_type_info _swigt__p_RegistrationSession = {"_p_RegistrationSession", "RegistrationSession *", 0, 0, (void*)"tinyWRAP::RegistrationSession", 0};
|
||||
|
@ -27622,6 +28175,7 @@ static swig_type_info *swig_type_initial[] = {
|
|||
&_swigt__p_ProxyVideoProducerCallback,
|
||||
&_swigt__p_PublicationEvent,
|
||||
&_swigt__p_PublicationSession,
|
||||
&_swigt__p_QoS,
|
||||
&_swigt__p_RPMessage,
|
||||
&_swigt__p_RegistrationEvent,
|
||||
&_swigt__p_RegistrationSession,
|
||||
|
@ -27721,6 +28275,7 @@ static swig_cast_info _swigc__p_ProxyVideoProducer[] = { {&_swigt__p_ProxyVideo
|
|||
static swig_cast_info _swigc__p_ProxyVideoProducerCallback[] = { {&_swigt__p_ProxyVideoProducerCallback, 0, 0, 0},{0, 0, 0, 0}};
|
||||
static swig_cast_info _swigc__p_PublicationEvent[] = { {&_swigt__p_PublicationEvent, 0, 0, 0},{0, 0, 0, 0}};
|
||||
static swig_cast_info _swigc__p_PublicationSession[] = { {&_swigt__p_PublicationSession, 0, 0, 0},{0, 0, 0, 0}};
|
||||
static swig_cast_info _swigc__p_QoS[] = { {&_swigt__p_QoS, 0, 0, 0},{0, 0, 0, 0}};
|
||||
static swig_cast_info _swigc__p_RPMessage[] = { {&_swigt__p_RPMessage, 0, 0, 0},{0, 0, 0, 0}};
|
||||
static swig_cast_info _swigc__p_RegistrationEvent[] = { {&_swigt__p_RegistrationEvent, 0, 0, 0},{0, 0, 0, 0}};
|
||||
static swig_cast_info _swigc__p_RegistrationSession[] = { {&_swigt__p_RegistrationSession, 0, 0, 0},{0, 0, 0, 0}};
|
||||
|
@ -27820,6 +28375,7 @@ static swig_cast_info *swig_cast_initial[] = {
|
|||
_swigc__p_ProxyVideoProducerCallback,
|
||||
_swigc__p_PublicationEvent,
|
||||
_swigc__p_PublicationSession,
|
||||
_swigc__p_QoS,
|
||||
_swigc__p_RPMessage,
|
||||
_swigc__p_RegistrationEvent,
|
||||
_swigc__p_RegistrationSession,
|
||||
|
@ -27917,6 +28473,22 @@ static swig_command_info swig_commands[] = {
|
|||
{"tinyWRAPc::ActionConfig_setResponseLine", _wrap_ActionConfig_setResponseLine},
|
||||
{"tinyWRAPc::ActionConfig_setMediaString", _wrap_ActionConfig_setMediaString},
|
||||
{"tinyWRAPc::ActionConfig_setMediaInt", _wrap_ActionConfig_setMediaInt},
|
||||
{"tinyWRAPc::delete_QoS", _wrap_delete_QoS},
|
||||
{"tinyWRAPc::QoS_getQavg", _wrap_QoS_getQavg},
|
||||
{"tinyWRAPc::QoS_getQ1", _wrap_QoS_getQ1},
|
||||
{"tinyWRAPc::QoS_getQ2", _wrap_QoS_getQ2},
|
||||
{"tinyWRAPc::QoS_getQ3", _wrap_QoS_getQ3},
|
||||
{"tinyWRAPc::QoS_getQ4", _wrap_QoS_getQ4},
|
||||
{"tinyWRAPc::QoS_getQ5", _wrap_QoS_getQ5},
|
||||
{"tinyWRAPc::QoS_getVideoInWidth", _wrap_QoS_getVideoInWidth},
|
||||
{"tinyWRAPc::QoS_getVideoOutWidth", _wrap_QoS_getVideoOutWidth},
|
||||
{"tinyWRAPc::QoS_getVideoInHeight", _wrap_QoS_getVideoInHeight},
|
||||
{"tinyWRAPc::QoS_getVideoOutHeight", _wrap_QoS_getVideoOutHeight},
|
||||
{"tinyWRAPc::QoS_getBandwidthDownKbps", _wrap_QoS_getBandwidthDownKbps},
|
||||
{"tinyWRAPc::QoS_getBandwidthUpKbps", _wrap_QoS_getBandwidthUpKbps},
|
||||
{"tinyWRAPc::QoS_getVideoInAvgFps", _wrap_QoS_getVideoInAvgFps},
|
||||
{"tinyWRAPc::QoS_getVideoDecAvgTime", _wrap_QoS_getVideoDecAvgTime},
|
||||
{"tinyWRAPc::QoS_getVideoEncAvgTime", _wrap_QoS_getVideoEncAvgTime},
|
||||
{"tinyWRAPc::delete_Codec", _wrap_delete_Codec},
|
||||
{"tinyWRAPc::Codec_getMediaType", _wrap_Codec_getMediaType},
|
||||
{"tinyWRAPc::Codec_getName", _wrap_Codec_getName},
|
||||
|
@ -27928,6 +28500,7 @@ static swig_command_info swig_commands[] = {
|
|||
{"tinyWRAPc::delete_MediaSessionMgr", _wrap_delete_MediaSessionMgr},
|
||||
{"tinyWRAPc::MediaSessionMgr_sessionSetInt32", _wrap_MediaSessionMgr_sessionSetInt32},
|
||||
{"tinyWRAPc::MediaSessionMgr_sessionGetInt32", _wrap_MediaSessionMgr_sessionGetInt32},
|
||||
{"tinyWRAPc::MediaSessionMgr_sessionGetQoS", _wrap_MediaSessionMgr_sessionGetQoS},
|
||||
{"tinyWRAPc::MediaSessionMgr_consumerSetInt32", _wrap_MediaSessionMgr_consumerSetInt32},
|
||||
{"tinyWRAPc::MediaSessionMgr_consumerSetInt64", _wrap_MediaSessionMgr_consumerSetInt64},
|
||||
{"tinyWRAPc::MediaSessionMgr_producerSetInt32", _wrap_MediaSessionMgr_producerSetInt32},
|
||||
|
@ -27947,6 +28520,8 @@ static swig_command_info swig_commands[] = {
|
|||
{"tinyWRAPc::MediaSessionMgr_defaultsSetBandwidthVideoUploadMax", _wrap_MediaSessionMgr_defaultsSetBandwidthVideoUploadMax},
|
||||
{"tinyWRAPc::MediaSessionMgr_defaultsSetBandwidthVideoDownloadMax", _wrap_MediaSessionMgr_defaultsSetBandwidthVideoDownloadMax},
|
||||
{"tinyWRAPc::MediaSessionMgr_defaultsSetPrefVideoSize", _wrap_MediaSessionMgr_defaultsSetPrefVideoSize},
|
||||
{"tinyWRAPc::MediaSessionMgr_defaultsSetPrefVideoSizeOutRange", _wrap_MediaSessionMgr_defaultsSetPrefVideoSizeOutRange},
|
||||
{"tinyWRAPc::MediaSessionMgr_defaultsSetAdaptativeVideoSizeOutEnabled", _wrap_MediaSessionMgr_defaultsSetAdaptativeVideoSizeOutEnabled},
|
||||
{"tinyWRAPc::MediaSessionMgr_defaultsSetJbMargin", _wrap_MediaSessionMgr_defaultsSetJbMargin},
|
||||
{"tinyWRAPc::MediaSessionMgr_defaultsSetJbMaxLateRate", _wrap_MediaSessionMgr_defaultsSetJbMaxLateRate},
|
||||
{"tinyWRAPc::MediaSessionMgr_defaultsSetEchoTail", _wrap_MediaSessionMgr_defaultsSetEchoTail},
|
||||
|
@ -28765,6 +29340,7 @@ XS(SWIG_init) {
|
|||
SvREADONLY_on(sv);
|
||||
} while(0) /*@SWIG@*/;
|
||||
SWIG_TypeClientData(SWIGTYPE_p_ActionConfig, (void*) "tinyWRAP::ActionConfig");
|
||||
SWIG_TypeClientData(SWIGTYPE_p_QoS, (void*) "tinyWRAP::QoS");
|
||||
SWIG_TypeClientData(SWIGTYPE_p_Codec, (void*) "tinyWRAP::Codec");
|
||||
SWIG_TypeClientData(SWIGTYPE_p_MediaSessionMgr, (void*) "tinyWRAP::MediaSessionMgr");
|
||||
SWIG_TypeClientData(SWIGTYPE_p_MediaContent, (void*) "tinyWRAP::MediaContent");
|
||||
|
|
|
@ -151,6 +151,33 @@ class ActionConfig(_object):
|
|||
ActionConfig_swigregister = _tinyWRAP.ActionConfig_swigregister
|
||||
ActionConfig_swigregister(ActionConfig)
|
||||
|
||||
class QoS(_object):
|
||||
__swig_setmethods__ = {}
|
||||
__setattr__ = lambda self, name, value: _swig_setattr(self, QoS, name, value)
|
||||
__swig_getmethods__ = {}
|
||||
__getattr__ = lambda self, name: _swig_getattr(self, QoS, name)
|
||||
def __init__(self, *args, **kwargs): raise AttributeError("No constructor defined")
|
||||
__repr__ = _swig_repr
|
||||
__swig_destroy__ = _tinyWRAP.delete_QoS
|
||||
__del__ = lambda self : None;
|
||||
def getQavg(self): return _tinyWRAP.QoS_getQavg(self)
|
||||
def getQ1(self): return _tinyWRAP.QoS_getQ1(self)
|
||||
def getQ2(self): return _tinyWRAP.QoS_getQ2(self)
|
||||
def getQ3(self): return _tinyWRAP.QoS_getQ3(self)
|
||||
def getQ4(self): return _tinyWRAP.QoS_getQ4(self)
|
||||
def getQ5(self): return _tinyWRAP.QoS_getQ5(self)
|
||||
def getVideoInWidth(self): return _tinyWRAP.QoS_getVideoInWidth(self)
|
||||
def getVideoOutWidth(self): return _tinyWRAP.QoS_getVideoOutWidth(self)
|
||||
def getVideoInHeight(self): return _tinyWRAP.QoS_getVideoInHeight(self)
|
||||
def getVideoOutHeight(self): return _tinyWRAP.QoS_getVideoOutHeight(self)
|
||||
def getBandwidthDownKbps(self): return _tinyWRAP.QoS_getBandwidthDownKbps(self)
|
||||
def getBandwidthUpKbps(self): return _tinyWRAP.QoS_getBandwidthUpKbps(self)
|
||||
def getVideoInAvgFps(self): return _tinyWRAP.QoS_getVideoInAvgFps(self)
|
||||
def getVideoDecAvgTime(self): return _tinyWRAP.QoS_getVideoDecAvgTime(self)
|
||||
def getVideoEncAvgTime(self): return _tinyWRAP.QoS_getVideoEncAvgTime(self)
|
||||
QoS_swigregister = _tinyWRAP.QoS_swigregister
|
||||
QoS_swigregister(QoS)
|
||||
|
||||
class Codec(_object):
|
||||
__swig_setmethods__ = {}
|
||||
__setattr__ = lambda self, name, value: _swig_setattr(self, Codec, name, value)
|
||||
|
@ -181,6 +208,7 @@ class MediaSessionMgr(_object):
|
|||
__del__ = lambda self : None;
|
||||
def sessionSetInt32(self, *args): return _tinyWRAP.MediaSessionMgr_sessionSetInt32(self, *args)
|
||||
def sessionGetInt32(self, *args): return _tinyWRAP.MediaSessionMgr_sessionGetInt32(self, *args)
|
||||
def sessionGetQoS(self, *args): return _tinyWRAP.MediaSessionMgr_sessionGetQoS(self, *args)
|
||||
def consumerSetInt32(self, *args): return _tinyWRAP.MediaSessionMgr_consumerSetInt32(self, *args)
|
||||
def consumerSetInt64(self, *args): return _tinyWRAP.MediaSessionMgr_consumerSetInt64(self, *args)
|
||||
def producerSetInt32(self, *args): return _tinyWRAP.MediaSessionMgr_producerSetInt32(self, *args)
|
||||
|
@ -211,6 +239,10 @@ class MediaSessionMgr(_object):
|
|||
if _newclass:defaultsSetBandwidthVideoDownloadMax = staticmethod(_tinyWRAP.MediaSessionMgr_defaultsSetBandwidthVideoDownloadMax)
|
||||
__swig_getmethods__["defaultsSetPrefVideoSize"] = lambda x: _tinyWRAP.MediaSessionMgr_defaultsSetPrefVideoSize
|
||||
if _newclass:defaultsSetPrefVideoSize = staticmethod(_tinyWRAP.MediaSessionMgr_defaultsSetPrefVideoSize)
|
||||
__swig_getmethods__["defaultsSetPrefVideoSizeOutRange"] = lambda x: _tinyWRAP.MediaSessionMgr_defaultsSetPrefVideoSizeOutRange
|
||||
if _newclass:defaultsSetPrefVideoSizeOutRange = staticmethod(_tinyWRAP.MediaSessionMgr_defaultsSetPrefVideoSizeOutRange)
|
||||
__swig_getmethods__["defaultsSetAdaptativeVideoSizeOutEnabled"] = lambda x: _tinyWRAP.MediaSessionMgr_defaultsSetAdaptativeVideoSizeOutEnabled
|
||||
if _newclass:defaultsSetAdaptativeVideoSizeOutEnabled = staticmethod(_tinyWRAP.MediaSessionMgr_defaultsSetAdaptativeVideoSizeOutEnabled)
|
||||
__swig_getmethods__["defaultsSetJbMargin"] = lambda x: _tinyWRAP.MediaSessionMgr_defaultsSetJbMargin
|
||||
if _newclass:defaultsSetJbMargin = staticmethod(_tinyWRAP.MediaSessionMgr_defaultsSetJbMargin)
|
||||
__swig_getmethods__["defaultsSetJbMaxLateRate"] = lambda x: _tinyWRAP.MediaSessionMgr_defaultsSetJbMaxLateRate
|
||||
|
@ -374,6 +406,14 @@ def MediaSessionMgr_defaultsSetPrefVideoSize(*args):
|
|||
return _tinyWRAP.MediaSessionMgr_defaultsSetPrefVideoSize(*args)
|
||||
MediaSessionMgr_defaultsSetPrefVideoSize = _tinyWRAP.MediaSessionMgr_defaultsSetPrefVideoSize
|
||||
|
||||
def MediaSessionMgr_defaultsSetPrefVideoSizeOutRange(*args):
|
||||
return _tinyWRAP.MediaSessionMgr_defaultsSetPrefVideoSizeOutRange(*args)
|
||||
MediaSessionMgr_defaultsSetPrefVideoSizeOutRange = _tinyWRAP.MediaSessionMgr_defaultsSetPrefVideoSizeOutRange
|
||||
|
||||
def MediaSessionMgr_defaultsSetAdaptativeVideoSizeOutEnabled(*args):
|
||||
return _tinyWRAP.MediaSessionMgr_defaultsSetAdaptativeVideoSizeOutEnabled(*args)
|
||||
MediaSessionMgr_defaultsSetAdaptativeVideoSizeOutEnabled = _tinyWRAP.MediaSessionMgr_defaultsSetAdaptativeVideoSizeOutEnabled
|
||||
|
||||
def MediaSessionMgr_defaultsSetJbMargin(*args):
|
||||
return _tinyWRAP.MediaSessionMgr_defaultsSetJbMargin(*args)
|
||||
MediaSessionMgr_defaultsSetJbMargin = _tinyWRAP.MediaSessionMgr_defaultsSetJbMargin
|
||||
|
|
|
@ -3480,70 +3480,71 @@ namespace Swig {
|
|||
#define SWIGTYPE_p_ProxyVideoProducerCallback swig_types[32]
|
||||
#define SWIGTYPE_p_PublicationEvent swig_types[33]
|
||||
#define SWIGTYPE_p_PublicationSession swig_types[34]
|
||||
#define SWIGTYPE_p_RPMessage swig_types[35]
|
||||
#define SWIGTYPE_p_RegistrationEvent swig_types[36]
|
||||
#define SWIGTYPE_p_RegistrationSession swig_types[37]
|
||||
#define SWIGTYPE_p_SMSData swig_types[38]
|
||||
#define SWIGTYPE_p_SMSEncoder swig_types[39]
|
||||
#define SWIGTYPE_p_SafeObject swig_types[40]
|
||||
#define SWIGTYPE_p_SdpMessage swig_types[41]
|
||||
#define SWIGTYPE_p_SipCallback swig_types[42]
|
||||
#define SWIGTYPE_p_SipEvent swig_types[43]
|
||||
#define SWIGTYPE_p_SipMessage swig_types[44]
|
||||
#define SWIGTYPE_p_SipSession swig_types[45]
|
||||
#define SWIGTYPE_p_SipStack swig_types[46]
|
||||
#define SWIGTYPE_p_SipUri swig_types[47]
|
||||
#define SWIGTYPE_p_StackEvent swig_types[48]
|
||||
#define SWIGTYPE_p_SubscriptionEvent swig_types[49]
|
||||
#define SWIGTYPE_p_SubscriptionSession swig_types[50]
|
||||
#define SWIGTYPE_p_T140Callback swig_types[51]
|
||||
#define SWIGTYPE_p_T140CallbackData swig_types[52]
|
||||
#define SWIGTYPE_p_XcapCallback swig_types[53]
|
||||
#define SWIGTYPE_p_XcapEvent swig_types[54]
|
||||
#define SWIGTYPE_p_XcapMessage swig_types[55]
|
||||
#define SWIGTYPE_p_XcapSelector swig_types[56]
|
||||
#define SWIGTYPE_p_XcapStack swig_types[57]
|
||||
#define SWIGTYPE_p_char swig_types[58]
|
||||
#define SWIGTYPE_p_int swig_types[59]
|
||||
#define SWIGTYPE_p_long_long swig_types[60]
|
||||
#define SWIGTYPE_p_short swig_types[61]
|
||||
#define SWIGTYPE_p_signed_char swig_types[62]
|
||||
#define SWIGTYPE_p_tdav_codec_id_e swig_types[63]
|
||||
#define SWIGTYPE_p_thttp_event_type_e swig_types[64]
|
||||
#define SWIGTYPE_p_tmedia_bandwidth_level_e swig_types[65]
|
||||
#define SWIGTYPE_p_tmedia_chroma_e swig_types[66]
|
||||
#define SWIGTYPE_p_tmedia_codec_id_e swig_types[67]
|
||||
#define SWIGTYPE_p_tmedia_mode_e swig_types[68]
|
||||
#define SWIGTYPE_p_tmedia_pref_video_size_s swig_types[69]
|
||||
#define SWIGTYPE_p_tmedia_profile_e swig_types[70]
|
||||
#define SWIGTYPE_p_tmedia_qos_strength_e swig_types[71]
|
||||
#define SWIGTYPE_p_tmedia_qos_stype_e swig_types[72]
|
||||
#define SWIGTYPE_p_tmedia_srtp_mode_e swig_types[73]
|
||||
#define SWIGTYPE_p_tmedia_srtp_type_e swig_types[74]
|
||||
#define SWIGTYPE_p_tmedia_t140_data_type_e swig_types[75]
|
||||
#define SWIGTYPE_p_tmsrp_event_type_e swig_types[76]
|
||||
#define SWIGTYPE_p_tmsrp_request_type_e swig_types[77]
|
||||
#define SWIGTYPE_p_tsip_event_type_e swig_types[78]
|
||||
#define SWIGTYPE_p_tsip_info_event_type_e swig_types[79]
|
||||
#define SWIGTYPE_p_tsip_invite_event_type_e swig_types[80]
|
||||
#define SWIGTYPE_p_tsip_message_event_type_e swig_types[81]
|
||||
#define SWIGTYPE_p_tsip_options_event_type_e swig_types[82]
|
||||
#define SWIGTYPE_p_tsip_publish_event_type_e swig_types[83]
|
||||
#define SWIGTYPE_p_tsip_register_event_type_e swig_types[84]
|
||||
#define SWIGTYPE_p_tsip_request_type_e swig_types[85]
|
||||
#define SWIGTYPE_p_tsip_stack_mode_e swig_types[86]
|
||||
#define SWIGTYPE_p_tsip_subscribe_event_type_e swig_types[87]
|
||||
#define SWIGTYPE_p_tsk_list_t swig_types[88]
|
||||
#define SWIGTYPE_p_twrap_media_type_e swig_types[89]
|
||||
#define SWIGTYPE_p_twrap_proxy_plugin_type_e swig_types[90]
|
||||
#define SWIGTYPE_p_twrap_rpmessage_type_e swig_types[91]
|
||||
#define SWIGTYPE_p_twrap_sms_type_e swig_types[92]
|
||||
#define SWIGTYPE_p_unsigned_char swig_types[93]
|
||||
#define SWIGTYPE_p_unsigned_int swig_types[94]
|
||||
#define SWIGTYPE_p_unsigned_long_long swig_types[95]
|
||||
#define SWIGTYPE_p_unsigned_short swig_types[96]
|
||||
static swig_type_info *swig_types[98];
|
||||
static swig_module_info swig_module = {swig_types, 97, 0, 0, 0, 0};
|
||||
#define SWIGTYPE_p_QoS swig_types[35]
|
||||
#define SWIGTYPE_p_RPMessage swig_types[36]
|
||||
#define SWIGTYPE_p_RegistrationEvent swig_types[37]
|
||||
#define SWIGTYPE_p_RegistrationSession swig_types[38]
|
||||
#define SWIGTYPE_p_SMSData swig_types[39]
|
||||
#define SWIGTYPE_p_SMSEncoder swig_types[40]
|
||||
#define SWIGTYPE_p_SafeObject swig_types[41]
|
||||
#define SWIGTYPE_p_SdpMessage swig_types[42]
|
||||
#define SWIGTYPE_p_SipCallback swig_types[43]
|
||||
#define SWIGTYPE_p_SipEvent swig_types[44]
|
||||
#define SWIGTYPE_p_SipMessage swig_types[45]
|
||||
#define SWIGTYPE_p_SipSession swig_types[46]
|
||||
#define SWIGTYPE_p_SipStack swig_types[47]
|
||||
#define SWIGTYPE_p_SipUri swig_types[48]
|
||||
#define SWIGTYPE_p_StackEvent swig_types[49]
|
||||
#define SWIGTYPE_p_SubscriptionEvent swig_types[50]
|
||||
#define SWIGTYPE_p_SubscriptionSession swig_types[51]
|
||||
#define SWIGTYPE_p_T140Callback swig_types[52]
|
||||
#define SWIGTYPE_p_T140CallbackData swig_types[53]
|
||||
#define SWIGTYPE_p_XcapCallback swig_types[54]
|
||||
#define SWIGTYPE_p_XcapEvent swig_types[55]
|
||||
#define SWIGTYPE_p_XcapMessage swig_types[56]
|
||||
#define SWIGTYPE_p_XcapSelector swig_types[57]
|
||||
#define SWIGTYPE_p_XcapStack swig_types[58]
|
||||
#define SWIGTYPE_p_char swig_types[59]
|
||||
#define SWIGTYPE_p_int swig_types[60]
|
||||
#define SWIGTYPE_p_long_long swig_types[61]
|
||||
#define SWIGTYPE_p_short swig_types[62]
|
||||
#define SWIGTYPE_p_signed_char swig_types[63]
|
||||
#define SWIGTYPE_p_tdav_codec_id_e swig_types[64]
|
||||
#define SWIGTYPE_p_thttp_event_type_e swig_types[65]
|
||||
#define SWIGTYPE_p_tmedia_bandwidth_level_e swig_types[66]
|
||||
#define SWIGTYPE_p_tmedia_chroma_e swig_types[67]
|
||||
#define SWIGTYPE_p_tmedia_codec_id_e swig_types[68]
|
||||
#define SWIGTYPE_p_tmedia_mode_e swig_types[69]
|
||||
#define SWIGTYPE_p_tmedia_pref_video_size_s swig_types[70]
|
||||
#define SWIGTYPE_p_tmedia_profile_e swig_types[71]
|
||||
#define SWIGTYPE_p_tmedia_qos_strength_e swig_types[72]
|
||||
#define SWIGTYPE_p_tmedia_qos_stype_e swig_types[73]
|
||||
#define SWIGTYPE_p_tmedia_srtp_mode_e swig_types[74]
|
||||
#define SWIGTYPE_p_tmedia_srtp_type_e swig_types[75]
|
||||
#define SWIGTYPE_p_tmedia_t140_data_type_e swig_types[76]
|
||||
#define SWIGTYPE_p_tmsrp_event_type_e swig_types[77]
|
||||
#define SWIGTYPE_p_tmsrp_request_type_e swig_types[78]
|
||||
#define SWIGTYPE_p_tsip_event_type_e swig_types[79]
|
||||
#define SWIGTYPE_p_tsip_info_event_type_e swig_types[80]
|
||||
#define SWIGTYPE_p_tsip_invite_event_type_e swig_types[81]
|
||||
#define SWIGTYPE_p_tsip_message_event_type_e swig_types[82]
|
||||
#define SWIGTYPE_p_tsip_options_event_type_e swig_types[83]
|
||||
#define SWIGTYPE_p_tsip_publish_event_type_e swig_types[84]
|
||||
#define SWIGTYPE_p_tsip_register_event_type_e swig_types[85]
|
||||
#define SWIGTYPE_p_tsip_request_type_e swig_types[86]
|
||||
#define SWIGTYPE_p_tsip_stack_mode_e swig_types[87]
|
||||
#define SWIGTYPE_p_tsip_subscribe_event_type_e swig_types[88]
|
||||
#define SWIGTYPE_p_tsk_list_t swig_types[89]
|
||||
#define SWIGTYPE_p_twrap_media_type_e swig_types[90]
|
||||
#define SWIGTYPE_p_twrap_proxy_plugin_type_e swig_types[91]
|
||||
#define SWIGTYPE_p_twrap_rpmessage_type_e swig_types[92]
|
||||
#define SWIGTYPE_p_twrap_sms_type_e swig_types[93]
|
||||
#define SWIGTYPE_p_unsigned_char swig_types[94]
|
||||
#define SWIGTYPE_p_unsigned_int swig_types[95]
|
||||
#define SWIGTYPE_p_unsigned_long_long swig_types[96]
|
||||
#define SWIGTYPE_p_unsigned_short swig_types[97]
|
||||
static swig_type_info *swig_types[99];
|
||||
static swig_module_info swig_module = {swig_types, 98, 0, 0, 0, 0};
|
||||
#define SWIG_TypeQuery(name) SWIG_TypeQueryModule(&swig_module, &swig_module, name)
|
||||
#define SWIG_MangledTypeQuery(name) SWIG_MangledTypeQueryModule(&swig_module, &swig_module, name)
|
||||
|
||||
|
@ -4030,6 +4031,16 @@ SWIG_AsVal_short (PyObject * obj, short *val)
|
|||
}
|
||||
|
||||
|
||||
#define SWIG_From_double PyFloat_FromDouble
|
||||
|
||||
|
||||
SWIGINTERNINLINE PyObject *
|
||||
SWIG_From_float (float value)
|
||||
{
|
||||
return SWIG_From_double (value);
|
||||
}
|
||||
|
||||
|
||||
SWIGINTERN int
|
||||
SWIG_AsVal_long_SS_long (PyObject *obj, long long *val)
|
||||
{
|
||||
|
@ -4113,16 +4124,6 @@ SWIG_AsVal_float (PyObject * obj, float *val)
|
|||
}
|
||||
|
||||
|
||||
#define SWIG_From_double PyFloat_FromDouble
|
||||
|
||||
|
||||
SWIGINTERNINLINE PyObject *
|
||||
SWIG_From_float (float value)
|
||||
{
|
||||
return SWIG_From_double (value);
|
||||
}
|
||||
|
||||
|
||||
SWIGINTERN int
|
||||
SWIG_AsVal_unsigned_SS_short (PyObject * obj, unsigned short *val)
|
||||
{
|
||||
|
@ -6273,6 +6274,364 @@ SWIGINTERN PyObject *ActionConfig_swigregister(PyObject *SWIGUNUSEDPARM(self), P
|
|||
return SWIG_Py_Void();
|
||||
}
|
||||
|
||||
SWIGINTERN PyObject *_wrap_delete_QoS(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
|
||||
PyObject *resultobj = 0;
|
||||
QoS *arg1 = (QoS *) 0 ;
|
||||
void *argp1 = 0 ;
|
||||
int res1 = 0 ;
|
||||
PyObject * obj0 = 0 ;
|
||||
|
||||
if (!PyArg_ParseTuple(args,(char *)"O:delete_QoS",&obj0)) SWIG_fail;
|
||||
res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_QoS, SWIG_POINTER_DISOWN | 0 );
|
||||
if (!SWIG_IsOK(res1)) {
|
||||
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_QoS" "', argument " "1"" of type '" "QoS *""'");
|
||||
}
|
||||
arg1 = reinterpret_cast< QoS * >(argp1);
|
||||
delete arg1;
|
||||
resultobj = SWIG_Py_Void();
|
||||
return resultobj;
|
||||
fail:
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
SWIGINTERN PyObject *_wrap_QoS_getQavg(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
|
||||
PyObject *resultobj = 0;
|
||||
QoS *arg1 = (QoS *) 0 ;
|
||||
void *argp1 = 0 ;
|
||||
int res1 = 0 ;
|
||||
PyObject * obj0 = 0 ;
|
||||
float result;
|
||||
|
||||
if (!PyArg_ParseTuple(args,(char *)"O:QoS_getQavg",&obj0)) SWIG_fail;
|
||||
res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_QoS, 0 | 0 );
|
||||
if (!SWIG_IsOK(res1)) {
|
||||
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "QoS_getQavg" "', argument " "1"" of type '" "QoS *""'");
|
||||
}
|
||||
arg1 = reinterpret_cast< QoS * >(argp1);
|
||||
result = (float)(arg1)->getQavg();
|
||||
resultobj = SWIG_From_float(static_cast< float >(result));
|
||||
return resultobj;
|
||||
fail:
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
SWIGINTERN PyObject *_wrap_QoS_getQ1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
|
||||
PyObject *resultobj = 0;
|
||||
QoS *arg1 = (QoS *) 0 ;
|
||||
void *argp1 = 0 ;
|
||||
int res1 = 0 ;
|
||||
PyObject * obj0 = 0 ;
|
||||
float result;
|
||||
|
||||
if (!PyArg_ParseTuple(args,(char *)"O:QoS_getQ1",&obj0)) SWIG_fail;
|
||||
res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_QoS, 0 | 0 );
|
||||
if (!SWIG_IsOK(res1)) {
|
||||
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "QoS_getQ1" "', argument " "1"" of type '" "QoS *""'");
|
||||
}
|
||||
arg1 = reinterpret_cast< QoS * >(argp1);
|
||||
result = (float)(arg1)->getQ1();
|
||||
resultobj = SWIG_From_float(static_cast< float >(result));
|
||||
return resultobj;
|
||||
fail:
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
SWIGINTERN PyObject *_wrap_QoS_getQ2(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
|
||||
PyObject *resultobj = 0;
|
||||
QoS *arg1 = (QoS *) 0 ;
|
||||
void *argp1 = 0 ;
|
||||
int res1 = 0 ;
|
||||
PyObject * obj0 = 0 ;
|
||||
float result;
|
||||
|
||||
if (!PyArg_ParseTuple(args,(char *)"O:QoS_getQ2",&obj0)) SWIG_fail;
|
||||
res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_QoS, 0 | 0 );
|
||||
if (!SWIG_IsOK(res1)) {
|
||||
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "QoS_getQ2" "', argument " "1"" of type '" "QoS *""'");
|
||||
}
|
||||
arg1 = reinterpret_cast< QoS * >(argp1);
|
||||
result = (float)(arg1)->getQ2();
|
||||
resultobj = SWIG_From_float(static_cast< float >(result));
|
||||
return resultobj;
|
||||
fail:
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
SWIGINTERN PyObject *_wrap_QoS_getQ3(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
|
||||
PyObject *resultobj = 0;
|
||||
QoS *arg1 = (QoS *) 0 ;
|
||||
void *argp1 = 0 ;
|
||||
int res1 = 0 ;
|
||||
PyObject * obj0 = 0 ;
|
||||
float result;
|
||||
|
||||
if (!PyArg_ParseTuple(args,(char *)"O:QoS_getQ3",&obj0)) SWIG_fail;
|
||||
res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_QoS, 0 | 0 );
|
||||
if (!SWIG_IsOK(res1)) {
|
||||
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "QoS_getQ3" "', argument " "1"" of type '" "QoS *""'");
|
||||
}
|
||||
arg1 = reinterpret_cast< QoS * >(argp1);
|
||||
result = (float)(arg1)->getQ3();
|
||||
resultobj = SWIG_From_float(static_cast< float >(result));
|
||||
return resultobj;
|
||||
fail:
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
SWIGINTERN PyObject *_wrap_QoS_getQ4(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
|
||||
PyObject *resultobj = 0;
|
||||
QoS *arg1 = (QoS *) 0 ;
|
||||
void *argp1 = 0 ;
|
||||
int res1 = 0 ;
|
||||
PyObject * obj0 = 0 ;
|
||||
float result;
|
||||
|
||||
if (!PyArg_ParseTuple(args,(char *)"O:QoS_getQ4",&obj0)) SWIG_fail;
|
||||
res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_QoS, 0 | 0 );
|
||||
if (!SWIG_IsOK(res1)) {
|
||||
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "QoS_getQ4" "', argument " "1"" of type '" "QoS *""'");
|
||||
}
|
||||
arg1 = reinterpret_cast< QoS * >(argp1);
|
||||
result = (float)(arg1)->getQ4();
|
||||
resultobj = SWIG_From_float(static_cast< float >(result));
|
||||
return resultobj;
|
||||
fail:
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
SWIGINTERN PyObject *_wrap_QoS_getQ5(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
|
||||
PyObject *resultobj = 0;
|
||||
QoS *arg1 = (QoS *) 0 ;
|
||||
void *argp1 = 0 ;
|
||||
int res1 = 0 ;
|
||||
PyObject * obj0 = 0 ;
|
||||
float result;
|
||||
|
||||
if (!PyArg_ParseTuple(args,(char *)"O:QoS_getQ5",&obj0)) SWIG_fail;
|
||||
res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_QoS, 0 | 0 );
|
||||
if (!SWIG_IsOK(res1)) {
|
||||
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "QoS_getQ5" "', argument " "1"" of type '" "QoS *""'");
|
||||
}
|
||||
arg1 = reinterpret_cast< QoS * >(argp1);
|
||||
result = (float)(arg1)->getQ5();
|
||||
resultobj = SWIG_From_float(static_cast< float >(result));
|
||||
return resultobj;
|
||||
fail:
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
SWIGINTERN PyObject *_wrap_QoS_getVideoInWidth(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
|
||||
PyObject *resultobj = 0;
|
||||
QoS *arg1 = (QoS *) 0 ;
|
||||
void *argp1 = 0 ;
|
||||
int res1 = 0 ;
|
||||
PyObject * obj0 = 0 ;
|
||||
unsigned int result;
|
||||
|
||||
if (!PyArg_ParseTuple(args,(char *)"O:QoS_getVideoInWidth",&obj0)) SWIG_fail;
|
||||
res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_QoS, 0 | 0 );
|
||||
if (!SWIG_IsOK(res1)) {
|
||||
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "QoS_getVideoInWidth" "', argument " "1"" of type '" "QoS *""'");
|
||||
}
|
||||
arg1 = reinterpret_cast< QoS * >(argp1);
|
||||
result = (unsigned int)(arg1)->getVideoInWidth();
|
||||
resultobj = SWIG_From_unsigned_SS_int(static_cast< unsigned int >(result));
|
||||
return resultobj;
|
||||
fail:
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
SWIGINTERN PyObject *_wrap_QoS_getVideoOutWidth(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
|
||||
PyObject *resultobj = 0;
|
||||
QoS *arg1 = (QoS *) 0 ;
|
||||
void *argp1 = 0 ;
|
||||
int res1 = 0 ;
|
||||
PyObject * obj0 = 0 ;
|
||||
unsigned int result;
|
||||
|
||||
if (!PyArg_ParseTuple(args,(char *)"O:QoS_getVideoOutWidth",&obj0)) SWIG_fail;
|
||||
res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_QoS, 0 | 0 );
|
||||
if (!SWIG_IsOK(res1)) {
|
||||
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "QoS_getVideoOutWidth" "', argument " "1"" of type '" "QoS *""'");
|
||||
}
|
||||
arg1 = reinterpret_cast< QoS * >(argp1);
|
||||
result = (unsigned int)(arg1)->getVideoOutWidth();
|
||||
resultobj = SWIG_From_unsigned_SS_int(static_cast< unsigned int >(result));
|
||||
return resultobj;
|
||||
fail:
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
SWIGINTERN PyObject *_wrap_QoS_getVideoInHeight(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
|
||||
PyObject *resultobj = 0;
|
||||
QoS *arg1 = (QoS *) 0 ;
|
||||
void *argp1 = 0 ;
|
||||
int res1 = 0 ;
|
||||
PyObject * obj0 = 0 ;
|
||||
unsigned int result;
|
||||
|
||||
if (!PyArg_ParseTuple(args,(char *)"O:QoS_getVideoInHeight",&obj0)) SWIG_fail;
|
||||
res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_QoS, 0 | 0 );
|
||||
if (!SWIG_IsOK(res1)) {
|
||||
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "QoS_getVideoInHeight" "', argument " "1"" of type '" "QoS *""'");
|
||||
}
|
||||
arg1 = reinterpret_cast< QoS * >(argp1);
|
||||
result = (unsigned int)(arg1)->getVideoInHeight();
|
||||
resultobj = SWIG_From_unsigned_SS_int(static_cast< unsigned int >(result));
|
||||
return resultobj;
|
||||
fail:
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
SWIGINTERN PyObject *_wrap_QoS_getVideoOutHeight(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
|
||||
PyObject *resultobj = 0;
|
||||
QoS *arg1 = (QoS *) 0 ;
|
||||
void *argp1 = 0 ;
|
||||
int res1 = 0 ;
|
||||
PyObject * obj0 = 0 ;
|
||||
unsigned int result;
|
||||
|
||||
if (!PyArg_ParseTuple(args,(char *)"O:QoS_getVideoOutHeight",&obj0)) SWIG_fail;
|
||||
res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_QoS, 0 | 0 );
|
||||
if (!SWIG_IsOK(res1)) {
|
||||
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "QoS_getVideoOutHeight" "', argument " "1"" of type '" "QoS *""'");
|
||||
}
|
||||
arg1 = reinterpret_cast< QoS * >(argp1);
|
||||
result = (unsigned int)(arg1)->getVideoOutHeight();
|
||||
resultobj = SWIG_From_unsigned_SS_int(static_cast< unsigned int >(result));
|
||||
return resultobj;
|
||||
fail:
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
SWIGINTERN PyObject *_wrap_QoS_getBandwidthDownKbps(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
|
||||
PyObject *resultobj = 0;
|
||||
QoS *arg1 = (QoS *) 0 ;
|
||||
void *argp1 = 0 ;
|
||||
int res1 = 0 ;
|
||||
PyObject * obj0 = 0 ;
|
||||
unsigned int result;
|
||||
|
||||
if (!PyArg_ParseTuple(args,(char *)"O:QoS_getBandwidthDownKbps",&obj0)) SWIG_fail;
|
||||
res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_QoS, 0 | 0 );
|
||||
if (!SWIG_IsOK(res1)) {
|
||||
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "QoS_getBandwidthDownKbps" "', argument " "1"" of type '" "QoS *""'");
|
||||
}
|
||||
arg1 = reinterpret_cast< QoS * >(argp1);
|
||||
result = (unsigned int)(arg1)->getBandwidthDownKbps();
|
||||
resultobj = SWIG_From_unsigned_SS_int(static_cast< unsigned int >(result));
|
||||
return resultobj;
|
||||
fail:
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
SWIGINTERN PyObject *_wrap_QoS_getBandwidthUpKbps(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
|
||||
PyObject *resultobj = 0;
|
||||
QoS *arg1 = (QoS *) 0 ;
|
||||
void *argp1 = 0 ;
|
||||
int res1 = 0 ;
|
||||
PyObject * obj0 = 0 ;
|
||||
unsigned int result;
|
||||
|
||||
if (!PyArg_ParseTuple(args,(char *)"O:QoS_getBandwidthUpKbps",&obj0)) SWIG_fail;
|
||||
res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_QoS, 0 | 0 );
|
||||
if (!SWIG_IsOK(res1)) {
|
||||
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "QoS_getBandwidthUpKbps" "', argument " "1"" of type '" "QoS *""'");
|
||||
}
|
||||
arg1 = reinterpret_cast< QoS * >(argp1);
|
||||
result = (unsigned int)(arg1)->getBandwidthUpKbps();
|
||||
resultobj = SWIG_From_unsigned_SS_int(static_cast< unsigned int >(result));
|
||||
return resultobj;
|
||||
fail:
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
SWIGINTERN PyObject *_wrap_QoS_getVideoInAvgFps(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
|
||||
PyObject *resultobj = 0;
|
||||
QoS *arg1 = (QoS *) 0 ;
|
||||
void *argp1 = 0 ;
|
||||
int res1 = 0 ;
|
||||
PyObject * obj0 = 0 ;
|
||||
unsigned int result;
|
||||
|
||||
if (!PyArg_ParseTuple(args,(char *)"O:QoS_getVideoInAvgFps",&obj0)) SWIG_fail;
|
||||
res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_QoS, 0 | 0 );
|
||||
if (!SWIG_IsOK(res1)) {
|
||||
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "QoS_getVideoInAvgFps" "', argument " "1"" of type '" "QoS *""'");
|
||||
}
|
||||
arg1 = reinterpret_cast< QoS * >(argp1);
|
||||
result = (unsigned int)(arg1)->getVideoInAvgFps();
|
||||
resultobj = SWIG_From_unsigned_SS_int(static_cast< unsigned int >(result));
|
||||
return resultobj;
|
||||
fail:
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
SWIGINTERN PyObject *_wrap_QoS_getVideoDecAvgTime(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
|
||||
PyObject *resultobj = 0;
|
||||
QoS *arg1 = (QoS *) 0 ;
|
||||
void *argp1 = 0 ;
|
||||
int res1 = 0 ;
|
||||
PyObject * obj0 = 0 ;
|
||||
unsigned int result;
|
||||
|
||||
if (!PyArg_ParseTuple(args,(char *)"O:QoS_getVideoDecAvgTime",&obj0)) SWIG_fail;
|
||||
res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_QoS, 0 | 0 );
|
||||
if (!SWIG_IsOK(res1)) {
|
||||
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "QoS_getVideoDecAvgTime" "', argument " "1"" of type '" "QoS *""'");
|
||||
}
|
||||
arg1 = reinterpret_cast< QoS * >(argp1);
|
||||
result = (unsigned int)(arg1)->getVideoDecAvgTime();
|
||||
resultobj = SWIG_From_unsigned_SS_int(static_cast< unsigned int >(result));
|
||||
return resultobj;
|
||||
fail:
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
SWIGINTERN PyObject *_wrap_QoS_getVideoEncAvgTime(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
|
||||
PyObject *resultobj = 0;
|
||||
QoS *arg1 = (QoS *) 0 ;
|
||||
void *argp1 = 0 ;
|
||||
int res1 = 0 ;
|
||||
PyObject * obj0 = 0 ;
|
||||
unsigned int result;
|
||||
|
||||
if (!PyArg_ParseTuple(args,(char *)"O:QoS_getVideoEncAvgTime",&obj0)) SWIG_fail;
|
||||
res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_QoS, 0 | 0 );
|
||||
if (!SWIG_IsOK(res1)) {
|
||||
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "QoS_getVideoEncAvgTime" "', argument " "1"" of type '" "QoS *""'");
|
||||
}
|
||||
arg1 = reinterpret_cast< QoS * >(argp1);
|
||||
result = (unsigned int)(arg1)->getVideoEncAvgTime();
|
||||
resultobj = SWIG_From_unsigned_SS_int(static_cast< unsigned int >(result));
|
||||
return resultobj;
|
||||
fail:
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
SWIGINTERN PyObject *QoS_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
|
||||
PyObject *obj;
|
||||
if (!PyArg_ParseTuple(args,(char*)"O:swigregister", &obj)) return NULL;
|
||||
SWIG_TypeNewClientData(SWIGTYPE_p_QoS, SWIG_NewClientData(obj));
|
||||
return SWIG_Py_Void();
|
||||
}
|
||||
|
||||
SWIGINTERN PyObject *_wrap_delete_Codec(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
|
||||
PyObject *resultobj = 0;
|
||||
Codec *arg1 = (Codec *) 0 ;
|
||||
|
@ -6571,6 +6930,37 @@ fail:
|
|||
}
|
||||
|
||||
|
||||
SWIGINTERN PyObject *_wrap_MediaSessionMgr_sessionGetQoS(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
|
||||
PyObject *resultobj = 0;
|
||||
MediaSessionMgr *arg1 = (MediaSessionMgr *) 0 ;
|
||||
twrap_media_type_t arg2 ;
|
||||
void *argp1 = 0 ;
|
||||
int res1 = 0 ;
|
||||
int val2 ;
|
||||
int ecode2 = 0 ;
|
||||
PyObject * obj0 = 0 ;
|
||||
PyObject * obj1 = 0 ;
|
||||
QoS *result = 0 ;
|
||||
|
||||
if (!PyArg_ParseTuple(args,(char *)"OO:MediaSessionMgr_sessionGetQoS",&obj0,&obj1)) SWIG_fail;
|
||||
res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_MediaSessionMgr, 0 | 0 );
|
||||
if (!SWIG_IsOK(res1)) {
|
||||
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MediaSessionMgr_sessionGetQoS" "', argument " "1"" of type '" "MediaSessionMgr *""'");
|
||||
}
|
||||
arg1 = reinterpret_cast< MediaSessionMgr * >(argp1);
|
||||
ecode2 = SWIG_AsVal_int(obj1, &val2);
|
||||
if (!SWIG_IsOK(ecode2)) {
|
||||
SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "MediaSessionMgr_sessionGetQoS" "', argument " "2"" of type '" "twrap_media_type_t""'");
|
||||
}
|
||||
arg2 = static_cast< twrap_media_type_t >(val2);
|
||||
result = (QoS *)(arg1)->sessionGetQoS(arg2);
|
||||
resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_QoS, SWIG_POINTER_OWN | 0 );
|
||||
return resultobj;
|
||||
fail:
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
SWIGINTERN PyObject *_wrap_MediaSessionMgr_consumerSetInt32(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
|
||||
PyObject *resultobj = 0;
|
||||
MediaSessionMgr *arg1 = (MediaSessionMgr *) 0 ;
|
||||
|
@ -7130,6 +7520,59 @@ fail:
|
|||
}
|
||||
|
||||
|
||||
SWIGINTERN PyObject *_wrap_MediaSessionMgr_defaultsSetPrefVideoSizeOutRange(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
|
||||
PyObject *resultobj = 0;
|
||||
tmedia_pref_video_size_t arg1 ;
|
||||
tmedia_pref_video_size_t arg2 ;
|
||||
int val1 ;
|
||||
int ecode1 = 0 ;
|
||||
int val2 ;
|
||||
int ecode2 = 0 ;
|
||||
PyObject * obj0 = 0 ;
|
||||
PyObject * obj1 = 0 ;
|
||||
bool result;
|
||||
|
||||
if (!PyArg_ParseTuple(args,(char *)"OO:MediaSessionMgr_defaultsSetPrefVideoSizeOutRange",&obj0,&obj1)) SWIG_fail;
|
||||
ecode1 = SWIG_AsVal_int(obj0, &val1);
|
||||
if (!SWIG_IsOK(ecode1)) {
|
||||
SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "MediaSessionMgr_defaultsSetPrefVideoSizeOutRange" "', argument " "1"" of type '" "tmedia_pref_video_size_t""'");
|
||||
}
|
||||
arg1 = static_cast< tmedia_pref_video_size_t >(val1);
|
||||
ecode2 = SWIG_AsVal_int(obj1, &val2);
|
||||
if (!SWIG_IsOK(ecode2)) {
|
||||
SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "MediaSessionMgr_defaultsSetPrefVideoSizeOutRange" "', argument " "2"" of type '" "tmedia_pref_video_size_t""'");
|
||||
}
|
||||
arg2 = static_cast< tmedia_pref_video_size_t >(val2);
|
||||
result = (bool)MediaSessionMgr::defaultsSetPrefVideoSizeOutRange(arg1,arg2);
|
||||
resultobj = SWIG_From_bool(static_cast< bool >(result));
|
||||
return resultobj;
|
||||
fail:
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
SWIGINTERN PyObject *_wrap_MediaSessionMgr_defaultsSetAdaptativeVideoSizeOutEnabled(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
|
||||
PyObject *resultobj = 0;
|
||||
bool arg1 ;
|
||||
bool val1 ;
|
||||
int ecode1 = 0 ;
|
||||
PyObject * obj0 = 0 ;
|
||||
bool result;
|
||||
|
||||
if (!PyArg_ParseTuple(args,(char *)"O:MediaSessionMgr_defaultsSetAdaptativeVideoSizeOutEnabled",&obj0)) SWIG_fail;
|
||||
ecode1 = SWIG_AsVal_bool(obj0, &val1);
|
||||
if (!SWIG_IsOK(ecode1)) {
|
||||
SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "MediaSessionMgr_defaultsSetAdaptativeVideoSizeOutEnabled" "', argument " "1"" of type '" "bool""'");
|
||||
}
|
||||
arg1 = static_cast< bool >(val1);
|
||||
result = (bool)MediaSessionMgr::defaultsSetAdaptativeVideoSizeOutEnabled(arg1);
|
||||
resultobj = SWIG_From_bool(static_cast< bool >(result));
|
||||
return resultobj;
|
||||
fail:
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
SWIGINTERN PyObject *_wrap_MediaSessionMgr_defaultsSetJbMargin(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
|
||||
PyObject *resultobj = 0;
|
||||
uint32_t arg1 ;
|
||||
|
@ -26276,6 +26719,23 @@ static PyMethodDef SwigMethods[] = {
|
|||
{ (char *)"ActionConfig_setMediaString", _wrap_ActionConfig_setMediaString, METH_VARARGS, NULL},
|
||||
{ (char *)"ActionConfig_setMediaInt", _wrap_ActionConfig_setMediaInt, METH_VARARGS, NULL},
|
||||
{ (char *)"ActionConfig_swigregister", ActionConfig_swigregister, METH_VARARGS, NULL},
|
||||
{ (char *)"delete_QoS", _wrap_delete_QoS, METH_VARARGS, NULL},
|
||||
{ (char *)"QoS_getQavg", _wrap_QoS_getQavg, METH_VARARGS, NULL},
|
||||
{ (char *)"QoS_getQ1", _wrap_QoS_getQ1, METH_VARARGS, NULL},
|
||||
{ (char *)"QoS_getQ2", _wrap_QoS_getQ2, METH_VARARGS, NULL},
|
||||
{ (char *)"QoS_getQ3", _wrap_QoS_getQ3, METH_VARARGS, NULL},
|
||||
{ (char *)"QoS_getQ4", _wrap_QoS_getQ4, METH_VARARGS, NULL},
|
||||
{ (char *)"QoS_getQ5", _wrap_QoS_getQ5, METH_VARARGS, NULL},
|
||||
{ (char *)"QoS_getVideoInWidth", _wrap_QoS_getVideoInWidth, METH_VARARGS, NULL},
|
||||
{ (char *)"QoS_getVideoOutWidth", _wrap_QoS_getVideoOutWidth, METH_VARARGS, NULL},
|
||||
{ (char *)"QoS_getVideoInHeight", _wrap_QoS_getVideoInHeight, METH_VARARGS, NULL},
|
||||
{ (char *)"QoS_getVideoOutHeight", _wrap_QoS_getVideoOutHeight, METH_VARARGS, NULL},
|
||||
{ (char *)"QoS_getBandwidthDownKbps", _wrap_QoS_getBandwidthDownKbps, METH_VARARGS, NULL},
|
||||
{ (char *)"QoS_getBandwidthUpKbps", _wrap_QoS_getBandwidthUpKbps, METH_VARARGS, NULL},
|
||||
{ (char *)"QoS_getVideoInAvgFps", _wrap_QoS_getVideoInAvgFps, METH_VARARGS, NULL},
|
||||
{ (char *)"QoS_getVideoDecAvgTime", _wrap_QoS_getVideoDecAvgTime, METH_VARARGS, NULL},
|
||||
{ (char *)"QoS_getVideoEncAvgTime", _wrap_QoS_getVideoEncAvgTime, METH_VARARGS, NULL},
|
||||
{ (char *)"QoS_swigregister", QoS_swigregister, METH_VARARGS, NULL},
|
||||
{ (char *)"delete_Codec", _wrap_delete_Codec, METH_VARARGS, NULL},
|
||||
{ (char *)"Codec_getMediaType", _wrap_Codec_getMediaType, METH_VARARGS, NULL},
|
||||
{ (char *)"Codec_getName", _wrap_Codec_getName, METH_VARARGS, NULL},
|
||||
|
@ -26288,6 +26748,7 @@ static PyMethodDef SwigMethods[] = {
|
|||
{ (char *)"delete_MediaSessionMgr", _wrap_delete_MediaSessionMgr, METH_VARARGS, NULL},
|
||||
{ (char *)"MediaSessionMgr_sessionSetInt32", _wrap_MediaSessionMgr_sessionSetInt32, METH_VARARGS, NULL},
|
||||
{ (char *)"MediaSessionMgr_sessionGetInt32", _wrap_MediaSessionMgr_sessionGetInt32, METH_VARARGS, NULL},
|
||||
{ (char *)"MediaSessionMgr_sessionGetQoS", _wrap_MediaSessionMgr_sessionGetQoS, METH_VARARGS, NULL},
|
||||
{ (char *)"MediaSessionMgr_consumerSetInt32", _wrap_MediaSessionMgr_consumerSetInt32, METH_VARARGS, NULL},
|
||||
{ (char *)"MediaSessionMgr_consumerSetInt64", _wrap_MediaSessionMgr_consumerSetInt64, METH_VARARGS, NULL},
|
||||
{ (char *)"MediaSessionMgr_producerSetInt32", _wrap_MediaSessionMgr_producerSetInt32, METH_VARARGS, NULL},
|
||||
|
@ -26307,6 +26768,8 @@ static PyMethodDef SwigMethods[] = {
|
|||
{ (char *)"MediaSessionMgr_defaultsSetBandwidthVideoUploadMax", _wrap_MediaSessionMgr_defaultsSetBandwidthVideoUploadMax, METH_VARARGS, NULL},
|
||||
{ (char *)"MediaSessionMgr_defaultsSetBandwidthVideoDownloadMax", _wrap_MediaSessionMgr_defaultsSetBandwidthVideoDownloadMax, METH_VARARGS, NULL},
|
||||
{ (char *)"MediaSessionMgr_defaultsSetPrefVideoSize", _wrap_MediaSessionMgr_defaultsSetPrefVideoSize, METH_VARARGS, NULL},
|
||||
{ (char *)"MediaSessionMgr_defaultsSetPrefVideoSizeOutRange", _wrap_MediaSessionMgr_defaultsSetPrefVideoSizeOutRange, METH_VARARGS, NULL},
|
||||
{ (char *)"MediaSessionMgr_defaultsSetAdaptativeVideoSizeOutEnabled", _wrap_MediaSessionMgr_defaultsSetAdaptativeVideoSizeOutEnabled, METH_VARARGS, NULL},
|
||||
{ (char *)"MediaSessionMgr_defaultsSetJbMargin", _wrap_MediaSessionMgr_defaultsSetJbMargin, METH_VARARGS, NULL},
|
||||
{ (char *)"MediaSessionMgr_defaultsSetJbMaxLateRate", _wrap_MediaSessionMgr_defaultsSetJbMaxLateRate, METH_VARARGS, NULL},
|
||||
{ (char *)"MediaSessionMgr_defaultsSetEchoTail", _wrap_MediaSessionMgr_defaultsSetEchoTail, METH_VARARGS, NULL},
|
||||
|
@ -26957,6 +27420,7 @@ static swig_type_info _swigt__p_ProxyVideoProducer = {"_p_ProxyVideoProducer", "
|
|||
static swig_type_info _swigt__p_ProxyVideoProducerCallback = {"_p_ProxyVideoProducerCallback", "ProxyVideoProducerCallback *", 0, 0, (void*)0, 0};
|
||||
static swig_type_info _swigt__p_PublicationEvent = {"_p_PublicationEvent", "PublicationEvent *", 0, 0, (void*)0, 0};
|
||||
static swig_type_info _swigt__p_PublicationSession = {"_p_PublicationSession", "PublicationSession *", 0, 0, (void*)0, 0};
|
||||
static swig_type_info _swigt__p_QoS = {"_p_QoS", "QoS *", 0, 0, (void*)0, 0};
|
||||
static swig_type_info _swigt__p_RPMessage = {"_p_RPMessage", "RPMessage *", 0, 0, (void*)0, 0};
|
||||
static swig_type_info _swigt__p_RegistrationEvent = {"_p_RegistrationEvent", "RegistrationEvent *", 0, 0, (void*)0, 0};
|
||||
static swig_type_info _swigt__p_RegistrationSession = {"_p_RegistrationSession", "RegistrationSession *", 0, 0, (void*)0, 0};
|
||||
|
@ -27056,6 +27520,7 @@ static swig_type_info *swig_type_initial[] = {
|
|||
&_swigt__p_ProxyVideoProducerCallback,
|
||||
&_swigt__p_PublicationEvent,
|
||||
&_swigt__p_PublicationSession,
|
||||
&_swigt__p_QoS,
|
||||
&_swigt__p_RPMessage,
|
||||
&_swigt__p_RegistrationEvent,
|
||||
&_swigt__p_RegistrationSession,
|
||||
|
@ -27155,6 +27620,7 @@ static swig_cast_info _swigc__p_ProxyVideoProducer[] = { {&_swigt__p_ProxyVideo
|
|||
static swig_cast_info _swigc__p_ProxyVideoProducerCallback[] = { {&_swigt__p_ProxyVideoProducerCallback, 0, 0, 0},{0, 0, 0, 0}};
|
||||
static swig_cast_info _swigc__p_PublicationEvent[] = { {&_swigt__p_PublicationEvent, 0, 0, 0},{0, 0, 0, 0}};
|
||||
static swig_cast_info _swigc__p_PublicationSession[] = { {&_swigt__p_PublicationSession, 0, 0, 0},{0, 0, 0, 0}};
|
||||
static swig_cast_info _swigc__p_QoS[] = { {&_swigt__p_QoS, 0, 0, 0},{0, 0, 0, 0}};
|
||||
static swig_cast_info _swigc__p_RPMessage[] = { {&_swigt__p_RPMessage, 0, 0, 0},{0, 0, 0, 0}};
|
||||
static swig_cast_info _swigc__p_RegistrationEvent[] = { {&_swigt__p_RegistrationEvent, 0, 0, 0},{0, 0, 0, 0}};
|
||||
static swig_cast_info _swigc__p_RegistrationSession[] = { {&_swigt__p_RegistrationSession, 0, 0, 0},{0, 0, 0, 0}};
|
||||
|
@ -27254,6 +27720,7 @@ static swig_cast_info *swig_cast_initial[] = {
|
|||
_swigc__p_ProxyVideoProducerCallback,
|
||||
_swigc__p_PublicationEvent,
|
||||
_swigc__p_PublicationSession,
|
||||
_swigc__p_QoS,
|
||||
_swigc__p_RPMessage,
|
||||
_swigc__p_RegistrationEvent,
|
||||
_swigc__p_RegistrationSession,
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -11,12 +11,14 @@
|
|||
#ifndef SWIG_TinyWRAP_WRAP_H_
|
||||
#define SWIG_TinyWRAP_WRAP_H_
|
||||
|
||||
namespace Swig {
|
||||
namespace Swig
|
||||
{
|
||||
class Director;
|
||||
}
|
||||
|
||||
|
||||
class SwigDirector_SipCallback : public SipCallback, public Swig::Director {
|
||||
class SwigDirector_SipCallback : public SipCallback, public Swig::Director
|
||||
{
|
||||
|
||||
public:
|
||||
SwigDirector_SipCallback(VALUE self);
|
||||
|
|
|
@ -44,7 +44,9 @@ namespace doubango_rt
|
|||
rtActionConfig^ setMediaInt(rt_twrap_media_type_t type, Platform::String^ key, int value);
|
||||
|
||||
internal:
|
||||
ActionConfig* getWrappedActionConfig(){ return m_pActionConfig; }
|
||||
ActionConfig* getWrappedActionConfig() {
|
||||
return m_pActionConfig;
|
||||
}
|
||||
|
||||
private:
|
||||
ActionConfig* m_pActionConfig;
|
||||
|
|
|
@ -28,4 +28,3 @@
|
|||
# define VISIBLE_VOID_PTR Platform::IntPtr
|
||||
# define VISIBLE_VOID_PTR_2_VOID_PTR(ptr) (void*)((ptr))
|
||||
#endif
|
||||
|
|
@ -79,7 +79,8 @@ namespace doubango_rt
|
|||
};
|
||||
|
||||
public enum class rt_tmedia_pref_video_size_t
|
||||
{/* must be sorted like this */
|
||||
{
|
||||
/* must be sorted like this */
|
||||
tmedia_pref_video_size_sqcif = tmedia_pref_video_size_sqcif, // 128 x 98
|
||||
tmedia_pref_video_size_qcif = tmedia_pref_video_size_qcif, // 176 x 144
|
||||
tmedia_pref_video_size_qvga = tmedia_pref_video_size_qvga, // 320 x 240
|
||||
|
|
|
@ -34,9 +34,18 @@ namespace doubango_rt
|
|||
internal:
|
||||
rtMsrpByteRange(int64 start, int64 end, int64 total):_start(start),_end(end),_total(total) {}
|
||||
public:
|
||||
property int64 Start{ int64 get() { return _start; }; }
|
||||
property int64 End{ int64 get() { return _end; }; }
|
||||
property int64 Total{ int64 get() { return _total; }; }
|
||||
property int64 Start { int64 get() {
|
||||
return _start;
|
||||
};
|
||||
}
|
||||
property int64 End { int64 get() {
|
||||
return _end;
|
||||
};
|
||||
}
|
||||
property int64 Total { int64 get() {
|
||||
return _total;
|
||||
};
|
||||
}
|
||||
private:
|
||||
int64 _start, _end, _total;
|
||||
};
|
||||
|
@ -97,7 +106,9 @@ namespace doubango_rt
|
|||
{
|
||||
internal:
|
||||
rtMsrpCallback(rtIMsrpCallback^ pI);
|
||||
const MsrpCallback* getWrappedCallback(){ return m_pCallback; }
|
||||
const MsrpCallback* getWrappedCallback() {
|
||||
return m_pCallback;
|
||||
}
|
||||
public:
|
||||
virtual ~rtMsrpCallback();
|
||||
|
||||
|
|
|
@ -186,19 +186,19 @@ namespace doubango_rt
|
|||
{
|
||||
internal:
|
||||
rtT140Callback();
|
||||
const T140Callback* getWrappedCallback(){ return m_pCallback; }
|
||||
const T140Callback* getWrappedCallback() {
|
||||
return m_pCallback;
|
||||
}
|
||||
|
||||
public:
|
||||
rtT140Callback(rtIT140Callback^ pI)
|
||||
{
|
||||
rtT140Callback(rtIT140Callback^ pI) {
|
||||
m_pI = pI;
|
||||
}
|
||||
virtual ~rtT140Callback();
|
||||
|
||||
protected:
|
||||
virtual int ondata(rtT140CallbackData^ pData) {
|
||||
if(m_pI)
|
||||
{
|
||||
if(m_pI) {
|
||||
return m_pI->ondata(pData);
|
||||
}
|
||||
return 0;
|
||||
|
@ -231,7 +231,9 @@ namespace doubango_rt
|
|||
virtual ~rtSipSession();
|
||||
internal:
|
||||
rtSipSession(SipStack* pStack, tsip_ssession_handle_t* pHandle);
|
||||
SipSession* getWrappedSession(){ return m_pSipSession; }
|
||||
SipSession* getWrappedSession() {
|
||||
return m_pSipSession;
|
||||
}
|
||||
|
||||
public:
|
||||
rtISession_Declare();
|
||||
|
@ -248,7 +250,9 @@ namespace doubango_rt
|
|||
virtual ~rtInviteSession();
|
||||
internal:
|
||||
rtInviteSession(SipStack* pStack, tsip_ssession_handle_t* pHandle);
|
||||
InviteSession* getWrappedSession(){ return m_pSipSession; }
|
||||
InviteSession* getWrappedSession() {
|
||||
return m_pSipSession;
|
||||
}
|
||||
|
||||
public:
|
||||
rtISession_Declare();
|
||||
|
@ -266,7 +270,9 @@ namespace doubango_rt
|
|||
virtual ~rtCallSession();
|
||||
internal:
|
||||
rtCallSession(SipStack* pStack, tsip_ssession_handle_t* pHandle);
|
||||
CallSession* getWrappedSession(){ return m_pSipSession; }
|
||||
CallSession* getWrappedSession() {
|
||||
return m_pSipSession;
|
||||
}
|
||||
|
||||
public:
|
||||
rtISession_Declare();
|
||||
|
@ -323,7 +329,9 @@ namespace doubango_rt
|
|||
|
||||
internal:
|
||||
rtMsrpSession(SipStack* pStack, tsip_ssession_handle_t* pHandle);
|
||||
MsrpSession* getWrappedSession(){ return m_pSipSession; }
|
||||
MsrpSession* getWrappedSession() {
|
||||
return m_pSipSession;
|
||||
}
|
||||
|
||||
public:
|
||||
rtISession_Declare();
|
||||
|
|
|
@ -37,8 +37,14 @@ namespace doubango_rt
|
|||
internal:
|
||||
rtDnsResult(uint16 port, Platform::String^ address):_port(port), _address(address) {}
|
||||
public:
|
||||
property uint16 Port{ uint16 get() { return _port; }; }
|
||||
property Platform::String^ Address{ Platform::String^ get() { return _address; }; }
|
||||
property uint16 Port { uint16 get() {
|
||||
return _port;
|
||||
};
|
||||
}
|
||||
property Platform::String^ Address { Platform::String^ get() {
|
||||
return _address;
|
||||
};
|
||||
}
|
||||
private:
|
||||
uint16 _port;
|
||||
Platform::String^ _address;
|
||||
|
@ -51,7 +57,9 @@ namespace doubango_rt
|
|||
|
||||
internal:
|
||||
rtSipStack(rtISipCallback^ callback, Platform::String^ realmUri, Platform::String^ impiString, Platform::String^ impuUri);
|
||||
const SipStack* getWrappedStack() { return m_pSipStack; }
|
||||
const SipStack* getWrappedStack() {
|
||||
return m_pSipStack;
|
||||
}
|
||||
|
||||
public:
|
||||
bool start();
|
||||
|
|
|
@ -51,7 +51,9 @@ namespace doubango_rt
|
|||
void setDisplayName(Platform::String^ displayName);
|
||||
|
||||
internal:
|
||||
const SipUri* getWrappedUri(){ return m_pSipUri; }
|
||||
const SipUri* getWrappedUri() {
|
||||
return m_pSipUri;
|
||||
}
|
||||
|
||||
private:
|
||||
SipUri* m_pSipUri;
|
||||
|
|
|
@ -27,33 +27,27 @@ using namespace std;
|
|||
class DDebugCallbackProxy : public DDebugCallback
|
||||
{
|
||||
public:
|
||||
DDebugCallbackProxy(rtDDebugCallback^ pCallback)
|
||||
{
|
||||
DDebugCallbackProxy(rtDDebugCallback^ pCallback) {
|
||||
m_pCallback = pCallback;
|
||||
}
|
||||
|
||||
~DDebugCallbackProxy()
|
||||
{
|
||||
~DDebugCallbackProxy() {
|
||||
|
||||
}
|
||||
|
||||
virtual int OnDebugInfo(const char* message)
|
||||
{
|
||||
virtual int OnDebugInfo(const char* message) {
|
||||
return m_pCallback->m_pI->OnDebugInfo(rtString::toString(message));
|
||||
}
|
||||
|
||||
virtual int OnDebugWarn(const char* message)
|
||||
{
|
||||
virtual int OnDebugWarn(const char* message) {
|
||||
return m_pCallback->m_pI->OnDebugWarn(rtString::toString(message));
|
||||
}
|
||||
|
||||
virtual int OnDebugError(const char* message)
|
||||
{
|
||||
virtual int OnDebugError(const char* message) {
|
||||
return m_pCallback->m_pI->OnDebugError(rtString::toString(message));
|
||||
}
|
||||
|
||||
virtual int OnDebugFatal(const char* message)
|
||||
{
|
||||
virtual int OnDebugFatal(const char* message) {
|
||||
return m_pCallback->m_pI->OnDebugFatal(rtString::toString(message));
|
||||
}
|
||||
|
||||
|
|
|
@ -114,8 +114,7 @@ bool rtMediaSessionMgr::producerSetInt64(rt_twrap_media_type_t media, Platform::
|
|||
rtCodec^ rtMediaSessionMgr::producerGetCodec(rt_twrap_media_type_t media)
|
||||
{
|
||||
Codec* c = m_pMediaSessionMgr->producerGetCodec((twrap_media_type_t)media);
|
||||
if(c)
|
||||
{
|
||||
if(c) {
|
||||
rtCodec^ codec = ref new rtCodec(const_cast<struct tmedia_codec_s*>(c->getWrappedCodec()));
|
||||
rtSafeDelete(c);
|
||||
return codec;
|
||||
|
|
|
@ -115,11 +115,9 @@ unsigned rtMsrpMessage::getMsrpContentLength()
|
|||
#if COM_VISIBLE
|
||||
String^ rtMsrpMessage::getMsrpContent(unsigned maxsize)
|
||||
{
|
||||
if(maxsize)
|
||||
{
|
||||
if(maxsize) {
|
||||
void* _s = calloc(maxsize + 1, 1);
|
||||
if(_s)
|
||||
{
|
||||
if(_s) {
|
||||
unsigned len = m_pMsrpMessage->getMsrpContent(_s, maxsize);
|
||||
String^ s = rtString::toString((const char*)_s);
|
||||
free(_s);
|
||||
|
@ -157,8 +155,7 @@ rt_tmsrp_event_type_t rtMsrpEvent::getType()
|
|||
|
||||
rtMsrpSession^ rtMsrpEvent::getSipSession()
|
||||
{
|
||||
if(m_pMsrpEvent->getSipSession())
|
||||
{
|
||||
if(m_pMsrpEvent->getSipSession()) {
|
||||
assert(0); // FIXME: Not implemented
|
||||
return nullptr;
|
||||
// return ref new rtMsrpSession(m_pMsrpEvent->getSipSession()->getWrappedSession());
|
||||
|
@ -168,8 +165,7 @@ rtMsrpSession^ rtMsrpEvent::getSipSession()
|
|||
|
||||
rtMsrpMessage^ rtMsrpEvent::getMessage()
|
||||
{
|
||||
if(m_pMsrpEvent->getMessage())
|
||||
{
|
||||
if(m_pMsrpEvent->getMessage()) {
|
||||
return ref new rtMsrpMessage(const_cast<struct tmsrp_message_s *>(const_cast<MsrpMessage*>(m_pMsrpEvent->getMessage())->getWrappedMsrpMessage()));
|
||||
}
|
||||
return nullptr;
|
||||
|
@ -191,4 +187,3 @@ rtMsrpCallback::~rtMsrpCallback()
|
|||
}
|
||||
|
||||
|
||||
|
|
@ -28,87 +28,68 @@ using namespace std;
|
|||
class SipCallbackProxy : public SipCallback
|
||||
{
|
||||
public:
|
||||
SipCallbackProxy(rtSipCallback^ rtCallback)
|
||||
{
|
||||
SipCallbackProxy(rtSipCallback^ rtCallback) {
|
||||
m_pCallback = rtCallback;
|
||||
}
|
||||
|
||||
virtual int OnDialogEvent(const DialogEvent* e) override
|
||||
{
|
||||
if(e && m_pCallback && m_pCallback->m_pI)
|
||||
{
|
||||
virtual int OnDialogEvent(const DialogEvent* e) override {
|
||||
if(e && m_pCallback && m_pCallback->m_pI) {
|
||||
return m_pCallback->m_pI->OnDialogEvent(ref new rtDialogEvent(const_cast<tsip_event_t*>(const_cast<DialogEvent*>(e)->getWrappedEvent())));
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
virtual int OnStackEvent(const StackEvent* e) override
|
||||
{
|
||||
if(e && m_pCallback && m_pCallback->m_pI)
|
||||
{
|
||||
virtual int OnStackEvent(const StackEvent* e) override {
|
||||
if(e && m_pCallback && m_pCallback->m_pI) {
|
||||
return m_pCallback->m_pI->OnStackEvent(ref new rtStackEvent(const_cast<tsip_event_t*>(const_cast<StackEvent*>(e)->getWrappedEvent())));
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
virtual int OnInviteEvent(const InviteEvent* e) override
|
||||
{
|
||||
if(e && m_pCallback && m_pCallback->m_pI)
|
||||
{
|
||||
virtual int OnInviteEvent(const InviteEvent* e) override {
|
||||
if(e && m_pCallback && m_pCallback->m_pI) {
|
||||
return m_pCallback->m_pI->OnInviteEvent(ref new rtInviteEvent(const_cast<tsip_event_t*>(const_cast<InviteEvent*>(e)->getWrappedEvent())));
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
virtual int OnMessagingEvent(const MessagingEvent* e) override
|
||||
{
|
||||
if(e && m_pCallback && m_pCallback->m_pI)
|
||||
{
|
||||
virtual int OnMessagingEvent(const MessagingEvent* e) override {
|
||||
if(e && m_pCallback && m_pCallback->m_pI) {
|
||||
return m_pCallback->m_pI->OnMessagingEvent(ref new rtMessagingEvent(const_cast<tsip_event_t*>(const_cast<MessagingEvent*>(e)->getWrappedEvent())));
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
virtual int OnInfoEvent(const InfoEvent* e) override
|
||||
{
|
||||
if(m_pCallback && m_pCallback->m_pI)
|
||||
{
|
||||
virtual int OnInfoEvent(const InfoEvent* e) override {
|
||||
if(m_pCallback && m_pCallback->m_pI) {
|
||||
return m_pCallback->m_pI->OnInfoEvent(ref new rtInfoEvent(const_cast<tsip_event_t*>(const_cast<InfoEvent*>(e)->getWrappedEvent())));
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
virtual int OnOptionsEvent(const OptionsEvent* e) override
|
||||
{
|
||||
if(e && m_pCallback && m_pCallback->m_pI)
|
||||
{
|
||||
virtual int OnOptionsEvent(const OptionsEvent* e) override {
|
||||
if(e && m_pCallback && m_pCallback->m_pI) {
|
||||
return m_pCallback->m_pI->OnOptionsEvent(ref new rtOptionsEvent(const_cast<tsip_event_t*>(const_cast<OptionsEvent*>(e)->getWrappedEvent())));
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
virtual int OnPublicationEvent(const PublicationEvent* e) override
|
||||
{
|
||||
if(e && m_pCallback && m_pCallback->m_pI)
|
||||
{
|
||||
virtual int OnPublicationEvent(const PublicationEvent* e) override {
|
||||
if(e && m_pCallback && m_pCallback->m_pI) {
|
||||
return m_pCallback->m_pI->OnPublicationEvent(ref new rtPublicationEvent(const_cast<tsip_event_t*>(const_cast<PublicationEvent*>(e)->getWrappedEvent())));
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
virtual int OnRegistrationEvent(const RegistrationEvent* e) override
|
||||
{
|
||||
if(m_pCallback && m_pCallback->m_pI)
|
||||
{
|
||||
virtual int OnRegistrationEvent(const RegistrationEvent* e) override {
|
||||
if(m_pCallback && m_pCallback->m_pI) {
|
||||
return m_pCallback->m_pI->OnRegistrationEvent(ref new rtRegistrationEvent(const_cast<tsip_event_t*>(const_cast<RegistrationEvent*>(e)->getWrappedEvent())));
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
virtual int OnSubscriptionEvent(const SubscriptionEvent* e) override
|
||||
{
|
||||
if(e && m_pCallback && m_pCallback->m_pI)
|
||||
{
|
||||
virtual int OnSubscriptionEvent(const SubscriptionEvent* e) override {
|
||||
if(e && m_pCallback && m_pCallback->m_pI) {
|
||||
return m_pCallback->m_pI->OnSubscriptionEvent(ref new rtSubscriptionEvent(const_cast<tsip_event_t*>(const_cast<SubscriptionEvent*>(e)->getWrappedEvent())));
|
||||
}
|
||||
return 0;
|
||||
|
|
|
@ -45,8 +45,7 @@ rtSdpMessage::~rtSdpMessage()
|
|||
|
||||
String^ rtSdpMessage::getSdpHeaderValue(String^ media, String^ name, unsigned index)
|
||||
{
|
||||
if(m_pSdpMessage)
|
||||
{
|
||||
if(m_pSdpMessage) {
|
||||
char * _str = m_pSdpMessage->getSdpHeaderValue
|
||||
(rtString::toUtf8(media).data(),
|
||||
rtString::toUtf8(media).data()[0],
|
||||
|
@ -65,8 +64,7 @@ String^ rtSdpMessage::getSdpHeaderValue(String^ media, String^ name)
|
|||
|
||||
String^ rtSdpMessage::getSdpHeaderAValue(String^ media, String^ attributeName)
|
||||
{
|
||||
if(m_pSdpMessage)
|
||||
{
|
||||
if(m_pSdpMessage) {
|
||||
char * _str = m_pSdpMessage->getSdpHeaderAValue
|
||||
(rtString::toUtf8(media).data(),
|
||||
rtString::toUtf8(attributeName).data());
|
||||
|
@ -145,11 +143,9 @@ unsigned rtSipMessage::getSipContentLength()
|
|||
String^ rtSipMessage::getSipContent()
|
||||
{
|
||||
unsigned len = getSipContentLength();
|
||||
if(len > 0)
|
||||
{
|
||||
if(len > 0) {
|
||||
void* data_ptr = calloc(len, 1);
|
||||
if(data_ptr)
|
||||
{
|
||||
if(data_ptr) {
|
||||
m_pSipMessage->getSipContent(data_ptr, len);
|
||||
String^ s = rtString::toString((const char*)data_ptr);
|
||||
free(data_ptr);
|
||||
|
|
|
@ -294,8 +294,7 @@ rtMsrpSession::~rtMsrpSession()
|
|||
bool rtMsrpSession::setCallback(rtIMsrpCallback^ pCallback)
|
||||
{
|
||||
rtSafeDelete(m_pCallback);
|
||||
if(!pCallback)
|
||||
{
|
||||
if(!pCallback) {
|
||||
return m_pSipSession->setCallback(tsk_null);
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -61,8 +61,7 @@ bool rtSipStack::setDebugCallback(rtIDDebugCallback^ pCallback)
|
|||
|
||||
m_pSipStack->setDebugCallback(tsk_null);
|
||||
rtSafeDelete(m_pDebugCallback);
|
||||
if(!pCallback)
|
||||
{
|
||||
if(!pCallback) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -95,8 +95,7 @@ Platform::String^ rtSipUri::getParamValue(Platform::String^ name)
|
|||
|
||||
void rtSipUri::setDisplayName(Platform::String^ displayName)
|
||||
{
|
||||
if(m_pSipUri)
|
||||
{
|
||||
if(m_pSipUri) {
|
||||
m_pSipUri->setDisplayName(rtString::toUtf8(displayName).data());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -25,14 +25,11 @@ using namespace std;
|
|||
|
||||
vector<char> rtString::toUtf8(String^ str)
|
||||
{
|
||||
if(str != nullptr && !str->IsEmpty())
|
||||
{
|
||||
if(str != nullptr && !str->IsEmpty()) {
|
||||
int len = WideCharToMultiByte(CP_UTF8, WC_ERR_INVALID_CHARS, str->Data(), str->Length(), nullptr, 0, nullptr, nullptr);
|
||||
if (len > 0)
|
||||
{
|
||||
if (len > 0) {
|
||||
vector<char> vec(len + 1);
|
||||
if (WideCharToMultiByte(CP_UTF8, WC_ERR_INVALID_CHARS, str->Data(), str->Length(), vec.data(), len, nullptr, nullptr) == len)
|
||||
{
|
||||
if (WideCharToMultiByte(CP_UTF8, WC_ERR_INVALID_CHARS, str->Data(), str->Length(), vec.data(), len, nullptr, nullptr) == len) {
|
||||
return std::move(vec);
|
||||
}
|
||||
}
|
||||
|
@ -42,14 +39,11 @@ vector<char> rtString::toUtf8(String^ str)
|
|||
|
||||
String^ rtString::toString(char const* str)
|
||||
{
|
||||
if(str)
|
||||
{
|
||||
if(str) {
|
||||
int len = MultiByteToWideChar(CP_UTF8, MB_ERR_INVALID_CHARS, str, -1, nullptr, 0);
|
||||
if (len > 0)
|
||||
{
|
||||
if (len > 0) {
|
||||
vector<wchar_t> vec(len);
|
||||
if (MultiByteToWideChar(CP_UTF8, MB_ERR_INVALID_CHARS, str, -1, vec.data(), len) == len)
|
||||
{
|
||||
if (MultiByteToWideChar(CP_UTF8, MB_ERR_INVALID_CHARS, str, -1, vec.data(), len) == len) {
|
||||
return ref new String(vec.data());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -29,8 +29,7 @@
|
|||
#include "tsk_safeobj.h"
|
||||
#include "tsk_debug.h"
|
||||
|
||||
typedef enum PLUGIN_INDEX_E
|
||||
{
|
||||
typedef enum PLUGIN_INDEX_E {
|
||||
PLUGIN_INDEX_AUDIO_CONSUMER,
|
||||
PLUGIN_INDEX_AUDIO_PRODUCER,
|
||||
PLUGIN_INDEX_COUNT
|
||||
|
@ -46,10 +45,11 @@ int __plugin_get_def_count()
|
|||
tsk_plugin_def_type_t __plugin_get_def_type_at(int index)
|
||||
{
|
||||
switch(index) {
|
||||
case PLUGIN_INDEX_AUDIO_CONSUMER: return tsk_plugin_def_type_consumer;
|
||||
case PLUGIN_INDEX_AUDIO_PRODUCER: return tsk_plugin_def_type_producer;
|
||||
default:
|
||||
{
|
||||
case PLUGIN_INDEX_AUDIO_CONSUMER:
|
||||
return tsk_plugin_def_type_consumer;
|
||||
case PLUGIN_INDEX_AUDIO_PRODUCER:
|
||||
return tsk_plugin_def_type_producer;
|
||||
default: {
|
||||
AUDIO_OPENSLES_DEBUG_ERROR("No plugin at index %d", index);
|
||||
return tsk_plugin_def_type_none;
|
||||
}
|
||||
|
@ -60,12 +60,10 @@ tsk_plugin_def_media_type_t __plugin_get_def_media_type_at(int index)
|
|||
{
|
||||
switch(index) {
|
||||
case PLUGIN_INDEX_AUDIO_CONSUMER:
|
||||
case PLUGIN_INDEX_AUDIO_PRODUCER:
|
||||
{
|
||||
case PLUGIN_INDEX_AUDIO_PRODUCER: {
|
||||
return tsk_plugin_def_media_type_audio;
|
||||
}
|
||||
default:
|
||||
{
|
||||
default: {
|
||||
AUDIO_OPENSLES_DEBUG_ERROR("No plugin at index %d", index);
|
||||
return tsk_plugin_def_media_type_none;
|
||||
}
|
||||
|
@ -75,16 +73,13 @@ tsk_plugin_def_media_type_t __plugin_get_def_media_type_at(int index)
|
|||
tsk_plugin_def_ptr_const_t __plugin_get_def_at(int index)
|
||||
{
|
||||
switch(index) {
|
||||
case PLUGIN_INDEX_AUDIO_CONSUMER:
|
||||
{
|
||||
case PLUGIN_INDEX_AUDIO_CONSUMER: {
|
||||
return audio_consumer_opensles_plugin_def_t;
|
||||
}
|
||||
case PLUGIN_INDEX_AUDIO_PRODUCER:
|
||||
{
|
||||
case PLUGIN_INDEX_AUDIO_PRODUCER: {
|
||||
return audio_producer_opensles_plugin_def_t;
|
||||
}
|
||||
default:
|
||||
{
|
||||
default: {
|
||||
AUDIO_OPENSLES_DEBUG_ERROR("No plugin at index %d", index);
|
||||
return tsk_null;
|
||||
}
|
||||
|
@ -95,8 +90,7 @@ tsk_plugin_def_ptr_const_t __plugin_get_def_at(int index)
|
|||
// SLES AudioInstance
|
||||
//
|
||||
|
||||
typedef struct audio_opensles_instance_s
|
||||
{
|
||||
typedef struct audio_opensles_instance_s {
|
||||
TSK_DECLARE_OBJECT;
|
||||
|
||||
uint64_t sessionId;
|
||||
|
@ -156,8 +150,7 @@ static int audio_opensles_instance_cmp(const tsk_object_t *_ai1, const tsk_objec
|
|||
{
|
||||
return ((int)_ai1 - (int)_ai2);
|
||||
}
|
||||
static const tsk_object_def_t audio_opensles_instance_def_s =
|
||||
{
|
||||
static const tsk_object_def_t audio_opensles_instance_def_s = {
|
||||
sizeof(audio_opensles_instance_t),
|
||||
audio_opensles_instance_ctor,
|
||||
audio_opensles_instance_dtor,
|
||||
|
@ -546,7 +539,8 @@ int audio_opensles_instance_set_microphone_volume(audio_opensles_instance_handle
|
|||
return self->device->SetMicrophoneVolume(volume);
|
||||
}
|
||||
|
||||
int audio_opensles_instance_destroy(audio_opensles_instance_handle_t** _self){
|
||||
int audio_opensles_instance_destroy(audio_opensles_instance_handle_t** _self)
|
||||
{
|
||||
if(!_self || !*_self) {
|
||||
AUDIO_OPENSLES_DEBUG_ERROR("Invalid parameter");
|
||||
return -1;
|
||||
|
|
|
@ -25,8 +25,7 @@
|
|||
#include "tsk_memory.h"
|
||||
#include "tsk_debug.h"
|
||||
|
||||
typedef struct audio_consumer_opensles_s
|
||||
{
|
||||
typedef struct audio_consumer_opensles_s {
|
||||
TDAV_DECLARE_CONSUMER_AUDIO;
|
||||
audio_opensles_instance_handle_t* audioInstHandle;
|
||||
bool isSpeakerOn;
|
||||
|
@ -107,7 +106,9 @@ static int audio_consumer_opensles_set(tmedia_consumer_t* _self, const tmedia_pa
|
|||
if(self->audioInstHandle) {
|
||||
return audio_opensles_instance_set_speakerOn(self->audioInstHandle, self->isSpeakerOn);
|
||||
}
|
||||
else return 0; // will be set when instance is initialized
|
||||
else {
|
||||
return 0; // will be set when instance is initialized
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -228,16 +229,14 @@ static tsk_object_t* audio_consumer_opensles_dtor(tsk_object_t *_self)
|
|||
return self;
|
||||
}
|
||||
/* object definition */
|
||||
static const tsk_object_def_t audio_consumer_opensles_def_s =
|
||||
{
|
||||
static const tsk_object_def_t audio_consumer_opensles_def_s = {
|
||||
sizeof(audio_consumer_opensles_t),
|
||||
audio_consumer_opensles_ctor,
|
||||
audio_consumer_opensles_dtor,
|
||||
tdav_consumer_audio_cmp,
|
||||
};
|
||||
/* plugin definition*/
|
||||
static const tmedia_consumer_plugin_def_t audio_consumer_opensles_plugin_def_s =
|
||||
{
|
||||
static const tmedia_consumer_plugin_def_t audio_consumer_opensles_plugin_def_s = {
|
||||
&audio_consumer_opensles_def_s,
|
||||
|
||||
tmedia_audio,
|
||||
|
|
|
@ -23,19 +23,32 @@
|
|||
#define CHECK_MICROPHONE_NOT_INITIALIZED() CHECK_FALSE(m_bMicrophoneInitialized, "Microphone initialized")
|
||||
|
||||
#if AUDIO_OPENSLES_UNDER_ANDROID
|
||||
static inline SLuint32 SL_SAMPLING_RATE(int RATE_INT){
|
||||
static inline SLuint32 SL_SAMPLING_RATE(int RATE_INT)
|
||||
{
|
||||
switch(RATE_INT) {
|
||||
case 8000: return SL_SAMPLINGRATE_8;
|
||||
case 11025: return SL_SAMPLINGRATE_11_025;
|
||||
default:case 16000: return SL_SAMPLINGRATE_16;
|
||||
case 22050: return SL_SAMPLINGRATE_22_05;
|
||||
case 24000: return SL_SAMPLINGRATE_24;
|
||||
case 32000: return SL_SAMPLINGRATE_32;
|
||||
case 44100: return SL_SAMPLINGRATE_44_1;
|
||||
case 64000: return SL_SAMPLINGRATE_64;
|
||||
case 88200: return SL_SAMPLINGRATE_88_2;
|
||||
case 96000: return SL_SAMPLINGRATE_96;
|
||||
case 192000: return SL_SAMPLINGRATE_192;
|
||||
case 8000:
|
||||
return SL_SAMPLINGRATE_8;
|
||||
case 11025:
|
||||
return SL_SAMPLINGRATE_11_025;
|
||||
default:
|
||||
case 16000:
|
||||
return SL_SAMPLINGRATE_16;
|
||||
case 22050:
|
||||
return SL_SAMPLINGRATE_22_05;
|
||||
case 24000:
|
||||
return SL_SAMPLINGRATE_24;
|
||||
case 32000:
|
||||
return SL_SAMPLINGRATE_32;
|
||||
case 44100:
|
||||
return SL_SAMPLINGRATE_44_1;
|
||||
case 64000:
|
||||
return SL_SAMPLINGRATE_64;
|
||||
case 88200:
|
||||
return SL_SAMPLINGRATE_88_2;
|
||||
case 96000:
|
||||
return SL_SAMPLINGRATE_96;
|
||||
case 192000:
|
||||
return SL_SAMPLINGRATE_192;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
@ -250,13 +263,21 @@ int SLAudioDevice::SetPlayoutSampleRate(int nPlayoutSampleRate)
|
|||
AUDIO_OPENSLES_DEBUG_INFO("SetPlayoutSampleRate(%d)", nPlayoutSampleRate);
|
||||
|
||||
switch(nPlayoutSampleRate) {
|
||||
case 8000: case 11025: case 16000: case 22050: case 24000: case 32000: case 44100: case 64000: case 88200: case 96000: case 192000:
|
||||
{
|
||||
case 8000:
|
||||
case 11025:
|
||||
case 16000:
|
||||
case 22050:
|
||||
case 24000:
|
||||
case 32000:
|
||||
case 44100:
|
||||
case 64000:
|
||||
case 88200:
|
||||
case 96000:
|
||||
case 192000: {
|
||||
m_nPlayoutSampleRate = nPlayoutSampleRate;
|
||||
return 0;
|
||||
}
|
||||
default:
|
||||
{
|
||||
default: {
|
||||
AUDIO_OPENSLES_DEBUG_ERROR("%d not valid sampling rate", nPlayoutSampleRate);
|
||||
return -1;
|
||||
}
|
||||
|
@ -618,13 +639,21 @@ int SLAudioDevice::SetRecordingSampleRate(int nRecordingSampleRate)
|
|||
AUDIO_OPENSLES_DEBUG_INFO("SetRecordingSampleRate(%d)", nRecordingSampleRate);
|
||||
|
||||
switch(nRecordingSampleRate) {
|
||||
case 8000: case 11025: case 16000: case 22050: case 24000: case 32000: case 44100: case 64000: case 88200: case 96000: case 192000:
|
||||
{
|
||||
case 8000:
|
||||
case 11025:
|
||||
case 16000:
|
||||
case 22050:
|
||||
case 24000:
|
||||
case 32000:
|
||||
case 44100:
|
||||
case 64000:
|
||||
case 88200:
|
||||
case 96000:
|
||||
case 192000: {
|
||||
m_nRecordingSampleRate = nRecordingSampleRate;
|
||||
return 0;
|
||||
}
|
||||
default:
|
||||
{
|
||||
default: {
|
||||
AUDIO_OPENSLES_DEBUG_ERROR("%d not valid sampling rate", nRecordingSampleRate);
|
||||
return -1;
|
||||
}
|
||||
|
@ -1059,8 +1088,7 @@ void SLAudioDevice::RecorderSimpleBufferQueueCallback(SLAndroidSimpleBufferQueue
|
|||
int16_t insertPos = -1;
|
||||
unsigned int nCopy = 0; // Number of samples to copy
|
||||
|
||||
while (dataPos < noSamp10ms)
|
||||
{
|
||||
while (dataPos < noSamp10ms) {
|
||||
// Loop over all recording buffers or until we find the partially
|
||||
// full buffer
|
||||
// First choice is to insert into partially full buffer,
|
||||
|
@ -1068,24 +1096,20 @@ void SLAudioDevice::RecorderSimpleBufferQueueCallback(SLAndroidSimpleBufferQueue
|
|||
bufPos = 0;
|
||||
insertPos = -1;
|
||||
nCopy = 0;
|
||||
while (bufPos < N_REC_BUFFERS)
|
||||
{
|
||||
if ((This->_recLength[bufPos] > 0) && (This->_recLength[bufPos] < noSamp10ms))
|
||||
{
|
||||
while (bufPos < N_REC_BUFFERS) {
|
||||
if ((This->_recLength[bufPos] > 0) && (This->_recLength[bufPos] < noSamp10ms)) {
|
||||
// Found the partially full buffer
|
||||
insertPos = static_cast<int16_t> (bufPos);
|
||||
bufPos = N_REC_BUFFERS; // Don't need to search more
|
||||
}
|
||||
else if ((-1 == insertPos) && (0 == This->_recLength[bufPos]))
|
||||
{
|
||||
else if ((-1 == insertPos) && (0 == This->_recLength[bufPos])) {
|
||||
// Found an empty buffer
|
||||
insertPos = static_cast<int16_t> (bufPos);
|
||||
}
|
||||
++bufPos;
|
||||
}
|
||||
|
||||
if (insertPos > -1)
|
||||
{
|
||||
if (insertPos > -1) {
|
||||
// We found a non-full buffer, copy data from the buffer queue
|
||||
// o recBuffer
|
||||
unsigned int dataToCopy = noSamp10ms - dataPos;
|
||||
|
@ -1093,8 +1117,7 @@ void SLAudioDevice::RecorderSimpleBufferQueueCallback(SLAndroidSimpleBufferQueue
|
|||
unsigned int roomInBuffer = noSamp10ms - currentRecLen;
|
||||
nCopy = (dataToCopy < roomInBuffer ? dataToCopy : roomInBuffer);
|
||||
memcpy(&This->_recBuffer[insertPos][currentRecLen], &This->_recQueueBuffer[This->_recQueueSeq][dataPos], nCopy * sizeof(short));
|
||||
if (0 == currentRecLen)
|
||||
{
|
||||
if (0 == currentRecLen) {
|
||||
_recSeqNumber[insertPos] = This->_recCurrentSeq;
|
||||
++_recCurrentSeq;
|
||||
}
|
||||
|
@ -1104,8 +1127,7 @@ void SLAudioDevice::RecorderSimpleBufferQueueCallback(SLAndroidSimpleBufferQueue
|
|||
This->_recLength[insertPos] += nCopy;
|
||||
dataPos += nCopy;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
// Didn't find a non-full buffer
|
||||
AUDIO_OPENSLES_DEBUG_WARN("Could not insert into recording buffer");
|
||||
dataPos = noSamp10ms; // Don't try to insert more
|
||||
|
|
|
@ -40,8 +40,12 @@ public:
|
|||
void* audioSamples,
|
||||
uint32_t& nSamplesOut);
|
||||
|
||||
inline void SetConsumer(const struct audio_consumer_opensles_s* pConsumer){ m_pConsumer = pConsumer; }
|
||||
inline void SetProducer(const struct audio_producer_opensles_s* pProducer){ m_pProducer = pProducer; }
|
||||
inline void SetConsumer(const struct audio_consumer_opensles_s* pConsumer) {
|
||||
m_pConsumer = pConsumer;
|
||||
}
|
||||
inline void SetProducer(const struct audio_producer_opensles_s* pProducer) {
|
||||
m_pProducer = pProducer;
|
||||
}
|
||||
|
||||
private:
|
||||
const struct audio_consumer_opensles_s* m_pConsumer; // mut be const and must not take reference
|
||||
|
|
|
@ -24,8 +24,7 @@
|
|||
#include "tsk_memory.h"
|
||||
#include "tsk_debug.h"
|
||||
|
||||
typedef struct audio_producer_opensles_s
|
||||
{
|
||||
typedef struct audio_producer_opensles_s {
|
||||
TDAV_DECLARE_PRODUCER_AUDIO;
|
||||
|
||||
bool isMuted;
|
||||
|
@ -215,16 +214,14 @@ static tsk_object_t* audio_producer_opensles_dtor(tsk_object_t *_self)
|
|||
return self;
|
||||
}
|
||||
/* object definition */
|
||||
static const tsk_object_def_t audio_producer_opensles_def_s =
|
||||
{
|
||||
static const tsk_object_def_t audio_producer_opensles_def_s = {
|
||||
sizeof(audio_producer_opensles_t),
|
||||
audio_producer_opensles_ctor,
|
||||
audio_producer_opensles_dtor,
|
||||
tdav_producer_audio_cmp,
|
||||
};
|
||||
/* plugin definition*/
|
||||
static const tmedia_producer_plugin_def_t audio_producer_opensles_plugin_def_s =
|
||||
{
|
||||
static const tmedia_producer_plugin_def_t audio_producer_opensles_plugin_def_s = {
|
||||
&audio_producer_opensles_def_s,
|
||||
|
||||
tmedia_audio,
|
||||
|
|
|
@ -22,8 +22,7 @@ BOOL APIENTRY DllMain( HMODULE hModule,
|
|||
LPVOID lpReserved
|
||||
)
|
||||
{
|
||||
switch (ul_reason_for_call)
|
||||
{
|
||||
switch (ul_reason_for_call) {
|
||||
case DLL_PROCESS_ATTACH:
|
||||
case DLL_THREAD_ATTACH:
|
||||
case DLL_THREAD_DETACH:
|
||||
|
|
|
@ -43,8 +43,7 @@ extern "C"
|
|||
}
|
||||
#endif
|
||||
|
||||
typedef enum PLUGIN_INDEX_E
|
||||
{
|
||||
typedef enum PLUGIN_INDEX_E {
|
||||
PLUGIN_INDEX_AUDIO_CONSUMER,
|
||||
PLUGIN_INDEX_AUDIO_PRODUCER,
|
||||
PLUGIN_INDEX_COUNT
|
||||
|
@ -60,10 +59,11 @@ int __plugin_get_def_count()
|
|||
tsk_plugin_def_type_t __plugin_get_def_type_at(int index)
|
||||
{
|
||||
switch(index) {
|
||||
case PLUGIN_INDEX_AUDIO_CONSUMER: return tsk_plugin_def_type_consumer;
|
||||
case PLUGIN_INDEX_AUDIO_PRODUCER: return tsk_plugin_def_type_producer;
|
||||
default:
|
||||
{
|
||||
case PLUGIN_INDEX_AUDIO_CONSUMER:
|
||||
return tsk_plugin_def_type_consumer;
|
||||
case PLUGIN_INDEX_AUDIO_PRODUCER:
|
||||
return tsk_plugin_def_type_producer;
|
||||
default: {
|
||||
DOUBANGO_AUDIO_WEBRTC_DEBUG_ERROR("No plugin at index %d", index);
|
||||
return tsk_plugin_def_type_none;
|
||||
}
|
||||
|
@ -74,12 +74,10 @@ tsk_plugin_def_media_type_t __plugin_get_def_media_type_at(int index)
|
|||
{
|
||||
switch(index) {
|
||||
case PLUGIN_INDEX_AUDIO_CONSUMER:
|
||||
case PLUGIN_INDEX_AUDIO_PRODUCER:
|
||||
{
|
||||
case PLUGIN_INDEX_AUDIO_PRODUCER: {
|
||||
return tsk_plugin_def_media_type_audio;
|
||||
}
|
||||
default:
|
||||
{
|
||||
default: {
|
||||
DOUBANGO_AUDIO_WEBRTC_DEBUG_ERROR("No plugin at index %d", index);
|
||||
return tsk_plugin_def_media_type_none;
|
||||
}
|
||||
|
@ -89,16 +87,13 @@ tsk_plugin_def_media_type_t __plugin_get_def_media_type_at(int index)
|
|||
tsk_plugin_def_ptr_const_t __plugin_get_def_at(int index)
|
||||
{
|
||||
switch(index) {
|
||||
case PLUGIN_INDEX_AUDIO_CONSUMER:
|
||||
{
|
||||
case PLUGIN_INDEX_AUDIO_CONSUMER: {
|
||||
return audio_consumer_webrtc_plugin_def_t;
|
||||
}
|
||||
case PLUGIN_INDEX_AUDIO_PRODUCER:
|
||||
{
|
||||
case PLUGIN_INDEX_AUDIO_PRODUCER: {
|
||||
return audio_producer_webrtc_plugin_def_t;
|
||||
}
|
||||
default:
|
||||
{
|
||||
default: {
|
||||
DOUBANGO_AUDIO_WEBRTC_DEBUG_ERROR("No plugin at index %d", index);
|
||||
return tsk_null;
|
||||
}
|
||||
|
@ -109,8 +104,7 @@ tsk_plugin_def_ptr_const_t __plugin_get_def_at(int index)
|
|||
// WebRTC AudioInstance
|
||||
//
|
||||
|
||||
typedef struct audio_webrtc_instance_s
|
||||
{
|
||||
typedef struct audio_webrtc_instance_s {
|
||||
TSK_DECLARE_OBJECT;
|
||||
|
||||
uint64_t sessionId;
|
||||
|
@ -170,8 +164,7 @@ static int audio_webrtc_instance_cmp(const tsk_object_t *_ai1, const tsk_object_
|
|||
{
|
||||
return ((int)_ai1 - (int)_ai2);
|
||||
}
|
||||
static const tsk_object_def_t audio_webrtc_instance_def_s =
|
||||
{
|
||||
static const tsk_object_def_t audio_webrtc_instance_def_s = {
|
||||
sizeof(audio_webrtc_instance_t),
|
||||
audio_webrtc_instance_ctor,
|
||||
audio_webrtc_instance_dtor,
|
||||
|
@ -544,7 +537,8 @@ done:
|
|||
return (self->isProducerStarted ? -1 : 0);
|
||||
}
|
||||
|
||||
int audio_webrtc_instance_destroy(audio_webrtc_instance_handle_t** _self){
|
||||
int audio_webrtc_instance_destroy(audio_webrtc_instance_handle_t** _self)
|
||||
{
|
||||
if(!_self || !*_self) {
|
||||
DOUBANGO_AUDIO_WEBRTC_DEBUG_ERROR("Invalid parameter");
|
||||
return -1;
|
||||
|
|
|
@ -120,10 +120,18 @@ static void DOUBANGO_AUDIO_WEBRTC_DEBUG_ANY(int level, const char* fmt, ...)
|
|||
|
||||
if(message) {
|
||||
switch(level) {
|
||||
case DEBUG_LEVEL_INFO: __android_log_write(ANDROID_LOG_INFO, ANDROID_DEBUG_TAG, message); break;
|
||||
case DEBUG_LEVEL_WARN: __android_log_write(ANDROID_LOG_WARN, ANDROID_DEBUG_TAG, message); break;
|
||||
case DEBUG_LEVEL_ERROR: __android_log_write(ANDROID_LOG_ERROR, ANDROID_DEBUG_TAG, message); break;
|
||||
case DEBUG_LEVEL_FATAL: __android_log_write(ANDROID_LOG_FATAL, ANDROID_DEBUG_TAG, message); break;
|
||||
case DEBUG_LEVEL_INFO:
|
||||
__android_log_write(ANDROID_LOG_INFO, ANDROID_DEBUG_TAG, message);
|
||||
break;
|
||||
case DEBUG_LEVEL_WARN:
|
||||
__android_log_write(ANDROID_LOG_WARN, ANDROID_DEBUG_TAG, message);
|
||||
break;
|
||||
case DEBUG_LEVEL_ERROR:
|
||||
__android_log_write(ANDROID_LOG_ERROR, ANDROID_DEBUG_TAG, message);
|
||||
break;
|
||||
case DEBUG_LEVEL_FATAL:
|
||||
__android_log_write(ANDROID_LOG_FATAL, ANDROID_DEBUG_TAG, message);
|
||||
break;
|
||||
}
|
||||
TSK_FREE(message);
|
||||
}
|
||||
|
|
|
@ -24,8 +24,7 @@
|
|||
#include "tsk_memory.h"
|
||||
#include "tsk_debug.h"
|
||||
|
||||
typedef struct audio_consumer_webrtc_s
|
||||
{
|
||||
typedef struct audio_consumer_webrtc_s {
|
||||
TDAV_DECLARE_CONSUMER_AUDIO;
|
||||
audio_webrtc_instance_handle_t* audioInstHandle;
|
||||
struct {
|
||||
|
@ -208,16 +207,14 @@ static tsk_object_t* audio_consumer_webrtc_dtor(tsk_object_t *_self)
|
|||
return self;
|
||||
}
|
||||
/* object definition */
|
||||
static const tsk_object_def_t audio_consumer_webrtc_def_s =
|
||||
{
|
||||
static const tsk_object_def_t audio_consumer_webrtc_def_s = {
|
||||
sizeof(audio_consumer_webrtc_t),
|
||||
audio_consumer_webrtc_ctor,
|
||||
audio_consumer_webrtc_dtor,
|
||||
tdav_consumer_audio_cmp,
|
||||
};
|
||||
/* plugin definition*/
|
||||
static const tmedia_consumer_plugin_def_t audio_consumer_webrtc_plugin_def_s =
|
||||
{
|
||||
static const tmedia_consumer_plugin_def_t audio_consumer_webrtc_plugin_def_s = {
|
||||
&audio_consumer_webrtc_def_s,
|
||||
|
||||
tmedia_audio,
|
||||
|
|
|
@ -24,8 +24,7 @@
|
|||
#include "tsk_memory.h"
|
||||
#include "tsk_debug.h"
|
||||
|
||||
typedef struct audio_producer_webrtc_s
|
||||
{
|
||||
typedef struct audio_producer_webrtc_s {
|
||||
TDAV_DECLARE_PRODUCER_AUDIO;
|
||||
|
||||
bool isMuted;
|
||||
|
@ -203,16 +202,14 @@ static tsk_object_t* audio_producer_webrtc_dtor(tsk_object_t *_self)
|
|||
return self;
|
||||
}
|
||||
/* object definition */
|
||||
static const tsk_object_def_t audio_producer_webrtc_def_s =
|
||||
{
|
||||
static const tsk_object_def_t audio_producer_webrtc_def_s = {
|
||||
sizeof(audio_producer_webrtc_t),
|
||||
audio_producer_webrtc_ctor,
|
||||
audio_producer_webrtc_dtor,
|
||||
tdav_producer_audio_cmp,
|
||||
};
|
||||
/* plugin definition*/
|
||||
static const tmedia_producer_plugin_def_t audio_producer_webrtc_plugin_def_s =
|
||||
{
|
||||
static const tmedia_producer_plugin_def_t audio_producer_webrtc_plugin_def_s = {
|
||||
&audio_producer_webrtc_def_s,
|
||||
|
||||
tmedia_audio,
|
||||
|
|
|
@ -48,50 +48,41 @@ public:
|
|||
|
||||
public:
|
||||
void SetFullDuplex(bool enable);
|
||||
void SetSpeakerVolume(bool enable)
|
||||
{
|
||||
void SetSpeakerVolume(bool enable) {
|
||||
_speakerVolume = enable;
|
||||
}
|
||||
;
|
||||
void SetSpeakerMute(bool enable)
|
||||
{
|
||||
void SetSpeakerMute(bool enable) {
|
||||
_speakerMute = enable;
|
||||
}
|
||||
;
|
||||
void SetMicrophoneMute(bool enable)
|
||||
{
|
||||
void SetMicrophoneMute(bool enable) {
|
||||
_microphoneMute = enable;
|
||||
}
|
||||
;
|
||||
void SetMicrophoneVolume(bool enable)
|
||||
{
|
||||
void SetMicrophoneVolume(bool enable) {
|
||||
_microphoneVolume = enable;
|
||||
}
|
||||
;
|
||||
void SetMicrophoneBoost(bool enable)
|
||||
{
|
||||
void SetMicrophoneBoost(bool enable) {
|
||||
_microphoneBoost = enable;
|
||||
}
|
||||
;
|
||||
void SetLoopbackMeasurements(bool enable)
|
||||
{
|
||||
void SetLoopbackMeasurements(bool enable) {
|
||||
_loopBackMeasurements = enable;
|
||||
}
|
||||
;
|
||||
void SetMicrophoneAGC(bool enable)
|
||||
{
|
||||
void SetMicrophoneAGC(bool enable) {
|
||||
_microphoneAGC = enable;
|
||||
}
|
||||
;
|
||||
|
||||
void SetConsumer(const struct audio_consumer_webrtc_s* consumer)
|
||||
{
|
||||
void SetConsumer(const struct audio_consumer_webrtc_s* consumer) {
|
||||
_consumer = consumer;
|
||||
}
|
||||
;
|
||||
|
||||
void SetProducer(const struct audio_producer_webrtc_s* producer)
|
||||
{
|
||||
void SetProducer(const struct audio_producer_webrtc_s* producer) {
|
||||
_producer = producer;
|
||||
}
|
||||
;
|
||||
|
|
|
@ -26,8 +26,7 @@ BOOL APIENTRY DllMain( HMODULE hModule,
|
|||
LPVOID lpReserved
|
||||
)
|
||||
{
|
||||
switch (ul_reason_for_call)
|
||||
{
|
||||
switch (ul_reason_for_call) {
|
||||
case DLL_PROCESS_ATTACH:
|
||||
case DLL_THREAD_ATTACH:
|
||||
case DLL_THREAD_DETACH:
|
||||
|
|
|
@ -56,8 +56,7 @@ BOOL APIENTRY DllMain( HMODULE hModule,
|
|||
LPVOID lpReserved
|
||||
)
|
||||
{
|
||||
switch (ul_reason_for_call)
|
||||
{
|
||||
switch (ul_reason_for_call) {
|
||||
case DLL_PROCESS_ATTACH:
|
||||
break;
|
||||
case DLL_THREAD_ATTACH:
|
||||
|
@ -71,8 +70,7 @@ BOOL APIENTRY DllMain( HMODULE hModule,
|
|||
}
|
||||
|
||||
|
||||
typedef enum PLUGIN_INDEX_E
|
||||
{
|
||||
typedef enum PLUGIN_INDEX_E {
|
||||
#if PLUGIN_CUDA_H264_ENABLE
|
||||
PLUGIN_INDEX_CODEC_H264_MAIN,
|
||||
PLUGIN_INDEX_CODEC_H264_BASE,
|
||||
|
@ -93,8 +91,7 @@ tsk_plugin_def_type_t __plugin_get_def_type_at(int index)
|
|||
#if PLUGIN_CUDA_H264_ENABLE
|
||||
switch(index) {
|
||||
case PLUGIN_INDEX_CODEC_H264_MAIN:
|
||||
case PLUGIN_INDEX_CODEC_H264_BASE:
|
||||
{
|
||||
case PLUGIN_INDEX_CODEC_H264_BASE: {
|
||||
return CudaUtils::IsH264Supported() ? tsk_plugin_def_type_codec : tsk_plugin_def_type_none;
|
||||
}
|
||||
}
|
||||
|
@ -108,8 +105,7 @@ tsk_plugin_def_media_type_t __plugin_get_def_media_type_at(int index)
|
|||
#if PLUGIN_CUDA_H264_ENABLE
|
||||
switch(index) {
|
||||
case PLUGIN_INDEX_CODEC_H264_MAIN:
|
||||
case PLUGIN_INDEX_CODEC_H264_BASE:
|
||||
{
|
||||
case PLUGIN_INDEX_CODEC_H264_BASE: {
|
||||
return CudaUtils::IsH264Supported() ? tsk_plugin_def_media_type_video : tsk_plugin_def_media_type_none;
|
||||
}
|
||||
}
|
||||
|
@ -122,12 +118,10 @@ tsk_plugin_def_ptr_const_t __plugin_get_def_at(int index)
|
|||
{
|
||||
#if PLUGIN_CUDA_H264_ENABLE
|
||||
switch(index) {
|
||||
case PLUGIN_INDEX_CODEC_H264_MAIN:
|
||||
{
|
||||
case PLUGIN_INDEX_CODEC_H264_MAIN: {
|
||||
return CudaUtils::IsH264Supported() ? cuda_codec_h264_main_plugin_def_t : tsk_null;
|
||||
}
|
||||
case PLUGIN_INDEX_CODEC_H264_BASE:
|
||||
{
|
||||
case PLUGIN_INDEX_CODEC_H264_BASE: {
|
||||
return CudaUtils::IsH264Supported() ? cuda_codec_h264_base_plugin_def_t : tsk_null;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -43,8 +43,7 @@
|
|||
#include <cuda.h>
|
||||
#include <Windows.h>
|
||||
|
||||
typedef struct cuda_codec_h264_s
|
||||
{
|
||||
typedef struct cuda_codec_h264_s {
|
||||
TDAV_DECLARE_CODEC_H264_COMMON;
|
||||
|
||||
// Encoder
|
||||
|
@ -129,18 +128,15 @@ static int cuda_codec_h264_set(tmedia_codec_t* self, const tmedia_param_t* param
|
|||
if(tsk_striequals(param->key, "action")) {
|
||||
tmedia_codec_action_t action = (tmedia_codec_action_t)TSK_TO_INT32((uint8_t*)param->value);
|
||||
switch(action) {
|
||||
case tmedia_codec_action_encode_idr:
|
||||
{
|
||||
case tmedia_codec_action_encode_idr: {
|
||||
h264->encoder.force_idr = tsk_true;
|
||||
break;
|
||||
}
|
||||
case tmedia_codec_action_bw_down:
|
||||
{
|
||||
case tmedia_codec_action_bw_down: {
|
||||
h264->encoder.quality = TSK_CLAMP(1, (h264->encoder.quality + 1), 31);
|
||||
break;
|
||||
}
|
||||
case tmedia_codec_action_bw_up:
|
||||
{
|
||||
case tmedia_codec_action_bw_up: {
|
||||
h264->encoder.quality = TSK_CLAMP(1, (h264->encoder.quality - 1), 31);
|
||||
break;
|
||||
}
|
||||
|
@ -233,8 +229,7 @@ static tsk_size_t cuda_codec_h264_encode(tmedia_codec_t* self, const void* in_da
|
|||
cuda_codec_h264_t* h264 = (cuda_codec_h264_t*)self;
|
||||
tdav_codec_h264_common_t* common = (tdav_codec_h264_common_t*)self;
|
||||
|
||||
if(!self || !in_data || !in_size)
|
||||
{
|
||||
if(!self || !in_data || !in_size) {
|
||||
TSK_DEBUG_ERROR("Invalid parameter");
|
||||
return 0;
|
||||
}
|
||||
|
@ -244,21 +239,18 @@ static tsk_size_t cuda_codec_h264_encode(tmedia_codec_t* self, const void* in_da
|
|||
return 0;
|
||||
}
|
||||
|
||||
if((h264->encoder.ctxParams.iOutputSize[1] * h264->encoder.ctxParams.iOutputSize[0] * 3) >> 1 != in_size)
|
||||
{
|
||||
if((h264->encoder.ctxParams.iOutputSize[1] * h264->encoder.ctxParams.iOutputSize[0] * 3) >> 1 != in_size) {
|
||||
/* guard */
|
||||
TSK_DEBUG_ERROR("Invalid size");
|
||||
return 0;
|
||||
}
|
||||
|
||||
if(!self->opened || !h264->encoder.pInst /*|| !h264->encoder.pInst->IsReady()*/)
|
||||
{
|
||||
if(!self->opened || !h264->encoder.pInst /*|| !h264->encoder.pInst->IsReady()*/) {
|
||||
TSK_DEBUG_ERROR("Encoder not opened or not ready");
|
||||
return 0;
|
||||
}
|
||||
|
||||
if(h264->encoder.passthrough)
|
||||
{
|
||||
if(h264->encoder.passthrough) {
|
||||
tdav_codec_h264_rtp_encap(TDAV_CODEC_H264_COMMON(h264), (const uint8_t*)in_data, in_size);
|
||||
return 0;
|
||||
}
|
||||
|
@ -286,8 +278,7 @@ static tsk_size_t cuda_codec_h264_encode(tmedia_codec_t* self, const void* in_da
|
|||
|| ( (h264->encoder.frame_count < h264->encoder.neg_fps * 4) && ((h264->encoder.frame_count % h264->encoder.neg_fps)==0) )
|
||||
);
|
||||
|
||||
if(send_idr)
|
||||
{
|
||||
if(send_idr) {
|
||||
flags |= 0x04; // FORCE IDR
|
||||
}
|
||||
|
||||
|
@ -298,25 +289,20 @@ static tsk_size_t cuda_codec_h264_encode(tmedia_codec_t* self, const void* in_da
|
|||
send_idr
|
||||
|| ( (h264->encoder.frame_count % (h264->encoder.neg_fps * 5))==0 )
|
||||
);
|
||||
if(send_hdr)
|
||||
{
|
||||
if(h264->encoder.ctxParams.iDisableSPSPPS)
|
||||
{
|
||||
if(send_hdr) {
|
||||
if(h264->encoder.ctxParams.iDisableSPSPPS) {
|
||||
unsigned char SPSPPSBuff[1024];
|
||||
int SPSPPSBuffSize = sizeof(SPSPPSBuff);
|
||||
hr = NVGetSPSPPS(h264->encoder.pInst, SPSPPSBuff, SPSPPSBuffSize, &SPSPPSBuffSize);
|
||||
if(SUCCEEDED(hr))
|
||||
{
|
||||
if(SUCCEEDED(hr)) {
|
||||
int size = 0;
|
||||
while(size < SPSPPSBuffSize - 2)
|
||||
{
|
||||
while(size < SPSPPSBuffSize - 2) {
|
||||
int16_t next_size = ((int16_t)SPSPPSBuff[size])<<1 | ((int16_t)SPSPPSBuff[size + 1]);
|
||||
tdav_codec_h264_rtp_encap(common, &SPSPPSBuff[size + 2], next_size);
|
||||
size += next_size + 2;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
TSK_DEBUG_ERROR("NVGetSPSPPS failed with error code = %08x", hr)
|
||||
}
|
||||
}
|
||||
|
@ -346,14 +332,12 @@ static tsk_size_t cuda_codec_h264_decode(tmedia_codec_t* self, const void* in_da
|
|||
static const tsk_size_t xmax_size = (3840 * 2160 * 3) >> 3; // >>3 instead of >>1 (not an error)
|
||||
static tsk_size_t start_code_prefix_size = sizeof(H264_START_CODE_PREFIX);
|
||||
|
||||
if(!h264 || !in_data || !in_size || !out_data)
|
||||
{
|
||||
if(!h264 || !in_data || !in_size || !out_data) {
|
||||
TSK_DEBUG_ERROR("Invalid parameter");
|
||||
return 0;
|
||||
}
|
||||
|
||||
if(!self->opened || !h264->encoder.pInst)
|
||||
{
|
||||
if(!self->opened || !h264->encoder.pInst) {
|
||||
TSK_DEBUG_ERROR("Decoder not opened or not ready");
|
||||
return 0;
|
||||
}
|
||||
|
@ -361,8 +345,7 @@ static tsk_size_t cuda_codec_h264_decode(tmedia_codec_t* self, const void* in_da
|
|||
HRESULT hr = S_OK;
|
||||
|
||||
/* Packet lost? */
|
||||
if((h264->decoder.last_seq + 1) != rtp_hdr->seq_num && h264->decoder.last_seq)
|
||||
{
|
||||
if((h264->decoder.last_seq + 1) != rtp_hdr->seq_num && h264->decoder.last_seq) {
|
||||
TSK_DEBUG_INFO("[H.264] Packet loss, seq_num=%d", (h264->decoder.last_seq + 1));
|
||||
}
|
||||
h264->decoder.last_seq = rtp_hdr->seq_num;
|
||||
|
@ -375,8 +358,7 @@ static tsk_size_t cuda_codec_h264_decode(tmedia_codec_t* self, const void* in_da
|
|||
|F|NRI| Type |
|
||||
+---------------+
|
||||
*/
|
||||
if(*((uint8_t*)in_data) & 0x80)
|
||||
{
|
||||
if(*((uint8_t*)in_data) & 0x80) {
|
||||
TSK_DEBUG_WARN("F=1");
|
||||
/* reset accumulator */
|
||||
h264->decoder.accumulator = 0;
|
||||
|
@ -384,8 +366,7 @@ static tsk_size_t cuda_codec_h264_decode(tmedia_codec_t* self, const void* in_da
|
|||
}
|
||||
|
||||
/* get payload */
|
||||
if((ret = tdav_codec_h264_get_pay(in_data, in_size, (const void**)&pay_ptr, &pay_size, &append_scp)) || !pay_ptr || !pay_size)
|
||||
{
|
||||
if((ret = tdav_codec_h264_get_pay(in_data, in_size, (const void**)&pay_ptr, &pay_size, &append_scp)) || !pay_ptr || !pay_size) {
|
||||
TSK_DEBUG_ERROR("Depayloader failed to get H.264 content");
|
||||
return 0;
|
||||
}
|
||||
|
@ -395,30 +376,24 @@ static tsk_size_t cuda_codec_h264_decode(tmedia_codec_t* self, const void* in_da
|
|||
sps_or_pps = append_scp && pay_ptr && ((pay_ptr[0] & 0x1F) == 7 || (pay_ptr[0] & 0x1F) == 8);
|
||||
|
||||
// start-accumulator
|
||||
if(!h264->decoder.accumulator)
|
||||
{
|
||||
if(size_to_copy > xmax_size)
|
||||
{
|
||||
if(!h264->decoder.accumulator) {
|
||||
if(size_to_copy > xmax_size) {
|
||||
TSK_DEBUG_ERROR("%u too big to contain valid encoded data. xmax_size=%u", size_to_copy, xmax_size);
|
||||
return 0;
|
||||
}
|
||||
if(!(h264->decoder.accumulator = tsk_calloc(size_to_copy, sizeof(uint8_t))))
|
||||
{
|
||||
if(!(h264->decoder.accumulator = tsk_calloc(size_to_copy, sizeof(uint8_t)))) {
|
||||
TSK_DEBUG_ERROR("Failed to allocated new buffer");
|
||||
return 0;
|
||||
}
|
||||
h264->decoder.accumulator_size = size_to_copy;
|
||||
}
|
||||
if((h264->decoder.accumulator_pos + size_to_copy) >= xmax_size)
|
||||
{
|
||||
if((h264->decoder.accumulator_pos + size_to_copy) >= xmax_size) {
|
||||
TSK_DEBUG_ERROR("BufferOverflow");
|
||||
h264->decoder.accumulator_pos = 0;
|
||||
return 0;
|
||||
}
|
||||
if((h264->decoder.accumulator_pos + size_to_copy) > h264->decoder.accumulator_size)
|
||||
{
|
||||
if(!(h264->decoder.accumulator = tsk_realloc(h264->decoder.accumulator, (h264->decoder.accumulator_pos + size_to_copy))))
|
||||
{
|
||||
if((h264->decoder.accumulator_pos + size_to_copy) > h264->decoder.accumulator_size) {
|
||||
if(!(h264->decoder.accumulator = tsk_realloc(h264->decoder.accumulator, (h264->decoder.accumulator_pos + size_to_copy)))) {
|
||||
TSK_DEBUG_ERROR("Failed to reallocated new buffer");
|
||||
h264->decoder.accumulator_pos = 0;
|
||||
h264->decoder.accumulator_size = 0;
|
||||
|
@ -427,8 +402,7 @@ static tsk_size_t cuda_codec_h264_decode(tmedia_codec_t* self, const void* in_da
|
|||
h264->decoder.accumulator_size = (h264->decoder.accumulator_pos + size_to_copy);
|
||||
}
|
||||
|
||||
if(append_scp)
|
||||
{
|
||||
if(append_scp) {
|
||||
memcpy(&((uint8_t*)h264->decoder.accumulator)[h264->decoder.accumulator_pos], H264_START_CODE_PREFIX, start_code_prefix_size);
|
||||
h264->decoder.accumulator_pos += start_code_prefix_size;
|
||||
}
|
||||
|
@ -437,24 +411,18 @@ static tsk_size_t cuda_codec_h264_decode(tmedia_codec_t* self, const void* in_da
|
|||
// end-accumulator
|
||||
|
||||
|
||||
if(sps_or_pps)
|
||||
{
|
||||
if(sps_or_pps) {
|
||||
// http://libav-users.943685.n4.nabble.com/Decode-H264-streams-how-to-fill-AVCodecContext-from-SPS-PPS-td2484472.html
|
||||
// SPS and PPS should be bundled with IDR
|
||||
TSK_DEBUG_INFO("Receiving SPS or PPS ...to be tied to an IDR");
|
||||
}
|
||||
else if(rtp_hdr->marker)
|
||||
{
|
||||
if(h264->decoder.passthrough)
|
||||
{
|
||||
if(*out_max_size < h264->decoder.accumulator_pos)
|
||||
{
|
||||
if((*out_data = tsk_realloc(*out_data, h264->decoder.accumulator_pos)))
|
||||
{
|
||||
else if(rtp_hdr->marker) {
|
||||
if(h264->decoder.passthrough) {
|
||||
if(*out_max_size < h264->decoder.accumulator_pos) {
|
||||
if((*out_data = tsk_realloc(*out_data, h264->decoder.accumulator_pos))) {
|
||||
*out_max_size = h264->decoder.accumulator_pos;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
*out_max_size = 0;
|
||||
return 0;
|
||||
}
|
||||
|
@ -462,8 +430,7 @@ static tsk_size_t cuda_codec_h264_decode(tmedia_codec_t* self, const void* in_da
|
|||
memcpy(*out_data, h264->decoder.accumulator, h264->decoder.accumulator_pos);
|
||||
retsize = h264->decoder.accumulator_pos;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
// !h264->decoder.passthrough
|
||||
CUVIDSOURCEDATAPACKET pkt;
|
||||
CUresult cuResult;
|
||||
|
@ -475,17 +442,14 @@ static tsk_size_t cuda_codec_h264_decode(tmedia_codec_t* self, const void* in_da
|
|||
// reset accumulator
|
||||
h264->decoder.accumulator_pos = 0;
|
||||
cuResult = cuvidParseVideoData(h264->decoder.cuParser, &pkt);
|
||||
if(cuResult != CUDA_SUCCESS)
|
||||
{
|
||||
if(cuResult != CUDA_SUCCESS) {
|
||||
TSK_DEBUG_ERROR("cuvidParseVideoData() failed with error code = %d", (int)cuResult);
|
||||
CHECK_HR(hr = E_FAIL);
|
||||
}
|
||||
|
||||
if(h264->decoder.cuBuffer.bAvail)
|
||||
{
|
||||
if(h264->decoder.cuBuffer.bAvail) {
|
||||
h264->decoder.cuBuffer.bAvail = tsk_false;
|
||||
if((retsize = _cuda_codec_h264_pict_layout(h264, out_data, out_max_size)) == 0)
|
||||
{
|
||||
if((retsize = _cuda_codec_h264_pict_layout(h264, out_data, out_max_size)) == 0) {
|
||||
TSK_DEBUG_ERROR("_cuda_codec_h264_pict_layout failed");
|
||||
CHECK_HR(hr = E_FAIL);
|
||||
}
|
||||
|
@ -494,11 +458,9 @@ static tsk_size_t cuda_codec_h264_decode(tmedia_codec_t* self, const void* in_da
|
|||
} // else if(rtp_hdr->marker)
|
||||
|
||||
bail:
|
||||
if(FAILED(hr))
|
||||
{
|
||||
if(FAILED(hr)) {
|
||||
TSK_DEBUG_INFO("Failed to decode the buffer with error code =%d, size=%u, append=%s", ret, h264->decoder.accumulator_pos, append_scp ? "yes" : "no");
|
||||
if(TMEDIA_CODEC_VIDEO(self)->in.callback)
|
||||
{
|
||||
if(TMEDIA_CODEC_VIDEO(self)->in.callback) {
|
||||
TMEDIA_CODEC_VIDEO(self)->in.result.type = tmedia_video_decode_result_type_error;
|
||||
TMEDIA_CODEC_VIDEO(self)->in.result.proto_hdr = proto_hdr;
|
||||
TMEDIA_CODEC_VIDEO(self)->in.callback(&TMEDIA_CODEC_VIDEO(self)->in.result);
|
||||
|
@ -553,16 +515,14 @@ static tsk_object_t* cuda_codec_h264_base_dtor(tsk_object_t * self)
|
|||
return self;
|
||||
}
|
||||
/* object definition */
|
||||
static const tsk_object_def_t cuda_codec_h264_base_def_s =
|
||||
{
|
||||
static const tsk_object_def_t cuda_codec_h264_base_def_s = {
|
||||
sizeof(cuda_codec_h264_t),
|
||||
cuda_codec_h264_base_ctor,
|
||||
cuda_codec_h264_base_dtor,
|
||||
tmedia_codec_cmp,
|
||||
};
|
||||
/* plugin definition*/
|
||||
static const tmedia_codec_plugin_def_t cuda_codec_h264_base_plugin_def_s =
|
||||
{
|
||||
static const tmedia_codec_plugin_def_t cuda_codec_h264_base_plugin_def_s = {
|
||||
&cuda_codec_h264_base_def_s,
|
||||
|
||||
tmedia_video,
|
||||
|
@ -619,16 +579,14 @@ static tsk_object_t* cuda_codec_h264_main_dtor(tsk_object_t * self)
|
|||
return self;
|
||||
}
|
||||
/* object definition */
|
||||
static const tsk_object_def_t cuda_codec_h264_main_def_s =
|
||||
{
|
||||
static const tsk_object_def_t cuda_codec_h264_main_def_s = {
|
||||
sizeof(cuda_codec_h264_t),
|
||||
cuda_codec_h264_main_ctor,
|
||||
cuda_codec_h264_main_dtor,
|
||||
tmedia_codec_cmp,
|
||||
};
|
||||
/* plugin definition*/
|
||||
static const tmedia_codec_plugin_def_t cuda_codec_h264_main_plugin_def_s =
|
||||
{
|
||||
static const tmedia_codec_plugin_def_t cuda_codec_h264_main_plugin_def_s = {
|
||||
&cuda_codec_h264_main_def_s,
|
||||
|
||||
tmedia_video,
|
||||
|
@ -669,8 +627,7 @@ int cuda_codec_h264_open_encoder(cuda_codec_h264_t* self)
|
|||
static int low_latency = 1;
|
||||
tdav_codec_h264_common_t* common = (tdav_codec_h264_common_t*)self;
|
||||
|
||||
if(self->encoder.pInst)
|
||||
{
|
||||
if(self->encoder.pInst) {
|
||||
TSK_DEBUG_ERROR("Encoder already initialized");
|
||||
#if defined(E_ILLEGAL_METHOD_CALL)
|
||||
CHECK_HR(hr = E_ILLEGAL_METHOD_CALL);
|
||||
|
@ -690,14 +647,12 @@ int cuda_codec_h264_open_encoder(cuda_codec_h264_t* self)
|
|||
CHECK_HR(hr = NVGetParamValue(self->encoder.pInst, NVVE_GET_GPU_COUNT, &self->encoder.ctxParams.GPU_count));
|
||||
{
|
||||
int temp = 0, deviceCount;
|
||||
for (deviceCount=0; deviceCount < self->encoder.ctxParams.GPU_count; deviceCount++)
|
||||
{
|
||||
for (deviceCount=0; deviceCount < self->encoder.ctxParams.GPU_count; deviceCount++) {
|
||||
NVVE_GPUAttributes GPUAttributes = {0};
|
||||
|
||||
GPUAttributes.iGpuOrdinal = deviceCount;
|
||||
hr = NVGetParamValue(self->encoder.pInst, NVVE_GET_GPU_ATTRIBUTES, &GPUAttributes);
|
||||
if(FAILED(hr))
|
||||
{
|
||||
if(FAILED(hr)) {
|
||||
TSK_DEBUG_ERROR("NVGetParamValue(NVVE_GET_GPU_ATTRIBUTES) failed with error code = %08x", hr);
|
||||
continue;
|
||||
}
|
||||
|
@ -705,8 +660,7 @@ int cuda_codec_h264_open_encoder(cuda_codec_h264_t* self)
|
|||
temp = GPUAttributes.iClockRate * GPUAttributes.iMultiProcessorCount;
|
||||
temp = temp * CudaUtils::ConvertSMVer2Cores(GPUAttributes.iMajor, GPUAttributes.iMinor);
|
||||
|
||||
if(temp > gpuPerf)
|
||||
{
|
||||
if(temp > gpuPerf) {
|
||||
gpuPerf = temp;
|
||||
bestGPU = deviceCount;
|
||||
}
|
||||
|
@ -763,22 +717,18 @@ int cuda_codec_h264_open_encoder(cuda_codec_h264_t* self)
|
|||
self->encoder.ctxParams.iDisableSPSPPS = 1; // Do not include SPS/PPS frames
|
||||
self->encoder.ctxParams.iNaluFramingType = 0; // StartCodes
|
||||
self->encoder.ctxParams.iMultiGPU = 1;
|
||||
switch(common->profile)
|
||||
{
|
||||
case profile_idc_baseline:
|
||||
{
|
||||
switch(common->profile) {
|
||||
case profile_idc_baseline: {
|
||||
self->encoder.ctxParams.iDisableCabac = 1;
|
||||
self->encoder.ctxParams.iProfileLevel = 0xff42; // 0xff -> autoselect level
|
||||
break;
|
||||
}
|
||||
case profile_idc_main:
|
||||
{
|
||||
case profile_idc_main: {
|
||||
self->encoder.ctxParams.iDisableCabac = 0;
|
||||
self->encoder.ctxParams.iProfileLevel = 0xff4d; // 0xff -> autoselect level
|
||||
break;
|
||||
}
|
||||
default:
|
||||
{
|
||||
default: {
|
||||
CHECK_HR(hr = E_NOTIMPL);
|
||||
break;
|
||||
}
|
||||
|
@ -788,8 +738,7 @@ int cuda_codec_h264_open_encoder(cuda_codec_h264_t* self)
|
|||
// Allocate memory
|
||||
//
|
||||
self->encoder.nBufferSize = (self->encoder.ctxParams.iOutputSize[1] * self->encoder.ctxParams.iOutputSize[0] * 3) >> 4;
|
||||
if(!self->encoder.pBufferPtr && !(self->encoder.pBufferPtr = tsk_realloc(self->encoder.pBufferPtr, self->encoder.nBufferSize)))
|
||||
{
|
||||
if(!self->encoder.pBufferPtr && !(self->encoder.pBufferPtr = tsk_realloc(self->encoder.pBufferPtr, self->encoder.nBufferSize))) {
|
||||
self->encoder.nBufferSize = 0;
|
||||
CHECK_HR(hr = E_OUTOFMEMORY);
|
||||
}
|
||||
|
@ -798,40 +747,116 @@ int cuda_codec_h264_open_encoder(cuda_codec_h264_t* self)
|
|||
// Set parameters
|
||||
//
|
||||
hr = NVSetParamValue(self->encoder.pInst, NVVE_FORCE_GPU_SELECTION, &self->encoder.ctxParams.iForcedGPU);
|
||||
if(FAILED(hr))
|
||||
{
|
||||
if(FAILED(hr)) {
|
||||
TSK_DEBUG_WARN("NVSetParamValue(NVVE_FORCE_GPU_SELECTION) failed with error code = %08x", hr);
|
||||
}
|
||||
CHECK_HR(hr = NVSetParamValue(self->encoder.pInst, NVVE_DEVICE_MEMORY_INPUT, &(self->encoder.ctxParams.iUseDeviceMem)));
|
||||
hr = NVSetParamValue(self->encoder.pInst,NVVE_OUT_SIZE, &(self->encoder.ctxParams.iOutputSize)); if (hr!=S_OK) { TSK_DEBUG_WARN("NVSetParamValue(NVVE_OUT_SIZE) failed with error code = %08x", hr); }
|
||||
hr = NVSetParamValue(self->encoder.pInst,NVVE_IN_SIZE, &(self->encoder.ctxParams.iInputSize)); if (hr!=S_OK) { TSK_DEBUG_WARN("NVSetParamValue(NVVE_IN_SIZE) failed with error code = %08x", hr); }
|
||||
hr = NVSetParamValue(self->encoder.pInst,NVVE_MULTI_GPU, &(self->encoder.ctxParams.iMultiGPU)); if (hr!=S_OK) { TSK_DEBUG_WARN("NVSetParamValue(NVVE_MULTI_GPU) failed with error code = %08x", hr); }
|
||||
hr = NVSetParamValue(self->encoder.pInst,NVVE_ASPECT_RATIO, &(self->encoder.ctxParams.iAspectRatio));if (hr!=S_OK) { TSK_DEBUG_WARN("NVSetParamValue(NVVE_ASPECT_RATIO) failed with error code = %08x", hr); }
|
||||
hr = NVSetParamValue(self->encoder.pInst,NVVE_FIELD_ENC_MODE, &(self->encoder.ctxParams.Fieldmode)); if (hr!=S_OK) { TSK_DEBUG_WARN("NVSetParamValue(NVVE_FIELD_ENC_MODE) failed with error code = %08x", hr); }
|
||||
hr = NVSetParamValue(self->encoder.pInst,NVVE_P_INTERVAL, &(self->encoder.ctxParams.iP_Interval)); if (hr!=S_OK) { TSK_DEBUG_WARN("NVSetParamValue(NVVE_P_INTERVAL) failed with error code = %08x", hr); }
|
||||
hr = NVSetParamValue(self->encoder.pInst,NVVE_IDR_PERIOD, &(self->encoder.ctxParams.iIDR_Period)); if (hr!=S_OK) { TSK_DEBUG_WARN("NVSetParamValue(NVVE_IDR_PERIOD) failed with error code = %08x", hr); }
|
||||
hr = NVSetParamValue(self->encoder.pInst,NVVE_DYNAMIC_GOP, &(self->encoder.ctxParams.iDynamicGOP)); if (hr!=S_OK) { TSK_DEBUG_WARN("NVSetParamValue(NVVE_DYNAMIC_GOP) failed with error code = %08x", hr); }
|
||||
hr = NVSetParamValue(self->encoder.pInst,NVVE_RC_TYPE, &(self->encoder.ctxParams.RCType)); if (hr!=S_OK) { TSK_DEBUG_WARN("NVSetParamValue(NVVE_RC_TYPE) failed with error code = %08x", hr); }
|
||||
hr = NVSetParamValue(self->encoder.pInst,NVVE_AVG_BITRATE, &(self->encoder.ctxParams.iAvgBitrate)); if (hr!=S_OK) { TSK_DEBUG_WARN("NVSetParamValue(NVVE_AVG_BITRATE) failed with error code = %08x", hr); }
|
||||
hr = NVSetParamValue(self->encoder.pInst,NVVE_PEAK_BITRATE, &(self->encoder.ctxParams.iPeakBitrate)); if (hr!=S_OK) { TSK_DEBUG_WARN("NVSetParamValue(NVVE_PEAK_BITRATE) failed with error code = %08x", hr); }
|
||||
hr = NVSetParamValue(self->encoder.pInst,NVVE_QP_LEVEL_INTRA, &(self->encoder.ctxParams.iQP_Level_Intra)); if (hr!=S_OK) { TSK_DEBUG_WARN("NVSetParamValue(NVVE_OUT_SIZE) failed with error code = %08x", hr); }
|
||||
hr = NVSetParamValue(self->encoder.pInst,NVVE_QP_LEVEL_INTER_P,&(self->encoder.ctxParams.iQP_Level_InterP)); if (hr!=S_OK) { TSK_DEBUG_WARN("NVSetParamValue(NVVE_QP_LEVEL_INTER_P) failed with error code = %08x", hr); }
|
||||
hr = NVSetParamValue(self->encoder.pInst,NVVE_QP_LEVEL_INTER_B,&(self->encoder.ctxParams.iQP_Level_InterB)); if (hr!=S_OK) { TSK_DEBUG_WARN("NVSetParamValue(NVVE_QP_LEVEL_INTER_B) failed with error code = %08x", hr); }
|
||||
hr = NVSetParamValue(self->encoder.pInst,NVVE_FRAME_RATE, &(self->encoder.ctxParams.iFrameRate)); if (hr!=S_OK) { TSK_DEBUG_WARN("NVSetParamValue(NVVE_FRAME_RATE) failed with error code = %08x", hr); }
|
||||
hr = NVSetParamValue(self->encoder.pInst,NVVE_DEBLOCK_MODE, &(self->encoder.ctxParams.iDeblockMode)); if (hr!=S_OK) { TSK_DEBUG_WARN("NVSetParamValue(NVVE_DEBLOCK_MODE) failed with error code = %08x", hr); }
|
||||
hr = NVSetParamValue(self->encoder.pInst,NVVE_PROFILE_LEVEL, &(self->encoder.ctxParams.iProfileLevel)); if (hr!=S_OK) { TSK_DEBUG_WARN("NVSetParamValue(NVVE_PROFILE_LEVEL) failed with error code = %08x", hr); }
|
||||
hr = NVSetParamValue(self->encoder.pInst,NVVE_FORCE_INTRA, &(self->encoder.ctxParams.iForceIntra)); if (hr!=S_OK) { TSK_DEBUG_WARN("NVSetParamValue(NVVE_FORCE_INTRA) failed with error code = %08x", hr); }
|
||||
hr = NVSetParamValue(self->encoder.pInst,NVVE_FORCE_IDR, &(self->encoder.ctxParams.iForceIDR)); if (hr!=S_OK) { TSK_DEBUG_WARN("NVSetParamValue(NVVE_FORCE_IDR) failed with error code = %08x", hr); }
|
||||
hr = NVSetParamValue(self->encoder.pInst,NVVE_CLEAR_STAT, &(self->encoder.ctxParams.iClearStat)); if (hr!=S_OK) { TSK_DEBUG_WARN("NVSetParamValue(NVVE_CLEAR_STAT) failed with error code = %08x", hr); }
|
||||
hr = NVSetParamValue(self->encoder.pInst,NVVE_SET_DEINTERLACE,&(self->encoder.ctxParams.DIMode)); if (hr!=S_OK) { TSK_DEBUG_WARN("NVSetParamValue(NVVE_SET_DEINTERLACE) failed with error code = %08x", hr); }
|
||||
if (self->encoder.ctxParams.Presets != -1)
|
||||
{
|
||||
hr = NVSetParamValue(self->encoder.pInst,NVVE_PRESETS, &(self->encoder.ctxParams.Presets)); if (hr!=S_OK) { TSK_DEBUG_WARN("NVSetParamValue(NVVE_PRESETS) failed with error code = %08x", hr); }
|
||||
hr = NVSetParamValue(self->encoder.pInst,NVVE_OUT_SIZE, &(self->encoder.ctxParams.iOutputSize));
|
||||
if (hr!=S_OK) {
|
||||
TSK_DEBUG_WARN("NVSetParamValue(NVVE_OUT_SIZE) failed with error code = %08x", hr);
|
||||
}
|
||||
hr = NVSetParamValue(self->encoder.pInst,NVVE_IN_SIZE, &(self->encoder.ctxParams.iInputSize));
|
||||
if (hr!=S_OK) {
|
||||
TSK_DEBUG_WARN("NVSetParamValue(NVVE_IN_SIZE) failed with error code = %08x", hr);
|
||||
}
|
||||
hr = NVSetParamValue(self->encoder.pInst,NVVE_MULTI_GPU, &(self->encoder.ctxParams.iMultiGPU));
|
||||
if (hr!=S_OK) {
|
||||
TSK_DEBUG_WARN("NVSetParamValue(NVVE_MULTI_GPU) failed with error code = %08x", hr);
|
||||
}
|
||||
hr = NVSetParamValue(self->encoder.pInst,NVVE_ASPECT_RATIO, &(self->encoder.ctxParams.iAspectRatio));
|
||||
if (hr!=S_OK) {
|
||||
TSK_DEBUG_WARN("NVSetParamValue(NVVE_ASPECT_RATIO) failed with error code = %08x", hr);
|
||||
}
|
||||
hr = NVSetParamValue(self->encoder.pInst,NVVE_FIELD_ENC_MODE, &(self->encoder.ctxParams.Fieldmode));
|
||||
if (hr!=S_OK) {
|
||||
TSK_DEBUG_WARN("NVSetParamValue(NVVE_FIELD_ENC_MODE) failed with error code = %08x", hr);
|
||||
}
|
||||
hr = NVSetParamValue(self->encoder.pInst,NVVE_P_INTERVAL, &(self->encoder.ctxParams.iP_Interval));
|
||||
if (hr!=S_OK) {
|
||||
TSK_DEBUG_WARN("NVSetParamValue(NVVE_P_INTERVAL) failed with error code = %08x", hr);
|
||||
}
|
||||
hr = NVSetParamValue(self->encoder.pInst,NVVE_IDR_PERIOD, &(self->encoder.ctxParams.iIDR_Period));
|
||||
if (hr!=S_OK) {
|
||||
TSK_DEBUG_WARN("NVSetParamValue(NVVE_IDR_PERIOD) failed with error code = %08x", hr);
|
||||
}
|
||||
hr = NVSetParamValue(self->encoder.pInst,NVVE_DYNAMIC_GOP, &(self->encoder.ctxParams.iDynamicGOP));
|
||||
if (hr!=S_OK) {
|
||||
TSK_DEBUG_WARN("NVSetParamValue(NVVE_DYNAMIC_GOP) failed with error code = %08x", hr);
|
||||
}
|
||||
hr = NVSetParamValue(self->encoder.pInst,NVVE_RC_TYPE, &(self->encoder.ctxParams.RCType));
|
||||
if (hr!=S_OK) {
|
||||
TSK_DEBUG_WARN("NVSetParamValue(NVVE_RC_TYPE) failed with error code = %08x", hr);
|
||||
}
|
||||
hr = NVSetParamValue(self->encoder.pInst,NVVE_AVG_BITRATE, &(self->encoder.ctxParams.iAvgBitrate));
|
||||
if (hr!=S_OK) {
|
||||
TSK_DEBUG_WARN("NVSetParamValue(NVVE_AVG_BITRATE) failed with error code = %08x", hr);
|
||||
}
|
||||
hr = NVSetParamValue(self->encoder.pInst,NVVE_PEAK_BITRATE, &(self->encoder.ctxParams.iPeakBitrate));
|
||||
if (hr!=S_OK) {
|
||||
TSK_DEBUG_WARN("NVSetParamValue(NVVE_PEAK_BITRATE) failed with error code = %08x", hr);
|
||||
}
|
||||
hr = NVSetParamValue(self->encoder.pInst,NVVE_QP_LEVEL_INTRA, &(self->encoder.ctxParams.iQP_Level_Intra));
|
||||
if (hr!=S_OK) {
|
||||
TSK_DEBUG_WARN("NVSetParamValue(NVVE_OUT_SIZE) failed with error code = %08x", hr);
|
||||
}
|
||||
hr = NVSetParamValue(self->encoder.pInst,NVVE_QP_LEVEL_INTER_P,&(self->encoder.ctxParams.iQP_Level_InterP));
|
||||
if (hr!=S_OK) {
|
||||
TSK_DEBUG_WARN("NVSetParamValue(NVVE_QP_LEVEL_INTER_P) failed with error code = %08x", hr);
|
||||
}
|
||||
hr = NVSetParamValue(self->encoder.pInst,NVVE_QP_LEVEL_INTER_B,&(self->encoder.ctxParams.iQP_Level_InterB));
|
||||
if (hr!=S_OK) {
|
||||
TSK_DEBUG_WARN("NVSetParamValue(NVVE_QP_LEVEL_INTER_B) failed with error code = %08x", hr);
|
||||
}
|
||||
hr = NVSetParamValue(self->encoder.pInst,NVVE_FRAME_RATE, &(self->encoder.ctxParams.iFrameRate));
|
||||
if (hr!=S_OK) {
|
||||
TSK_DEBUG_WARN("NVSetParamValue(NVVE_FRAME_RATE) failed with error code = %08x", hr);
|
||||
}
|
||||
hr = NVSetParamValue(self->encoder.pInst,NVVE_DEBLOCK_MODE, &(self->encoder.ctxParams.iDeblockMode));
|
||||
if (hr!=S_OK) {
|
||||
TSK_DEBUG_WARN("NVSetParamValue(NVVE_DEBLOCK_MODE) failed with error code = %08x", hr);
|
||||
}
|
||||
hr = NVSetParamValue(self->encoder.pInst,NVVE_PROFILE_LEVEL, &(self->encoder.ctxParams.iProfileLevel));
|
||||
if (hr!=S_OK) {
|
||||
TSK_DEBUG_WARN("NVSetParamValue(NVVE_PROFILE_LEVEL) failed with error code = %08x", hr);
|
||||
}
|
||||
hr = NVSetParamValue(self->encoder.pInst,NVVE_FORCE_INTRA, &(self->encoder.ctxParams.iForceIntra));
|
||||
if (hr!=S_OK) {
|
||||
TSK_DEBUG_WARN("NVSetParamValue(NVVE_FORCE_INTRA) failed with error code = %08x", hr);
|
||||
}
|
||||
hr = NVSetParamValue(self->encoder.pInst,NVVE_FORCE_IDR, &(self->encoder.ctxParams.iForceIDR));
|
||||
if (hr!=S_OK) {
|
||||
TSK_DEBUG_WARN("NVSetParamValue(NVVE_FORCE_IDR) failed with error code = %08x", hr);
|
||||
}
|
||||
hr = NVSetParamValue(self->encoder.pInst,NVVE_CLEAR_STAT, &(self->encoder.ctxParams.iClearStat));
|
||||
if (hr!=S_OK) {
|
||||
TSK_DEBUG_WARN("NVSetParamValue(NVVE_CLEAR_STAT) failed with error code = %08x", hr);
|
||||
}
|
||||
hr = NVSetParamValue(self->encoder.pInst,NVVE_SET_DEINTERLACE,&(self->encoder.ctxParams.DIMode));
|
||||
if (hr!=S_OK) {
|
||||
TSK_DEBUG_WARN("NVSetParamValue(NVVE_SET_DEINTERLACE) failed with error code = %08x", hr);
|
||||
}
|
||||
if (self->encoder.ctxParams.Presets != -1) {
|
||||
hr = NVSetParamValue(self->encoder.pInst,NVVE_PRESETS, &(self->encoder.ctxParams.Presets));
|
||||
if (hr!=S_OK) {
|
||||
TSK_DEBUG_WARN("NVSetParamValue(NVVE_PRESETS) failed with error code = %08x", hr);
|
||||
}
|
||||
}
|
||||
hr = NVSetParamValue(self->encoder.pInst,NVVE_DISABLE_CABAC, &(self->encoder.ctxParams.iDisableCabac));
|
||||
if (hr!=S_OK) {
|
||||
TSK_DEBUG_WARN("NVSetParamValue(NVVE_DISABLE_CABAC) failed with error code = %08x", hr);
|
||||
}
|
||||
hr = NVSetParamValue(self->encoder.pInst,NVVE_CONFIGURE_NALU_FRAMING_TYPE, &(self->encoder.ctxParams.iNaluFramingType));
|
||||
if (hr!=S_OK) {
|
||||
TSK_DEBUG_WARN("NVSetParamValue(NVVE_CONFIGURE_NALU_FRAMING_TYPE) failed with error code = %08x", hr);
|
||||
}
|
||||
hr = NVSetParamValue(self->encoder.pInst,NVVE_DISABLE_SPS_PPS,&(self->encoder.ctxParams.iDisableSPSPPS));
|
||||
if (hr!=S_OK) {
|
||||
TSK_DEBUG_WARN("NVSetParamValue(NVVE_DISABLE_SPS_PPS) failed with error code = %08x", hr);
|
||||
}
|
||||
hr = NVSetParamValue(self->encoder.pInst,NVVE_LOW_LATENCY,&low_latency);
|
||||
if (hr!=S_OK) {
|
||||
TSK_DEBUG_WARN("NVSetParamValue(NVVE_LOW_LATENCY) failed with error code = %08x", hr);
|
||||
}
|
||||
hr = NVSetParamValue(self->encoder.pInst,NVVE_DISABLE_CABAC, &(self->encoder.ctxParams.iDisableCabac)); if (hr!=S_OK) { TSK_DEBUG_WARN("NVSetParamValue(NVVE_DISABLE_CABAC) failed with error code = %08x", hr); }
|
||||
hr = NVSetParamValue(self->encoder.pInst,NVVE_CONFIGURE_NALU_FRAMING_TYPE, &(self->encoder.ctxParams.iNaluFramingType)); if (hr!=S_OK) { TSK_DEBUG_WARN("NVSetParamValue(NVVE_CONFIGURE_NALU_FRAMING_TYPE) failed with error code = %08x", hr); }
|
||||
hr = NVSetParamValue(self->encoder.pInst,NVVE_DISABLE_SPS_PPS,&(self->encoder.ctxParams.iDisableSPSPPS)); if (hr!=S_OK) { TSK_DEBUG_WARN("NVSetParamValue(NVVE_DISABLE_SPS_PPS) failed with error code = %08x", hr); }
|
||||
hr = NVSetParamValue(self->encoder.pInst,NVVE_LOW_LATENCY,&low_latency); if (hr!=S_OK) { TSK_DEBUG_WARN("NVSetParamValue(NVVE_LOW_LATENCY) failed with error code = %08x", hr); }
|
||||
|
||||
self->encoder.clbParams.pfnacquirebitstream = _NVCallback_HandleAcquireBitStream;
|
||||
self->encoder.clbParams.pfnonbeginframe = _NVCallback_HandleOnBeginFrame;
|
||||
|
@ -848,15 +873,12 @@ bail:
|
|||
|
||||
int cuda_codec_h264_close_encoder(cuda_codec_h264_t* self)
|
||||
{
|
||||
if(self)
|
||||
{
|
||||
if(self->encoder.pInst)
|
||||
{
|
||||
if(self) {
|
||||
if(self->encoder.pInst) {
|
||||
NVDestroyEncoder(self->encoder.pInst);
|
||||
self->encoder.pInst = NULL;
|
||||
}
|
||||
if(self->encoder.pBufferPtr)
|
||||
{
|
||||
if(self->encoder.pBufferPtr) {
|
||||
TSK_FREE(self->encoder.pBufferPtr);
|
||||
self->encoder.nBufferSize = 0;
|
||||
}
|
||||
|
@ -874,8 +896,7 @@ int cuda_codec_h264_open_decoder(cuda_codec_h264_t* self)
|
|||
CUresult cuResult;
|
||||
D3DPRESENT_PARAMETERS d3dpp;
|
||||
|
||||
if(self->decoder.pInst || self->decoder.cuDevice || self->decoder.cuContext || self->decoder.pD3D9 || self->decoder.pD3D9Device)
|
||||
{
|
||||
if(self->decoder.pInst || self->decoder.cuDevice || self->decoder.cuContext || self->decoder.pD3D9 || self->decoder.pD3D9Device) {
|
||||
TSK_DEBUG_ERROR("Decoder already initialized");
|
||||
#if defined(E_ILLEGAL_METHOD_CALL)
|
||||
CHECK_HR(hr = E_ILLEGAL_METHOD_CALL);
|
||||
|
@ -921,13 +942,11 @@ int cuda_codec_h264_open_decoder(cuda_codec_h264_t* self)
|
|||
|
||||
// create Direct3D instance
|
||||
self->decoder.pD3D9 = Direct3DCreate9(D3D_SDK_VERSION);
|
||||
if(!self->decoder.pD3D9)
|
||||
{
|
||||
if(!self->decoder.pD3D9) {
|
||||
CHECK_HR(hr = E_OUTOFMEMORY);
|
||||
}
|
||||
adapterCount = self->decoder.pD3D9->GetAdapterCount();
|
||||
for(i = 0; i < adapterCount; ++i)
|
||||
{
|
||||
for(i = 0; i < adapterCount; ++i) {
|
||||
ZeroMemory(&d3dpp, sizeof(d3dpp));
|
||||
d3dpp.Windowed = TRUE;
|
||||
d3dpp.BackBufferFormat = D3DFMT_X8R8G8B8;
|
||||
|
@ -943,24 +962,20 @@ int cuda_codec_h264_open_decoder(cuda_codec_h264_t* self)
|
|||
D3DCREATE_FPU_PRESERVE | D3DCREATE_MULTITHREADED | D3DCREATE_HARDWARE_VERTEXPROCESSING,
|
||||
&d3dpp,
|
||||
&self->decoder.pD3D9Device);
|
||||
if(hr == S_OK)
|
||||
{
|
||||
if(hr == S_OK) {
|
||||
cuResult = cuD3D9CtxCreate(&self->decoder.cuContext, &self->decoder.cuDevice, 0, self->decoder.pD3D9Device);
|
||||
if(cuResult == CUDA_SUCCESS)
|
||||
{
|
||||
if(cuResult == CUDA_SUCCESS) {
|
||||
break;
|
||||
}
|
||||
SafeRelease(&self->decoder.pD3D9Device);
|
||||
if(self->decoder.cuContext)
|
||||
{
|
||||
if(self->decoder.cuContext) {
|
||||
cuCtxDestroy(self->decoder.cuContext);
|
||||
self->decoder.cuContext = NULL;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(!self->decoder.pD3D9Device)
|
||||
{
|
||||
if(!self->decoder.pD3D9Device) {
|
||||
TSK_DEBUG_ERROR("Failed to create D3D9 device");
|
||||
CHECK_HR(hr = E_FAIL);
|
||||
}
|
||||
|
@ -974,21 +989,18 @@ int cuda_codec_h264_open_decoder(cuda_codec_h264_t* self)
|
|||
self->decoder.cuPaserParams.pfnDecodePicture = _NVCallback_HandlePictureDecode;
|
||||
self->decoder.cuPaserParams.pfnDisplayPicture = _NVCallback_HandlePictureDisplay;
|
||||
cuResult = cuvidCreateVideoParser(&self->decoder.cuParser, &self->decoder.cuPaserParams);
|
||||
if(cuResult != CUDA_SUCCESS)
|
||||
{
|
||||
if(cuResult != CUDA_SUCCESS) {
|
||||
TSK_DEBUG_ERROR("cuvidCreateVideoParser(0) failed with error code = %d", (int)cuResult);
|
||||
CHECK_HR(hr = E_FAIL);
|
||||
}
|
||||
|
||||
cuResult = cuvidCreateDecoder(&self->decoder.pInst, &self->decoder.cuInfo);
|
||||
if(CUDA_SUCCESS != cuResult)
|
||||
{
|
||||
if(CUDA_SUCCESS != cuResult) {
|
||||
TSK_DEBUG_ERROR("cuvidCreateDecoder failed with error code=%d", (int)cuResult);
|
||||
CHECK_HR(hr = E_FAIL);
|
||||
}
|
||||
|
||||
if(!self->decoder.phMutex && !(self->decoder.phMutex = tsk_mutex_create()))
|
||||
{
|
||||
if(!self->decoder.phMutex && !(self->decoder.phMutex = tsk_mutex_create())) {
|
||||
TSK_DEBUG_ERROR("Failed to create mutex");
|
||||
CHECK_HR(hr = E_FAIL);
|
||||
}
|
||||
|
@ -999,28 +1011,23 @@ bail:
|
|||
|
||||
int cuda_codec_h264_close_decoder(cuda_codec_h264_t* self)
|
||||
{
|
||||
if(self)
|
||||
{
|
||||
if(self->decoder.pInst)
|
||||
{
|
||||
if(self) {
|
||||
if(self->decoder.pInst) {
|
||||
cuvidDestroyDecoder(self->decoder.pInst);
|
||||
self->decoder.pInst = NULL;
|
||||
}
|
||||
if(self->decoder.cuContext)
|
||||
{
|
||||
if(self->decoder.cuContext) {
|
||||
cuCtxDestroy(self->decoder.cuContext);
|
||||
self->decoder.cuContext = NULL;
|
||||
}
|
||||
SafeRelease(&self->decoder.pD3D9Device);
|
||||
SafeRelease(&self->decoder.pD3D9);
|
||||
if(self->decoder.cuParser)
|
||||
{
|
||||
if(self->decoder.cuParser) {
|
||||
cuvidDestroyVideoParser(self->decoder.cuParser);
|
||||
self->decoder.cuParser = NULL;
|
||||
}
|
||||
{/* cuBuffer.XXX */
|
||||
if(self->decoder.cuBuffer.pcuPtr)
|
||||
{
|
||||
if(self->decoder.cuBuffer.pcuPtr) {
|
||||
cuMemFreeHost(self->decoder.cuBuffer.pcuPtr);
|
||||
self->decoder.cuBuffer.pcuPtr = NULL;
|
||||
}
|
||||
|
@ -1028,8 +1035,7 @@ int cuda_codec_h264_close_decoder(cuda_codec_h264_t* self)
|
|||
self->decoder.cuBuffer.bAvail = tsk_false;
|
||||
}
|
||||
|
||||
if(self->decoder.phMutex)
|
||||
{
|
||||
if(self->decoder.phMutex) {
|
||||
tsk_mutex_destroy(&self->decoder.phMutex);
|
||||
}
|
||||
|
||||
|
@ -1046,22 +1052,19 @@ int cuda_codec_h264_init(cuda_codec_h264_t* self, profile_idc_t profile)
|
|||
level_idc_t level;
|
||||
tdav_codec_h264_common_t* common = (tdav_codec_h264_common_t*)self;
|
||||
|
||||
if(!self)
|
||||
{
|
||||
if(!self) {
|
||||
TSK_DEBUG_ERROR("Invalid parameter");
|
||||
return -1;
|
||||
}
|
||||
|
||||
CudaUtils::Startup();
|
||||
|
||||
if((ret = tdav_codec_h264_common_init(common)))
|
||||
{
|
||||
if((ret = tdav_codec_h264_common_init(common))) {
|
||||
TSK_DEBUG_ERROR("cuda_codec_h264_common_init() faile with error code=%d", ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
if((ret = tdav_codec_h264_common_level_from_size(TMEDIA_CODEC_VIDEO(self)->out.width, TMEDIA_CODEC_VIDEO(self)->out.height, &level)))
|
||||
{
|
||||
if((ret = tdav_codec_h264_common_level_from_size(TMEDIA_CODEC_VIDEO(self)->out.width, TMEDIA_CODEC_VIDEO(self)->out.height, &level))) {
|
||||
TSK_DEBUG_ERROR("Failed to find level for size=[%u, %u]", TMEDIA_CODEC_VIDEO(self)->out.width, TMEDIA_CODEC_VIDEO(self)->out.height);
|
||||
return ret;
|
||||
}
|
||||
|
@ -1083,8 +1086,7 @@ int cuda_codec_h264_init(cuda_codec_h264_t* self, profile_idc_t profile)
|
|||
|
||||
int cuda_codec_h264_deinit(cuda_codec_h264_t* self)
|
||||
{
|
||||
if(!self)
|
||||
{
|
||||
if(!self) {
|
||||
TSK_DEBUG_ERROR("Invalid parameter");
|
||||
return -1;
|
||||
}
|
||||
|
@ -1096,8 +1098,7 @@ int cuda_codec_h264_deinit(cuda_codec_h264_t* self)
|
|||
|
||||
static inline tsk_size_t _cuda_codec_h264_pict_layout(cuda_codec_h264_t* self, void**output, tsk_size_t *output_size)
|
||||
{
|
||||
if(self && self->decoder.cuBuffer.pcuPtr && self->decoder.cuBuffer.nSize)
|
||||
{
|
||||
if(self && self->decoder.cuBuffer.pcuPtr && self->decoder.cuBuffer.nSize) {
|
||||
const unsigned int w = TMEDIA_CODEC_VIDEO(self)->in.width;
|
||||
const unsigned int w_div_2 = (w >> 1);
|
||||
const unsigned int h = TMEDIA_CODEC_VIDEO(self)->in.height;
|
||||
|
@ -1106,14 +1107,11 @@ static inline tsk_size_t _cuda_codec_h264_pict_layout(cuda_codec_h264_t* self, v
|
|||
const unsigned int pitch_div_2 = (pitch >> 1);
|
||||
const tsk_size_t xsize = (w * h * 3) >> 1;
|
||||
// resize if too short
|
||||
if(*output_size < xsize)
|
||||
{
|
||||
if((*output = tsk_realloc(*output, xsize)))
|
||||
{
|
||||
if(*output_size < xsize) {
|
||||
if((*output = tsk_realloc(*output, xsize))) {
|
||||
*output_size = xsize;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
*output_size = 0;
|
||||
return 0;
|
||||
}
|
||||
|
@ -1124,8 +1122,7 @@ static inline tsk_size_t _cuda_codec_h264_pict_layout(cuda_codec_h264_t* self, v
|
|||
const unsigned char *p = (const unsigned char *)self->decoder.cuBuffer.pcuPtr, *q = p + (h * pitch);
|
||||
register unsigned char *i = (unsigned char *)*output, *j = i + (h * w);
|
||||
|
||||
for (y = 0; y < h; y++)
|
||||
{
|
||||
for (y = 0; y < h; y++) {
|
||||
// luma
|
||||
memcpy(i, p, w);
|
||||
i += w;
|
||||
|
@ -1134,8 +1131,7 @@ static inline tsk_size_t _cuda_codec_h264_pict_layout(cuda_codec_h264_t* self, v
|
|||
// chroma
|
||||
memcpy(j, &q[(y&1) ? w_div_2 : 0], w_div_2);
|
||||
j += w_div_2;
|
||||
if(y&1)
|
||||
{
|
||||
if(y&1) {
|
||||
q += pitch;
|
||||
}
|
||||
}
|
||||
|
@ -1152,8 +1148,7 @@ static int CUDAAPI _NVCallback_HandleVideoSequence(void *pvUserData, CUVIDEOFORM
|
|||
cuda_codec_h264_t* h264 = (cuda_codec_h264_t*)pvUserData;
|
||||
CUresult cuResult;
|
||||
|
||||
if(!h264 || !pFormat)
|
||||
{
|
||||
if(!h264 || !pFormat) {
|
||||
TSK_DEBUG_ERROR("Invalid parameter");
|
||||
return 0;//error
|
||||
}
|
||||
|
@ -1169,8 +1164,7 @@ static int CUDAAPI _NVCallback_HandleVideoSequence(void *pvUserData, CUVIDEOFORM
|
|||
int newWidth = pFormat->coded_width;//pFormat->display_area.right - pFormat->display_area.left;
|
||||
int newHeight = pFormat->coded_height;//pFormat->display_area.bottom - pFormat->display_area.top;
|
||||
|
||||
if(newWidth != TMEDIA_CODEC_VIDEO(h264)->in.width || pFormat->coded_height != newHeight)
|
||||
{
|
||||
if(newWidth != TMEDIA_CODEC_VIDEO(h264)->in.width || pFormat->coded_height != newHeight) {
|
||||
TSK_DEBUG_INFO("[H.264 CUDA decoder] display area = left:%d, right:%d, bottom:%d, top:%d",
|
||||
pFormat->display_area.left,
|
||||
pFormat->display_area.right,
|
||||
|
@ -1184,27 +1178,23 @@ static int CUDAAPI _NVCallback_HandleVideoSequence(void *pvUserData, CUVIDEOFORM
|
|||
h264->decoder.cuInfo.ulTargetHeight = newHeight;
|
||||
|
||||
CUresult cuResult = cuCtxPushCurrent(h264->decoder.cuContext);
|
||||
if(cuResult != CUDA_SUCCESS)
|
||||
{
|
||||
if(cuResult != CUDA_SUCCESS) {
|
||||
TSK_DEBUG_ERROR("cuCtxPushCurrent failed with error code=%d", (int)cuResult);
|
||||
ret = 0; //error
|
||||
goto bail;
|
||||
}
|
||||
|
||||
if(h264->decoder.pInst)
|
||||
{
|
||||
if(h264->decoder.pInst) {
|
||||
cuvidDestroyDecoder(h264->decoder.pInst);
|
||||
h264->decoder.pInst = NULL;
|
||||
}
|
||||
cuResult = cuvidCreateDecoder(&h264->decoder.pInst, &h264->decoder.cuInfo);
|
||||
if(CUDA_SUCCESS != cuResult)
|
||||
{
|
||||
if(CUDA_SUCCESS != cuResult) {
|
||||
TSK_DEBUG_ERROR("cuvidCreateDecoder failed with error code=%d", (int)cuResult);
|
||||
ret = 0; //error
|
||||
goto bail;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
TMEDIA_CODEC_VIDEO(h264)->in.width = /*pFormat->coded_width*/newWidth;
|
||||
TMEDIA_CODEC_VIDEO(h264)->in.height = /*pFormat->coded_height*/newHeight;
|
||||
ret = 1; //success
|
||||
|
@ -1219,8 +1209,7 @@ bail:
|
|||
static int CUDAAPI _NVCallback_HandlePictureDecode(void *pvUserData, CUVIDPICPARAMS *pPicParams)
|
||||
{
|
||||
cuda_codec_h264_t* h264 = (cuda_codec_h264_t*)pvUserData;
|
||||
if(!h264 || !pPicParams)
|
||||
{
|
||||
if(!h264 || !pPicParams) {
|
||||
TSK_DEBUG_ERROR("Invalid parameter");
|
||||
return 0;//error
|
||||
}
|
||||
|
@ -1229,8 +1218,7 @@ static int CUDAAPI _NVCallback_HandlePictureDecode(void *pvUserData, CUVIDPICPAR
|
|||
CUresult cuResult = cuvidDecodePicture(h264->decoder.pInst, pPicParams);
|
||||
tsk_mutex_unlock(h264->decoder.phMutex);
|
||||
|
||||
if(cuResult != CUDA_SUCCESS)
|
||||
{
|
||||
if(cuResult != CUDA_SUCCESS) {
|
||||
TSK_DEBUG_ERROR("cuvidDecodePicture failed with error code= %d", cuResult);
|
||||
return 0;//error
|
||||
}
|
||||
|
@ -1248,15 +1236,13 @@ static int CUDAAPI _NVCallback_HandlePictureDisplay(void *pvUserData, CUVIDPARSE
|
|||
tsk_bool_t mapped = tsk_false;
|
||||
int ret = 1;//success
|
||||
|
||||
if(!h264 || !pPicParams)
|
||||
{
|
||||
if(!h264 || !pPicParams) {
|
||||
TSK_DEBUG_ERROR("Invalid parameter");
|
||||
return 0;//error
|
||||
}
|
||||
|
||||
cuResult = cuCtxPushCurrent(h264->decoder.cuContext);
|
||||
if(cuResult != CUDA_SUCCESS)
|
||||
{
|
||||
if(cuResult != CUDA_SUCCESS) {
|
||||
TSK_DEBUG_ERROR("cuCtxPushCurrent failed with error code = %d", (int)cuResult);
|
||||
ret = 0;//error
|
||||
goto bail;
|
||||
|
@ -1266,43 +1252,36 @@ static int CUDAAPI _NVCallback_HandlePictureDisplay(void *pvUserData, CUVIDPARSE
|
|||
vpp.top_field_first = pPicParams->top_field_first;
|
||||
cuResult = cuvidMapVideoFrame(h264->decoder.pInst, pPicParams->picture_index, &devPtr, &h264->decoder.cuBuffer.nPitch, &vpp);
|
||||
|
||||
if(cuResult != CUDA_SUCCESS)
|
||||
{
|
||||
if(cuResult != CUDA_SUCCESS) {
|
||||
TSK_DEBUG_ERROR("cuvidMapVideoFrame failed with error code = %d", (int)cuResult);
|
||||
ret = 0;//error
|
||||
goto bail;
|
||||
}
|
||||
mapped = tsk_true;
|
||||
nv12_size = ((h264->decoder.cuBuffer.nPitch * TMEDIA_CODEC_VIDEO(h264)->in.height) * 3) >> 1;
|
||||
if ((!h264->decoder.cuBuffer.pcuPtr) || (nv12_size > h264->decoder.cuBuffer.nSize))
|
||||
{
|
||||
if ((!h264->decoder.cuBuffer.pcuPtr) || (nv12_size > h264->decoder.cuBuffer.nSize)) {
|
||||
h264->decoder.cuBuffer.nSize = 0;
|
||||
if (h264->decoder.cuBuffer.pcuPtr)
|
||||
{
|
||||
if (h264->decoder.cuBuffer.pcuPtr) {
|
||||
cuResult = cuMemFreeHost(h264->decoder.cuBuffer.pcuPtr);
|
||||
h264->decoder.cuBuffer.pcuPtr = NULL;
|
||||
}
|
||||
cuResult = cuMemAllocHost((void**)&h264->decoder.cuBuffer.pcuPtr, nv12_size);
|
||||
if (cuResult != CUDA_SUCCESS)
|
||||
{
|
||||
if (cuResult != CUDA_SUCCESS) {
|
||||
TSK_DEBUG_ERROR("cuMemAllocHost failed to allocate %d bytes (error code=%d)", nv12_size, (int)cuResult);
|
||||
h264->decoder.cuBuffer.pcuPtr = tsk_null;
|
||||
h264->decoder.cuBuffer.nSize = 0;
|
||||
ret = 0;//error
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
h264->decoder.cuBuffer.nSize = nv12_size;
|
||||
}
|
||||
}
|
||||
if(h264->decoder.cuBuffer.pcuPtr)
|
||||
{
|
||||
if(h264->decoder.cuBuffer.pcuPtr) {
|
||||
cuResult = cuMemcpyDtoH(h264->decoder.cuBuffer.pcuPtr, devPtr, nv12_size);
|
||||
}
|
||||
|
||||
bail:
|
||||
if(mapped)
|
||||
{
|
||||
if(mapped) {
|
||||
cuResult = cuvidUnmapVideoFrame(h264->decoder.pInst, devPtr);
|
||||
}
|
||||
cuResult = cuCtxPopCurrent(NULL);
|
||||
|
@ -1314,8 +1293,7 @@ bail:
|
|||
static unsigned char* CUDAAPI _NVCallback_HandleAcquireBitStream(int *pBufferSize, void *pUserdata)
|
||||
{
|
||||
cuda_codec_h264_t* h264 = (cuda_codec_h264_t*)pUserdata;
|
||||
if(!h264 || !pBufferSize)
|
||||
{
|
||||
if(!h264 || !pBufferSize) {
|
||||
TSK_DEBUG_ERROR("Invalid parameter");
|
||||
return tsk_null;
|
||||
}
|
||||
|
@ -1327,8 +1305,7 @@ static unsigned char* CUDAAPI _NVCallback_HandleAcquireBitStream(int *pBufferSiz
|
|||
static void CUDAAPI _NVCallback_HandleReleaseBitStream(int nBytesInBuffer, unsigned char *cb, void *pUserdata)
|
||||
{
|
||||
tdav_codec_h264_common_t* common = (tdav_codec_h264_common_t*)pUserdata;
|
||||
if(!common || !cb || !nBytesInBuffer)
|
||||
{
|
||||
if(!common || !cb || !nBytesInBuffer) {
|
||||
TSK_DEBUG_ERROR("Invalid parameter");
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -31,19 +31,15 @@ int CudaUtils::g_nCores = 0;
|
|||
|
||||
HRESULT CudaUtils::Startup()
|
||||
{
|
||||
if(!g_bStarted)
|
||||
{
|
||||
if(!g_bStarted) {
|
||||
CUresult cuResult = CUDA_SUCCESS;
|
||||
HRESULT hr = CoInitializeEx(NULL, COINIT_MULTITHREADED);
|
||||
if(SUCCEEDED(hr) || hr == 0x80010106) // 0x80010106 when called from managed code (e.g. Boghe) - More info: http://support.microsoft.com/kb/824480
|
||||
{
|
||||
if((cuResult = cuInit(0)) != CUDA_SUCCESS)
|
||||
{
|
||||
if(SUCCEEDED(hr) || hr == 0x80010106) { // 0x80010106 when called from managed code (e.g. Boghe) - More info: http://support.microsoft.com/kb/824480
|
||||
if((cuResult = cuInit(0)) != CUDA_SUCCESS) {
|
||||
TSK_DEBUG_ERROR("cuInit() failed with error code = %08x", cuResult);
|
||||
hr = E_FAIL;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
hr = S_OK;
|
||||
}
|
||||
}
|
||||
|
@ -61,8 +57,7 @@ HRESULT CudaUtils::Shutdown()
|
|||
|
||||
bool CudaUtils::IsH264Supported()
|
||||
{
|
||||
if(g_bH264Checked)
|
||||
{
|
||||
if(g_bH264Checked) {
|
||||
return g_bH264Supported;
|
||||
}
|
||||
|
||||
|
@ -83,8 +78,7 @@ bool CudaUtils::IsH264Supported()
|
|||
g_bH264Supported = true;
|
||||
|
||||
bail:
|
||||
if(pEncoder)
|
||||
{
|
||||
if(pEncoder) {
|
||||
NVDestroyEncoder(pEncoder);
|
||||
pEncoder = NULL;
|
||||
}
|
||||
|
@ -94,20 +88,17 @@ bail:
|
|||
|
||||
int CudaUtils::ConvertSMVer2Cores(int nMajor, int nMinor)
|
||||
{
|
||||
if(g_nCores != 0)
|
||||
{
|
||||
if(g_nCores != 0) {
|
||||
return g_nCores;
|
||||
}
|
||||
|
||||
// Defines for GPU Architecture types (using the SM version to determine the # of cores per SM
|
||||
typedef struct
|
||||
{
|
||||
typedef struct {
|
||||
int SM; // 0xMm (hexidecimal notation), M = SM Major version, and m = SM minor version
|
||||
int Cores;
|
||||
} sSMtoCores;
|
||||
|
||||
sSMtoCores nGpuArchCoresPerSM[] =
|
||||
{
|
||||
sSMtoCores nGpuArchCoresPerSM[] = {
|
||||
{ 0x10, 8 }, // Tesla Generation (SM 1.0) G80 class
|
||||
{ 0x11, 8 }, // Tesla Generation (SM 1.1) G8x class
|
||||
{ 0x12, 8 }, // Tesla Generation (SM 1.2) G9x class
|
||||
|
@ -120,10 +111,8 @@ int CudaUtils::ConvertSMVer2Cores(int nMajor, int nMinor)
|
|||
|
||||
int index = 0;
|
||||
|
||||
while (nGpuArchCoresPerSM[index].SM != -1)
|
||||
{
|
||||
if (nGpuArchCoresPerSM[index].SM == ((nMajor << 4) + nMinor))
|
||||
{
|
||||
while (nGpuArchCoresPerSM[index].SM != -1) {
|
||||
if (nGpuArchCoresPerSM[index].SM == ((nMajor << 4) + nMinor)) {
|
||||
g_nCores = nGpuArchCoresPerSM[index].Cores;
|
||||
break;
|
||||
}
|
||||
|
@ -152,12 +141,10 @@ int CudaUtils::GetMaxGflopsDeviceId()
|
|||
max_gflops = device_properties.multiProcessorCount * device_properties.clockRate;
|
||||
++current_device;
|
||||
|
||||
while( current_device < device_count )
|
||||
{
|
||||
while( current_device < device_count ) {
|
||||
cudaGetDeviceProperties( &device_properties, current_device );
|
||||
int gflops = device_properties.multiProcessorCount * device_properties.clockRate;
|
||||
if( gflops > max_gflops )
|
||||
{
|
||||
if( gflops > max_gflops ) {
|
||||
max_gflops = gflops;
|
||||
max_gflops_device = current_device;
|
||||
}
|
||||
|
|
|
@ -42,8 +42,9 @@ extern const tmedia_consumer_plugin_def_t *plugin_video_dshow_consumer_plugin_de
|
|||
extern const tmedia_producer_plugin_def_t *plugin_video_dshow_producer_plugin_def_t;
|
||||
extern const tmedia_producer_plugin_def_t *plugin_screencast_dshow_producer_plugin_def_t;
|
||||
|
||||
CFactoryTemplate g_Templates[]=
|
||||
{ { L""
|
||||
CFactoryTemplate g_Templates[]= {
|
||||
{
|
||||
L""
|
||||
, NULL
|
||||
, NULL
|
||||
, NULL
|
||||
|
@ -58,8 +59,7 @@ BOOL APIENTRY DllMain( HMODULE hModule,
|
|||
LPVOID lpReserved
|
||||
)
|
||||
{
|
||||
switch (ul_reason_for_call)
|
||||
{
|
||||
switch (ul_reason_for_call) {
|
||||
case DLL_PROCESS_ATTACH:
|
||||
case DLL_THREAD_ATTACH:
|
||||
case DLL_THREAD_DETACH:
|
||||
|
@ -70,8 +70,7 @@ BOOL APIENTRY DllMain( HMODULE hModule,
|
|||
}
|
||||
#endif
|
||||
|
||||
typedef enum PLUGIN_INDEX_E
|
||||
{
|
||||
typedef enum PLUGIN_INDEX_E {
|
||||
PLUGIN_INDEX_VIDEO_CONSUMER,
|
||||
PLUGIN_INDEX_VIDEO_PRODUCER,
|
||||
#if 0
|
||||
|
@ -97,8 +96,7 @@ tsk_plugin_def_type_t __plugin_get_def_type_at(int index)
|
|||
case PLUGIN_INDEX_SCREENCAST_PRODUCER:
|
||||
#endif
|
||||
return tsk_plugin_def_type_producer;
|
||||
default:
|
||||
{
|
||||
default: {
|
||||
TSK_DEBUG_ERROR("No plugin at index %d", index);
|
||||
return tsk_plugin_def_type_none;
|
||||
}
|
||||
|
@ -108,22 +106,18 @@ tsk_plugin_def_type_t __plugin_get_def_type_at(int index)
|
|||
tsk_plugin_def_media_type_t __plugin_get_def_media_type_at(int index)
|
||||
{
|
||||
switch(index) {
|
||||
case PLUGIN_INDEX_VIDEO_CONSUMER:
|
||||
{
|
||||
case PLUGIN_INDEX_VIDEO_CONSUMER: {
|
||||
return IsD3D9Supported() ? tsk_plugin_def_media_type_video : tsk_plugin_def_media_type_none;
|
||||
}
|
||||
case PLUGIN_INDEX_VIDEO_PRODUCER:
|
||||
{
|
||||
case PLUGIN_INDEX_VIDEO_PRODUCER: {
|
||||
return tsk_plugin_def_media_type_video;
|
||||
}
|
||||
#if ENABLE_SCREENCAST
|
||||
case PLUGIN_INDEX_SCREENCAST_PRODUCER:
|
||||
{
|
||||
case PLUGIN_INDEX_SCREENCAST_PRODUCER: {
|
||||
return tsk_plugin_def_media_type_screencast;
|
||||
}
|
||||
#endif
|
||||
default:
|
||||
{
|
||||
default: {
|
||||
TSK_DEBUG_ERROR("No plugin at index %d", index);
|
||||
return tsk_plugin_def_media_type_none;
|
||||
}
|
||||
|
@ -133,22 +127,18 @@ tsk_plugin_def_media_type_t __plugin_get_def_media_type_at(int index)
|
|||
tsk_plugin_def_ptr_const_t __plugin_get_def_at(int index)
|
||||
{
|
||||
switch(index) {
|
||||
case PLUGIN_INDEX_VIDEO_CONSUMER:
|
||||
{
|
||||
case PLUGIN_INDEX_VIDEO_CONSUMER: {
|
||||
return IsD3D9Supported() ? plugin_video_dshow_consumer_plugin_def_t : tsk_null;
|
||||
}
|
||||
case PLUGIN_INDEX_VIDEO_PRODUCER:
|
||||
{
|
||||
case PLUGIN_INDEX_VIDEO_PRODUCER: {
|
||||
return plugin_video_dshow_producer_plugin_def_t;
|
||||
}
|
||||
#if ENABLE_SCREENCAST
|
||||
case PLUGIN_INDEX_SCREENCAST_PRODUCER:
|
||||
{
|
||||
case PLUGIN_INDEX_SCREENCAST_PRODUCER: {
|
||||
return plugin_screencast_dshow_producer_plugin_def_t;
|
||||
}
|
||||
#endif
|
||||
default:
|
||||
{
|
||||
default: {
|
||||
TSK_DEBUG_ERROR("No plugin at index %d", index);
|
||||
return tsk_null;
|
||||
}
|
||||
|
|
|
@ -43,17 +43,37 @@ int DSCaptureFormat::getMatchScore(int w, int h)
|
|||
bool DSCaptureFormat::isRGB()
|
||||
{
|
||||
// Order used is optimized for most used RGB types
|
||||
if (IsEqualGUID(this->chroma, MEDIASUBTYPE_RGB32)) return true;
|
||||
if (IsEqualGUID(this->chroma, MEDIASUBTYPE_RGB24)) return true;
|
||||
if (IsEqualGUID(this->chroma, MEDIASUBTYPE_RGB565)) return true;
|
||||
if (IsEqualGUID(this->chroma, MEDIASUBTYPE_RGB555)) return true;
|
||||
if (IsEqualGUID(this->chroma, MEDIASUBTYPE_RGB8)) return true;
|
||||
if (IsEqualGUID(this->chroma, MEDIASUBTYPE_RGB4)) return true;
|
||||
if (IsEqualGUID(this->chroma, MEDIASUBTYPE_RGB1)) return true;
|
||||
if (IsEqualGUID(this->chroma, MEDIASUBTYPE_RGB32)) {
|
||||
return true;
|
||||
}
|
||||
if (IsEqualGUID(this->chroma, MEDIASUBTYPE_RGB24)) {
|
||||
return true;
|
||||
}
|
||||
if (IsEqualGUID(this->chroma, MEDIASUBTYPE_RGB565)) {
|
||||
return true;
|
||||
}
|
||||
if (IsEqualGUID(this->chroma, MEDIASUBTYPE_RGB555)) {
|
||||
return true;
|
||||
}
|
||||
if (IsEqualGUID(this->chroma, MEDIASUBTYPE_RGB8)) {
|
||||
return true;
|
||||
}
|
||||
if (IsEqualGUID(this->chroma, MEDIASUBTYPE_RGB4)) {
|
||||
return true;
|
||||
}
|
||||
if (IsEqualGUID(this->chroma, MEDIASUBTYPE_RGB1)) {
|
||||
return true;
|
||||
}
|
||||
#ifndef _WIN32_WCE
|
||||
if (IsEqualGUID(this->chroma, MEDIASUBTYPE_ARGB32)) return true;
|
||||
if (IsEqualGUID(this->chroma, MEDIASUBTYPE_ARGB4444)) return true;
|
||||
if (IsEqualGUID(this->chroma, MEDIASUBTYPE_ARGB1555)) return true;
|
||||
if (IsEqualGUID(this->chroma, MEDIASUBTYPE_ARGB32)) {
|
||||
return true;
|
||||
}
|
||||
if (IsEqualGUID(this->chroma, MEDIASUBTYPE_ARGB4444)) {
|
||||
return true;
|
||||
}
|
||||
if (IsEqualGUID(this->chroma, MEDIASUBTYPE_ARGB1555)) {
|
||||
return true;
|
||||
}
|
||||
#endif
|
||||
|
||||
return false;
|
||||
|
|
|
@ -28,10 +28,18 @@ public:
|
|||
DSCaptureFormat(int w, int h, int f, GUID c) : width(w), height(h), fps(f), chroma(c) {};
|
||||
virtual ~DSCaptureFormat() {};
|
||||
|
||||
int getWidth() { return this->width; };
|
||||
int getHeight() { return this->height; };
|
||||
int getFramerate() { return this->fps; };
|
||||
GUID getChroma() { return this->chroma; };
|
||||
int getWidth() {
|
||||
return this->width;
|
||||
};
|
||||
int getHeight() {
|
||||
return this->height;
|
||||
};
|
||||
int getFramerate() {
|
||||
return this->fps;
|
||||
};
|
||||
GUID getChroma() {
|
||||
return this->chroma;
|
||||
};
|
||||
|
||||
int getMatchScore(int w, int h);
|
||||
bool isRGB();
|
||||
|
|
|
@ -122,10 +122,14 @@ HRESULT DSCaptureGraph::setParameters(DSCaptureFormat *format, int framerate)
|
|||
HRESULT hr = E_FAIL;
|
||||
AM_MEDIA_TYPE *mediaType = NULL;
|
||||
|
||||
if (!this->streamConfiguration) goto bail;
|
||||
if (!this->streamConfiguration) {
|
||||
goto bail;
|
||||
}
|
||||
|
||||
hr = this->streamConfiguration->GetFormat(&mediaType);
|
||||
if (FAILED(hr)) goto bail;
|
||||
if (FAILED(hr)) {
|
||||
goto bail;
|
||||
}
|
||||
|
||||
VIDEOINFOHEADER* vih = reinterpret_cast<VIDEOINFOHEADER*>(mediaType->pbFormat);
|
||||
BITMAPINFOHEADER* bih = &vih->bmiHeader;
|
||||
|
@ -152,17 +156,23 @@ HRESULT DSCaptureGraph::setParameters(DSCaptureFormat *format, int framerate)
|
|||
mediaType->subtype = format->getChroma();
|
||||
|
||||
hr = this->streamConfiguration->SetFormat(mediaType);
|
||||
if (FAILED(hr)) goto bail;
|
||||
if (FAILED(hr)) {
|
||||
goto bail;
|
||||
}
|
||||
|
||||
#if defined(_WIN32_WCE)
|
||||
hr = this->grabberController->SetFps((int) DS_SECONDS_FROM_100NS(vih->AvgTimePerFrame)/*format->getFramerate()*/, framerate);
|
||||
if (FAILED(hr)) goto bail;
|
||||
if (FAILED(hr)) {
|
||||
goto bail;
|
||||
}
|
||||
hr = this->grabberController->SetSize(w,h);
|
||||
#else
|
||||
// Set fps using tdshow filter
|
||||
hr = this->frameRateFilter->SetFps((int) ((float)vih->AvgTimePerFrame/10000.f)/*format->getFramerate()*/, framerate);
|
||||
#endif
|
||||
if (FAILED(hr)) goto bail;
|
||||
if (FAILED(hr)) {
|
||||
goto bail;
|
||||
}
|
||||
|
||||
this->captureFormat = format;
|
||||
|
||||
|
@ -195,30 +205,73 @@ HRESULT DSCaptureGraph::connect()
|
|||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (this->captureFormat->isRGB())
|
||||
{
|
||||
if (this->captureFormat->isRGB()) {
|
||||
#if defined(_WIN32_WCE)
|
||||
hr = ConnectFilters(this->graphBuilder, this->sourceFilter, this->colorConvertor565) ; if(FAILED(hr)) { TSK_DEBUG_ERROR("ConnectFilters failed"); return hr; }
|
||||
hr = ConnectFilters(this->graphBuilder, this->colorConvertor565, this->sampleGrabberFilter) ; if(FAILED(hr)) { TSK_DEBUG_ERROR("ConnectFilters failed"); return hr; }
|
||||
hr = ConnectFilters(this->graphBuilder, this->sampleGrabberFilter, this->nullRendererFilter); if(FAILED(hr)) { TSK_DEBUG_ERROR("ConnectFilters failed"); return hr; }
|
||||
hr = ConnectFilters(this->graphBuilder, this->sourceFilter, this->colorConvertor565) ;
|
||||
if(FAILED(hr)) {
|
||||
TSK_DEBUG_ERROR("ConnectFilters failed");
|
||||
return hr;
|
||||
}
|
||||
hr = ConnectFilters(this->graphBuilder, this->colorConvertor565, this->sampleGrabberFilter) ;
|
||||
if(FAILED(hr)) {
|
||||
TSK_DEBUG_ERROR("ConnectFilters failed");
|
||||
return hr;
|
||||
}
|
||||
hr = ConnectFilters(this->graphBuilder, this->sampleGrabberFilter, this->nullRendererFilter);
|
||||
if(FAILED(hr)) {
|
||||
TSK_DEBUG_ERROR("ConnectFilters failed");
|
||||
return hr;
|
||||
}
|
||||
#else
|
||||
hr = ConnectFilters(this->graphBuilder, this->sourceFilter, this->frameRateFilter); if(FAILED(hr)) { TSK_DEBUG_ERROR("ConnectFilters failed"); return hr; }
|
||||
hr = ConnectFilters(this->graphBuilder, this->frameRateFilter, this->sampleGrabberFilter); if(FAILED(hr)) { TSK_DEBUG_ERROR("ConnectFilters failed"); return hr; }
|
||||
hr = ConnectFilters(this->graphBuilder, this->sampleGrabberFilter, this->nullRendererFilter); if(FAILED(hr)) { TSK_DEBUG_ERROR("ConnectFilters failed"); return hr; }
|
||||
hr = ConnectFilters(this->graphBuilder, this->sourceFilter, this->frameRateFilter);
|
||||
if(FAILED(hr)) {
|
||||
TSK_DEBUG_ERROR("ConnectFilters failed");
|
||||
return hr;
|
||||
}
|
||||
hr = ConnectFilters(this->graphBuilder, this->frameRateFilter, this->sampleGrabberFilter);
|
||||
if(FAILED(hr)) {
|
||||
TSK_DEBUG_ERROR("ConnectFilters failed");
|
||||
return hr;
|
||||
}
|
||||
hr = ConnectFilters(this->graphBuilder, this->sampleGrabberFilter, this->nullRendererFilter);
|
||||
if(FAILED(hr)) {
|
||||
TSK_DEBUG_ERROR("ConnectFilters failed");
|
||||
return hr;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
#if defined(_WIN32_WCE)
|
||||
hr = ConnectFilters(this->graphBuilder, this->sourceFilter, this->colorConvertor565) ; if(FAILED(hr))return hr;
|
||||
hr = ConnectFilters(this->graphBuilder, this->colorConvertor565, this->sampleGrabberFilter) ; if(FAILED(hr))return hr;
|
||||
hr = ConnectFilters(this->graphBuilder, this->sampleGrabberFilter, this->nullRendererFilter); if(FAILED(hr))return hr;
|
||||
hr = ConnectFilters(this->graphBuilder, this->sourceFilter, this->colorConvertor565) ;
|
||||
if(FAILED(hr)) {
|
||||
return hr;
|
||||
}
|
||||
hr = ConnectFilters(this->graphBuilder, this->colorConvertor565, this->sampleGrabberFilter) ;
|
||||
if(FAILED(hr)) {
|
||||
return hr;
|
||||
}
|
||||
hr = ConnectFilters(this->graphBuilder, this->sampleGrabberFilter, this->nullRendererFilter);
|
||||
if(FAILED(hr)) {
|
||||
return hr;
|
||||
}
|
||||
#else
|
||||
// No convertor needed
|
||||
// AVI Decompressor Filter is automatically by the Filter Graph Manager when needed
|
||||
hr = ConnectFilters(this->graphBuilder, this->sourceFilter, this->frameRateFilter); if(FAILED(hr)) { TSK_DEBUG_ERROR("ConnectFilters failed"); return hr; }
|
||||
hr = ConnectFilters(this->graphBuilder, this->frameRateFilter, this->sampleGrabberFilter); if(FAILED(hr)) { TSK_DEBUG_ERROR("ConnectFilters failed"); return hr; }
|
||||
hr = ConnectFilters(this->graphBuilder, this->sampleGrabberFilter, this->nullRendererFilter); if(FAILED(hr)) { TSK_DEBUG_ERROR("ConnectFilters failed"); return hr; }
|
||||
hr = ConnectFilters(this->graphBuilder, this->sourceFilter, this->frameRateFilter);
|
||||
if(FAILED(hr)) {
|
||||
TSK_DEBUG_ERROR("ConnectFilters failed");
|
||||
return hr;
|
||||
}
|
||||
hr = ConnectFilters(this->graphBuilder, this->frameRateFilter, this->sampleGrabberFilter);
|
||||
if(FAILED(hr)) {
|
||||
TSK_DEBUG_ERROR("ConnectFilters failed");
|
||||
return hr;
|
||||
}
|
||||
hr = ConnectFilters(this->graphBuilder, this->sampleGrabberFilter, this->nullRendererFilter);
|
||||
if(FAILED(hr)) {
|
||||
TSK_DEBUG_ERROR("ConnectFilters failed");
|
||||
return hr;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@ -237,8 +290,7 @@ HRESULT DSCaptureGraph::disconnect()
|
|||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (this->captureFormat->isRGB())
|
||||
{
|
||||
if (this->captureFormat->isRGB()) {
|
||||
#if defined(_WIN32_WCE)
|
||||
hr = DisconnectFilters(this->graphBuilder, this->sourceFilter, this->colorConvertor565);
|
||||
hr = DisconnectFilters(this->graphBuilder, this->colorConvertor565, this->sampleGrabberFilter);
|
||||
|
@ -249,12 +301,20 @@ HRESULT DSCaptureGraph::disconnect()
|
|||
hr = DisconnectFilters(this->graphBuilder, this->sampleGrabberFilter, this->nullRendererFilter);
|
||||
#endif
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
#if defined(_WIN32_WCE)
|
||||
hr = DisconnectFilters(this->graphBuilder, this->sourceFilter, this->colorConvertor565); if(FAILED(hr))return hr;
|
||||
hr = DisconnectFilters(this->graphBuilder, this->colorConvertor565, this->sampleGrabberFilter); if(FAILED(hr))return hr;
|
||||
hr = DisconnectFilters(this->graphBuilder, this->sampleGrabberFilter, this->nullRendererFilter); if(FAILED(hr))return hr;
|
||||
hr = DisconnectFilters(this->graphBuilder, this->sourceFilter, this->colorConvertor565);
|
||||
if(FAILED(hr)) {
|
||||
return hr;
|
||||
}
|
||||
hr = DisconnectFilters(this->graphBuilder, this->colorConvertor565, this->sampleGrabberFilter);
|
||||
if(FAILED(hr)) {
|
||||
return hr;
|
||||
}
|
||||
hr = DisconnectFilters(this->graphBuilder, this->sampleGrabberFilter, this->nullRendererFilter);
|
||||
if(FAILED(hr)) {
|
||||
return hr;
|
||||
}
|
||||
#else
|
||||
hr = DisconnectFilters(this->graphBuilder, this->sourceFilter, this->frameRateFilter);
|
||||
hr = DisconnectFilters(this->graphBuilder, this->frameRateFilter, this->sampleGrabberFilter);
|
||||
|
@ -284,8 +344,7 @@ HRESULT DSCaptureGraph::start()
|
|||
hr = this->mediaController->Run();
|
||||
}*/
|
||||
|
||||
if (!SUCCEEDED(hr))
|
||||
{
|
||||
if (!SUCCEEDED(hr)) {
|
||||
#if defined(_WIN32_WCE)
|
||||
MessageBox(NULL, _T("Starting DirectShow Graph Failed"), _T("Failure"), MB_OK);
|
||||
//assert(1==15);
|
||||
|
@ -314,16 +373,14 @@ HRESULT DSCaptureGraph::stop()
|
|||
HRESULT hr;
|
||||
#if 0 // Must not
|
||||
hr = this->mediaController->Pause();
|
||||
if (hr == S_FALSE)
|
||||
{
|
||||
if (hr == S_FALSE) {
|
||||
TSK_DEBUG_ERROR("DSCaptureGraph::mediaController->Pause() has failed with %ld. Waiting for transition.", hr);
|
||||
FILTER_STATE pfs;
|
||||
hr = this->mediaController->GetState(2500, (OAFilterState*) &pfs);
|
||||
}
|
||||
#endif
|
||||
hr = this->mediaController->Stop();
|
||||
if (!SUCCEEDED(hr))
|
||||
{
|
||||
if (!SUCCEEDED(hr)) {
|
||||
TSK_DEBUG_ERROR("DSCaptureGraph::mediaController->Stop() has failed with %ld", hr);
|
||||
}
|
||||
this->running = false;
|
||||
|
@ -364,9 +421,14 @@ HRESULT DSCaptureGraph::createCaptureGraph()
|
|||
// Create filters
|
||||
LPUNKNOWN pUnk1 = NULL, pUnk2 = NULL;
|
||||
CHECK_HR(hr = COCREATE(CLSID_Colour, IID_IBaseFilter, this->colorConvertor565));
|
||||
this->sampleGrabberFilter = new DSSampleGrabber(FITLER_SAMPLE_GRABBER, pUnk1, &hr); CHECK_HR(hr);
|
||||
this->nullRendererFilter = new DSNullFilter(/*FILTER_NULL_RENDERER,*/ pUnk2, &hr); CHECK_HR(hr);
|
||||
this->grabberController = (DSSampleGrabber*)(this->sampleGrabberFilter); if (!this->grabberController) CHECK_HR(E_FAIL);
|
||||
this->sampleGrabberFilter = new DSSampleGrabber(FITLER_SAMPLE_GRABBER, pUnk1, &hr);
|
||||
CHECK_HR(hr);
|
||||
this->nullRendererFilter = new DSNullFilter(/*FILTER_NULL_RENDERER,*/ pUnk2, &hr);
|
||||
CHECK_HR(hr);
|
||||
this->grabberController = (DSSampleGrabber*)(this->sampleGrabberFilter);
|
||||
if (!this->grabberController) {
|
||||
CHECK_HR(E_FAIL);
|
||||
}
|
||||
|
||||
// Add Filters
|
||||
CHECK_HR(hr = this->graphBuilder->AddFilter(this->colorConvertor565, FILTER_COLOR_CONVERTOR_565));
|
||||
|
@ -393,8 +455,11 @@ HRESULT DSCaptureGraph::createCaptureGraph()
|
|||
|
||||
// Create tdshow filter
|
||||
LPUNKNOWN pUnk = NULL;
|
||||
this->frameRateFilter = new DSFrameRateFilter(FILTER_FRAMERATE, pUnk, &hr); CHECK_HR(hr);
|
||||
if (!this->frameRateFilter == NULL) CHECK_HR(E_FAIL);
|
||||
this->frameRateFilter = new DSFrameRateFilter(FILTER_FRAMERATE, pUnk, &hr);
|
||||
CHECK_HR(hr);
|
||||
if (!this->frameRateFilter == NULL) {
|
||||
CHECK_HR(E_FAIL);
|
||||
}
|
||||
|
||||
// Create the NULL renderer
|
||||
CHECK_HR(hr = COCREATE(CLSID_NullRenderer, IID_IBaseFilter, this->nullRendererFilter));
|
||||
|
|
|
@ -43,7 +43,9 @@ public:
|
|||
#endif
|
||||
virtual ~DSCaptureGraph();
|
||||
|
||||
std::vector<DSCaptureFormat> *getFormats() { return &this->supportedFormats; };
|
||||
std::vector<DSCaptureFormat> *getFormats() {
|
||||
return &this->supportedFormats;
|
||||
};
|
||||
|
||||
HRESULT setSource(const std::string &devicePath);
|
||||
HRESULT setParameters(DSCaptureFormat *format, int framerate);
|
||||
|
@ -57,7 +59,9 @@ public:
|
|||
bool isRunning();
|
||||
bool isPaused();
|
||||
|
||||
std::string getDeviceId() const { return this->deviceId; };
|
||||
std::string getDeviceId() const {
|
||||
return this->deviceId;
|
||||
};
|
||||
|
||||
HRESULT getConnectedMediaType(AM_MEDIA_TYPE *mediaType);
|
||||
|
||||
|
|
|
@ -46,39 +46,41 @@ HRESULT enumerateCaptureDevices(const std::string &prefix, std::vector<VideoGrab
|
|||
HANDLE handle = NULL;
|
||||
DEVMGR_DEVICE_INFORMATION di;
|
||||
|
||||
TCHAR pwzName[MAX_PATH]; memset(pwzName,NULL,MAX_PATH);
|
||||
TCHAR pwzName[MAX_PATH];
|
||||
memset(pwzName,NULL,MAX_PATH);
|
||||
|
||||
GUID guidCamera = { 0xCB998A05, 0x122C, 0x4166, 0x84, 0x6A,
|
||||
0x93, 0x3E, 0x4D, 0x7E, 0x3C, 0x86 }; // http://msdn.microsoft.com/en-us/library/aa918757.aspx
|
||||
0x93, 0x3E, 0x4D, 0x7E, 0x3C, 0x86
|
||||
}; // http://msdn.microsoft.com/en-us/library/aa918757.aspx
|
||||
|
||||
di.dwSize = sizeof(di);
|
||||
|
||||
for( int i=0; ; i++)
|
||||
{
|
||||
if(0 == i)
|
||||
{ /* 1st time */
|
||||
for( int i=0; ; i++) {
|
||||
if(0 == i) {
|
||||
/* 1st time */
|
||||
handle = FindFirstDevice( DeviceSearchByGuid, &guidCamera, &di );
|
||||
if(!handle || !di.hDevice)
|
||||
{
|
||||
if(!handle || !di.hDevice) {
|
||||
hr = ( HRESULT_FROM_WIN32( GetLastError() ));
|
||||
goto bail;
|
||||
}
|
||||
}
|
||||
else if(handle)
|
||||
{ /* 2nd or 3rd time */
|
||||
else if(handle) {
|
||||
/* 2nd or 3rd time */
|
||||
BOOL ret = FindNextDevice(handle, &di);
|
||||
if(!ret || !di.hDevice)
|
||||
{
|
||||
if(!ret || !di.hDevice) {
|
||||
/* No 2nd or 3rd camera ==> do not return error*/
|
||||
goto bail;
|
||||
}
|
||||
}
|
||||
else assert(0);
|
||||
else {
|
||||
assert(0);
|
||||
}
|
||||
|
||||
StringCchCopy( pwzName, MAX_PATH, di.szDeviceName );
|
||||
|
||||
/* from LPWSTR to LPSTR */
|
||||
char mbstr_name[MAX_PATH]; memset(mbstr_name,NULL,MAX_PATH);
|
||||
char mbstr_name[MAX_PATH];
|
||||
memset(mbstr_name,NULL,MAX_PATH);
|
||||
wcstombs(mbstr_name, pwzName, MAX_PATH);
|
||||
|
||||
VideoGrabberName grabberName(std::string((const char*)mbstr_name), std::string((const char*)mbstr_name));
|
||||
|
@ -87,7 +89,9 @@ HRESULT enumerateCaptureDevices(const std::string &prefix, std::vector<VideoGrab
|
|||
|
||||
bail:
|
||||
/* close */
|
||||
if(handle) FindClose( handle );
|
||||
if(handle) {
|
||||
FindClose( handle );
|
||||
}
|
||||
|
||||
#else
|
||||
ICreateDevEnum *deviceEnum;
|
||||
|
@ -96,24 +100,28 @@ bail:
|
|||
|
||||
// Create the System Device Enumerator
|
||||
hr = COCREATE(CLSID_SystemDeviceEnum, IID_ICreateDevEnum, deviceEnum);
|
||||
if (FAILED(hr)) goto bail;
|
||||
if (FAILED(hr)) {
|
||||
goto bail;
|
||||
}
|
||||
|
||||
// Ask for a device enumerator
|
||||
hr = deviceEnum->CreateClassEnumerator(CLSID_VideoInputDeviceCategory, &enumerator, INCLUDE_CATEGORY_FLAG);
|
||||
if (FAILED(hr)) goto bail;
|
||||
if (FAILED(hr)) {
|
||||
goto bail;
|
||||
}
|
||||
|
||||
// hr = S_FALSE and enumerator is NULL if there is no device to enumerate
|
||||
if (!enumerator) goto bail;
|
||||
if (!enumerator) {
|
||||
goto bail;
|
||||
}
|
||||
|
||||
USES_CONVERSION;
|
||||
|
||||
while (enumerator->Next(1, &moniker, NULL) == S_OK)
|
||||
{
|
||||
while (enumerator->Next(1, &moniker, NULL) == S_OK) {
|
||||
// Get the properties bag for each device
|
||||
IPropertyBag *propBag;
|
||||
hr = moniker->BindToStorage(0, 0, IID_IPropertyBag, reinterpret_cast<void**>(&propBag));
|
||||
if (FAILED(hr))
|
||||
{
|
||||
if (FAILED(hr)) {
|
||||
SAFE_RELEASE(moniker);
|
||||
continue;
|
||||
}
|
||||
|
@ -128,22 +136,23 @@ bail:
|
|||
|
||||
// Find the device path (uniqueness is guaranteed)
|
||||
hr = propBag->Read(L"DevicePath", &varName, 0);
|
||||
if (SUCCEEDED(hr))
|
||||
{
|
||||
if (prefix != "") name = prefix + ":";
|
||||
if (SUCCEEDED(hr)) {
|
||||
if (prefix != "") {
|
||||
name = prefix + ":";
|
||||
}
|
||||
name = name + std::string(W2A(varName.bstrVal));
|
||||
}
|
||||
|
||||
// Find friendly name or the description
|
||||
hr = propBag->Read(L"FriendlyName", &varDescription, 0);
|
||||
if (SUCCEEDED(hr))
|
||||
{
|
||||
if (SUCCEEDED(hr)) {
|
||||
description = std::string(W2A(varDescription.bstrVal));
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
hr = propBag->Read(L"Description", &varDescription, 0);
|
||||
if (SUCCEEDED(hr)) description = std::string(W2A(varDescription.bstrVal));
|
||||
if (SUCCEEDED(hr)) {
|
||||
description = std::string(W2A(varDescription.bstrVal));
|
||||
}
|
||||
}
|
||||
|
||||
hr = VariantClear(&varName);
|
||||
|
@ -153,8 +162,7 @@ bail:
|
|||
SAFE_RELEASE(moniker);
|
||||
|
||||
// Add it to the list
|
||||
if (name != "")
|
||||
{
|
||||
if (name != "") {
|
||||
VideoGrabberName grabberName(name, description);
|
||||
names->push_back(grabberName);
|
||||
}
|
||||
|
@ -187,31 +195,31 @@ HRESULT createSourceFilter(std::string *devicePath, IBaseFilter **sourceFilter)
|
|||
CComVariant varCamName;
|
||||
IPersistPropertyBag *propBag = NULL;
|
||||
GUID guidCamera = { 0xCB998A05, 0x122C, 0x4166, 0x84, 0x6A,
|
||||
0x93, 0x3E, 0x4D, 0x7E, 0x3C, 0x86 }; // http://msdn.microsoft.com/en-us/library/aa918757.aspx
|
||||
0x93, 0x3E, 0x4D, 0x7E, 0x3C, 0x86
|
||||
}; // http://msdn.microsoft.com/en-us/library/aa918757.aspx
|
||||
|
||||
di.dwSize = sizeof(di);
|
||||
|
||||
for( int i=0; ; i++)
|
||||
{
|
||||
if(0 == i)
|
||||
{ /* 1st time */
|
||||
for( int i=0; ; i++) {
|
||||
if(0 == i) {
|
||||
/* 1st time */
|
||||
handle = FindFirstDevice( DeviceSearchByGuid, &guidCamera, &di );
|
||||
if(!handle || !di.hDevice)
|
||||
{
|
||||
if(!handle || !di.hDevice) {
|
||||
hr = ( HRESULT_FROM_WIN32( GetLastError() ));
|
||||
goto bail;
|
||||
}
|
||||
}
|
||||
else if(handle)
|
||||
{ /* 2nd or 3rd time */
|
||||
else if(handle) {
|
||||
/* 2nd or 3rd time */
|
||||
BOOL ret = FindNextDevice(handle, &di);
|
||||
if(!ret || !di.hDevice)
|
||||
{
|
||||
if(!ret || !di.hDevice) {
|
||||
/* No 2nd or 3rd camera ==> do not return error*/
|
||||
goto bail;
|
||||
}
|
||||
}
|
||||
else assert(0);
|
||||
else {
|
||||
assert(0);
|
||||
}
|
||||
|
||||
StringCchCopy( pwzName, MAX_PATH, di.szDeviceName );
|
||||
|
||||
|
@ -220,28 +228,34 @@ HRESULT createSourceFilter(std::string *devicePath, IBaseFilter **sourceFilter)
|
|||
memset(mbstr_name,NULL,MAX_PATH);
|
||||
wcstombs(mbstr_name, pwzName, MAX_PATH);
|
||||
|
||||
if((std::string((const char*)mbstr_name) == (*devicePath)) || ("0" == (*devicePath)))
|
||||
{
|
||||
if((std::string((const char*)mbstr_name) == (*devicePath)) || ("0" == (*devicePath))) {
|
||||
varCamName = pwzName;
|
||||
if( varCamName.vt != VT_BSTR )
|
||||
{
|
||||
if( varCamName.vt != VT_BSTR ) {
|
||||
hr = E_OUTOFMEMORY;
|
||||
goto bail;
|
||||
}
|
||||
|
||||
// Create Source filter
|
||||
hr = COCREATE(CLSID_VideoCapture, IID_IBaseFilter, *sourceFilter);
|
||||
if(FAILED(hr)) goto bail;
|
||||
if(FAILED(hr)) {
|
||||
goto bail;
|
||||
}
|
||||
|
||||
// Query PropertyBag
|
||||
hr = QUERY((*sourceFilter), IID_IPersistPropertyBag, propBag);
|
||||
if(FAILED(hr)) goto bail;
|
||||
if(FAILED(hr)) {
|
||||
goto bail;
|
||||
}
|
||||
|
||||
hr = pBag.Write( L"VCapName", &varCamName );
|
||||
if(FAILED(hr)) goto bail;
|
||||
if(FAILED(hr)) {
|
||||
goto bail;
|
||||
}
|
||||
|
||||
hr = propBag->Load( &pBag, NULL );
|
||||
if(FAILED(hr)) goto bail;
|
||||
if(FAILED(hr)) {
|
||||
goto bail;
|
||||
}
|
||||
}
|
||||
}
|
||||
#else
|
||||
|
@ -282,13 +296,14 @@ HRESULT createSourceFilter(std::string *devicePath, IBaseFilter **sourceFilter)
|
|||
|
||||
// Find the device path (uniqueness is guaranteed)
|
||||
hr = propBag->Read(L"DevicePath", &varName, 0);
|
||||
if (SUCCEEDED(hr)) name = std::string(W2A(varName.bstrVal));
|
||||
if (SUCCEEDED(hr)) {
|
||||
name = std::string(W2A(varName.bstrVal));
|
||||
}
|
||||
|
||||
// Check for device path
|
||||
// "Null" means first found
|
||||
if ((name == (*devicePath)) ||
|
||||
("Null" == (*devicePath)))
|
||||
{
|
||||
("Null" == (*devicePath))) {
|
||||
hr = moniker->BindToObject(0, 0, IID_IBaseFilter, reinterpret_cast<void**>(&(*sourceFilter)));
|
||||
if (SUCCEEDED(hr)) {
|
||||
(*devicePath) = name;
|
||||
|
@ -305,7 +320,9 @@ HRESULT createSourceFilter(std::string *devicePath, IBaseFilter **sourceFilter)
|
|||
|
||||
bail:
|
||||
#ifdef _WIN32_WCE
|
||||
if(handle) FindClose(handle);
|
||||
if(handle) {
|
||||
FindClose(handle);
|
||||
}
|
||||
#else
|
||||
SAFE_RELEASE(deviceEnum);
|
||||
#endif
|
||||
|
@ -325,21 +342,31 @@ HRESULT getSupportedFormats(IBaseFilter *sourceFilter, std::vector<DSCaptureForm
|
|||
int count, size;
|
||||
|
||||
// Check source filter pointer
|
||||
if (!sourceFilter) goto bail;
|
||||
if (!sourceFilter) {
|
||||
goto bail;
|
||||
}
|
||||
|
||||
pinOut = GetPin(sourceFilter, PINDIR_OUTPUT);
|
||||
if(!pinOut) goto bail;
|
||||
if(!pinOut) {
|
||||
goto bail;
|
||||
}
|
||||
|
||||
// Retrieve the stream config interface
|
||||
hr = QUERY(pinOut, IID_IAMStreamConfig, streamConfig);
|
||||
if (FAILED(hr)) goto bail;
|
||||
if (FAILED(hr)) {
|
||||
goto bail;
|
||||
}
|
||||
|
||||
// Get the number of capabilities
|
||||
hr = streamConfig->GetNumberOfCapabilities(&count, &size);
|
||||
if (FAILED(hr)) goto bail;
|
||||
if (FAILED(hr)) {
|
||||
goto bail;
|
||||
}
|
||||
|
||||
hr = streamConfig->GetFormat(&mediaType);
|
||||
if (FAILED(hr)) goto bail;
|
||||
if (FAILED(hr)) {
|
||||
goto bail;
|
||||
}
|
||||
|
||||
// Iterate through the formats
|
||||
for (int i = 0; i < count; i++) {
|
||||
|
|
|
@ -22,8 +22,9 @@ HBITMAP CopyScreenToBitmap(LPRECT lpRect, BYTE *pData, BITMAPINFO *pHeader)
|
|||
int xScrn, yScrn; // screen resolution
|
||||
|
||||
// check for an empty rectangle
|
||||
if (IsRectEmpty(lpRect))
|
||||
if (IsRectEmpty(lpRect)) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
// create a DC for the screen and create
|
||||
// a memory DC compatible to screen DC
|
||||
|
@ -41,14 +42,18 @@ HBITMAP CopyScreenToBitmap(LPRECT lpRect, BYTE *pData, BITMAPINFO *pHeader)
|
|||
yScrn = GetDeviceCaps(hScrDC, VERTRES);
|
||||
|
||||
//make sure bitmap rectangle is visible
|
||||
if (nX < 0)
|
||||
if (nX < 0) {
|
||||
nX = 0;
|
||||
if (nY < 0)
|
||||
}
|
||||
if (nY < 0) {
|
||||
nY = 0;
|
||||
if (nX2 > xScrn)
|
||||
}
|
||||
if (nX2 > xScrn) {
|
||||
nX2 = xScrn;
|
||||
if (nY2 > yScrn)
|
||||
}
|
||||
if (nY2 > yScrn) {
|
||||
nY2 = yScrn;
|
||||
}
|
||||
|
||||
nWidth = nX2 - nX;
|
||||
nHeight = nY2 - nY;
|
||||
|
|
|
@ -36,8 +36,7 @@ using namespace std;
|
|||
#define FSCREEN_MIN_IDEAL_WIDTH 352
|
||||
#define FSCREEN_MIN_IDEAL_HEIGHT 288
|
||||
|
||||
typedef struct tdshow_display_s
|
||||
{
|
||||
typedef struct tdshow_display_s {
|
||||
TSK_DECLARE_OBJECT;
|
||||
|
||||
HWND hwnd;
|
||||
|
@ -97,7 +96,9 @@ DSDisplay::DSDisplay(HRESULT *hr)
|
|||
this->fps = 15;
|
||||
|
||||
this->graph = new DSDisplayGraph(hr);
|
||||
if (FAILED(*hr)) return;
|
||||
if (FAILED(*hr)) {
|
||||
return;
|
||||
}
|
||||
#if USE_OVERLAY
|
||||
this->overlay = new DSDisplayOverlay();
|
||||
#else
|
||||
|
@ -345,12 +346,10 @@ void DSDisplay::handleVideoFrame(const void* data, int w, int h)
|
|||
|
||||
LRESULT DSDisplay::handleEvents(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
switch(uMsg)
|
||||
{
|
||||
switch(uMsg) {
|
||||
case WM_CREATE:
|
||||
case WM_SIZE:
|
||||
case WM_MOVE:
|
||||
{
|
||||
case WM_MOVE: {
|
||||
RECT rect = {0};
|
||||
GetWindowRect(hWnd, &rect);
|
||||
applyRatio(rect);
|
||||
|
@ -378,8 +377,7 @@ LRESULT DSDisplay::handleEvents(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lPar
|
|||
case WM_LBUTTONDOWN:
|
||||
case WM_RBUTTONDOWN:
|
||||
case WM_KEYDOWN:
|
||||
if(this->isFullscreen())
|
||||
{
|
||||
if(this->isFullscreen()) {
|
||||
#if USE_OVERLAY
|
||||
// Re-Show overlay
|
||||
this->overlay->show(OVERLAY_TIMEOUT * this->graph->getDisplayFps());
|
||||
|
@ -389,25 +387,21 @@ LRESULT DSDisplay::handleEvents(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lPar
|
|||
|
||||
case WM_CHAR:
|
||||
case WM_KEYUP:
|
||||
if(this->isFullscreen() && (wParam == 0x1B || wParam == VK_ESCAPE))
|
||||
{
|
||||
if(this->isFullscreen() && (wParam == 0x1B || wParam == VK_ESCAPE)) {
|
||||
// escape
|
||||
this->setFullscreen(false);
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case WM_GRAPHNOTIFY:
|
||||
{
|
||||
case WM_GRAPHNOTIFY: {
|
||||
long evCode;
|
||||
LONG_PTR param1, param2;
|
||||
HRESULT hr;
|
||||
while (hr = this->graph->getMediaEvent()->GetEvent(&evCode, ¶m1, ¶m2, 0), SUCCEEDED(hr))
|
||||
{
|
||||
while (hr = this->graph->getMediaEvent()->GetEvent(&evCode, ¶m1, ¶m2, 0), SUCCEEDED(hr)) {
|
||||
hr = this->graph->getMediaEvent()->FreeEventParams(evCode, param1, param2);
|
||||
|
||||
switch(evCode)
|
||||
{
|
||||
switch(evCode) {
|
||||
case EC_FULLSCREEN_LOST:
|
||||
#if USE_OVERLAY
|
||||
this->overlay->show(0);
|
||||
|
@ -423,13 +417,11 @@ LRESULT DSDisplay::handleEvents(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lPar
|
|||
break;
|
||||
|
||||
#if defined(VMR9_WINDOWLESS)
|
||||
case WM_DISPLAYCHANGE:
|
||||
{
|
||||
case WM_DISPLAYCHANGE: {
|
||||
this->graph->getWindowlessControl()->DisplayModeChanged();
|
||||
}
|
||||
break;
|
||||
case WM_PAINT:
|
||||
{
|
||||
case WM_PAINT: {
|
||||
RECT rect = {0};
|
||||
GetWindowRect(hWnd, &rect);
|
||||
|
||||
|
@ -463,8 +455,9 @@ void DSDisplay::hook()
|
|||
|
||||
bool lock = (__directshow__Displays != NULL);
|
||||
|
||||
if(lock)
|
||||
if(lock) {
|
||||
tsk_list_lock(__directshow__Displays);
|
||||
}
|
||||
{
|
||||
// Gets the parent Window procedure
|
||||
#if defined(_WIN32_WCE)
|
||||
|
@ -478,8 +471,9 @@ void DSDisplay::hook()
|
|||
tsk_object_new(tdshow_display_def_t, this->window, this);
|
||||
#endif
|
||||
}
|
||||
if(lock)
|
||||
if(lock) {
|
||||
tsk_list_unlock(__directshow__Displays);
|
||||
}
|
||||
|
||||
RECT rect;
|
||||
GetWindowRect(this->window, &rect);
|
||||
|
@ -533,8 +527,9 @@ void DSDisplay::unhook()
|
|||
#endif
|
||||
|
||||
bool lock = (__directshow__Displays != NULL);
|
||||
if(lock)
|
||||
if(lock) {
|
||||
tsk_list_lock(__directshow__Displays);
|
||||
}
|
||||
{
|
||||
// Remove this instance from the callback map
|
||||
tsk_list_remove_item_by_pred(__directshow__Displays, __pred_find_display_by_hwnd, &this->window);
|
||||
|
@ -547,8 +542,9 @@ void DSDisplay::unhook()
|
|||
SetWindowLongPtr(this->window, GWLP_WNDPROC, (LONG_PTR) this->parentWindowProc);
|
||||
#endif
|
||||
}
|
||||
if(lock)
|
||||
if(lock) {
|
||||
tsk_list_unlock(__directshow__Displays);
|
||||
}
|
||||
|
||||
this->hooked = FALSE;
|
||||
}
|
||||
|
@ -608,12 +604,15 @@ static int tdshow_display_cmp(const tsk_object_t *_d1, const tsk_object_t *_d2)
|
|||
tsk_subsat_int32_ptr(d1->hwnd, d2->hwnd, &ret);
|
||||
return ret;
|
||||
}
|
||||
else if(!d1 && !d2) return 0;
|
||||
else return -1;
|
||||
else if(!d1 && !d2) {
|
||||
return 0;
|
||||
}
|
||||
else {
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
static const tsk_object_def_t tdshow_display_def_s =
|
||||
{
|
||||
static const tsk_object_def_t tdshow_display_def_s = {
|
||||
sizeof(tdshow_display_t),
|
||||
tdshow_display_ctor,
|
||||
tdshow_display_dtor,
|
||||
|
|
|
@ -55,10 +55,14 @@ DSDisplayGraph::DSDisplayGraph(HRESULT *hr)
|
|||
#endif
|
||||
|
||||
*hr = this->createDisplayGraph();
|
||||
if (FAILED(*hr)) return;
|
||||
if (FAILED(*hr)) {
|
||||
return;
|
||||
}
|
||||
|
||||
*hr = this->connect();
|
||||
if (FAILED(*hr)) return;
|
||||
if (FAILED(*hr)) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
DSDisplayGraph::~DSDisplayGraph()
|
||||
|
@ -251,94 +255,134 @@ HRESULT DSDisplayGraph::createDisplayGraph()
|
|||
|
||||
// Create the graph builder
|
||||
hr = COCREATE(CLSID_FilterGraph, IID_IGraphBuilder, this->graphBuilder);
|
||||
if(FAILED(hr)) return hr;
|
||||
if(FAILED(hr)) {
|
||||
return hr;
|
||||
}
|
||||
|
||||
|
||||
// Create my custom filter
|
||||
LPUNKNOWN pUnk = NULL;
|
||||
this->sourceFilter = new DSOutputFilter(pUnk, &hr /*, this*/);
|
||||
if(FAILED(hr) || this->sourceFilter == NULL) return hr;
|
||||
if(FAILED(hr) || this->sourceFilter == NULL) {
|
||||
return hr;
|
||||
}
|
||||
|
||||
// Create the color space convertor filter
|
||||
hr = COCREATE(CLSID_Colour, IID_IBaseFilter, this->colorspaceConverterFilter);
|
||||
if(FAILED(hr)) return hr;
|
||||
if(FAILED(hr)) {
|
||||
return hr;
|
||||
}
|
||||
|
||||
#if defined(VMR)
|
||||
// Create the video mixing renderer based on Direct X
|
||||
hr = COCREATE(CLSID_VideoMixingRenderer, IID_IBaseFilter, this->videoRendererFilter);
|
||||
if(FAILED(hr)) return hr;
|
||||
if(FAILED(hr)) {
|
||||
return hr;
|
||||
}
|
||||
#elif defined(VMR9) || defined(VMR9_WINDOWLESS)
|
||||
// Create the video mixing renderer based on Direct X 9.0
|
||||
hr = COCREATE(CLSID_VideoMixingRenderer9, IID_IBaseFilter, this->videoRendererFilter);
|
||||
if(FAILED(hr)) return hr;
|
||||
if(FAILED(hr)) {
|
||||
return hr;
|
||||
}
|
||||
#else
|
||||
// Create the video renderer
|
||||
hr = COCREATE(CLSID_VideoRenderer, IID_IBaseFilter, this->videoRendererFilter);
|
||||
if(FAILED(hr)) return hr;
|
||||
if(FAILED(hr)) {
|
||||
return hr;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
// Add dource filter to the graph
|
||||
hr = this->graphBuilder->AddFilter(this->sourceFilter, FILTER_OUTPUT);
|
||||
if(FAILED(hr)) return hr;
|
||||
if(FAILED(hr)) {
|
||||
return hr;
|
||||
}
|
||||
|
||||
// Add the color space convertor to the graph
|
||||
hr = this->graphBuilder->AddFilter(this->colorspaceConverterFilter, FILTER_COLORSPACE_CONVERTOR);
|
||||
if(FAILED(hr)) return hr;
|
||||
if(FAILED(hr)) {
|
||||
return hr;
|
||||
}
|
||||
|
||||
// Add video renderer to the graph
|
||||
hr = this->graphBuilder->AddFilter(this->videoRendererFilter, FILTER_VIDEO_RENDERER);
|
||||
if(FAILED(hr)) return hr;
|
||||
if(FAILED(hr)) {
|
||||
return hr;
|
||||
}
|
||||
|
||||
|
||||
// Find media control
|
||||
hr = QUERY(this->graphBuilder, IID_IMediaControl, this->mediaController);
|
||||
if(FAILED(hr)) return hr;
|
||||
if(FAILED(hr)) {
|
||||
return hr;
|
||||
}
|
||||
|
||||
// Find media event
|
||||
hr = QUERY(this->graphBuilder, IID_IMediaEventEx, this->mediaEvent);
|
||||
if(FAILED(hr)) return hr;
|
||||
if(FAILED(hr)) {
|
||||
return hr;
|
||||
}
|
||||
// hr = this->mediaEvent->SetNotifyFlags(AM_MEDIAEVENT_NONOTIFY);
|
||||
|
||||
|
||||
#if defined(VMR)
|
||||
// Find the bitmap mixer (Direct X)
|
||||
hr = QUERY(this->videoRendererFilter, IID_IVMRMixerBitmap, this->mixerBitmap);
|
||||
if(FAILED(hr)) return hr;
|
||||
if(FAILED(hr)) {
|
||||
return hr;
|
||||
}
|
||||
|
||||
// Find the bitmap configurer (Direct X)
|
||||
hr = QUERY(this->videoRendererFilter, IID_IVMRFilterConfig, this->filterConfig);
|
||||
if(FAILED(hr)) return hr;
|
||||
if(FAILED(hr)) {
|
||||
return hr;
|
||||
}
|
||||
|
||||
// Set the number of streams (Direct X)
|
||||
hr = this->filterConfig->SetNumberOfStreams(1);
|
||||
if(FAILED(hr)) return hr;
|
||||
if(FAILED(hr)) {
|
||||
return hr;
|
||||
}
|
||||
#elif defined(VMR9) || defined(VMR9_WINDOWLESS)
|
||||
// Find the bitmap mixer (Direct X 9.0)
|
||||
hr = QUERY(this->videoRendererFilter, IID_IVMRMixerBitmap9, this->mixerBitmap);
|
||||
if(FAILED(hr)) return hr;
|
||||
if(FAILED(hr)) {
|
||||
return hr;
|
||||
}
|
||||
|
||||
// Find the bitmap configurer (Direct X 9.0)
|
||||
hr = QUERY(this->videoRendererFilter, IID_IVMRFilterConfig9, this->filterConfig);
|
||||
if(FAILED(hr)) return hr;
|
||||
if(FAILED(hr)) {
|
||||
return hr;
|
||||
}
|
||||
|
||||
// Set the number of streams (Direct X 9.0)
|
||||
hr = this->filterConfig->SetNumberOfStreams(1);
|
||||
if(FAILED(hr)) return hr;
|
||||
if(FAILED(hr)) {
|
||||
return hr;
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(VMR9_WINDOWLESS)
|
||||
// Set the rendering mode (Direct X 9.0)
|
||||
hr = this->filterConfig->SetRenderingMode(VMR9Mode_Windowless);
|
||||
if(FAILED(hr)) return hr;
|
||||
if(FAILED(hr)) {
|
||||
return hr;
|
||||
}
|
||||
|
||||
// Find the windowless control (Direct X 9.0)
|
||||
hr = QUERY(this->videoRendererFilter, IID_IVMRWindowlessControl9, this->windowlessControl);
|
||||
if(FAILED(hr)) return hr;
|
||||
if(FAILED(hr)) {
|
||||
return hr;
|
||||
}
|
||||
#else
|
||||
// Find IVideoWindow interface
|
||||
hr = QUERY(this->graphBuilder, IID_IVideoWindow, this->videoWindow);
|
||||
if(FAILED(hr)) return hr;
|
||||
if(FAILED(hr)) {
|
||||
return hr;
|
||||
}
|
||||
#endif
|
||||
|
||||
return hr;
|
||||
|
|
|
@ -42,7 +42,9 @@ public:
|
|||
DSDisplayGraph(HRESULT *hr);
|
||||
virtual ~DSDisplayGraph();
|
||||
|
||||
int getDisplayFps() { return this->fps; };
|
||||
int getDisplayFps() {
|
||||
return this->fps;
|
||||
};
|
||||
void setDisplayFps(int fps_);
|
||||
|
||||
bool getImageFormat(UINT &width, UINT &height);
|
||||
|
@ -57,18 +59,34 @@ public:
|
|||
bool isRunning();
|
||||
bool isPaused();
|
||||
|
||||
IMediaEventEx *getMediaEvent() { return this->mediaEvent; };
|
||||
IVideoWindow *getVideoWindow() { return this->videoWindow; };
|
||||
DSOutputFilter *getSourceFilter() { return this->sourceFilter; };
|
||||
IMediaEventEx *getMediaEvent() {
|
||||
return this->mediaEvent;
|
||||
};
|
||||
IVideoWindow *getVideoWindow() {
|
||||
return this->videoWindow;
|
||||
};
|
||||
DSOutputFilter *getSourceFilter() {
|
||||
return this->sourceFilter;
|
||||
};
|
||||
|
||||
#if defined(VMR)
|
||||
IVMRMixerBitmap *getMixerBitmap() { return this->mixerBitmap; };
|
||||
IVMRMixerBitmap *getMixerBitmap() {
|
||||
return this->mixerBitmap;
|
||||
};
|
||||
#elif defined(VMR9)
|
||||
IVMRMixerBitmap9 *getMixerBitmap() { return this->mixerBitmap; };
|
||||
IVMRMixerBitmap9 *getMixerBitmap() {
|
||||
return this->mixerBitmap;
|
||||
};
|
||||
#elif defined(VMR9_WINDOWLESS)
|
||||
IVMRMixerBitmap9 *getMixerBitmap() { return this->mixerBitmap; };
|
||||
IVMRMixerControl9 *getMixerControl() { return this->mixerControl; };
|
||||
IVMRWindowlessControl9 *getWindowlessControl() { return this->windowlessControl; };
|
||||
IVMRMixerBitmap9 *getMixerBitmap() {
|
||||
return this->mixerBitmap;
|
||||
};
|
||||
IVMRMixerControl9 *getMixerControl() {
|
||||
return this->mixerControl;
|
||||
};
|
||||
IVMRWindowlessControl9 *getWindowlessControl() {
|
||||
return this->windowlessControl;
|
||||
};
|
||||
#endif
|
||||
|
||||
void handleFrame(const void* data, int w, int h);
|
||||
|
|
|
@ -56,30 +56,26 @@ void DSDisplayOverlay::attach(HWND parent, DSDisplayGraph *graph)
|
|||
this->window = parent;
|
||||
this->displayGraph = graph;
|
||||
|
||||
if (this->window)
|
||||
{
|
||||
if (this->window) {
|
||||
// Hack to get module of the current code
|
||||
TCHAR *modulePath = (TCHAR *) calloc(255, sizeof(TCHAR));
|
||||
GetModuleFileName((HINSTANCE)&__ImageBase, modulePath, 255);
|
||||
HMODULE module = GetModuleHandle(modulePath);
|
||||
delete[] modulePath;
|
||||
if (!module)
|
||||
{
|
||||
if (!module) {
|
||||
cout << "Failed to get current module";
|
||||
return;
|
||||
}
|
||||
|
||||
HBITMAP bitmap = LoadBitmap(module, MAKEINTRESOURCE(IDB_BITMAP_OVERLAY));
|
||||
if (!bitmap)
|
||||
{
|
||||
if (!bitmap) {
|
||||
cout << "Failed to load overlay bitmap" << endl;
|
||||
return;
|
||||
}
|
||||
|
||||
RECT rect;
|
||||
hr = GetWindowRect(this->window, &rect);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
if (FAILED(hr)) {
|
||||
cout << "Failed to get window size" << endl;
|
||||
return;
|
||||
}
|
||||
|
@ -142,8 +138,7 @@ void DSDisplayOverlay::show(int value)
|
|||
|
||||
void DSDisplayOverlay::update()
|
||||
{
|
||||
if (this->displayGraph && (this->ticks > 0))
|
||||
{
|
||||
if (this->displayGraph && (this->ticks > 0)) {
|
||||
this->ticks--;
|
||||
|
||||
// Be sure alpha is in 0.0 .. 1.0 range.
|
||||
|
@ -159,18 +154,15 @@ void DSDisplayOverlay::internalUpdate()
|
|||
{
|
||||
HRESULT hr;
|
||||
|
||||
if (this->ticks > 0)
|
||||
{
|
||||
if (this->ticks > 0) {
|
||||
this->alphaBitmap.dwFlags = VMRBITMAP_HDC | VMRBITMAP_SRCCOLORKEY;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
this->alphaBitmap.dwFlags = VMRBITMAP_DISABLE;
|
||||
}
|
||||
|
||||
hr = this->displayGraph->getMixerBitmap()->SetAlphaBitmap(&this->alphaBitmap);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
if (FAILED(hr)) {
|
||||
cout << "Failed to mix overylay (" << hr << ")" << endl;
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -37,8 +37,7 @@ DSDisplayOverlay::DSDisplayOverlay()
|
|||
this->direct3DSurface = NULL;
|
||||
|
||||
this->direct3D = Direct3DCreate9(D3D_SDK_VERSION);
|
||||
if (!this->direct3D)
|
||||
{
|
||||
if (!this->direct3D) {
|
||||
cout << "Cannot create Direct3D environment" << endl;
|
||||
return;
|
||||
}
|
||||
|
@ -57,8 +56,7 @@ void DSDisplayOverlay::attach(HWND parent, DSDisplayGraph *graph)
|
|||
this->window = parent;
|
||||
this->displayGraph = graph;
|
||||
|
||||
if (this->window)
|
||||
{
|
||||
if (this->window) {
|
||||
D3DPRESENT_PARAMETERS d3dpp;
|
||||
ZeroMemory(&d3dpp, sizeof(D3DPRESENT_PARAMETERS));
|
||||
d3dpp.Windowed = TRUE;
|
||||
|
@ -71,16 +69,14 @@ void DSDisplayOverlay::attach(HWND parent, DSDisplayGraph *graph)
|
|||
D3DCREATE_SOFTWARE_VERTEXPROCESSING,
|
||||
&d3dpp,
|
||||
&this->direct3DDevice);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
if (FAILED(hr)) {
|
||||
cout << "Cannot create Direct3D device" << endl;
|
||||
return;
|
||||
}
|
||||
|
||||
ZeroMemory(&this->overlayInfo, sizeof(D3DXIMAGE_INFO));
|
||||
hr = D3DXGetImageInfoFromFile(FILENAME, &this->overlayInfo);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
if (FAILED(hr)) {
|
||||
cout << "Cannot stat overlay file" << endl;
|
||||
return;
|
||||
}
|
||||
|
@ -92,8 +88,7 @@ void DSDisplayOverlay::attach(HWND parent, DSDisplayGraph *graph)
|
|||
D3DPOOL_SYSTEMMEM,
|
||||
&this->direct3DSurface,
|
||||
NULL);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
if (FAILED(hr)) {
|
||||
cout << "Cannot create Direct3D surface" << endl;
|
||||
return;
|
||||
}
|
||||
|
@ -108,8 +103,7 @@ void DSDisplayOverlay::attach(HWND parent, DSDisplayGraph *graph)
|
|||
D3DX_FILTER_NONE,
|
||||
alphaKey,
|
||||
&this->overlayInfo);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
if (FAILED(hr)) {
|
||||
cout << "Cannot load overlay file" << endl;
|
||||
return;
|
||||
}
|
||||
|
@ -118,8 +112,7 @@ void DSDisplayOverlay::attach(HWND parent, DSDisplayGraph *graph)
|
|||
ZeroMemory(&viewport, sizeof(D3DVIEWPORT9));
|
||||
|
||||
hr= this->direct3DDevice->GetViewport(&viewport);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
if (FAILED(hr)) {
|
||||
cout << "Cannot get view port" << endl;
|
||||
return;
|
||||
}
|
||||
|
@ -170,8 +163,7 @@ void DSDisplayOverlay::show(int value)
|
|||
|
||||
void DSDisplayOverlay::update()
|
||||
{
|
||||
if (this->displayGraph && (this->ticks > 0))
|
||||
{
|
||||
if (this->displayGraph && (this->ticks > 0)) {
|
||||
this->ticks--;
|
||||
|
||||
// Be sure alpha is in 0.0 .. 1.0 range.
|
||||
|
@ -187,18 +179,15 @@ void DSDisplayOverlay::internalUpdate()
|
|||
{
|
||||
HRESULT hr;
|
||||
|
||||
if (this->ticks > 0)
|
||||
{
|
||||
if (this->ticks > 0) {
|
||||
this->alphaBitmap.dwFlags = VMR9AlphaBitmap_EntireDDS;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
this->alphaBitmap.dwFlags = VMR9AlphaBitmap_Disable;
|
||||
}
|
||||
|
||||
hr = this->displayGraph->getMixerBitmap()->SetAlphaBitmap(&this->alphaBitmap);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
if (FAILED(hr)) {
|
||||
cout << "Failed to mix overylay (" << hr << ")" << endl;
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -52,8 +52,7 @@ void DSDisplayOverlay::show(int value)
|
|||
|
||||
void DSDisplayOverlay::update()
|
||||
{
|
||||
if (this->displayGraph && (this->ticks > 0))
|
||||
{
|
||||
if (this->displayGraph && (this->ticks > 0)) {
|
||||
this->ticks--;
|
||||
this->internalUpdate();
|
||||
}
|
||||
|
|
|
@ -48,8 +48,7 @@ DSFrameRateFilter::~DSFrameRateFilter()
|
|||
|
||||
HRESULT DSFrameRateFilter::SetFps(int inputFps, int outputFps)
|
||||
{
|
||||
if(inputFps <= 0 || outputFps <= 0)
|
||||
{
|
||||
if(inputFps <= 0 || outputFps <= 0) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
|
@ -74,7 +73,9 @@ HRESULT DSFrameRateFilter::SetFps(int inputFps, int outputFps)
|
|||
|
||||
HRESULT DSFrameRateFilter::Transform(IMediaSample *pSample)
|
||||
{
|
||||
if(!this->m_bProcessFrame) return S_FALSE;
|
||||
if(!this->m_bProcessFrame) {
|
||||
return S_FALSE;
|
||||
}
|
||||
|
||||
CheckPointer(pSample, E_POINTER);
|
||||
|
||||
|
|
|
@ -63,7 +63,8 @@ DSGrabber::DSGrabber(HRESULT *hr, BOOL _screenCast)
|
|||
this->buffer = NULL;
|
||||
this->mutex_buffer = tsk_mutex_create();
|
||||
|
||||
bail: ;
|
||||
bail:
|
||||
;
|
||||
}
|
||||
|
||||
DSGrabber::~DSGrabber()
|
||||
|
@ -223,18 +224,15 @@ HRESULT DSGrabber::BufferCB(double SampleTime, BYTE *pBuffer, long BufferLen)
|
|||
}
|
||||
|
||||
// Examine the format block.
|
||||
if ((mediaType.formattype == FORMAT_VideoInfo) && (mediaType.cbFormat >= sizeof(VIDEOINFOHEADER)) && (mediaType.pbFormat != NULL) )
|
||||
{
|
||||
if ((mediaType.formattype == FORMAT_VideoInfo) && (mediaType.cbFormat >= sizeof(VIDEOINFOHEADER)) && (mediaType.pbFormat != NULL) ) {
|
||||
VIDEOINFOHEADER *pVih = reinterpret_cast<VIDEOINFOHEADER *>(mediaType.pbFormat);
|
||||
BITMAPINFOHEADER* bih = &pVih->bmiHeader;
|
||||
|
||||
//int framerate = pVih->AvgTimePerFrame;
|
||||
if( (bih->biHeight == this->bitmapInfo.biHeight) && (bih->biWidth == this->bitmapInfo.biWidth) && (bih->biBitCount == this->bitmapInfo.biBitCount) )
|
||||
{
|
||||
if( (bih->biHeight == this->bitmapInfo.biHeight) && (bih->biWidth == this->bitmapInfo.biWidth) && (bih->biBitCount == this->bitmapInfo.biBitCount) ) {
|
||||
memmove(this->buffer, pBuffer, this->bitmapInfo.biSizeImage);
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
ResizeRGB(
|
||||
bih,
|
||||
(const unsigned char *) pBuffer,
|
||||
|
@ -272,8 +270,7 @@ HRESULT DSGrabber::QueryInterface(REFIID iid, LPVOID *ppv)
|
|||
#ifdef _WIN32_WCE
|
||||
assert(1==0);
|
||||
#else
|
||||
if( iid == IID_ISampleGrabberCB || iid == IID_IUnknown )
|
||||
{
|
||||
if( iid == IID_ISampleGrabberCB || iid == IID_IUnknown ) {
|
||||
*ppv = (void *) static_cast<ISampleGrabberCB*>(this);
|
||||
return NOERROR;
|
||||
}
|
||||
|
|
|
@ -47,7 +47,9 @@ void DSOutputFilter::setBuffer(void *pointer, int size)
|
|||
if((this->outputStream->buffer = tsk_realloc(this->outputStream->buffer, size))) {
|
||||
this->outputStream->buffer_size = size;
|
||||
}
|
||||
else goto done;
|
||||
else {
|
||||
goto done;
|
||||
}
|
||||
}
|
||||
memcpy(this->outputStream->buffer, pointer, size);
|
||||
}
|
||||
|
@ -103,8 +105,7 @@ void DSOutputFilter::reset()
|
|||
#ifdef _WIN32_WCE
|
||||
STDMETHODIMP_(ULONG) DSOutputFilter::NonDelegatingRelease()
|
||||
{
|
||||
if(InterlockedDecrement(&m_cRef) == 0)
|
||||
{
|
||||
if(InterlockedDecrement(&m_cRef) == 0) {
|
||||
delete this;
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -84,7 +84,9 @@ void DSOutputStream::showOverlay(int value)
|
|||
|
||||
HRESULT DSOutputStream::setImageFormat(UINT width, UINT height)
|
||||
{
|
||||
if ((this->width == width) && (this->height == height)) return S_FALSE;
|
||||
if ((this->width == width) && (this->height == height)) {
|
||||
return S_FALSE;
|
||||
}
|
||||
|
||||
this->width = width;
|
||||
this->height = height;
|
||||
|
@ -111,8 +113,9 @@ HRESULT DSOutputStream::GetMediaType(CMediaType *pMediaType)
|
|||
ZeroMemory(pMediaType, sizeof(CMediaType));
|
||||
|
||||
VIDEOINFO *pvi = (VIDEOINFO *)pMediaType->AllocFormatBuffer(sizeof(VIDEOINFO));
|
||||
if (NULL == pvi)
|
||||
if (NULL == pvi) {
|
||||
return E_OUTOFMEMORY;
|
||||
}
|
||||
|
||||
ZeroMemory(pvi, sizeof(VIDEOINFO));
|
||||
|
||||
|
@ -168,8 +171,7 @@ HRESULT DSOutputStream::DecideBufferSize(IMemAllocator *pMemAlloc, ALLOCATOR_PRO
|
|||
}
|
||||
|
||||
// Is this allocator unsuitable?
|
||||
if(Actual.cbBuffer < pProperties->cbBuffer)
|
||||
{
|
||||
if(Actual.cbBuffer < pProperties->cbBuffer) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
|
@ -199,11 +201,14 @@ HRESULT DSOutputStream::OnThreadCreate()
|
|||
HRESULT DSOutputStream::OnThreadDestroy()
|
||||
{
|
||||
#if OVERLAY
|
||||
if (paintDC) DeleteDC(paintDC);
|
||||
if (hObject) DeleteObject(hObject);
|
||||
if (paintDC) {
|
||||
DeleteDC(paintDC);
|
||||
}
|
||||
if (hObject) {
|
||||
DeleteObject(hObject);
|
||||
}
|
||||
|
||||
if (paintBuffer)
|
||||
{
|
||||
if (paintBuffer) {
|
||||
//delete[] paintBuffer; // will be done
|
||||
//paintBuffer = NULL;
|
||||
}
|
||||
|
@ -220,7 +225,9 @@ inline HRESULT DSOutputStream::DrawOverLay(void *pBuffer, long lSize)
|
|||
#ifdef _WIN32_WCE
|
||||
|
||||
#else
|
||||
if( !TextOut( paintDC, 0, 0, OVERLAY_TEXT, (int)_tcslen( OVERLAY_TEXT ) ) ) return E_FAIL;
|
||||
if( !TextOut( paintDC, 0, 0, OVERLAY_TEXT, (int)_tcslen( OVERLAY_TEXT ) ) ) {
|
||||
return E_FAIL;
|
||||
}
|
||||
#endif
|
||||
|
||||
CopyMemory(pBuffer, paintBuffer, lSize);
|
||||
|
@ -230,8 +237,7 @@ inline HRESULT DSOutputStream::DrawOverLay(void *pBuffer, long lSize)
|
|||
|
||||
static __inline void TransfertBuffer(void* src, void* dest, long lSize)
|
||||
{
|
||||
__try
|
||||
{
|
||||
__try {
|
||||
#if MEMCPY_WORKAROUND
|
||||
//#ifdef _WIN32_WCE
|
||||
memmove(dest, src, lSize);
|
||||
|
@ -249,8 +255,7 @@ static __inline void TransfertBuffer(void* src, void* dest, long lSize)
|
|||
CopyMemory(dest, src, lSize); //BUGGY
|
||||
#endif
|
||||
}
|
||||
__except(EXCEPTION_ACCESS_VIOLATION == GetExceptionCode())
|
||||
{
|
||||
__except(EXCEPTION_ACCESS_VIOLATION == GetExceptionCode()) {
|
||||
//ZeroMemory(dest, sizeof(void*));
|
||||
}
|
||||
}
|
||||
|
@ -267,18 +272,15 @@ HRESULT DSOutputStream::FillBuffer(IMediaSample *pSample)
|
|||
long lSize, lDataSize;
|
||||
|
||||
hr = pSample->GetPointer(&pBuffer);
|
||||
if (SUCCEEDED(hr))
|
||||
{
|
||||
if (SUCCEEDED(hr)) {
|
||||
lDataSize = lSize = pSample->GetSize();
|
||||
|
||||
// Check that we're still using video
|
||||
//ASSERT(m_mt.formattype == FORMAT_VideoInfo);
|
||||
|
||||
if (this->buffer)
|
||||
{
|
||||
if (this->buffer) {
|
||||
#if OVERLAY
|
||||
if (this->overlay)
|
||||
{
|
||||
if (this->overlay) {
|
||||
DrawOverLay(this->buffer, lSize);
|
||||
}
|
||||
#endif
|
||||
|
@ -288,8 +290,7 @@ HRESULT DSOutputStream::FillBuffer(IMediaSample *pSample)
|
|||
TransfertBuffer(this->buffer, (void*)pBuffer, lDataSize);
|
||||
this->unlockBuffer();
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
// Avoid caching last image
|
||||
memset((void*)pBuffer, NULL, lSize);
|
||||
}
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue