diff options
author | Sebastien Vincent <seb@jitsi.org> | 2011-02-25 09:41:28 +0000 |
---|---|---|
committer | Sebastien Vincent <seb@jitsi.org> | 2011-02-25 09:41:28 +0000 |
commit | 9979ac0ca3827a50b82b66664a286b08c0300be8 (patch) | |
tree | a896243610d7edb39bf814b8d7d98a7748e3e6ac /src/native | |
parent | 8cd17189ddc05e6640e87c28749290987ef75cd4 (diff) | |
download | jitsi-9979ac0ca3827a50b82b66664a286b08c0300be8.zip jitsi-9979ac0ca3827a50b82b66664a286b08c0300be8.tar.gz jitsi-9979ac0ca3827a50b82b66664a286b08c0300be8.tar.bz2 |
Revert directshow changes from revision 8273.
Diffstat (limited to 'src/native')
3 files changed, 16 insertions, 68 deletions
diff --git a/src/native/windows/directshow/ds_capture_device.cpp b/src/native/windows/directshow/ds_capture_device.cpp index 641126a..b4fcb4d 100644 --- a/src/native/windows/directshow/ds_capture_device.cpp +++ b/src/native/windows/directshow/ds_capture_device.cpp @@ -112,7 +112,6 @@ DSCaptureDevice::DSCaptureDevice(const WCHAR* name) m_name = wcsdup(name);
}
- m_flip = false;
m_callback = NULL;
m_filterGraph = NULL;
@@ -377,40 +376,6 @@ bool DSCaptureDevice::initDevice(IMoniker* moniker) /* initialize the list of formats this device supports */
initSupportedFormats();
- /* see if camera support flipping */
- IAMVideoControl* videoControl = NULL;
- long caps = 0;
-
- ret = m_captureGraphBuilder->FindInterface(&PIN_CATEGORY_CAPTURE, &MEDIATYPE_Video,
- m_srcFilter, IID_IAMVideoControl, (void**)&videoControl);
-
- if(!FAILED(ret))
- {
- IPin* pin = NULL;
-
- ret = m_captureGraphBuilder->FindPin(
- m_srcFilter, PINDIR_OUTPUT, &PIN_CATEGORY_CAPTURE, NULL, FALSE, 0, &pin);
-
- if(!FAILED(ret))
- {
- if(!FAILED(videoControl->GetCaps(pin, &caps)))
- {
- if((caps & VideoControlFlag_FlipVertical) > 0)
- {
- m_flip = true;
- }
- else
- {
- m_flip = false;
- }
- videoControl->SetMode(pin, caps);
- }
- pin->Release();
- }
-
- videoControl->Release();
- }
-
return setFormat(m_formats.front());
}
@@ -533,8 +498,3 @@ size_t DSCaptureDevice::getBitPerPixel() return m_bitPerPixel;
}
-bool DSCaptureDevice::isFlip()
-{
- return m_flip;
-}
-
diff --git a/src/native/windows/directshow/ds_capture_device.h b/src/native/windows/directshow/ds_capture_device.h index a8393ab..78db67d 100644 --- a/src/native/windows/directshow/ds_capture_device.h +++ b/src/native/windows/directshow/ds_capture_device.h @@ -171,12 +171,6 @@ public: */
size_t getBitPerPixel();
- /**
- * \brief If the image is flipped vertically.
- * \return true if image is flipped vertically, false otherwise
- */
- bool isFlip();
-
private:
/**
* \brief Initialize list of supported size.
@@ -242,11 +236,6 @@ private: * \brief Current bit per pixel.
*/
size_t m_bitPerPixel;
-
- /**
- * \brief If the video is already flipped.
- */
- bool m_flip;
};
#endif /* DS_CAPTURE_DEVICE_H */
diff --git a/src/native/windows/directshow/net_java_sip_communicator_impl_neomedia_directshow_DSCaptureDevice.cpp b/src/native/windows/directshow/net_java_sip_communicator_impl_neomedia_directshow_DSCaptureDevice.cpp index 66dd0de..8272340 100644 --- a/src/native/windows/directshow/net_java_sip_communicator_impl_neomedia_directshow_DSCaptureDevice.cpp +++ b/src/native/windows/directshow/net_java_sip_communicator_impl_neomedia_directshow_DSCaptureDevice.cpp @@ -94,9 +94,8 @@ public: bytesPerPixel = m_dev->getBitPerPixel() / 8;
/* flip image for RGB content */
- flipImage = !m_dev->isFlip() &&
- (format.mediaType == MEDIASUBTYPE_ARGB32 ||
- format.mediaType == MEDIASUBTYPE_RGB32 ||
+ flipImage = (format.mediaType == MEDIASUBTYPE_ARGB32 ||
+ format.mediaType == MEDIASUBTYPE_RGB32 ||
format.mediaType == MEDIASUBTYPE_RGB24);
sample->GetPointer(&data);
@@ -118,7 +117,7 @@ public: m_bytesLength = length;
}
- /* it seems that images is always inversed,
+ /* it seems that images is always inversed,
* the following code from lti-civil is always used to flip
* images
*/
@@ -140,7 +139,7 @@ public: }
return S_OK;
}
-
+
/**
* \brief Java VM.
*/
@@ -154,7 +153,7 @@ public: /**
* \brief Internal buffer.
*/
- BYTE* m_bytes;
+ BYTE* m_bytes;
/**
* \brief Length of internal buffer.
@@ -172,7 +171,7 @@ public: * \param env JNI environment
* \param obj DSCaptureDevice object
* \param ptr native pointer of DSCaptureDevice
- */
+ */
JNIEXPORT void JNICALL Java_net_java_sip_communicator_impl_neomedia_directshow_DSCaptureDevice_open
(JNIEnv* env, jobject obj, jlong ptr)
{
@@ -187,21 +186,21 @@ JNIEXPORT void JNICALL Java_net_java_sip_communicator_impl_neomedia_directshow_D * \param env JNI environment
* \param obj DSCaptureDevice object
* \param ptr native pointer of DSCaptureDevice
- */
+ */
JNIEXPORT void JNICALL Java_net_java_sip_communicator_impl_neomedia_directshow_DSCaptureDevice_close
(JNIEnv* env, jobject obj, jlong ptr)
{
DSCaptureDevice* dev = reinterpret_cast<DSCaptureDevice*>(ptr);
dev->stop();
}
-
+
/**
* \brief Get name of native capture device.
* \param env JNI environment
* \param obj DSCaptureDevice object
* \param ptr native pointer of DSCaptureDevice
* \return name of the native capture device
- */
+ */
JNIEXPORT jstring JNICALL Java_net_java_sip_communicator_impl_neomedia_directshow_DSCaptureDevice_getName
(JNIEnv* env, jobject obj, jlong ptr)
{
@@ -225,14 +224,14 @@ JNIEXPORT jstring JNICALL Java_net_java_sip_communicator_impl_neomedia_directsho * \param obj DSCaptureDevice object
* \param ptr native pointer of DSCaptureDevice
* \param format DSFormat to set
- */
+ */
JNIEXPORT void JNICALL Java_net_java_sip_communicator_impl_neomedia_directshow_DSCaptureDevice_setFormat
(JNIEnv* env, jobject obj, jlong ptr, jobject format)
{
DSCaptureDevice* dev = reinterpret_cast<DSCaptureDevice*>(ptr);
VideoFormat fmt;
jclass clazz = env->GetObjectClass(format);
-
+
if(clazz)
{
jfieldID fieldH = env->GetFieldID(clazz, "height", "I");
@@ -241,11 +240,11 @@ JNIEXPORT void JNICALL Java_net_java_sip_communicator_impl_neomedia_directshow_D jlong f = env->GetLongField(format, fieldF);
jint w = env->GetIntField(format, fieldW);
jint h = env->GetIntField(format, fieldH);
-
+
fmt.width = w;
fmt.height = h;
fmt.pixelFormat = (unsigned long)f;
-
+
dev->setFormat(fmt);
dev->start();
}
@@ -292,7 +291,7 @@ JNIEXPORT jobject JNICALL Java_net_java_sip_communicator_impl_neomedia_directsho * \param obj DSCaptureDevice object
* \param ptr native pointer of DSCaptureDevice
* \return array of DSFormat object
- */
+ */
JNIEXPORT jobjectArray JNICALL Java_net_java_sip_communicator_impl_neomedia_directshow_DSCaptureDevice_getSupportedFormats
(JNIEnv* env, jobject obj, jlong ptr)
{
@@ -356,7 +355,7 @@ JNIEXPORT void JNICALL Java_net_java_sip_communicator_impl_neomedia_directshow_D Grabber* grab = NULL;
DSCaptureDevice* dev = reinterpret_cast<DSCaptureDevice*>(ptr);
DSGrabberCallback* prev = dev->getCallback();
-
+
if(delegate != NULL)
{
delegate = env->NewGlobalRef(delegate);
@@ -373,7 +372,7 @@ JNIEXPORT void JNICALL Java_net_java_sip_communicator_impl_neomedia_directshow_D {
dev->setCallback(NULL);
}
-
+
if(prev)
{
jobject tmp_delegate = ((Grabber*)prev)->m_delegate;
|