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 758689 - decodebin: insert input-selector to resolve the issue when a unique codec is allowed for each decoder type
decodebin: insert input-selector to resolve the issue when a unique codec is ...
Status: RESOLVED DUPLICATE of bug 775132
Product: GStreamer
Classification: Platform
Component: gst-plugins-base
git master
Other Windows
: Normal enhancement
: git master
Assigned To: GStreamer Maintainers
GStreamer Maintainers
: 756794 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2015-11-26 06:59 UTC by WeiChungChang
Modified: 2018-05-05 16:00 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
patch (14.25 KB, patch)
2015-11-26 06:59 UTC, WeiChungChang
none Details | Review
corrected patch version 2 (10.84 KB, patch)
2015-11-26 07:30 UTC, WeiChungChang
none Details | Review
implementation details (548.61 KB, application/pdf)
2015-11-26 07:39 UTC, WeiChungChang
  Details
original flow - with duplication codec instances (374.63 KB, image/png)
2015-11-26 07:46 UTC, WeiChungChang
  Details
with the insertion of input selector - a unique codec is shared by dual audio tracks (406.54 KB, image/png)
2015-11-26 07:48 UTC, WeiChungChang
  Details

Description WeiChungChang 2015-11-26 06:59:05 UTC
Created attachment 316282 [details] [review]
patch

Currently GStreamer will try to create several duplications of CODEC instances even if the types are all the same. For some applications such as an embedded hardware COEDC which could be accessed only by one decoding thread, it will be an issue.

It seems that decode bin version 3 has tried to resolve this problem. But for now, I still struggled in this issue. In order to support adaptive streaming (DASH) which has multiple adaption sets (ex, native YouTube has dual video tracks as well as dual audio tracks although the types are not same), it needs a way to resolve this problem.

Here I try to insert input selector between demuxer & codec (in fact, between the multiqueue right after demuxer & codec) to resolve this problem. It seems to successfully achieve the requirement of a unique codec. I still work on the task to see if do switch between tracks is O.K but would like to share my current implementation here. I will be very appreciated if anyone has better idea and could give me a feedback or suggestion.

A given testing DASH URL below contains dual audio tracks with the same type (audio/mpeg, mpeg version = 4). It is a good point to start the experiment so I worked on it.
http://marea.tilab.com:8085/content/dash/clear/multiaudio/2audio/c1/all.mpd

command = 
gst-launch-1.0 -v playbin uri=http://marea.tilab.com:8085/content/dash/clear/multiaudio/2audio/c1/all.mpd flags=0x56

The attached file is the detail about the patch. 

Welcome to any suggestion!

Thank you~
Comment 1 WeiChungChang 2015-11-26 07:00:07 UTC
Comment on attachment 316282 [details] [review]
patch

Proposed patch.
Comment 2 WeiChungChang 2015-11-26 07:30:17 UTC
Created attachment 316284 [details] [review]
corrected patch version 2

corrected patch version 2
Comment 3 WeiChungChang 2015-11-26 07:39:39 UTC
Created attachment 316285 [details]
implementation details

Document of detailed implementation idea & flows.
Comment 4 WeiChungChang 2015-11-26 07:46:40 UTC
Created attachment 316286 [details]
original flow - with duplication codec instances

graph dump of original flow - with duplication (audio) codec instances
Comment 5 WeiChungChang 2015-11-26 07:48:33 UTC
Created attachment 316287 [details]
with the insertion of input selector - a unique codec is shared by dual audio tracks

graph dump with the insertion of input selector - a unique codec is shared by dual audio tracks
Comment 6 Sébastien Wilmet 2015-11-27 11:38:56 UTC
*** Bug 756794 has been marked as a duplicate of this bug. ***
Comment 7 Edward Hervey 2018-05-05 16:00:51 UTC
This is fixed by:
* using decodebin3/playbin3
* having adaptive demuxers handle stream selection themselves

I am therefore marking this as a duplicate of the adaptive stream selection handling bug.

*** This bug has been marked as a duplicate of bug 775132 ***