Commit ad5e5d8a authored by Ghislain MARY's avatar Ghislain MARY

Correctly set device orientation for VideoPreview stream.

parent 11181906
......@@ -781,6 +781,7 @@ MS2_PUBLIC VideoPreview * video_preview_new(void);
#define video_preview_set_native_window_id(p,id) video_stream_set_native_preview_window_id(p,id)
#define video_preview_get_native_window_id(p) video_stream_get_native_preview_window_id(p)
#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 void video_preview_stop(VideoPreview *stream);
......
......@@ -1014,6 +1014,12 @@ void video_preview_start(VideoPreview *stream, MSWebCam *device){
stream->source = ms_web_cam_create_reader(device);
/* Transmit orientation to source filter. */
ms_filter_call_method(stream->source, MS_VIDEO_CAPTURE_SET_DEVICE_ORIENTATION, &stream->device_orientation);
/* Initialize the capture device orientation. */
if (ms_filter_has_method(stream->source, MS_VIDEO_DISPLAY_SET_DEVICE_ORIENTATION)) {
ms_filter_call_method(stream->source, MS_VIDEO_DISPLAY_SET_DEVICE_ORIENTATION, &stream->device_orientation);
}
/* configure the filters */
ms_filter_call_method(stream->source,MS_FILTER_SET_VIDEO_SIZE,&vsize);
......@@ -1044,6 +1050,7 @@ void video_preview_start(VideoPreview *stream, MSWebCam *device){
if (stream->preview_window_id!=0){
video_stream_set_native_preview_window_id(stream, stream->preview_window_id);
}
/* create the ticker */
stream->ms.sessions.ticker = ms_ticker_new();
ms_ticker_set_name(stream->ms.sessions.ticker,"Video MSTicker");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment