After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 730070 - hlsdemux: add support for stream RESOLUTION extension
hlsdemux: add support for stream RESOLUTION extension
Status: RESOLVED OBSOLETE
Product: GStreamer
Classification: Platform
Component: gst-plugins-bad
git master
Other Linux
: Normal enhancement
: git master
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2014-05-13 16:58 UTC by m][sko
Modified: 2018-11-03 13:23 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
video: Add new query for querying video surface information (7.27 KB, patch)
2014-05-27 14:48 UTC, Sebastian Dröge (slomo)
none Details | Review
prototype emit query from HLSdemux (3.62 KB, patch)
2014-07-14 07:09 UTC, m][sko
none Details | Review
route sink query in mpegtsdemux (1.64 KB, patch)
2014-07-14 07:09 UTC, m][sko
none Details | Review
reconfigure event + sink query (2.52 KB, application/octet-stream)
2014-07-14 07:11 UTC, m][sko
  Details

Description m][sko 2014-05-13 16:58:57 UTC
This property is useful if player change output window and in most case it is really waste of bandwidth if hlsdemux switch to higher quality/quality/bitrate  but player window is much smaller window.
Comment 1 m][sko 2014-05-27 06:40:31 UTC
From mail conversation with Sebastian Dröge

The resolution is usually propagated upstream to elements with the CAPS
query, and the elements are notified of something changing with the
RECONFIGURE event. Unfortunately in this case this won't work yet as
1) after hlsdemux there is another demuxer that does not forward and
   transform the CAPS query downstream (and can't sensibly). This
   is tsdemux usually.
2) after that second demuxer there is a video decoder, and video
   decoders currently don't forward and transform the CAPS query.
   The decoder could do this quite easily, and it could probably
   even be implemented in the video decoder base class.

1) is a real problem and I currently don't know how to solve that
without putting demuxers inside hlsdemux so that hlsdemux can directly
query the CAPS on the video stream.

Hi sebastian
I checked xvideosink and other video sinks
and I simply can't find any notice that videosink sent upstream information when window size change.
ximagesink send gst_event_new_reconfigure() in gst_ximagesink_xwindow_update_geometry => regenerate caps
As this isn't caps related it is just some event that will notify upstream elements  

The reconfigure event is sent upstream, and tells upstream elements that
they should reconfigure. I.e. check with downstream if there's a more
optimal configuration now, regarding caps (e.g. the resolution!) or the
used allocation mechanism. hlsdemux would get this event whenever the
resolution changes and can then do something.

But as explained in the previous mail, it currently can't do much and
you would need to find a way to proxy the resolution in the caps up to
hlsdemux.
Comment 2 Sebastian Dröge (slomo) 2014-05-27 06:55:03 UTC
We need something like in your patch in bug #730225 here. I think ideally we would do the following:
- Add a "reason" to the reconfigure event, which is an array of strings. This can be "caps", "allocation", ..., "window-size". Reason being an empty array means all have to be checked (default case)
- Add a query to libgstvideo to query the downstream window size

Then before first rendering and whenever we get such a reconfigure event we would run the query. I'll take a look at implementing that.
Comment 3 Sebastian Dröge (slomo) 2014-05-27 07:53:42 UTC
API proposals here btw

> GstEvent*       gst_event_new_reconfigure              (void) G_GNUC_MALLOC;
> void            gst_event_add_reconfigure_reason       (GstEvent * event, const gchar * reason);
> guint           gst_event_get_n_reconfigure_reasons    (GstEvent * event);
> gboolean        gst_event_parse_nth_reconfigure_reason (GstEvent * event, guint n, gchar ** reason);
> gboolean        gst_event_has_reconfigure_reason       (GstEvent * event, const gchar * reason);

