Refact MediaResoure base class

RESOLVED WONTFIX

Status

RESOLVED WONTFIX
5 years ago
8 months ago

People

(Reporter: bechen, Unassigned)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

5 years ago
Fork from bug 831645 comment 150.

Basically the class MediaResource is designed for byte-range usage. So there are many functions depend on byte operations such as |Read, ReadAt Seek |... . Aslo there is a class MediaCacheStream glued to it.

For RTSP streaming, we create another class RtspMediaResource inherits from MediaResource and then there are many dummy functions in RtspMediaResource since the Rtsp streaming is not byte-based.

Maybe we should refact the base classes for both byte-range and non-byte-range media.
It doesn't make sense for the non-RTSP code to have non byte range methods exposed on their MediaResources. So I don't think you should merge RtspMediaResource and byte range MediaResource functionality into a single class.

How about have RtspMediaResource class use (contain) a MediaResource, instead of inheriting from MediaResource?

i.e.:

class RtspMediaResource {
  //...
private:
  RefPtr<MediaResource> mResource;
};

Would that work?

Comment 2

8 months ago
Firefox OS is not being worked on
Status: NEW → RESOLVED
Last Resolved: 8 months ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.