This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Linux/DRA746: waylandsink: How to fit to screen/display resolution with videos larger/smaller than it?

Part Number: DRA746

Tool/software: Linux

Hi Team,

 Could you suggest a way on how to show videos which is smaller or larger than screen/display resolution to fit to screen/display (fullscreen) with waylandsink? I checked and waylandsink seems do not have “width” and “height” property.

 We are using display with 800x480 resolution. We have different variant with different display resolution and looking for a standard way to show it fullscreen irrespective of video source size.

 

B01_Baseline1.0_1280_720.MP4 (while playing this video it only shows top left part of it )

TearOfSteel-AV-Short-720x420.mp4 (while playing we see black strip on right and bottom)

 

 Thanks & regards,

Vikash

  • Hi Vikash,
    Current version of Linux SDK doesn't support resizing with waylandsink plugin as there are no properties to set the resolution of the window.
    But you can modify waylandsink plugin to hardcode window size for your display resolution with wl_viewport_set_destination() call.
    TI has a patch for to set window-resolution with properties, we will push the patch after review and share you the information.

    Ramprasad
  • Hi Ramprasad,

    Thank you for quick reply. Yes, currently I am using wl_viewport_set_destination(). Could you share the patch? Do you know when it will it be available?

    Regards,
    Vikash
  • Hi Ram,

    Could you share the patch for this so we could test?

    Regards,
    Vikash
  • Hi Vikash,
    Latest Gst-Bad v1.13.1 also doesn't have this feature of configuring window resolution with a property. TI will consider adding this with next SDK release.
    Is this supported on other platforms like imx?

    Thanks
    Ramprasad
  • Hi Ram,

    For i.MX6 we do not use waylandsink. Instead we are using "glimagesink". Could you please tell ETA for this?

    Regards,
    Vikash
  • Hi Vikash,

    Please use the attached patch to set the window resolution using a property of waylandsink. 0001-waylandsink-Add-scalar-support-with-waylandsink.zip

    Ram

  • Hi Ram,

    I have integrated and built the waylandsink. However it is not working as expected.

    I tried with the below command and on display video comes for only 768x464.

    gst-launch-1.0 playbin uri=file:///home/root/TearOfSteel-AV-Short-720x420.mp4 video-sink=waylandsink sync=false window-resolution=800x480

    Also I was using below change previpusly and I removed it in my above testing? Do I need to keep this change also?

    static void
    gst_wl_window_resize_video_surface (GstWlWindow * window, gboolean commit)
    {

    //wl_viewport_set_destination (window->video_viewport, res.w, res.h);
    wl_viewport_set_destination (window->video_viewport, 800, 480);


    Regards,
    Vikash
  • Hi Vikash,

    If my patch is applied, no need to hardcode .

    Can you first try the pipeline for explicit pipleline and not playbin?

    If you are using playbin, then video-sink property should be set as shown below , i,e use " "

    gst-launch-1.0 playbin uri=file:///home/root/TearOfSteel-AV-Short-720x420.mp4 video-sink="waylandsink sync=false window-resolution=800x480"

     

    Can you try this ?

    Ram

  • Hi Ram,

    I tested with following pipelines and it seems to work fine.

    1. video with 1280x720
    gst-launch-1.0 filesrc location=/home/root/B01_Baseline1.0_1280_720.MP4 ! qtdemux ! h264parse ! ducatih264dec ! waylandsink window-resolution=800x480

    Result: Works fine.

    2. video with 800x480
    gst-launch-1.0 playbin uri=file:///home/root/TearOfSteel-AV-Short-720x420.mp4 video-sink="waylandsink window-resolution=800x480"

    Result: Works fine.

    3. video with 640x360
    gst-launch-1.0 playbin uri=file:///home/root/Ep1.mp4 video-sink="waylandsink window-resolution=800x480"

    Result: Works fine.

    If I add "sync=false" then resolution is fine but it seems video is fast forwarding.

    Regards,
    Vikash
  • Hi Vikash,
    Thanks for confirming the result.
    sync=false is to display without waiting for render callback. By default it is true.
    You don't need to set this to false explicitly. You can close this thread if the issue is resolved

    Thanks
    Ram
  • Thank you Ram for your kind support.