Commit 79549898 authored by Ghislain MARY's avatar Ghislain MARY

Add video_stream_get_camera_sensor_rotation().

parent 60edaade
......@@ -443,6 +443,17 @@ MS2_PUBLIC void video_stream_use_preview_video_window(VideoStream *stream, bool_
MS2_PUBLIC void video_stream_set_device_rotation(VideoStream *stream, int orientation);
MS2_PUBLIC void video_stream_show_video(VideoStream *stream, bool_t show);
/**
* @brief Gets the camera sensor rotation.
*
* This is needed on some mobile platforms to get the number of degrees the camera sensor
* is rotated relative to the screen.
*
* @param stream The video stream related to the operation
* @return The camera sensor rotation in degrees (0 to 360) or -1 if it could not be retrieved
*/
MS2_PUBLIC int video_stream_get_camera_sensor_rotation(VideoStream *stream);
/*provided for compatibility, use video_stream_set_direction() instead */
MS2_PUBLIC int video_stream_recv_only_start(VideoStream *videostream, RtpProfile *profile, const char *addr, int port, int used_pt, int jitt_comp);
MS2_PUBLIC int video_stream_send_only_start(VideoStream *videostream,
......
......@@ -180,6 +180,8 @@ typedef enum _MSRecorderState MSRecorderState;
/** Interface definitions for video capture */
#define MS_VIDEO_CAPTURE_SET_DEVICE_ORIENTATION \
MS_FILTER_METHOD(MSFilterVideoCaptureInterface,0,int)
#define MS_VIDEO_CAPTURE_GET_CAMERA_SENSOR_ROTATION \
MS_FILTER_METHOD(MSFilterVideoCaptureInterface, 1, int)
/** Interface definitions for audio decoder */
......
......@@ -704,6 +704,16 @@ void video_stream_set_device_rotation(VideoStream *stream, int orientation){
stream->device_orientation = orientation;
}
int video_stream_get_camera_sensor_rotation(VideoStream *stream) {
int rotation = -1;
if (stream->source) {
if (ms_filter_has_method(stream->source, MS_VIDEO_CAPTURE_GET_CAMERA_SENSOR_ROTATION)
&& ms_filter_call_method(stream->source, MS_VIDEO_CAPTURE_GET_CAMERA_SENSOR_ROTATION, &rotation) == 0)
return rotation;
}
return -1;
}
VideoPreview * video_preview_new(void){
VideoPreview *stream = (VideoPreview *)ms_new0 (VideoPreview, 1);
stream->sent_vsize.width=MS_VIDEO_SIZE_CIF_W;
......
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