[go: nahoru, domu]

Replace StreamStatusChanged callback with async track switching

Allow the pipeline to control the entire track switch process without
    the media source communicating directly with the renderer.

    WMPL | pipeline | demuxer | demuxer_stream | renderer | video/audio_renderer
    ───────────────────────────Old Control Flow─────────────────────────────────
         |          |         |                |          |
     switch_track   |         |                |          |
      --------->    |         |                |          |
         |    switch track    |                |          |
         |     --------->     |                |          |
         |          | disable/enable stream    |          |
         |          |      ----------->        |          |
    ───────────────────────Sometime in the future───────────────────────────────
         |          |         |               read from stream
         |          |         |        <-----------------------------
         |          |         |                |End of stream
         |          |         |        ----------------------------->
         |          |         |                |      OnStreamStatus
         |          |         |                |    <----------------
         |          |         |                |   Flush/Restart/Reset
         |          |         |                |    ---------------->
         |          |         |                | OnBufferingStateChange
         |          |         |                |    <----------------
         |          | OnBufferingStateChange   |          |
         |    <--------------------------------------     |
    OnBufferingStateChange    |                |          |
    <----------     |         |                |          |

    ───────────────────────────New Control Flow─────────────────────────────────
    WMPL | pipeline | demuxer | demuxer_stream | renderer | video/audio_renderer
         |          |         |                |          |
     switch_track   |         |                |          |
      --------->    |         |                |          |
         |    switch track    |                |          |
         |     --------->     |                |          |
         |          | disable/enable stream    |          |
         |          |      ----------->        |          |
         |   active streams   |                |          |
         |     <---------     |                |          |
         |          |        switch track      |          |
         |     -------------------------------------->    |
         |          |         |                |    Flush/Restart/Reset
         |          |         |                |     --------------->
         |          |  Notify pipeline of completed track change
         |     <-----------------------------------------------------
    ───────────────────────Sometime in the future───────────────────────────────
         |          |         |                | OnBufferingStateChange
         |          |         |                |    <----------------
         |          | OnBufferingStateChange   |          |
         |    <--------------------------------------     |
    OnBufferingStateChange    |                |          |
    <----------     |         |                |          |

    In the new control flow the pipeline is able to control both the demuxer
    and the renderer, instead of controlling the demuxer and waiting for the
    renderer to act on it's own.


Bug: 709302
Cq-Include-Trybots: luci.chromium.try:android_optional_gpu_tests_rel;luci.chromium.try:linux_optional_gpu_tests_rel;luci.chromium.try:mac_optional_gpu_tests_rel;luci.chromium.try:win_optional_gpu_tests_rel;luci.chromium.try:win_optional_gpu_tests_rel
Change-Id: Iafc862e79f5afc1d3a6ea3400c03decd0ce91d27
Reviewed-on: https://chromium-review.googlesource.com/899843
Commit-Queue: Ted Meyer <tmathmeyer@chromium.org>
Reviewed-by: Sergey Volk <servolk@chromium.org>
Reviewed-by: Dale Curtis <dalecurtis@chromium.org>
Reviewed-by: Dan Sanders <sandersd@chromium.org>
Reviewed-by: Xiangjun Zhang <xjz@chromium.org>
Reviewed-by: Yuri Wiitala <miu@chromium.org>
Cr-Commit-Position: refs/heads/master@{#551901}
33 files changed