dom/media/Benchmark.cpp only supports video

RESOLVED FIXED in Firefox 61

Status

()

enhancement
RESOLVED FIXED
Last year
Last year

People

(Reporter: decoder, Assigned: decoder)

Tracking

(Blocks 1 bug)

Trunk
mozilla61
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(firefox61 fixed)

Details

Attachments

(1 attachment)

Currently, the Benchmark class only seems to support video input judging from this code:

https://searchfox.org/mozilla-central/rev/3abf6fa7e2a6d9a7bfb88796141b0f012e68c2db/dom/media/Benchmark.cpp#180

I rewrote the code as follows:

> -      mTrackDemuxer =
> -        mDemuxer->GetTrackDemuxer(TrackInfo::kVideoTrack, 0);
> +      if (mDemuxer->GetNumberTracks(TrackInfo::kVideoTrack)) {
> +        mTrackDemuxer =
> +          mDemuxer->GetTrackDemuxer(TrackInfo::kVideoTrack, 0);
> +      } else if (mDemuxer->GetNumberTracks(TrackInfo::kAudioTrack)) {
> +        mTrackDemuxer =
> +          mDemuxer->GetTrackDemuxer(TrackInfo::kAudioTrack, 0);
> +      }

Does this look like the right approach? And does it make sense to support more than one audio/video track?

I can attach a proper patch for review if this is the right way to go.
Component: Audio/Video → Audio/Video: Playback
Setting needinfo for :jya to confirm the approach in comment 0 or suggest an alternative that I can implement.
Flags: needinfo?(jyavenard)
that or following the current style.
      mTrackDemuxer =
        mDemuxer->GetTrackDemuxer(TrackInfo::kVideoTrack, 0);
      if (!mTrackDemuxer) {
          mTrackDemuxer =
            mDemuxer->GetTrackDemuxer(TrackInfo::kVideoTrack, 0);
          if (!mTrackDemuxer) {
              MainThreadShutdown();
              return;
          }
      }


the one you suggest looks better though
Flags: needinfo?(jyavenard)
Comment on attachment 8962686 [details]
Bug 1446929 - Support audio files in media Benchmark class.

https://reviewboard.mozilla.org/r/231556/#review237054
Attachment #8962686 - Flags: review?(jyavenard) → review+
Assignee: nobody → choller
Status: NEW → ASSIGNED
Pushed by choller@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/fc9024c91420
Support audio files in media Benchmark class. r=jya
https://hg.mozilla.org/mozilla-central/rev/fc9024c91420
Status: ASSIGNED → RESOLVED
Closed: Last year
Resolution: --- → FIXED
Target Milestone: --- → mozilla61
You need to log in before you can comment on or make changes to this bug.