Add ContainerType to MuxerListener
Container type should be passed to MuxerListener Change-Id: I4941f17d68fab1565c6105a73e50fa9885bbd304
This commit is contained in:
parent
522048b0d9
commit
6d68f778ee
|
@ -17,8 +17,12 @@ namespace event {
|
|||
// to add GetStatus() method somewhere (maybe in MuxerListener, maybe not).
|
||||
class MuxerListener {
|
||||
public:
|
||||
MuxerListener() {};
|
||||
virtual ~MuxerListener() {};
|
||||
enum ContainerType {
|
||||
kContainerUnknown = 0,
|
||||
kContainerMp4,
|
||||
kContainerMpeg2ts,
|
||||
kContainerWebM
|
||||
};
|
||||
|
||||
// Called when muxing starts. This event happens before any other events.
|
||||
// For MPEG DASH Live profile, the initialization segment information is
|
||||
|
@ -27,7 +31,8 @@ class MuxerListener {
|
|||
// specified in |stream_infos|.
|
||||
virtual void OnMediaStart(const MuxerOptions& muxer_options,
|
||||
const std::vector<StreamInfo*>& stream_infos,
|
||||
uint32 time_scale) = 0;
|
||||
uint32 time_scale,
|
||||
ContainerType container_type) = 0;
|
||||
|
||||
// Called when all files are written out and the muxer object does not output
|
||||
// any more files.
|
||||
|
@ -57,6 +62,9 @@ class MuxerListener {
|
|||
virtual void OnNewSegment(uint64 start_time,
|
||||
uint64 duration,
|
||||
uint64 segment_file_size) = 0;
|
||||
protected:
|
||||
MuxerListener() {};
|
||||
virtual ~MuxerListener() {};
|
||||
};
|
||||
|
||||
} // namespace event
|
||||
|
|
|
@ -37,7 +37,8 @@ void VodMediaInfoDumpMuxerListener::SetContentProtectionSchemeIdUri(
|
|||
void VodMediaInfoDumpMuxerListener::OnMediaStart(
|
||||
const MuxerOptions& muxer_options,
|
||||
const std::vector<StreamInfo*>& stream_infos,
|
||||
uint32 time_scale) {
|
||||
uint32 time_scale,
|
||||
ContainerType container_type) {
|
||||
DLOG(INFO)
|
||||
<< "VodMediaInfoDumpMuxerListener does not care about OnMediaStart.";
|
||||
}
|
||||
|
|
|
@ -35,7 +35,8 @@ class VodMediaInfoDumpMuxerListener : public MuxerListener {
|
|||
// MuxerListener implementation.
|
||||
virtual void OnMediaStart(const MuxerOptions& muxer_options,
|
||||
const std::vector<StreamInfo*>& stream_infos,
|
||||
uint32 time_scale) OVERRIDE;
|
||||
uint32 time_scale,
|
||||
ContainerType container_type) OVERRIDE;
|
||||
|
||||
virtual void OnMediaEnd(const std::vector<StreamInfo*>& stream_infos,
|
||||
bool has_init_range,
|
||||
|
|
|
@ -23,7 +23,8 @@ VodMpdNotifyMuxerListener::~VodMpdNotifyMuxerListener() {}
|
|||
void VodMpdNotifyMuxerListener::OnMediaStart(
|
||||
const MuxerOptions& muxer_options,
|
||||
const std::vector<StreamInfo*>& stream_infos,
|
||||
uint32 time_scale) {}
|
||||
uint32 time_scale,
|
||||
ContainerType container_type) {}
|
||||
|
||||
void VodMpdNotifyMuxerListener::OnMediaEnd(
|
||||
const std::vector<StreamInfo*>& stream_infos,
|
||||
|
|
|
@ -24,7 +24,8 @@ class VodMpdNotifyMuxerListener : public MuxerListener {
|
|||
// MuxerListener implementation.
|
||||
virtual void OnMediaStart(const MuxerOptions& muxer_options,
|
||||
const std::vector<StreamInfo*>& stream_infos,
|
||||
uint32 time_scale) OVERRIDE;
|
||||
uint32 time_scale,
|
||||
ContainerType container_type) OVERRIDE;
|
||||
|
||||
virtual void OnMediaEnd(const std::vector<StreamInfo*>& stream_infos,
|
||||
bool has_init_range,
|
||||
|
|
|
@ -284,7 +284,10 @@ void MP4Muxer::FireOnMediaStartEvent() {
|
|||
std::vector<StreamInfo*> stream_info_vec;
|
||||
GetStreamInfo(&stream_info_vec);
|
||||
const uint32 timescale = segmenter_->GetReferenceTimeScale();
|
||||
muxer_listener()->OnMediaStart(options(), stream_info_vec, timescale);
|
||||
muxer_listener()->OnMediaStart(options(),
|
||||
stream_info_vec,
|
||||
timescale,
|
||||
event::MuxerListener::kContainerMp4);
|
||||
}
|
||||
|
||||
void MP4Muxer::FireOnMediaEndEvent() {
|
||||
|
|
Loading…
Reference in New Issue