Adds support mirroring video produced by Hovis camera
This commit is contained in:
parent
b07f2a9541
commit
52a5a609bd
|
@ -516,7 +516,7 @@ static const tmedia_producer_plugin_def_t twrap_producer_proxy_video_plugin_def_
|
|||
tmedia_chroma_t ProxyVideoProducer::s_eDefaultChroma = tmedia_chroma_nv21;
|
||||
|
||||
ProxyVideoProducer::ProxyVideoProducer(tmedia_chroma_t eChroma, struct twrap_producer_proxy_video_s* pProducer)
|
||||
:m_pCallback(tsk_null), m_eChroma(eChroma), m_nRotation(0), m_pWrappedPlugin(pProducer), ProxyPlugin(twrap_proxy_plugin_video_producer)
|
||||
:m_pCallback(tsk_null), m_eChroma(eChroma), m_nRotation(0), m_bMirror(false), m_pWrappedPlugin(pProducer), ProxyPlugin(twrap_proxy_plugin_video_producer)
|
||||
{
|
||||
if(m_pWrappedPlugin){
|
||||
m_pWrappedPlugin->id = this->getId();
|
||||
|
@ -536,13 +536,28 @@ int ProxyVideoProducer::getRotation()const
|
|||
bool ProxyVideoProducer::setRotation(int nRot)
|
||||
{
|
||||
m_nRotation = nRot;
|
||||
if(m_pWrappedPlugin){
|
||||
if (m_pWrappedPlugin) {
|
||||
TMEDIA_PRODUCER(m_pWrappedPlugin)->video.rotation = m_nRotation;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool ProxyVideoProducer::getMirror()const
|
||||
{
|
||||
return m_bMirror;
|
||||
}
|
||||
|
||||
bool ProxyVideoProducer::setMirror(bool bMirror)
|
||||
{
|
||||
m_bMirror = bMirror;
|
||||
if (m_pWrappedPlugin) {
|
||||
TMEDIA_PRODUCER(m_pWrappedPlugin)->video.mirror = m_bMirror ? tsk_true : tsk_false;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
// alert the encoder which size your camera is using because it's very hard to retrieve it from send(buffer, size) function
|
||||
// this function is only needed if the actual size (output from your camera) is different than the negociated one
|
||||
bool ProxyVideoProducer::setActualCameraOutputSize(unsigned nWidth, unsigned nHeight)
|
||||
|
|
|
@ -126,6 +126,8 @@ public:
|
|||
|
||||
int getRotation()const;
|
||||
bool setRotation(int nRot);
|
||||
bool getMirror()const;
|
||||
bool setMirror(bool bMirror);
|
||||
bool setActualCameraOutputSize(unsigned nWidth, unsigned nHeight);
|
||||
int push(const void* pBuffer, unsigned nSize);
|
||||
void setCallback(ProxyVideoProducerCallback* pCallback) { m_pCallback = pCallback; }
|
||||
|
@ -158,6 +160,7 @@ private:
|
|||
ProxyVideoProducerCallback* m_pCallback;
|
||||
tmedia_chroma_t m_eChroma;
|
||||
int m_nRotation;
|
||||
bool m_bMirror;
|
||||
|
||||
static tmedia_chroma_t s_eDefaultChroma;
|
||||
};
|
||||
|
|
|
@ -50,6 +50,16 @@ public class ProxyVideoProducer : ProxyPlugin {
|
|||
return ret;
|
||||
}
|
||||
|
||||
public bool getMirror() {
|
||||
bool ret = tinyWRAPPINVOKE.ProxyVideoProducer_getMirror(swigCPtr);
|
||||
return ret;
|
||||
}
|
||||
|
||||
public bool setMirror(bool bMirror) {
|
||||
bool ret = tinyWRAPPINVOKE.ProxyVideoProducer_setMirror(swigCPtr, bMirror);
|
||||
return ret;
|
||||
}
|
||||
|
||||
public bool setActualCameraOutputSize(uint nWidth, uint nHeight) {
|
||||
bool ret = tinyWRAPPINVOKE.ProxyVideoProducer_setActualCameraOutputSize(swigCPtr, nWidth, nHeight);
|
||||
return ret;
|
||||
|
|
|
@ -1533,6 +1533,12 @@ class tinyWRAPPINVOKE {
|
|||
[DllImport("tinyWRAP", EntryPoint="CSharp_ProxyVideoProducer_setRotation")]
|
||||
public static extern bool ProxyVideoProducer_setRotation(HandleRef jarg1, int jarg2);
|
||||
|
||||
[DllImport("tinyWRAP", EntryPoint="CSharp_ProxyVideoProducer_getMirror")]
|
||||
public static extern bool ProxyVideoProducer_getMirror(HandleRef jarg1);
|
||||
|
||||
[DllImport("tinyWRAP", EntryPoint="CSharp_ProxyVideoProducer_setMirror")]
|
||||
public static extern bool ProxyVideoProducer_setMirror(HandleRef jarg1, bool jarg2);
|
||||
|
||||
[DllImport("tinyWRAP", EntryPoint="CSharp_ProxyVideoProducer_setActualCameraOutputSize")]
|
||||
public static extern bool ProxyVideoProducer_setActualCameraOutputSize(HandleRef jarg1, uint jarg2, uint jarg3);
|
||||
|
||||
|
|
|
@ -6835,6 +6835,32 @@ SWIGEXPORT unsigned int SWIGSTDCALL CSharp_ProxyVideoProducer_setRotation(void *
|
|||
}
|
||||
|
||||
|
||||
SWIGEXPORT unsigned int SWIGSTDCALL CSharp_ProxyVideoProducer_getMirror(void * jarg1) {
|
||||
unsigned int jresult ;
|
||||
ProxyVideoProducer *arg1 = (ProxyVideoProducer *) 0 ;
|
||||
bool result;
|
||||
|
||||
arg1 = (ProxyVideoProducer *)jarg1;
|
||||
result = (bool)((ProxyVideoProducer const *)arg1)->getMirror();
|
||||
jresult = result;
|
||||
return jresult;
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT unsigned int SWIGSTDCALL CSharp_ProxyVideoProducer_setMirror(void * jarg1, unsigned int jarg2) {
|
||||
unsigned int jresult ;
|
||||
ProxyVideoProducer *arg1 = (ProxyVideoProducer *) 0 ;
|
||||
bool arg2 ;
|
||||
bool result;
|
||||
|
||||
arg1 = (ProxyVideoProducer *)jarg1;
|
||||
arg2 = jarg2 ? true : false;
|
||||
result = (bool)(arg1)->setMirror(arg2);
|
||||
jresult = result;
|
||||
return jresult;
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT unsigned int SWIGSTDCALL CSharp_ProxyVideoProducer_setActualCameraOutputSize(void * jarg1, unsigned int jarg2, unsigned int jarg3) {
|
||||
unsigned int jresult ;
|
||||
ProxyVideoProducer *arg1 = (ProxyVideoProducer *) 0 ;
|
||||
|
|
|
@ -43,6 +43,14 @@ public class ProxyVideoProducer extends ProxyPlugin {
|
|||
return tinyWRAPJNI.ProxyVideoProducer_setRotation(swigCPtr, this, nRot);
|
||||
}
|
||||
|
||||
public boolean getMirror() {
|
||||
return tinyWRAPJNI.ProxyVideoProducer_getMirror(swigCPtr, this);
|
||||
}
|
||||
|
||||
public boolean setMirror(boolean bMirror) {
|
||||
return tinyWRAPJNI.ProxyVideoProducer_setMirror(swigCPtr, this, bMirror);
|
||||
}
|
||||
|
||||
public boolean setActualCameraOutputSize(long nWidth, long nHeight) {
|
||||
return tinyWRAPJNI.ProxyVideoProducer_setActualCameraOutputSize(swigCPtr, this, nWidth, nHeight);
|
||||
}
|
||||
|
|
|
@ -43,6 +43,14 @@ public class ProxyVideoProducer extends ProxyPlugin {
|
|||
return tinyWRAPJNI.ProxyVideoProducer_setRotation(swigCPtr, this, nRot);
|
||||
}
|
||||
|
||||
public boolean getMirror() {
|
||||
return tinyWRAPJNI.ProxyVideoProducer_getMirror(swigCPtr, this);
|
||||
}
|
||||
|
||||
public boolean setMirror(boolean bMirror) {
|
||||
return tinyWRAPJNI.ProxyVideoProducer_setMirror(swigCPtr, this, bMirror);
|
||||
}
|
||||
|
||||
public boolean setActualCameraOutputSize(long nWidth, long nHeight) {
|
||||
return tinyWRAPJNI.ProxyVideoProducer_setActualCameraOutputSize(swigCPtr, this, nWidth, nHeight);
|
||||
}
|
||||
|
|
|
@ -464,6 +464,8 @@ public class tinyWRAPJNI {
|
|||
public final static native void delete_ProxyVideoProducer(long jarg1);
|
||||
public final static native int ProxyVideoProducer_getRotation(long jarg1, ProxyVideoProducer jarg1_);
|
||||
public final static native boolean ProxyVideoProducer_setRotation(long jarg1, ProxyVideoProducer jarg1_, int jarg2);
|
||||
public final static native boolean ProxyVideoProducer_getMirror(long jarg1, ProxyVideoProducer jarg1_);
|
||||
public final static native boolean ProxyVideoProducer_setMirror(long jarg1, ProxyVideoProducer jarg1_, boolean jarg2);
|
||||
public final static native boolean ProxyVideoProducer_setActualCameraOutputSize(long jarg1, ProxyVideoProducer jarg1_, long jarg2, long jarg3);
|
||||
public final static native int ProxyVideoProducer_push(long jarg1, ProxyVideoProducer jarg1_, java.nio.ByteBuffer jarg2, long jarg3);
|
||||
public final static native void ProxyVideoProducer_setCallback(long jarg1, ProxyVideoProducer jarg1_, long jarg2, ProxyVideoProducerCallback jarg2_);
|
||||
|
|
|
@ -9611,6 +9611,38 @@ SWIGEXPORT jboolean JNICALL Java_org_doubango_tinyWRAP_tinyWRAPJNI_ProxyVideoPro
|
|||
}
|
||||
|
||||
|
||||
SWIGEXPORT jboolean JNICALL Java_org_doubango_tinyWRAP_tinyWRAPJNI_ProxyVideoProducer_1getMirror(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) {
|
||||
jboolean jresult = 0 ;
|
||||
ProxyVideoProducer *arg1 = (ProxyVideoProducer *) 0 ;
|
||||
bool result;
|
||||
|
||||
(void)jenv;
|
||||
(void)jcls;
|
||||
(void)jarg1_;
|
||||
arg1 = *(ProxyVideoProducer **)&jarg1;
|
||||
result = (bool)((ProxyVideoProducer const *)arg1)->getMirror();
|
||||
jresult = (jboolean)result;
|
||||
return jresult;
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT jboolean JNICALL Java_org_doubango_tinyWRAP_tinyWRAPJNI_ProxyVideoProducer_1setMirror(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jboolean jarg2) {
|
||||
jboolean jresult = 0 ;
|
||||
ProxyVideoProducer *arg1 = (ProxyVideoProducer *) 0 ;
|
||||
bool arg2 ;
|
||||
bool result;
|
||||
|
||||
(void)jenv;
|
||||
(void)jcls;
|
||||
(void)jarg1_;
|
||||
arg1 = *(ProxyVideoProducer **)&jarg1;
|
||||
arg2 = jarg2 ? true : false;
|
||||
result = (bool)(arg1)->setMirror(arg2);
|
||||
jresult = (jboolean)result;
|
||||
return jresult;
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT jboolean JNICALL Java_org_doubango_tinyWRAP_tinyWRAPJNI_ProxyVideoProducer_1setActualCameraOutputSize(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jlong jarg3) {
|
||||
jboolean jresult = 0 ;
|
||||
ProxyVideoProducer *arg1 = (ProxyVideoProducer *) 0 ;
|
||||
|
|
|
@ -464,6 +464,8 @@ public class tinyWRAPJNI {
|
|||
public final static native void delete_ProxyVideoProducer(long jarg1);
|
||||
public final static native int ProxyVideoProducer_getRotation(long jarg1, ProxyVideoProducer jarg1_);
|
||||
public final static native boolean ProxyVideoProducer_setRotation(long jarg1, ProxyVideoProducer jarg1_, int jarg2);
|
||||
public final static native boolean ProxyVideoProducer_getMirror(long jarg1, ProxyVideoProducer jarg1_);
|
||||
public final static native boolean ProxyVideoProducer_setMirror(long jarg1, ProxyVideoProducer jarg1_, boolean jarg2);
|
||||
public final static native boolean ProxyVideoProducer_setActualCameraOutputSize(long jarg1, ProxyVideoProducer jarg1_, long jarg2, long jarg3);
|
||||
public final static native int ProxyVideoProducer_push(long jarg1, ProxyVideoProducer jarg1_, java.nio.ByteBuffer jarg2, long jarg3);
|
||||
public final static native void ProxyVideoProducer_setCallback(long jarg1, ProxyVideoProducer jarg1_, long jarg2, ProxyVideoProducerCallback jarg2_);
|
||||
|
|
|
@ -9611,6 +9611,38 @@ SWIGEXPORT jboolean JNICALL Java_org_doubango_tinyWRAP_tinyWRAPJNI_ProxyVideoPro
|
|||
}
|
||||
|
||||
|
||||
SWIGEXPORT jboolean JNICALL Java_org_doubango_tinyWRAP_tinyWRAPJNI_ProxyVideoProducer_1getMirror(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) {
|
||||
jboolean jresult = 0 ;
|
||||
ProxyVideoProducer *arg1 = (ProxyVideoProducer *) 0 ;
|
||||
bool result;
|
||||
|
||||
(void)jenv;
|
||||
(void)jcls;
|
||||
(void)jarg1_;
|
||||
arg1 = *(ProxyVideoProducer **)&jarg1;
|
||||
result = (bool)((ProxyVideoProducer const *)arg1)->getMirror();
|
||||
jresult = (jboolean)result;
|
||||
return jresult;
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT jboolean JNICALL Java_org_doubango_tinyWRAP_tinyWRAPJNI_ProxyVideoProducer_1setMirror(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jboolean jarg2) {
|
||||
jboolean jresult = 0 ;
|
||||
ProxyVideoProducer *arg1 = (ProxyVideoProducer *) 0 ;
|
||||
bool arg2 ;
|
||||
bool result;
|
||||
|
||||
(void)jenv;
|
||||
(void)jcls;
|
||||
(void)jarg1_;
|
||||
arg1 = *(ProxyVideoProducer **)&jarg1;
|
||||
arg2 = jarg2 ? true : false;
|
||||
result = (bool)(arg1)->setMirror(arg2);
|
||||
jresult = (jboolean)result;
|
||||
return jresult;
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT jboolean JNICALL Java_org_doubango_tinyWRAP_tinyWRAPJNI_ProxyVideoProducer_1setActualCameraOutputSize(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jlong jarg3) {
|
||||
jboolean jresult = 0 ;
|
||||
ProxyVideoProducer *arg1 = (ProxyVideoProducer *) 0 ;
|
||||
|
|
|
@ -1825,6 +1825,8 @@ sub DESTROY {
|
|||
|
||||
*getRotation = *tinyWRAPc::ProxyVideoProducer_getRotation;
|
||||
*setRotation = *tinyWRAPc::ProxyVideoProducer_setRotation;
|
||||
*getMirror = *tinyWRAPc::ProxyVideoProducer_getMirror;
|
||||
*setMirror = *tinyWRAPc::ProxyVideoProducer_setMirror;
|
||||
*setActualCameraOutputSize = *tinyWRAPc::ProxyVideoProducer_setActualCameraOutputSize;
|
||||
*push = *tinyWRAPc::ProxyVideoProducer_push;
|
||||
*setCallback = *tinyWRAPc::ProxyVideoProducer_setCallback;
|
||||
|
@ -2592,6 +2594,8 @@ package tinyWRAP;
|
|||
*tmedia_chroma_yuv422p = *tinyWRAPc::tmedia_chroma_yuv422p;
|
||||
*tmedia_chroma_uyvy422 = *tinyWRAPc::tmedia_chroma_uyvy422;
|
||||
*tmedia_chroma_yuv420p = *tinyWRAPc::tmedia_chroma_yuv420p;
|
||||
*tmedia_chroma_mjpeg = *tinyWRAPc::tmedia_chroma_mjpeg;
|
||||
*tmedia_chroma_yuyv422 = *tinyWRAPc::tmedia_chroma_yuyv422;
|
||||
*tmedia_mode_none = *tinyWRAPc::tmedia_mode_none;
|
||||
*tmedia_mode_optional = *tinyWRAPc::tmedia_mode_optional;
|
||||
*tmedia_mode_mandatory = *tinyWRAPc::tmedia_mode_mandatory;
|
||||
|
@ -2630,6 +2634,7 @@ package tinyWRAP;
|
|||
*tmedia_pref_video_size_hvga = *tinyWRAPc::tmedia_pref_video_size_hvga;
|
||||
*tmedia_pref_video_size_vga = *tinyWRAPc::tmedia_pref_video_size_vga;
|
||||
*tmedia_pref_video_size_4cif = *tinyWRAPc::tmedia_pref_video_size_4cif;
|
||||
*tmedia_pref_video_size_wvga = *tinyWRAPc::tmedia_pref_video_size_wvga;
|
||||
*tmedia_pref_video_size_svga = *tinyWRAPc::tmedia_pref_video_size_svga;
|
||||
*tmedia_pref_video_size_480p = *tinyWRAPc::tmedia_pref_video_size_480p;
|
||||
*tmedia_pref_video_size_720p = *tinyWRAPc::tmedia_pref_video_size_720p;
|
||||
|
|
|
@ -20411,6 +20411,72 @@ XS(_wrap_ProxyVideoProducer_setRotation) {
|
|||
}
|
||||
|
||||
|
||||
XS(_wrap_ProxyVideoProducer_getMirror) {
|
||||
{
|
||||
ProxyVideoProducer *arg1 = (ProxyVideoProducer *) 0 ;
|
||||
void *argp1 = 0 ;
|
||||
int res1 = 0 ;
|
||||
int argvi = 0;
|
||||
bool result;
|
||||
dXSARGS;
|
||||
|
||||
if ((items < 1) || (items > 1)) {
|
||||
SWIG_croak("Usage: ProxyVideoProducer_getMirror(self);");
|
||||
}
|
||||
res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_ProxyVideoProducer, 0 | 0 );
|
||||
if (!SWIG_IsOK(res1)) {
|
||||
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ProxyVideoProducer_getMirror" "', argument " "1"" of type '" "ProxyVideoProducer const *""'");
|
||||
}
|
||||
arg1 = reinterpret_cast< ProxyVideoProducer * >(argp1);
|
||||
result = (bool)((ProxyVideoProducer const *)arg1)->getMirror();
|
||||
ST(argvi) = SWIG_From_bool SWIG_PERL_CALL_ARGS_1(static_cast< bool >(result)); argvi++ ;
|
||||
|
||||
XSRETURN(argvi);
|
||||
fail:
|
||||
|
||||
SWIG_croak_null();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
XS(_wrap_ProxyVideoProducer_setMirror) {
|
||||
{
|
||||
ProxyVideoProducer *arg1 = (ProxyVideoProducer *) 0 ;
|
||||
bool arg2 ;
|
||||
void *argp1 = 0 ;
|
||||
int res1 = 0 ;
|
||||
bool val2 ;
|
||||
int ecode2 = 0 ;
|
||||
int argvi = 0;
|
||||
bool result;
|
||||
dXSARGS;
|
||||
|
||||
if ((items < 2) || (items > 2)) {
|
||||
SWIG_croak("Usage: ProxyVideoProducer_setMirror(self,bMirror);");
|
||||
}
|
||||
res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_ProxyVideoProducer, 0 | 0 );
|
||||
if (!SWIG_IsOK(res1)) {
|
||||
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ProxyVideoProducer_setMirror" "', argument " "1"" of type '" "ProxyVideoProducer *""'");
|
||||
}
|
||||
arg1 = reinterpret_cast< ProxyVideoProducer * >(argp1);
|
||||
ecode2 = SWIG_AsVal_bool SWIG_PERL_CALL_ARGS_2(ST(1), &val2);
|
||||
if (!SWIG_IsOK(ecode2)) {
|
||||
SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ProxyVideoProducer_setMirror" "', argument " "2"" of type '" "bool""'");
|
||||
}
|
||||
arg2 = static_cast< bool >(val2);
|
||||
result = (bool)(arg1)->setMirror(arg2);
|
||||
ST(argvi) = SWIG_From_bool SWIG_PERL_CALL_ARGS_1(static_cast< bool >(result)); argvi++ ;
|
||||
|
||||
|
||||
XSRETURN(argvi);
|
||||
fail:
|
||||
|
||||
|
||||
SWIG_croak_null();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
XS(_wrap_ProxyVideoProducer_setActualCameraOutputSize) {
|
||||
{
|
||||
ProxyVideoProducer *arg1 = (ProxyVideoProducer *) 0 ;
|
||||
|
@ -28037,6 +28103,8 @@ static swig_command_info swig_commands[] = {
|
|||
{"tinyWRAPc::delete_ProxyVideoProducer", _wrap_delete_ProxyVideoProducer},
|
||||
{"tinyWRAPc::ProxyVideoProducer_getRotation", _wrap_ProxyVideoProducer_getRotation},
|
||||
{"tinyWRAPc::ProxyVideoProducer_setRotation", _wrap_ProxyVideoProducer_setRotation},
|
||||
{"tinyWRAPc::ProxyVideoProducer_getMirror", _wrap_ProxyVideoProducer_getMirror},
|
||||
{"tinyWRAPc::ProxyVideoProducer_setMirror", _wrap_ProxyVideoProducer_setMirror},
|
||||
{"tinyWRAPc::ProxyVideoProducer_setActualCameraOutputSize", _wrap_ProxyVideoProducer_setActualCameraOutputSize},
|
||||
{"tinyWRAPc::ProxyVideoProducer_push", _wrap_ProxyVideoProducer_push},
|
||||
{"tinyWRAPc::ProxyVideoProducer_setCallback", _wrap_ProxyVideoProducer_setCallback},
|
||||
|
@ -28442,7 +28510,7 @@ XS(SWIG_init) {
|
|||
|
||||
/* Install commands */
|
||||
for (i = 0; swig_commands[i].name; i++) {
|
||||
// Casts only needed for Perl < 5.10.
|
||||
/* Casts only needed for Perl < 5.10. */
|
||||
#ifdef __cplusplus
|
||||
newXS(const_cast<char*>(swig_commands[i].name), swig_commands[i].wrapper, const_cast<char*>(__FILE__));
|
||||
#else
|
||||
|
@ -29140,6 +29208,16 @@ XS(SWIG_init) {
|
|||
sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1(static_cast< int >(tmedia_chroma_yuv420p)));
|
||||
SvREADONLY_on(sv);
|
||||
} while(0) /*@SWIG@*/;
|
||||
/*@SWIG:/usr/local/share/swig/2.0.9/perl5/perltypemaps.swg,65,%set_constant@*/ do {
|
||||
SV *sv = get_sv((char*) SWIG_prefix "tmedia_chroma_mjpeg", TRUE | 0x2 | GV_ADDMULTI);
|
||||
sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1(static_cast< int >(tmedia_chroma_mjpeg)));
|
||||
SvREADONLY_on(sv);
|
||||
} while(0) /*@SWIG@*/;
|
||||
/*@SWIG:/usr/local/share/swig/2.0.9/perl5/perltypemaps.swg,65,%set_constant@*/ do {
|
||||
SV *sv = get_sv((char*) SWIG_prefix "tmedia_chroma_yuyv422", TRUE | 0x2 | GV_ADDMULTI);
|
||||
sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1(static_cast< int >(tmedia_chroma_yuyv422)));
|
||||
SvREADONLY_on(sv);
|
||||
} while(0) /*@SWIG@*/;
|
||||
/*@SWIG:/usr/local/share/swig/2.0.9/perl5/perltypemaps.swg,65,%set_constant@*/ do {
|
||||
SV *sv = get_sv((char*) SWIG_prefix "tmedia_mode_none", TRUE | 0x2 | GV_ADDMULTI);
|
||||
sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1(static_cast< int >(tmedia_mode_none)));
|
||||
|
@ -29330,6 +29408,11 @@ XS(SWIG_init) {
|
|||
sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1(static_cast< int >(tmedia_pref_video_size_4cif)));
|
||||
SvREADONLY_on(sv);
|
||||
} while(0) /*@SWIG@*/;
|
||||
/*@SWIG:/usr/local/share/swig/2.0.9/perl5/perltypemaps.swg,65,%set_constant@*/ do {
|
||||
SV *sv = get_sv((char*) SWIG_prefix "tmedia_pref_video_size_wvga", TRUE | 0x2 | GV_ADDMULTI);
|
||||
sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1(static_cast< int >(tmedia_pref_video_size_wvga)));
|
||||
SvREADONLY_on(sv);
|
||||
} while(0) /*@SWIG@*/;
|
||||
/*@SWIG:/usr/local/share/swig/2.0.9/perl5/perltypemaps.swg,65,%set_constant@*/ do {
|
||||
SV *sv = get_sv((char*) SWIG_prefix "tmedia_pref_video_size_svga", TRUE | 0x2 | GV_ADDMULTI);
|
||||
sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1(static_cast< int >(tmedia_pref_video_size_svga)));
|
||||
|
|
|
@ -1458,6 +1458,8 @@ class ProxyVideoProducer(ProxyPlugin):
|
|||
__del__ = lambda self : None;
|
||||
def getRotation(self): return _tinyWRAP.ProxyVideoProducer_getRotation(self)
|
||||
def setRotation(self, *args): return _tinyWRAP.ProxyVideoProducer_setRotation(self, *args)
|
||||
def getMirror(self): return _tinyWRAP.ProxyVideoProducer_getMirror(self)
|
||||
def setMirror(self, *args): return _tinyWRAP.ProxyVideoProducer_setMirror(self, *args)
|
||||
def setActualCameraOutputSize(self, *args): return _tinyWRAP.ProxyVideoProducer_setActualCameraOutputSize(self, *args)
|
||||
def push(self, *args): return _tinyWRAP.ProxyVideoProducer_push(self, *args)
|
||||
def setCallback(self, *args): return _tinyWRAP.ProxyVideoProducer_setCallback(self, *args)
|
||||
|
|
|
@ -20130,6 +20130,59 @@ fail:
|
|||
}
|
||||
|
||||
|
||||
SWIGINTERN PyObject *_wrap_ProxyVideoProducer_getMirror(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
|
||||
PyObject *resultobj = 0;
|
||||
ProxyVideoProducer *arg1 = (ProxyVideoProducer *) 0 ;
|
||||
void *argp1 = 0 ;
|
||||
int res1 = 0 ;
|
||||
PyObject * obj0 = 0 ;
|
||||
bool result;
|
||||
|
||||
if (!PyArg_ParseTuple(args,(char *)"O:ProxyVideoProducer_getMirror",&obj0)) SWIG_fail;
|
||||
res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_ProxyVideoProducer, 0 | 0 );
|
||||
if (!SWIG_IsOK(res1)) {
|
||||
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ProxyVideoProducer_getMirror" "', argument " "1"" of type '" "ProxyVideoProducer const *""'");
|
||||
}
|
||||
arg1 = reinterpret_cast< ProxyVideoProducer * >(argp1);
|
||||
result = (bool)((ProxyVideoProducer const *)arg1)->getMirror();
|
||||
resultobj = SWIG_From_bool(static_cast< bool >(result));
|
||||
return resultobj;
|
||||
fail:
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
SWIGINTERN PyObject *_wrap_ProxyVideoProducer_setMirror(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
|
||||
PyObject *resultobj = 0;
|
||||
ProxyVideoProducer *arg1 = (ProxyVideoProducer *) 0 ;
|
||||
bool arg2 ;
|
||||
void *argp1 = 0 ;
|
||||
int res1 = 0 ;
|
||||
bool val2 ;
|
||||
int ecode2 = 0 ;
|
||||
PyObject * obj0 = 0 ;
|
||||
PyObject * obj1 = 0 ;
|
||||
bool result;
|
||||
|
||||
if (!PyArg_ParseTuple(args,(char *)"OO:ProxyVideoProducer_setMirror",&obj0,&obj1)) SWIG_fail;
|
||||
res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_ProxyVideoProducer, 0 | 0 );
|
||||
if (!SWIG_IsOK(res1)) {
|
||||
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ProxyVideoProducer_setMirror" "', argument " "1"" of type '" "ProxyVideoProducer *""'");
|
||||
}
|
||||
arg1 = reinterpret_cast< ProxyVideoProducer * >(argp1);
|
||||
ecode2 = SWIG_AsVal_bool(obj1, &val2);
|
||||
if (!SWIG_IsOK(ecode2)) {
|
||||
SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ProxyVideoProducer_setMirror" "', argument " "2"" of type '" "bool""'");
|
||||
}
|
||||
arg2 = static_cast< bool >(val2);
|
||||
result = (bool)(arg1)->setMirror(arg2);
|
||||
resultobj = SWIG_From_bool(static_cast< bool >(result));
|
||||
return resultobj;
|
||||
fail:
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
SWIGINTERN PyObject *_wrap_ProxyVideoProducer_setActualCameraOutputSize(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
|
||||
PyObject *resultobj = 0;
|
||||
ProxyVideoProducer *arg1 = (ProxyVideoProducer *) 0 ;
|
||||
|
@ -26483,6 +26536,8 @@ static PyMethodDef SwigMethods[] = {
|
|||
{ (char *)"delete_ProxyVideoProducer", _wrap_delete_ProxyVideoProducer, METH_VARARGS, NULL},
|
||||
{ (char *)"ProxyVideoProducer_getRotation", _wrap_ProxyVideoProducer_getRotation, METH_VARARGS, NULL},
|
||||
{ (char *)"ProxyVideoProducer_setRotation", _wrap_ProxyVideoProducer_setRotation, METH_VARARGS, NULL},
|
||||
{ (char *)"ProxyVideoProducer_getMirror", _wrap_ProxyVideoProducer_getMirror, METH_VARARGS, NULL},
|
||||
{ (char *)"ProxyVideoProducer_setMirror", _wrap_ProxyVideoProducer_setMirror, METH_VARARGS, NULL},
|
||||
{ (char *)"ProxyVideoProducer_setActualCameraOutputSize", _wrap_ProxyVideoProducer_setActualCameraOutputSize, METH_VARARGS, NULL},
|
||||
{ (char *)"ProxyVideoProducer_push", _wrap_ProxyVideoProducer_push, METH_VARARGS, NULL},
|
||||
{ (char *)"ProxyVideoProducer_setCallback", _wrap_ProxyVideoProducer_setCallback, METH_VARARGS, NULL},
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<?xml version="1.0" encoding="Windows-1252"?>
|
||||
<VisualStudioProject
|
||||
ProjectType="Visual C++"
|
||||
Version="9.00"
|
||||
Version="9,00"
|
||||
Name="audio_opensles"
|
||||
ProjectGUID="{1C451CD7-337D-4E72-8788-9607D263752B}"
|
||||
RootNamespace="audio_opensles"
|
||||
|
|
|
@ -58,6 +58,10 @@ typedef struct tdav_converter_video_libyuv_s
|
|||
uint8* ptr;
|
||||
int size;
|
||||
}scale;
|
||||
struct{
|
||||
uint8* ptr;
|
||||
int size;
|
||||
}mirror;
|
||||
}
|
||||
tdav_converter_video_libyuv_t;
|
||||
|
||||
|
@ -188,7 +192,7 @@ static tsk_size_t tdav_converter_video_libyuv_process(tmedia_converter_video_t*
|
|||
|
||||
src_w = (int)_self->srcWidth , src_h = (int)_self->srcHeight;
|
||||
|
||||
if(self->toI420){
|
||||
if (self->toI420) {
|
||||
tsk_size_t x_in_size;
|
||||
// check input size
|
||||
x_in_size = _tdav_converter_video_libyuv_is_chroma_varsize(_self->srcChroma) ? buffer_size : _tdav_converter_video_libyuv_get_size(_self->srcChroma, src_w, src_h);
|
||||
|
@ -220,10 +224,23 @@ static tsk_size_t tdav_converter_video_libyuv_process(tmedia_converter_video_t*
|
|||
dst_u, dst_u_stride,
|
||||
dst_v, dst_v_stride,
|
||||
crop_x, crop_y,
|
||||
(int)_self->srcWidth, (int)(_self->flip ? (_self->srcHeight * -1) : _self->srcHeight),
|
||||
(int)_self->srcWidth, (int)(_self->flip ? (_self->srcHeight * -1) : _self->srcHeight), // vertical flip
|
||||
(int)_self->srcWidth, (int)_self->srcHeight,
|
||||
kRotate0,
|
||||
(uint32) self->srcFormat);
|
||||
// mirror: horizontal flip (front camera video)
|
||||
if (_self->mirror) {
|
||||
RESIZE_BUFFER(self->mirror.ptr, self->mirror.size, s);
|
||||
ret = I420Mirror(
|
||||
dst_y, dst_y_stride,
|
||||
dst_u, dst_u_stride,
|
||||
dst_v, dst_v_stride,
|
||||
self->mirror.ptr, dst_y_stride,
|
||||
(self->mirror.ptr + ls), dst_u_stride,
|
||||
(self->mirror.ptr + ls + (ls >> 2)), dst_v_stride,
|
||||
(int)_self->srcWidth, (int)_self->srcHeight);
|
||||
memcpy(dst_y, self->mirror.ptr, s);
|
||||
}
|
||||
|
||||
if (ret){
|
||||
TSK_DEBUG_ERROR("ConvertToI420 failed with error code = %d, in_size:%u", ret, x_in_size);
|
||||
|
@ -368,9 +385,28 @@ static tsk_size_t tdav_converter_video_libyuv_process(tmedia_converter_video_t*
|
|||
src_y_stride = src_w;
|
||||
src_u_stride = src_v_stride = ((src_y_stride + 1) >> 1);
|
||||
|
||||
if(scale){
|
||||
ls = dst_w * dst_h;
|
||||
// mirror: horizontal flip (front camera video)
|
||||
if ((_self->mirror)) {
|
||||
ls = src_w * src_h;
|
||||
s = ((ls * 3) >> 1);
|
||||
if (s < (int)buffer_size) { // security check
|
||||
RESIZE_BUFFER(self->mirror.ptr, self->mirror.size, s);
|
||||
ret = I420Mirror(
|
||||
src_y, src_y_stride,
|
||||
src_u, src_u_stride,
|
||||
src_v, src_v_stride,
|
||||
self->mirror.ptr, src_y_stride,
|
||||
(self->mirror.ptr + ls), src_u_stride,
|
||||
(self->mirror.ptr + ls + (ls >> 2)), src_v_stride,
|
||||
src_w, src_h);
|
||||
memcpy(src_y, self->mirror.ptr, s);
|
||||
}
|
||||
}
|
||||
|
||||
if(scale){
|
||||
ls = dst_w * dst_h;
|
||||
s = ((ls * 3) >> 1);
|
||||
|
||||
RESIZE_BUFFER(self->scale.ptr, self->scale.size, s);
|
||||
dst_y = self->scale.ptr;
|
||||
dst_u = (dst_y + (dst_w * dst_h));
|
||||
|
@ -409,7 +445,7 @@ static tsk_size_t tdav_converter_video_libyuv_process(tmedia_converter_video_t*
|
|||
src_u, src_u_stride,
|
||||
src_v, src_v_stride,
|
||||
(uint8*)*output, dst_sample_stride,
|
||||
(int)_self->dstWidth, (_self->flip ? ((int)_self->dstHeight * -1) : (int)_self->dstHeight),
|
||||
(int)_self->dstWidth, (_self->flip ? ((int)_self->dstHeight * -1) : (int)_self->dstHeight), // vertical flip
|
||||
(uint32) self->dstFormat);
|
||||
if(ret){
|
||||
TSK_DEBUG_ERROR("ConvertFromI420 failed with error code = %d", ret);
|
||||
|
@ -439,6 +475,7 @@ static tsk_object_t* tdav_converter_video_libyuv_dtor(tsk_object_t * self)
|
|||
TSK_FREE(converter->chroma.ptr);
|
||||
TSK_FREE(converter->rotate.ptr);
|
||||
TSK_FREE(converter->scale.ptr);
|
||||
TSK_FREE(converter->mirror.ptr);
|
||||
}
|
||||
|
||||
return self;
|
||||
|
|
|
@ -398,9 +398,10 @@ static int tdav_session_video_producer_enc_cb(const void* callback_data, const v
|
|||
#define ENCODED_NEED_FLIP TMEDIA_CODEC_VIDEO(video->encoder.codec)->out.flip
|
||||
#define ENCODED_NEED_RESIZE (base->producer->video.width != TMEDIA_CODEC_VIDEO(video->encoder.codec)->out.width || base->producer->video.height != TMEDIA_CODEC_VIDEO(video->encoder.codec)->out.height)
|
||||
#define PRODUCED_FRAME_NEED_ROTATION (base->producer->video.rotation != 0)
|
||||
#define PRODUCED_FRAME_NEED_MIRROR (base->producer->video.mirror != tsk_false)
|
||||
#define PRODUCED_FRAME_NEED_CHROMA_CONVERSION (base->producer->video.chroma != TMEDIA_CODEC_VIDEO(video->encoder.codec)->out.chroma)
|
||||
// Video codecs only accept YUV420P buffers ==> do conversion if needed or producer doesn't have the right size
|
||||
if(PRODUCER_OUTPUT_RAW && (PRODUCED_FRAME_NEED_CHROMA_CONVERSION || PRODUCER_SIZE_CHANGED || ENCODED_NEED_FLIP || ENCODED_NEED_RESIZE ||PRODUCED_FRAME_NEED_ROTATION)){
|
||||
if(PRODUCER_OUTPUT_RAW && (PRODUCED_FRAME_NEED_CHROMA_CONVERSION || PRODUCER_SIZE_CHANGED || ENCODED_NEED_FLIP || ENCODED_NEED_RESIZE ||PRODUCED_FRAME_NEED_ROTATION || PRODUCED_FRAME_NEED_MIRROR)){
|
||||
// Create video converter if not already done or producer size have changed
|
||||
if(!video->conv.toYUV420 || PRODUCER_SIZE_CHANGED){
|
||||
TSK_OBJECT_SAFE_FREE(video->conv.toYUV420);
|
||||
|
@ -444,7 +445,7 @@ static int tdav_session_video_producer_enc_cb(const void* callback_data, const v
|
|||
}
|
||||
|
||||
// update one-shot parameters
|
||||
tmedia_converter_video_set(video->conv.toYUV420, base->producer->video.rotation, TMEDIA_CODEC_VIDEO(video->encoder.codec)->out.flip, video->encoder.scale_rotated_frames);
|
||||
tmedia_converter_video_set(video->conv.toYUV420, base->producer->video.rotation, TMEDIA_CODEC_VIDEO(video->encoder.codec)->out.flip, base->producer->video.mirror, video->encoder.scale_rotated_frames);
|
||||
|
||||
yuv420p_size = tmedia_converter_video_process(video->conv.toYUV420, buffer, size, &video->encoder.conv_buffer, &video->encoder.conv_buffer_size);
|
||||
if(!yuv420p_size || !video->encoder.conv_buffer){
|
||||
|
|
|
@ -56,6 +56,7 @@ typedef struct tmedia_converter_video_s
|
|||
// one shot parameters
|
||||
int rotation;
|
||||
tsk_bool_t flip;
|
||||
tsk_bool_t mirror;
|
||||
tsk_bool_t scale_rotated_frames;
|
||||
|
||||
const struct tmedia_converter_video_plugin_def_s* plugin;
|
||||
|
@ -64,10 +65,11 @@ tmedia_converter_video_t;
|
|||
|
||||
#define TMEDIA_DECLARE_CONVERTER_VIDEO tmedia_converter_video_t __converter__
|
||||
|
||||
#define tmedia_converter_video_set(self, _rotation, _flip, _scale_rotated_frames) \
|
||||
#define tmedia_converter_video_set(self, _rotation, _flip, _mirror, _scale_rotated_frames) \
|
||||
if((self)){ \
|
||||
(self)->rotation = (_rotation); \
|
||||
(self)->flip = (_flip); \
|
||||
(self)->mirror = (_mirror); \
|
||||
(self)->scale_rotated_frames = (_scale_rotated_frames); \
|
||||
}
|
||||
#define tmedia_converter_video_set_rotation(self, _rotation) \
|
||||
|
@ -78,6 +80,10 @@ tmedia_converter_video_t;
|
|||
if((self)){ \
|
||||
(self)->flip = (_flip); \
|
||||
}
|
||||
#define tmedia_converter_video_set_mirror(self, _mirror) \
|
||||
if((self)){ \
|
||||
(self)->mirror = (_mirror); \
|
||||
}
|
||||
#define tmedia_converter_video_set_scale_rotated_frames(self, _scale_rotated_frames) \
|
||||
if((self)){ \
|
||||
(self)->scale_rotated_frames = (_scale_rotated_frames); \
|
||||
|
|
|
@ -66,6 +66,7 @@ typedef struct tmedia_producer_s
|
|||
tmedia_chroma_t chroma;
|
||||
int fps;
|
||||
int rotation;
|
||||
tsk_bool_t mirror;
|
||||
tsk_size_t width;
|
||||
tsk_size_t height;
|
||||
} video;
|
||||
|
|
|
@ -265,7 +265,7 @@
|
|||
|
||||
<!-- click-to-call widget -->
|
||||
|
||||
<script type='text/javascript' src='http://click2dial.org/c2c-api.js'></script>
|
||||
<script type='text/javascript' src='https://click-2-dial.googlecode.com/svn/trunk/release/c2c-api.js'></script>
|
||||
|
||||
<script type='text/javascript'>
|
||||
c2c.from = 'ZGlvcG1hbWFkb3VAZG91YmFuZ28ub3Jn';
|
||||
|
|
Loading…
Reference in New Issue