> gboolean      gst_video_query_is_surface_info    (GstQuery * query);
> GstQuery *    gst_video_query_new_surface_info   (void);
> 
> void          gst_video_query_set_surface_size   (GstQuery * query, gint width, gint height);
> gboolean      gst_video_query_parse_surface_size (GstQuery * query, gint * width, gint * height);
> 
> void          gst_video_query_set_surface_framerate   (GstQuery * query, gint fps_n, gint fps_d);
> gboolean      gst_video_query_parse_surface_framerate (GstQuery * query, gint * fps_n, gint * fps_d);
> 
> void          gst_video_query_set_surface_pixel_aspect_ratio   (GstQuery * query, gint par_n, gint par_d);
> gboolean      gst_video_query_parse_surface_pixel_aspect_ratio (GstQuery * query, gint * par_n, gint * par_d);


Will implement that in a bit if nobody has any comments
Comment 4 m][sko 2014-05-27 10:12:07 UTC
And what if we have pipeline with videoscale element?
videoscale element pass query to another element?
Comment 5 Sebastian Dröge (slomo) 2014-05-27 10:26:49 UTC
Yes
Comment 6 m][sko 2014-05-27 11:37:12 UTC
Then we still need to add support for window size to all elements in possible pipelines.
Like mpegdemux for POSITION for example?
http://cgit.freedesktop.org/gstreamer/gst-plugins-bad/tree/gst/mpegdemux/gstmpegdemux.c#n1344

hlsdemux/dashdemux/.. query src element in pipeline for window size
and elements will pass this query .. to some sink that really understand this query.
Right? :)
Comment 7 Nicolas Dufresne (ndufresne) 2014-05-27 13:25:51 UTC
(In reply to comment #2)
> We need something like in your patch in bug #730225 here. I think ideally we
> would do the following:
> - Add a "reason" to the reconfigure event, which is an array of strings. This
> can be "caps", "allocation", ..., "window-size". Reason being an empty array
> means all have to be checked (default case)

How do you get the reconfigure event, usually we detect that reconfigure through the reconfigure flag on the pad. Should the event become the first upstream sticky, with a new method to check reconfigure ?
Comment 8 Sebastian Dröge (slomo) 2014-05-27 14:48:09 UTC
(In reply to comment #6)
> Then we still need to add support for window size to all elements in possible
> pipelines.
> Like mpegdemux for POSITION for example?
> http://cgit.freedesktop.org/gstreamer/gst-plugins-bad/tree/gst/mpegdemux/gstmpegdemux.c#n1344
> 
> hlsdemux/dashdemux/.. query src element in pipeline for window size
> and elements will pass this query .. to some sink that really understand this
> query.
> Right? :)

Nope, that should all be handled automagically as long as you don't have multiple video sinks... in which case you just get one of the values automatically.


(In reply to comment #7)
> (In reply to comment #2)
> > We need something like in your patch in bug #730225 here. I think ideally we
> > would do the following:
> > - Add a "reason" to the reconfigure event, which is an array of strings. This
> > can be "caps", "allocation", ..., "window-size". Reason being an empty array
> > means all have to be checked (default case)
> 
> How do you get the reconfigure event, usually we detect that reconfigure
> through the reconfigure flag on the pad. Should the event become the first
> upstream sticky, with a new method to check reconfigure ?

gst_pad_check_reconfigure_full(pad, &reasons)
Comment 9 Sebastian Dröge (slomo) 2014-05-27 14:48:50 UTC
Created attachment 277303 [details] [review]
video: Add new query for querying video surface information

... like the effective width and height of the video.
Comment 10 m][sko 2014-07-14 07:09:11 UTC
Created attachment 280618 [details] [review]
prototype emit query from HLSdemux
Comment 11 m][sko 2014-07-14 07:09:53 UTC
Created attachment 280619 [details] [review]
route sink query in mpegtsdemux
Comment 12 m][sko 2014-07-14 07:11:06 UTC
Created attachment 280620 [details]
reconfigure event + sink query
Comment 13 m][sko 2014-07-14 07:18:05 UTC
Anybody can plz review my last 3 patches.
I did it as prototype.
If everybody agree with this prototype I will add support for more sinks and demuxers(mkv,..)
Comment 14 m][sko 2014-08-06 21:26:30 UTC
anybody can look at this?
Comment 15 GStreamer system administrator 2018-11-03 13:23:19 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/issues/146.