meta-digi/meta-digi-dey/recipes-multimedia/gst-plugins/gst-fsl-plugin-2.0.3/0001-gplay_fullscreen.patch

81 lines
3.5 KiB
Diff

From: Javier Viguera <javier.viguera@digi.com>
Date: Mon, 9 Apr 2012 12:44:06 +0200
Subject: [PATCH] gplay_fullscreen
* At start play the video with it's own resolution (not full-screened)
* Fix 'resize' command to set full-screen flag depending on the display
size.
Signed-off-by: Javier Viguera <javier.viguera@digi.com>
---
src/misc/v4l_sink/src/mfw_gst_v4l.c | 4 ++--
src/misc/v4l_sink/src/mfw_gst_v4lsink.c | 2 +-
tools/gplay/mfw_gplay_core.c | 16 ++++++++++++++++
3 files changed, 19 insertions(+), 3 deletions(-)
diff --git a/src/misc/v4l_sink/src/mfw_gst_v4l.c b/src/misc/v4l_sink/src/mfw_gst_v4l.c
index 8c2ed72..b85879a 100755
--- a/src/misc/v4l_sink/src/mfw_gst_v4l.c
+++ b/src/misc/v4l_sink/src/mfw_gst_v4l.c
@@ -1355,11 +1355,11 @@ mfw_gst_v4l2_display_init (MFW_GST_V4LSINK_INFO_T * v4l_info,
height = (disp_height >> 3) << 3;
if (width == 0) {
GST_WARNING("Wrong display width information");
- width = v4l_info->fullscreen_width;
+ width = v4l_info->width;
}
if (height == 0) {
GST_WARNING("Wrong display height information");
- height = v4l_info->fullscreen_height;
+ height = v4l_info->height;
}
return ( mfw_gst_v4l2_set_crop(v4l_info, width, height) );
diff --git a/src/misc/v4l_sink/src/mfw_gst_v4lsink.c b/src/misc/v4l_sink/src/mfw_gst_v4lsink.c
index 20bf126..a3ba4a6 100755
--- a/src/misc/v4l_sink/src/mfw_gst_v4lsink.c
+++ b/src/misc/v4l_sink/src/mfw_gst_v4lsink.c
@@ -976,7 +976,7 @@ mfw_gst_v4lsink_show_frame (GstBaseSink * basesink, GstBuffer * buf)
v4l_info->disp_height);
if (result != TRUE) {
- g_print ("\nFailed to initalize the display\n");
+ GST_WARNING ("Failed to initalize the display");
g_mutex_unlock (v4l_info->flow_lock);
return GST_FLOW_OK;
}
diff --git a/tools/gplay/mfw_gplay_core.c b/tools/gplay/mfw_gplay_core.c
index 8361499..04be21b 100755
--- a/tools/gplay/mfw_gplay_core.c
+++ b/tools/gplay/mfw_gplay_core.c
@@ -1583,6 +1583,9 @@ fsl_player_ret_val fsl_player_resize(fsl_player_handle handle, fsl_player_displa
fsl_player_property* pproperty = (fsl_player_property*)pplayer->property_handle;
GstElement* auto_video_sink = NULL;
GstElement* actual_video_sink = NULL;
+ fsl_player_s32 fullscreen_width = 0;
+ fsl_player_s32 fullscreen_height = 0;
+ fsl_player_s32 fb = 0;
g_object_get(pproperty->playbin, "video-sink", &auto_video_sink, NULL);
if( NULL == auto_video_sink )
@@ -1607,6 +1610,19 @@ fsl_player_ret_val fsl_player_resize(fsl_player_handle handle, fsl_player_displa
g_object_set(G_OBJECT(actual_video_sink), "disp-width", pproperty->display_parameter.disp_width, NULL);
g_object_set(G_OBJECT(actual_video_sink), "disp-height", pproperty->display_parameter.disp_height, NULL);
+ /* Set full-screen flag depending on the new display parameters */
+ fullscreen_fb0_open(&fb);
+ fullscreen_fb0_get_width_height(fb, &(fullscreen_width), &(fullscreen_height));
+ fullscreen_fb0_close(&fb);
+ if ((pproperty->display_parameter.offsetx == 0)
+ && (pproperty->display_parameter.offsety == 0)
+ && (pproperty->display_parameter.disp_width == fullscreen_width)
+ && (pproperty->display_parameter.disp_height == fullscreen_height)) {
+ pproperty->bfullscreen = 1;
+ } else {
+ pproperty->bfullscreen = 0;
+ }
+
update_mfw_v4lsink_parameter(actual_video_sink);
g_object_unref (actual_video_sink);