sonyxperiadev / MultimediaForAndroidLibrary

88 stars 33 forks source link

Calculator bandwidth #5

Open kienbk1910 opened 9 years ago

kienbk1910 commented 9 years ago

Hi, I have a question about onDownloadNext() in DefaultDASHRepresentationSelector.java. At a time, chunk is downloaded(audio chunk or video chunk). At selectRepresentations() in DefaultDASHRepresentationSelector.java . Why do you calculate available bandwidth ? availableBandwidth = bandwidth - audioBandwidth - subtitleBandwidth;

ghost commented 9 years ago

Hi. onDownloadNext will download either audio, video or subtitle.

The reason for the calculation is to calculate the available bandwidth left for video. We only care to adapt the video resolution. So the bandwidth remaining is the available bandwidth - audio - subtitle bandwidth.

kienbk1910 commented 9 years ago

Thanks for your support. But I think your only connect internet at a time. It will download either audio, video or subtitle. And you have an instance insDefaultDASHBandwidthEstimator . We don't need bandwidth remaining, because only TrackType is downloaded at a time. What do you think of my thoughts?

ghost commented 9 years ago

The measurement is only done on video download. That is why we do the calculation of available bandwidth.

kienbk1910 commented 9 years ago

Thanks you But I still don't understand . At a time, only one chuck type download, it don't share bandwidth .

ghost commented 9 years ago

Let see if I can elaborate a bit to clarify it.

When we measure the bandwidth that is only done on Video download, that mean that during the video download we have the full bandwidth available. However if we then would use that bandwidth, and that the selected bandwidth is just below the full availble bandwidth, there might not be enough time to download audio + subtitles, meaning that we get playback stalling. Therefor we subtract the audio and subtitle bandwidth to ensure that we can download video + audio + subtitles without it taking more time to download than the playtime is.

Does that make things clear how we have thought?

kienbk1910 commented 9 years ago

Thanks you so much! I got it.

ghost commented 9 years ago

Great. One question. Are you working on a SmoothStreaming implementation?

kienbk1910 commented 9 years ago

Yes,My project support it, Thanks your for your project. I have a problem about change quality. With SmoothStreaming, quality Audio higher, If we don't care time of audio, bandwidth is incorrect.Do you have advice for my problem?