Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
BC
public
mediastreamer2
Commits
350bc637
Commit
350bc637
authored
Dec 10, 2014
by
Simon Morlat
Browse files
fix race condition
parent
b4c77370
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
4 deletions
+17
-4
include/mediastreamer2/mediastream.h
include/mediastreamer2/mediastream.h
+1
-0
src/android/androidvideo.cpp
src/android/androidvideo.cpp
+9
-4
src/voip/videostream.c
src/voip/videostream.c
+7
-0
No files found.
include/mediastreamer2/mediastream.h
View file @
350bc637
...
...
@@ -859,6 +859,7 @@ MS2_PUBLIC VideoPreview * video_preview_new(void);
#define video_preview_set_fps(p,fps) video_stream_set_fps((VideoStream*)p,fps)
#define video_preview_set_device_rotation(p, r) video_stream_set_device_rotation(p, r)
MS2_PUBLIC
void
video_preview_start
(
VideoPreview
*
stream
,
MSWebCam
*
device
);
MS2_PUBLIC
MSVideoSize
video_preview_get_current_size
(
VideoPreview
*
stream
);
MS2_PUBLIC
void
video_preview_stop
(
VideoPreview
*
stream
);
/**
...
...
src/android/androidvideo.cpp
View file @
350bc637
...
...
@@ -327,9 +327,10 @@ static void video_capture_process(MSFilter *f){
static
void
video_capture_postprocess
(
MSFilter
*
f
){
ms_message
(
"Postprocessing of Android VIDEO capture filter"
);
AndroidReaderContext
*
d
=
getContext
(
f
);
ms_mutex_lock
(
&
d
->
mutex
);
JNIEnv
*
env
=
ms_get_jni_env
();
ms_mutex_lock
(
&
d
->
mutex
);
if
(
d
->
androidCamera
)
{
jmethodID
method
=
env
->
GetStaticMethodID
(
d
->
helperClass
,
"stopRecording"
,
"(Ljava/lang/Object;)V"
);
...
...
@@ -464,9 +465,13 @@ extern "C" {
JNIEXPORT
void
JNICALL
Java_org_linphone_mediastream_video_capture_AndroidVideoApi5JniWrapper_putImage
(
JNIEnv
*
env
,
jclass
thiz
,
jlong
nativePtr
,
jbyteArray
frame
)
{
AndroidReaderContext
*
d
=
(
AndroidReaderContext
*
)
nativePtr
;
if
(
!
d
->
androidCamera
)
return
;
ms_mutex_lock
(
&
d
->
mutex
);
if
(
!
d
->
androidCamera
){
ms_mutex_unlock
(
&
d
->
mutex
);
return
;
}
if
(
!
ms_video_capture_new_frame
(
&
d
->
fpsControl
,
d
->
filter
->
ticker
->
time
))
{
ms_mutex_unlock
(
&
d
->
mutex
);
...
...
src/voip/videostream.c
View file @
350bc637
...
...
@@ -1145,6 +1145,13 @@ VideoPreview * video_preview_new(void){
return
stream
;
}
MSVideoSize
video_preview_get_current_size
(
VideoPreview
*
stream
){
MSVideoSize
ret
=
{
0
};
if
(
stream
->
source
){
ms_filter_call_method
(
stream
->
source
,
MS_FILTER_GET_VIDEO_SIZE
,
&
ret
);
}
return
ret
;
}
void
video_preview_start
(
VideoPreview
*
stream
,
MSWebCam
*
device
){
MSPixFmt
format
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment